Blockchain-Based Flexible Double-Chain Architecture and Performance Optimization for Better Sustainability in Agriculture
2021-12-14LuonaSongXiaojuanWangPengWeiZikuiLuXiaojunWangandNicolasMerveille
Luona Song,Xiaojuan Wang,*,Peng Wei,Zikui Lu,Xiaojun Wang and Nicolas Merveille
1Beijing University of Posts and Telecommunications,Beijing,100876,China
2Dublin City University(DCU),Dublin 9,Ireland
3University of Quebec at Montreal,Montreal,H2X 3X2,Canada
Abstract:Blockchain is an emerging decentralized distributed technology that can cross the boundaries and guarantee safe and trustworthy value transfers between participants.Combining the blockchain technology with the Internet of Things (IoT) technology to enhance the transparency and sustainability of agricultural supply chains, has attracted researchers from both academia and industry.This paper reviews the latest applications of the blockchain and IoT technologies in the sustainable agricultural supply chain management and explores the design and implementation of a blockchain-based sustainable solution.By placing the sustainable agricultural supply chain management at its core, a blockchain-based framework is designed.Considering the heterogeneity of the transaction data and the IoT data,the openness of sustainability information and the sensitivity of participants’data,a double-chain structure is proposed including the consensus method,the transaction mechanisms,the sustainability assessment method and the performance optimization strategy.The sustainable management practices of all participants are introduced into the blockchain network, especially those allowing the government to play a more signifcant role in agriculture supply management.Meanwhile,to meet the scenario requirements, a data reduction method is designed to improve performance and reduce block size.Simulations are performed to evaluate the latency,throughput,costs and effciency of the proposed structure.This paper can be a useful reference for further research on the application of blockchain and IoT technologies in sustainable agricultural management.
Keywords: Blockchain; IoT; sustainability management; information system
1 Introduction
With the massive implementation of technology, sustainability in agriculture is now facing major challenges.The sustainable development goals (SDGs), in the form of established mitigation targets and industrial strategies, are top priorities for many countries.According to a meta-analysis published in Science [1], the food sector accounts for approximately 26% of global greenhouse gas emissions.The United Nations forecasts that the population to be fed will rise to nearly 10 billion by 2050.Many countries have established goals for climate neutrality (e.g., Denmark, France),productivity (e.g., Australia, Germany), the elimination of hunger (e.g., Canada, the United States)and land management (e.g., Israel, New Zealand, the Netherlands).Achieving the sustainability goals in the agricultural sector involves technical and non-technical elements.
The frst challenge is the data shortage in the sustainability assessment process although big data is generated in the agriculture supply chains (ASCs).Different partners, such as farmers,process enterprises, logistics, and retailers, play different roles in an ASC.To improve agricultural sustainability, supply chain partners must take responsibility for their specifc environmental impacts and monitor them.One practical approach is to build an ASC only with partners who are determined to meet sustainability targets and then communicate this success to consumers and related parties, such as government regulators.However, limited participation of farmers has led to the lack of critical details in sustainability assessment during the agri-food life cycle.The development of the Internet of Things (IoT) has provided a practical way to capture data generated during agricultural production, but farmers lack incentives to invest in IoT systems.Low-proft margins make any agricultural transformations (e.g., agriculture 4.0, rural revitalization, digital agriculture) more prudent, and using technology just for the sake of using technology can mar sustainability in both the short and long term [2].Therefore, to improve transparency in ASCs, it is important to consider IT acceptance, cost and performance, as well as value creation mechanisms.
The performance and cost of technology deployment have become the second challenge in developing sustainable ASCs.In recent years, blockchain technology is found to be an ideal tool to prevent tampering and guarantee the traceability of agricultural data and provide a truthful record, based on which regulators can supervise and third parties can provide services.Due to its specifc heterogeneity, the agricultural industry requires critical considerations of data heterogeneity, multipartite interactions, and technical indicators such as the usability and scalability of the system when adopting blockchain-based solutions.In sustainable ASCs, data generated during transactions and sustainability data collected by IoT devices are different in their security requirements, generation rates and scales; thus, the integration of data fows, the selection of blockchain networks, appropriate technology combinations, and the operation of sustainable ASCs deserve further attention from scholars and practitioners.
At present, many studies introduce blockchain-and IoT-based solutions into agricultural scenarios that include sustainability concerns to varying degrees (e.g., [3]).The majority of efforts have been invested in discovering technological possibilities (e.g., [4,5]) and evidence of improvement (e.g., [6]), summarizing use cases (e.g., [7]) and proposing frameworks and systems (e.g., [8]).Nevertheless, extensive research is required to enable blockchain systems to interact signifcantly with other technologies in a sustainability-driven ASC.Signifcant research is required to enable blockchain solutions that truly consider the demands and principles of other methodologies in a sustainable agricultural system, including monitoring and managing agricultural sustainability.This paper addresses the deployment of blockchain and IoT technologies in ASCs with a specifc focus on sustainability.The main contributions of this paper include:
(1) This paper summarizes the data requirements of a value creation mechanism for sustainability assessment designs to enhance interactions between related parties and improve sustainability in ASCs, and propose a sustainability framework for agricultural supply chains based on blockchain technology;
(2) This paper also develops a blockchain-based fexible double-chain structure to fulfl the multifunctional sustainability management needs of agricultural systems, design corresponding incentive mechanisms, improve the consensus algorithm, and indicate the applicability and effectiveness of the proposed structure using throughput, latency, and cost indicators;
(3) This paper proposes a data reduction method to improve the effciency of data collection and further lower the storage pressure on blockchain-based databases and considers performance optimization of the vast scale and limited value of IoT data in ACSs scenarios.
The rest of the paper is organized as follows:Section 2 reviews the concept of sustainability in ASC and recent works of blockchain- and IoT-based solutions.Section 3 introduces the design of blockchain-based double-chain architecture in ASCs, the data reduction method, and performance optimization strategy.Section 4 presents the simulation and discussion.Section 5 concludes the paper.
2 Related Work
Sustainability assessments of products have become an increasingly important feld with increased public attention toward sustainable development, and there are many well-defned tools for such assessments.However, owing to information latency and a lack of transparency, data collection remains an enduring challenge in life-cycle assessments [9].Meanwhile, improved transparency also brings challenges related to energy consumption in IT implementation.Thus, the performance and cost of technical solutions become a problem that cannot be ignored by any industry, especially agriculture, that considers the blockchain to be an enabler.A recent paper has proposed a data-driven framework including three-dimensional (economic, environmental, and social) sustainable performance indicators but remained vague as to how these objectives may be attained through improved data analytics capabilities, and the relevance of their objectives is unclear [2].Another paper has reviewed the role of machine learning in sustainable agricultural supply chains and proposed an ASC performance framework that lists similar objectives [10].Current frameworks lack measurements and ignore technological sustainability, making them less appropriate for blockchain-based systems.
IoT systems are widely used for data collection in current blockchain solutions for agricultural applications.Using the IoT instead of manual data collection not only avoids human error but also solves the problem of data tampering before upload.For current sensor deployment, many studies focus on production processes without data processing before upload and neglect the security of the sensor networks [10,11] and trust issues [12,13].For instance, Lin et al.[14]proposed a trusted, self-organized, open and ecological system for food traceability based on blockchain and IoT.Sensors are used to record a variety of environmental data, which are stored in every node of the blockchain system through an IoT gateway.In [15], the blockchain nodes are divided into nine types to store data from different sensors.Accordingly, blockchain technology is also considered an ideal solution to tackle the challenges of security problems in IoT systems [16].
Regarding the deployment of the IoT in the supply chain, different approaches focus on different processes.Some studies consider all participants in the agricultural supply chain (e.g., [17,18]),while others involve only business users.In [14], a reliable food traceability system records information from processing companies, seeding companies, logistics companies and food retailers.Awan et al.[19] put forward a model for upgrading traditional agriculture to smart agriculture in which blockchain records the product name and origin and other information that is accessible to all stakeholders.While IoT information collection and sharing have penetrated many links in the supply chain, the depth and impact of this sharing are still relatively limited.Blockchain users have access only to product information.However, information on the sustainability assessment of products, which is closely related to stakeholders, is not collected, processed or shared effectively.
Regarding data processing, very few studies have considered the problem of information overload in the blockchain, which edge computing is a possible solution [20].In [21], edge computing is used to reduce computing and storage costs and thus save network resources, while many other studies ignore this problem and suppose real-time updates and access to data (e.g., [17]).However,this previous work only mentions that edge computing can analyze data from the IoT layer,without providing details about deployment and processing.In [15], the transaction throughput and latency in agricultural blockchain are simulated, but resource effciency and block scales are not considered.In [19,22], only the transaction throughput is simulated, without considering transaction latency, the number of users, or other issues.
3 Design of the Blockchain-Based Double-chain Architecture
The sustainability of agriculture involves economic, environmental, social and technological factors.Therefore, the designed system must adopt a reasonable consensus algorithm and system architecture to ensure safe and effcient sustainable agricultural development.The sustainability performance metrics of an ASC consists of economic sustainability (ES), potential environmental impacts (EI) and the social sustainability (SS) of the producti, as well as technological sustainability (TS).Sustainability assessments can be expressed as follows:
where in the above ES metric Eq.(1),Fmrepresents farmerm,PFrepresents farmer’s proftability andLPrepresents land productivity.In the EI metric Eq.(2),represents product type or crop typei, andrepresents life cycle phasejof producti, such as production, processing and transportation processes.WI,SIandAPrepresent water impact, soil impact and air pollution respectively.
wherein SS metric Eq.(3),HR,WEandPSRrepresent human rights, working environment,and product social responsibility respectively.The TS metric Eq.(4) focuses on the technology investment and return of agricultural supply chain participants and determines whether supply chain participants’ levels of informatization meet their current development needs.In the TS metric equation,ILrepresent technological level,FLstands for fnancial level,MLrefers to management level andKLstands for knowledge and experience level.
The combination of blockchain, IoT and other new technologies can result in a high degree of resource integration, enhance the transparency of ASCs, and quantify the sustainability of the performances of participants.For upstream farmers in ASCs, technologies can detect various indicators, such as crop growth, and help farmers increase production and income, thus realizing green agriculture.For the processing enterprises in ASCs, supporting farmers in deploying IoT equipment with extra computing power can help enterprises obtain additional tokens.Similarly,the sustainability of the enterprise is quantifed by the results of analyses of the IoT data and the disclosure data.Green production can bring smart contracts into effect.To realize the above vision and functions in ASC scenarios, we construct a double-chain structure (as shown in Fig.1)composed of a main-chain (Mainchain) and a sub-chain (Subchain).
Figure 1:Blockchain-based double-chain framework for sustainable ASCs
The arrangement accounts for function differentiation and security levels.The Mainchain connects enterprises, farmers, government regulators, and fnancial service providers and stores information on enterprises and farmers, such as their account information and their transaction and social sustainability assessment information.The Subchain mostly stores data collected by IoT devices in ASCs, including agriproduct information, product transportation information and data on the corresponding environmental impacts during the life cycle of agricultural products.Farmers and enterprises are the main uploaders of the information.As stakeholders, the government,consumers and fnancial institutions have the right to know and supervise part of the information.
3.1 Design of the Mainchain and Sustainability Assessment
The Mainchain stores information on a variety of transactions that occur in ASCs and is supervised by government regulators.It is necessary to design and manage the block data structure, consensus method, and transaction mechanisms.
3.1.1 Block Data Structure and Consensus Method
The key nodes in the Mainchain of the double-chain structure are government regulators,and the non-key nodes are enterprises, farmers and fnancial institutions.The initialization of the Mainchain for agricultural resources is shown in Eq.(5).In the Mainchain, the key nodes are responsible for the generation of new blocks.
whereBNis the Mainchain after initialization,Erefers to enterprises,Frefers to farmers,Grefers to government regulators,FIrefers to third parties such as fnancial institutions,BNeorefers to the information uploaded from environmental sustainability assessments (EI) in the Subchain, andIOtrefers to transaction information in ASCs.SCrepresents smart contracts andCAis the consensus method.Our Mainchain and Subchain reference Proof-of-Authority (POA)to design consensus mechanism, and support users to deploy more appropriate mechanism.In the Mainchain, according to their functions, we defne key nodes and non-key nodes.The key nodes mainly refer to government nodes and non-key nodes refer to the farmers, enterprises and third parties.The task of the key nodes is to audit the data submitted from the non-key nodes.The non-key nodes are responsible for providing information (transaction information of two sides and sustainability-related data) to the key nodes and are responsible for verifying the auditing results of the government nodes.Firstly, a non-key node generates a request about the transaction information that needs to be updated and the transaction information with sustainability-related data is sent to one of the key nodes.Secondly, the key nodes audit the transaction information in turn according to the audit procedures (the auditing order can be set by setting different reputation values).The last key node in the auditing procedures is the accounting node and it calculates the value of the data and sends the result to non-key nodes for verifcation.Thirdly,each non-key node verifes the result audited by the accounting node and sends a confrmation message to all other nodes after verifcation.Fourthly, the key nodes collect the verifcation result.Fifthly, the accounting key node then generates a new block.Finally, the content of the new block is broadcasted to all non-key nodes.Fig.2 shows a logical diagram of the block-building procedure in the Mainchain.
The data block of the Mainchain contains the block header (Header) and the block body(Body).The block header encapsulates the hash value of the previous block, the version number,the Merkle root hash and the timestamp.The block body encapsulates the audit results, verifcation results, and a digital signature.Digital signatures come from all Mainchain participants,which can be used to prevent repudiation.
3.1.2 Transactions and Incentive Mechanisms
In the Mainchain, a variety of transactions will occur between different participants in ASCs.The broadcasted transaction information contains the product type, quantity, location, and volume, and the hash values and sustainability scores of both parties.To ensure the uniqueness and security of the transaction, enterprises and farmers will generate a unique hash code according to their identity information and time stamp.The hash code is calculated using Eq.(6) below.
whereIis the hash code that identifes both parties,tis the timestamp, andIOais the information from both parties.Taking the transactions between farmers and enterprises and the transactions between different enterprises as examples, we construct two transaction scenarios.
When transactions occur between an enterprise and a farmer (MEF) or between enterprises (MEE),the broadcasted information is expressed as follows:
wherePTirefers to product type,nis the quantity,lis the location of the transaction,TAis the total amount of the transaction,sreEiandsreFiare the sustainability scores of the enterprise and the farmer, andIiis a hash code to identify each party.
Figure 2:Logical diagram of the block-building procedure in the Mainchain
The incentive mechanism usually refers to an incentive measure (such as awarding tokens) to stimulate the smooth operation and development of blockchain networks.In the Mainchain, there are several ways to obtain tokens, such as green production; enterprises buy agricultural products with high sustainability scores, and farmers sell agricultural products to enterprises with high sustainability scores.For instance, transactions between sustainable farmers and enterprises are rewarded by an incentive mechanism.Before each transaction, we calculate the sustainability score for each of the two parties (farmers or enterprises) based on their EI and SS values to get the combined sustainability score of the transaction.In trading, we set a basic reward unit (in terms of the number of tokens) and classify the sustainable scores into different scales, which correspond to different sustainability reward weights.The fnal reward for both parties in a transaction is obtained by multiplying the basic reward unit with the reward weight corresponding to the scale that the combined sustainability score of the transaction falls in.
3.2 Data Compression Method and Design of the Subchain
The Subchain collects data from several enterprises and farmers separately, involving a large volume of data and diverse data types, such as information on products, transportation and environmental impacts.Therefore, it is necessary to use IoT sensors to collect these data.Due to the explosive growth of real-time updating data, the data must be simplifed before they are uploaded to the blockchain.Under the premise of ensuring the accuracy of the information, the compressed data is recorded in the Subchain and thus minimize the storage.Hence, we compress the massive data by designing a data reduction algorithm for the edge nodes and then use smart contracts to audit and verify the data so that participants can access the required data safely and easily.Because environmental data, such as those on water impacts and air pollution, may change slightly with time or temperature, data collected at adjacent times may be more similar.Given this fact, ASC members can set a baseline according to the type of the sensor, the type of the crop,or the data recorded at a certain time.
The input to the data-reduction algorithm is the data collected by each sensor at different time points.These data are temporarily stored in a large-scale two-dimensional matrix.The outputs of the algorithm are three much smaller two-dimensional matrices.The original input data can be recovered from these three small matrices within a controllable error range.The data reduction process is shown in Algorithm 1.
?
In Algorithm 1,data[] represents the collected raw data,Nintervalrepresents the number of collected raw data in the time interval between two adjacent baseline data time points (interval=ΔT), andsignintervalis the time interval between the time point of baseline data and the time point of verifcation data (signinterval=Δt).The verifcation data is used to verify the compressed data in each time interval to monitor the accuracy of the transmission process.Lcomprefers to the loss threshold value, in each time interval, only the difference between the value collected at a certain time and the corresponding baseline data is greater thelcomp, will we record the value.
Fig.3 shows the data compression and decompression processes.We use data matrixx∗mto represent data to be compressed.xstands for categories of IoT devices, a certain type of IoT device is represented byCx,mis the number of time points with collected data, andTmrepresents a certain time point.In a data matrix, we defneVas the data value,represents the value of data collected by IoT deviceCxat timeTm, and superscriptSSindicates the changing state of the data value.If the data value changes compared with its baseline data of the same IoT device,thenSis incremented by 1 (S=S+1), otherwise, the valueSremains unchanged.Assume that data compression is conducted in each time intervalΔTwithncollected raw data, and eachΔTcontains only one baseline data (the frst data in eachΔT) and one verifcation data which is selected randomly inΔt(1<Δt<=n).
Figure 3:The data compression and decompression processes
As Fig.3 shows, the values whose background are red denotes the changed ones compared with the baseline data in a time interval.To compress data, the ith difference is recorded as:
At the same time, the index of the difference also needs to be recorded.As described in Fig.3, the timeTmand the categoryCnare necessary.It is noted that the compression loss is bounded by the loss threshold valueLcomp, which ranges from 0 tolcomp.When the difference between any other collected raw data value and its corresponding baseline data value exceedsLcomp, the collected raw data will be regarded as changed data and will be recorded asdiffi.Thelcompcontrols the maximum loss of accuracy in the compression.Largerlcompresults in a higher loss of accuracy and achieve a higher compression rate, while smallerlcompresults in lower data accuracy loss and lower compression rate, and there is no compression whenlcomp=0.Besides, the baseline data and verifcation data are required.So, the compressed data consists of three parts:the baseline data list, the verifcation data list and the difference list.The fnal data reduction rate(DRR) can be defned as:
whereNdenotes the function to calculate the number of differences.It can be simplifed as:
We can conclude that whenmis large enough and the difference numN(diff)>the compression effect will not be achieved.So the applicable condition of the algorithm is that the data fuctuation is less thanDRR andLcompare closely related, and ASC participants can setLcompaccording to the desired data reduction effect and storage demand.For example,users need to set a lowerlcompvalue for critical data to guarantee the accuracy of sustainability calculation.For non-critical data, without affecting sustainability assessments, a higherlcompvalue can be set to save storage space as much as possible.Meanwhile, whenmdata arrive, DRR can be calculated by segments.Moreover, the data compression rate (controlled by thelcompvalue) can be adjusted according to the importance levels of the data.The fexibility of setting differentlcompvalues for different kinds of data helps to save resources and improve effciency dramatically.The decompression process is also depicted in Fig.3 and it is worth mentioning that the decompressed data can be verifed with verifcation data list recorded in the compression process.In the calculation process, only the difference between the data at each time point and the baseline data needs to be calculated.The categories of IoT devicexare limited andmis defned as the number of time points with collected data above.Thus, whenmapproaches infnity, the computational complexity of the compression isO(m).As for the decompression process, when data arrives, the original data can be restored by summing baseline data anddiffin compressed data.Besides, the data verifcation process will also be carried outtimes and the total time cost ism+Therefore, whenmapproaches infnity, the computational complexity of the decompression isO(m).In application scenarios, the cost of calculation is estimated to be equivalent to m times of simple subtraction calculations.The number of times of data generation is the number of times we need to calculate, so the time cost is acceptable here.
The compressed data then is uploaded to the Subchain.To guarantee security, we introduce Verifable Random Function (VRF) to encrypt the compressed data.VRF is equivalent to random oracle adding non-interactive zero-knowledge proof functionally.When sending data locally, nodes can add random information through VRF, and other nodes can verify the selected results according to the public information including random number, proof and public key.The consensus process of the Subchain is as follows.Firstly, the IoT nodes generate data requests.The original raw data should be compressed frst, and the compressed data should be combined with VRF generated random information to ensure the security of data.Secondly, the information will be broadcasted to all key nodes.Thirdly, calculating the reputation of all key nodes through the rules defned in advance, to select the accounting node.Fourthly, the accounting node calculates the hash value of the block and sends the result to other nodes for verifcation.In the last step, the other nodes will send correct messages to each other after verifcation.When each node receives confrm messages from more thanof the total nodes, the key nodes update this block.Block building in Subchain is shown in Algorithm 2.
?
The input of Algorithm 2 includes three arrays, which are a set of data to be verifed, a set of key nodes and a set of non-key nodes.The non-key nodes verify the data audited by the key nodes.If it is correct, every non-key node will return a positive signal to the key nodes.Otherwise,the non-key nodes will return negative signals.When a transaction occurs, the required data are sent to the key nodes of the government regulatory departments frstly.Similar to the Mainchain,the block of data in the Subchain includes the Header and the Body.However, The Body in the Subchain block contains all verifed information records about the product, transportation and the environmental impacts.
To monitor and encourage farmers and enterprises in the Subchain, tokens can be issued as incentives.For farmers, conducting environmentally friendly practices has several benefts.First,land productivity and proftability can be recorded by technology.Second, tokens gained from sustainable production can be used to apply for agricultural insurance and tax benefts.Third,farmers can enhance their bargaining power.Through controllable IT implementation, enterprises can ensure the transparency of data along supply chains.The way to obtain tokens in the Subchain is to record and analyze the data from IoT devices.
3.3 Performance Optimization
In sustainable ASCs scenarios, there are three indicators to be focused on:the throughputRof the model, the latencyTLof tasks and the costPof tasks.The throughput is infuenced by the number and size of the transactions initiated by clients, and the scale of the block.If the block can accommodate all the transactions, the throughput equals to the number of transactions.If not, the actual throughput is the biggest quantity that the block can accommodate.Here, we userito represent the number of the transactions that the clientiinitiates and useηjto present the corresponding size.is the average transaction size andsBis the size of a block.Then,Rcan be described as:
And the latencyTLcontains two parts:the block intervalTIand the consumed timeTC.Thus, the latency can be calculated as:
whereTIis a variable value defned by the model.TCis determined by the compression timeTComp, the algorithm calculation timeTAand the sizesB.And we can conclude that
whereJdenotes the waiting time calculation process of the transaction whensBchanges.The costPmainly contains the calculation costPC, the storage costPSand power costPP.PCandPPare determined bysBandTI, which can be depicted asH(sB,TI).ThereforePis explained as:
In the experiment, we expect to make the throughputRgreater and reduceTLandP.Thus,the objective function can be defned as:
And if we use the original variable, it can be calculated as:
whereGis the calculation function ofR,Irefers to the process ofTLandEdenotes the calculation process ofP.To get the optimal solution of the function, we use simulated annealing algorithm [23].Regarding timing choice, different optimization methods are used for different data streams in the sustainable ASC scenario.The amount of data is relatively small on the Mainchain and the generation of data has a relatively long periodicity.Therefore, offine optimization is more applicable and only the data generated in one cycle should be considered.However, the amount of data is relatively large on the Subchain and the data is constantly generated, so real-time optimization is more desirable.To achieve real-time optimization, a certain time interval needs to be set, and the parameters in the current time interval are used to optimize the parameters of the next time interval.When the time interval is small enough, the effect of real-time optimization can be achieved.The simulation result is depicted in Section 4.
4 Simulation and Evaluation
To verify the applicability and superiority of the double-chain structure in ASCs to improve sustainability, several experimental schemes are designed and simulated by OMNeT++ (an opensource software).The performance and cost of the double-chain and the single-chain structures are evaluated and compared in term of latency of transaction confrmations, cost of unit latencies,throughput, and throughput per unit cost.
Based on the main data fows in sustainable ASCs, the experiment divides the practical agricultural application into three business scenarios:an IoT scenario that contains only IoT data fows, an ASC scenario that contains only ASC transaction fows, and a hybrid scenario that contains both IoT and ASC data fows.In different application scenarios, there are some differences in performance and cost between a single chain and double chain structures.To study these differences, three blockchain structures have been designed, including two single chains and one double chain.One single chain (single-I) is set for IoT scenarios, and the other single chain (single-E) is for ASC scenarios.Double-chain has two chains that can accommodate both IoT and ASC scenarios.The performance and cost of the three chains were recorded under the three scenarios.The performance metrics include transaction latency and throughput, and cost metrics include cost per latency and throughput per unit cost.Moreover, we conduct a throughput comparison of the system under different data reduction rate (DRR) and different adaptive settings (fexibility of block size and block interval).
4.1 Parameter Descriptions
In different application scenarios, there will be differences in performance and costs between the single chains and the double chain, as well as between the different single chains.OMNeT++is used to simulate the communication of an IoT device in the process from transaction generation in the actual environment to the fnal confrmation and encapsulation in the block by a consensus algorithm.The transaction confrmation latency, throughput, and cost are recorded for different scenarios.Finally, through the Matplotlib library, the recorded data are visualized for analysis.The simulation setup parameters are shown in Tab.1.
Table 1:Simulation setup parameters
Performance affects the usability of the system, while cost consumption affects the scalability of the system.Assessing the sustainability of a system requires consideration of both performance and cost.An evaluation of these indicators can help achieve the lowest cost under a given performance demand to realize the sustainable development of agriculture.
4.2 Analysis and Discussion of the Experimental Results
Fig.4 shows the throughput comparison of the system under different DRR and different adaptive settings.The adaptive system includes three kinds of adaptive settings:1) adjustable block size and interval; 2) fxed block size; 3) fxed block interval.In Fig.4a, DRR=80% represents 80% compression on the original data and so on.So larger DRR fgure indicates higher data reduction.Under the same block resource cost, the higher the DRR is, the greater the throughput is.This is because the greater the data reduction, the more the transaction data can be stored with the same block resource cost.At the same time, the higher the data, the faster the curve levels off, allowing the resulting transactions to be linked up in real-time.Data reduction removes data redundancy, resulting in greater data capacity for the same storage cost, that is, increased throughput.But the greater the data reduction, the longer the data recovery time and the higher the system cost.After all the curves in the fgure have levelled off, the lower the percentage, that is,the higher the data reduction, the higher the cost.In practical applications, business requirements and costs should be considered at the same time.To satisfy these requirements, an appropriate data reduction ratio should be selected to minimize the cost.
Figure 4:Comparison of the system under different DRR and adaptive settings (a) Throughput of different data reduction rates (b) Throughput of different adaptive settings
In Fig.4b, the adaptive system in which both block size and block interval are adjustable can always meet throughput requirements.When the transaction rate is high, the system with fxed block-size will experience congestion and throughput decline after the block interval reaches the regulated limit.The system with fxed block-interval can adjust the block size to meet the throughput requirements, but too large the block size will increase the cost and delay, so the throughput performance is not as good as that of the system with adjustable size and interval.The higher the DRR, the more data the block can contain at the same storage cost.Regarding when to do data reduction, data reduction is needed when the system needs to get rid of congestion quickly,or when the same block scale needs more throughput.In this case, the larger the DRR is, the faster it gets rid of congestion, and the larger the throughput is under the same block scale.As for the time cost of data reduction, under the same block scale, the higher the DRR, the greater the throughput.But the higher the DRR, the more time it takes to compress and decompress.This will lead to the increase of system delay.Therefore, it is necessary to select the appropriate DRR to meet the throughput requirements while maintaining the delay in an acceptable range.
Fig.5 shows a comparison of different chain structures in the ASC and IoT scenarios.The ASC scenario only contains transactions among ASC participants and the IoT scenario only contains IoT data fows.To achieve optimal performance and minimize cost, performance optimization is used to obtain optimal results.Figs.5a and 5b correspond to the ASC scenario,and Figs.5c and 5d correspond to the IoT scenario.In Fig.5a, there is no congestion in the three chains, and the enterprise single-chain (single-E) latency is the smallest.The IoT single-chain(single-I) consensus algorithm has the longest execution time and the largest latency, while the latency of the double chain lies in the middle.In Fig.5b, since the enterprise single-chain is designed for the ASC scenario, it has the lowest cost.The IoT single-chain costs more in the IoT scenarios than in the ASC scenarios.The cost of the double chain is moderate.Fig.5c indicates that in the case of low block resource cost, the single-chain for enterprises does not suffer from congestion, while the single-chain for IoT does suffer from congestion.The total latency in the double-chain lies between those of the two single chains.In Fig.5d, the cost of the IoT singlechain is the lowest, the cost of the enterprise single-chain is the highest, and the cost of the double-chain is moderate.For every single type of transaction only scenario, the corresponding single-chain performs better in terms of latency and cost, while the double-chain is in the middle.
Figure 5:Comparison of different chain structures in the ASC and IoT scenarios (a) Latency in different chains (b) Cost of different chains (c) Latency in different chains (d) Cost of different chains
Fig.6 shows a performance and latency comparison of different chains under the sustainable ASC scenario (a mixed scenario combining transactions with IoT data).The goal is to maximize throughput and minimize latency and cost through performance optimization.In this hybrid scenario, both ASC and IoT transactions occur.
Figure 6:Comparison of different chains in the sustainable ASC scenario (a) Latency in different chains (b) Cost of different chains (c) Throughput of different chains (d) Throughput per unit cost of different chains
In Fig.6a, the enterprise has low single-chain latency and no congestion.The IoT singlechain has signifcant latencies in processing IoT transactions, causing congestion in the system.Therefore, the total latency of the double chain lies between the two single chains.In Fig.6b,IoT single-chain transactions have the lowest costs when processing IoT transactions but the highest costs when processing ASC transactions as well as enterprise single-chain transactions.The double chain uses two mechanisms at the same time, and its cost is relatively moderate when processing both transactions, so the unit latency cost is the lowest when the system eliminates congestion.In Fig.6c, the enterprise single-chain can always maintain high throughput.The IoT single-chain throughput starts small and then increases due to the long execution time of the consensus algorithm.The Subchain in the double chain has large latencies that cause congestion at the beginning, affecting performance.However, after eliminating the congestion, the two parts of the double chain adapt to the two scenarios, so the throughput of the double chain gradually increases.In Fig.6d, the cost of the double chain is relatively moderate for both transactions, so the throughput of the unit cost is the highest once the system eliminates congestion.
For performance optimization, the double chain in the sustainable ASC scenario meets the performance requirements, and its implementation cost is the lowest.In the ASC transaction only or IoT transaction only scenarios, the performance and cost of a double-chain are in between the two corresponding single-chains.However, in a sustainable ASC scenario, although the performance of the double chain is moderate, its cost is the lowest, allowing it to achieve comprehensively optimal performance and cost.Therefore, in the sustainable ASC scenario, the double-chain scheme can meet the performance requirements, making the cost minimum.
5 Conclusion
The combination of blockchain and Internet of Things technologies not only provides transparent solutions for the traditional agricultural supply chain but also provides opportunities to support progress and innovation through sustainable management tools and methods.Concerning the challenges related to transparency, data collection and data sharing in sustainable development,this paper explores sustainable management in ASCs.Addressing the current situation of low-level farmer informatizationand inadequate government supervision about sustainable goals, a doublechain structure with low energy consumption is designed to achieve the sustainability management of the entire supply chain and promote value creation in the life cycle of agricultural products.Finally, the proposed technical scheme is evaluated through simulation and the performances of different implementation scales are analysed.The future work is to develop more accurate technical solutions for the double-chain application in different scenarios.
Acknowledgement:Thanks for the environment provided by laboratory ICN&CAD of School of Electronic Engineering.
Funding Statement:This study was funded by the project of the National Natural Science Foundation of China [Grant Numbers 62071056].
Conficts of Interest:The authors declare that they have no conficts of interest to report regarding the present study.
杂志排行
Computers Materials&Continua的其它文章
- An Optimized Deep Residual Network with a Depth Concatenated Block for Handwritten Characters Classifcation
- A Machine Learning Based Algorithm to Process Partial Shading Effects in PV Arrays
- Interference Mitigation in D2D Communication Underlying Cellular Networks:Towards Green Energy
- A New BEM for Fractional Nonlinear Generalized Porothermoelastic Wave Propagation Problems
- Tamper Detection and Localization for Quranic Text Watermarking Scheme Based on Hybrid Technique
- COVID-19 and Learning Styles:GCET as Case Study