# Application of IOT in Exploring the Development Path of the Whole Agricultural Industry Chain under the Perspective of Ecological Environment

Authors: Jing Wang
Journal: Mobile Information Systems
 (2022)

---

## Abstract

The green development of the entire agricultural industry chain is not only an important way to enhance the competitiveness of agricultural products and promote the value-added of the agricultural industry but also an inevitable choice to improve the efficiency of resource utilization and ensure sustainable economic development from the perspective of the ecological environment. This paper defines the connotation and characteristics of the green development of the whole agricultural industry chain and deeply analyzes the development status, major challenges, and feasible paths of the whole agricultural industry chain in China. It has built a whole industry chain development model of “Internet + modern agriculture” and proposed a decentralized agricultural data management system based on the IoT to solve the problem of untraceable of traditional agricultural products and other data. The agricultural IoT system is designed with a unique blockchain double-chain structure, using the global hash chain and the mutual verification between the transaction chains in each partition. It proposes the PMCP protocol, which improves the performance of the system by producing blocks in parallel for several consensus groups in each consensus cycle. The experimental results show that the proposed model is queryable, traceable, and trustworthy for whole-life agricultural data, and the proposed model outperforms other schemes in terms of throughput and delay.


---

## Body

## 1. Introduction

In recent years, with the improvement of social living standards, the standards of the public for spiritual life are also getting higher and higher. People have higher requirements for living, learning, and working environment. Therefore, building a good ecological environment and realizing sustainable social and economic development have become current important tasks. The country attaches great importance to the construction of social-ecological civilization. If agricultural enterprises want to gain a firm foothold in the new era, they must strengthen their development and improve their comprehensive competitiveness from the perspective of the ecological environment. Agricultural enterprises should not only improve their competitiveness by strengthening the economy but also actively practice the social responsibility of building an ecological environment [1].The integration of the whole agricultural industry chain led by green development is the core of ensuring the improvement of agricultural quality, efficiency, and environmental friendliness, and the realization of the green transformation of agricultural production. The state attaches great importance to the integration of the agricultural industry chain and the coordinated development of the ecological environment. From 2012 to 2019, the green development pattern of agriculture has gradually formed [2], which better adapts to the miniaturization, quality, and refinement characteristics of consumer demand [3, 4]. Strengthening the construction of the whole agricultural industry chain and green transformation and upgrading, ensuring the effective supply of high-quality agricultural products and meeting the requirements of ecological environment quality, will become the main direction of green and high-quality agricultural development in China.There are numerous studies on the whole agricultural industry chain, focusing on the definition of connotation, model classification, path exploration, effect analysis, etc., showing a development trend of continuous integration and continuous optimization [5]. In recent years, the rise of new development concepts, the transformation of consumption patterns, and the wide application of informatization have jointly promoted the formation of the concept of green development in the agricultural industry chain. In terms of the operation mode of the agricultural industry chain, it can be split into leading enterprise-driven, intermediary organization-driven, professional market-driven, and other types according to the different participants [6]. In addition, adjusting the composition of the value chain and optimizing the innovation system can ensure food safety, improve the output value and circulation efficiency of agricultural products, and promote farmers’ income increase, poverty alleviation, and agricultural industry development [7–9].Existing studies have focused on the definition of connotation, development transformation, evaluation indicators, and realization paths [10] regarding agricultural green development. Agricultural green development has gone through multiple stages of evolution, such as germination, development, enhancement, and promotion, and the core connotation mainly includes resource conservation, environmental friendliness, clean origin environment, product quality improvement, and ecosystem stability [11], which can be measured by data envelopment analysis (DEA) [12], stochastic frontier analysis (SFA) [13], and other models for partial factor productivity and total factor productivity. The development of digital technology, especially the proposal of “Internet + agriculture,” provides new ideas for the development of traditional agriculture [14–16]. It redistributes the relationship between various stakeholders and also makes a profound change in agricultural production, management methods, and industrial models. Therefore, it is of great practical significance to study the development model of the whole agricultural industry chain under the background of “Internet+.” The agricultural production mode is currently undergoing tremendous changes, from the past manual participation to the current mechanized and information-based smart agriculture. The agricultural Internet of Things (IoT) is an important foundation of smart agriculture and information agriculture, and the future of agricultural Internet of Things will be the general trend [17].Agricultural IoT is a monitoring network formed by a large number of sensor nodes to help farmers find problems in a timely and accurate manner [18]. Agricultural IoT shifts agriculture from human-centered to information-centered. A number of data collection points are set up in the production area of agricultural products, and the collection points collect agricultural data automatically through IOT devices. The data are collected at the collection points and uploaded to the server regularly through the Internet protocol, and the server saves and backs up the data. This shifts agriculture from human-centric to information-centric. However, most of the current IoT systems are centralized systems, which not only bring a huge burden to computing, storage, and network resources but also have problems such as single point of failure, data privacy, and reliability [19]. Blockchain has been regarded as one of the most promising technologies to solve the above IoT problems [20]. But the combination of blockchain and IoT also faces many problems. First, each node in the blockchain system stores the same copy of the blockchain, and increasing the number of nodes does not expand the storage capacity of the blockchain. Second, since the blockchain is a decentralized distributed system, it is necessary to ensure the consistency of the data of the entire network nodes through a consensus mechanism. The complex consensus process limits the transaction processing capacity of the blockchain and prolongs the transaction confirmation time. Bitcoin based on PoW can only process seven transactions per second [21]. Ethereum also only can process a few dozen transactions. Although the transaction processing capability of PBFT [22] is significantly better than that of proof of work (PoW) and consensus mechanisms based on proof of stake (PoS) [23], the communication complexity of practical byzantine fault tolerance (PBFT) is high. This limits the scalability of the system, and the throughput of the system becomes the bottleneck of its expansion [24, 25].The whole agricultural industry chain is a necessary component of the green transformation of agriculture, and the two integrate and promote each other. At present, there are relatively few studies on the green development of agriculture from the perspective of green transformation of the entire industrial chain and the perspective of “Internet + agriculture” to promote the construction and integration of the entire agricultural industry chain. This paper takes the integration and green transformation of the whole agricultural industry chain as an entry point and proposes a logical framework and key points from the connotation and characteristics of the green development of the whole agricultural industry chain. The framework condenses the development path model and enriches the theoretical research on the green development of the whole agricultural industry chain in China. And a decentralized management system of the IoT that solves the data management of traditional agricultural products is proposed to promote the healthy development of the agricultural product industry.Section2 is the state of the art. Section 3 is the method of implementing agricultural Internet of Things model. Section 4 is the result analysis and discussion. Section 5 is the conclusion.


## 2. State of the Art

### 2.1. Basic Connotation of Green Development of the Whole Agricultural Industry Chain

The green development of the entire agricultural industry chain takes the integration of the entire industry chain as the mainline, practices the concept of green development, and adheres to the principles of ecological priority and environmental friendliness. Based on resource endowments, we carry out industrial upgrading, linking, and integration; develop agricultural industries and industrial clusters with obvious advantages and distinctive characteristics; and realize the coordinated improvement of the efficiency and output value of the entire industrial chain.It is the basic requirement for the green development of the whole agricultural industry chain to realize the demand for a green ecological environment through the regulation and optimization of the material flow of the whole agricultural industry chain. Ecological priority and green development are the basic prerequisites for the green development of the entire agricultural industry chain. Matter and energy are the interaction between the entire agricultural industry chain and the ecological environment system. The whole agricultural industry chain needs to coordinate the whole chain management to realize the regulation and optimization of material flow and energy flow. It is mainly characterized by recycling, high efficiency, and full utilization; carries out the green transformation of the whole chain; improves the efficiency of resource utilization; and then meets the needs of the green ecological environment (Figure1). Corresponding management involves reduction at the source, process control, and end-point treatment: strengthening the input control of the entire agricultural industry chain from the source and reducing the excessive input of resources and the introduction of pollutants. We optimize the process management of the entire agricultural industry chain, improve resource utilization efficiency, and reduce environmental emissions. We strengthen the reprocessing and reuse of waste resources, reduce the amount of waste generated, and reduce environmental pressure.Figure 1
The logical idea of green development of the whole agricultural industry chain.The whole agricultural industry chain links farmland and table, is an intermediate between producers and consumers, and is also a comprehensive carrier of production, processing, circulation, consumption, and other links. Carrying out value tapping, optimizing benefit distribution, and realizing the value enhancement of the entire industrial chain have become the direct demand for the green development of the entire agricultural industrial chain (Figure1).


### 2.2. The Path Model of Green Development of the Whole Agricultural Industry Chain in China

#### 2.2.1. Logic and Key Points of Green Development of the Entire Agricultural Industry Chain

Under the new development pattern, we adhere to the new development concept, enhance the value of each link of the existing industrial chain, seek breakthroughs in systems and mechanisms, and innovate the chain extension and integration mode of the entire agricultural industrial chain. Compared with the current situation and macro demands of green development of the whole agricultural industry chain, the green development of the whole agricultural industry chain in China needs to make key breakthroughs in the following four aspects in terms of value enhancement of the existing industry chain (Figure2).Figure 2
Logical framework model for green development of the whole agricultural chain.(1) Green Production and Improving Quality and Efficiency. Quality improvement and efficiency improvement are mutually integrated and inseparable. Agricultural production is the starting point of the entire agricultural industry chain, and it is also the most important link to environmental emissions.(2) Circulation Chain Integration, Reducing Damage, and Increasing Efficiency. The circulation link including processing, storage, and transportation is the link between the effective operation of the production link and the quality and safety of the agricultural products on the market.(3) Brand Building and Precise Promotion. Brand building and precise promotion guide the consumption of green and high-quality agricultural products through precise promotion, cultivate first-class brands, increase the premium of agricultural products, and create a high-quality and high-price marketing system.(4) Improve Policies and Strengthen Support. Given the strong positive externalities of the green production of agricultural products and the low degree of product value display, timely research and release complete supporting policies provide a solid guarantee for the green production of agricultural products and the quality and price of products.


#### 2.2.2. The Key Path for Green Development of the Entire Agricultural Industry Chain

The key paths (industrial integration models) for the green development of China's entire agricultural industry chain are mainly divided into four categories: internal circulation integration, horizontal extension and expansion, vertical element integration, and industrial leapfrog integration (Figure3).Figure 3
The key path for the development of the entire agricultural production chain.(1) Internal Circulation Integration. Internal circulation integration refers to changing the straight-chain structure into a circular structure within the entire agricultural industry chain; strengthening the coupling of upstream, middle, and downstream; and promoting internal circulation. In the whole chain, the principle of material recycling and regeneration and the technology of material multilevel utilization are used to reduce the amount of waste generated in the whole agricultural industry chain; promote the recycling and utilization of wastes; realize loss savings, cost reduction, and efficient utilization; and reduce negative effects on the ecological environment.(2) Horizontal Extension Expansion. Horizontal expansion refers to extending the entire agricultural industry based on agriculture, focusing on consumer demand. Extend from primary industries such as raw materials and fresh food to processing/functional industries such as food processing, biological materials, and clean energy, and realize the improvement of the quality and value of agricultural products.(3) Vertical Element Integration. Vertical element integration refers to promoting the active integration of the whole agricultural industry chain into science and technology, data, capital, and other elements.(4) Industry Crossover Integration. Industry crossover integration refers to fully exploiting the functional characteristics of labor and employment security, ecological conservation, farming culture inheritance, cultural tourism and health care, and folk experience in addition to the basic functions of agricultural product supply, and promoting the integration of agriculture and tertiary industries such as tourism, culture, and education. Deep integration will stimulate the endogenous power of agricultural production and broaden the channels for farmers to increase their income.


## 2.1. Basic Connotation of Green Development of the Whole Agricultural Industry Chain

The green development of the entire agricultural industry chain takes the integration of the entire industry chain as the mainline, practices the concept of green development, and adheres to the principles of ecological priority and environmental friendliness. Based on resource endowments, we carry out industrial upgrading, linking, and integration; develop agricultural industries and industrial clusters with obvious advantages and distinctive characteristics; and realize the coordinated improvement of the efficiency and output value of the entire industrial chain.It is the basic requirement for the green development of the whole agricultural industry chain to realize the demand for a green ecological environment through the regulation and optimization of the material flow of the whole agricultural industry chain. Ecological priority and green development are the basic prerequisites for the green development of the entire agricultural industry chain. Matter and energy are the interaction between the entire agricultural industry chain and the ecological environment system. The whole agricultural industry chain needs to coordinate the whole chain management to realize the regulation and optimization of material flow and energy flow. It is mainly characterized by recycling, high efficiency, and full utilization; carries out the green transformation of the whole chain; improves the efficiency of resource utilization; and then meets the needs of the green ecological environment (Figure1). Corresponding management involves reduction at the source, process control, and end-point treatment: strengthening the input control of the entire agricultural industry chain from the source and reducing the excessive input of resources and the introduction of pollutants. We optimize the process management of the entire agricultural industry chain, improve resource utilization efficiency, and reduce environmental emissions. We strengthen the reprocessing and reuse of waste resources, reduce the amount of waste generated, and reduce environmental pressure.Figure 1
The logical idea of green development of the whole agricultural industry chain.The whole agricultural industry chain links farmland and table, is an intermediate between producers and consumers, and is also a comprehensive carrier of production, processing, circulation, consumption, and other links. Carrying out value tapping, optimizing benefit distribution, and realizing the value enhancement of the entire industrial chain have become the direct demand for the green development of the entire agricultural industrial chain (Figure1).


## 2.2. The Path Model of Green Development of the Whole Agricultural Industry Chain in China

### 2.2.1. Logic and Key Points of Green Development of the Entire Agricultural Industry Chain

Under the new development pattern, we adhere to the new development concept, enhance the value of each link of the existing industrial chain, seek breakthroughs in systems and mechanisms, and innovate the chain extension and integration mode of the entire agricultural industrial chain. Compared with the current situation and macro demands of green development of the whole agricultural industry chain, the green development of the whole agricultural industry chain in China needs to make key breakthroughs in the following four aspects in terms of value enhancement of the existing industry chain (Figure2).Figure 2
Logical framework model for green development of the whole agricultural chain.(1) Green Production and Improving Quality and Efficiency. Quality improvement and efficiency improvement are mutually integrated and inseparable. Agricultural production is the starting point of the entire agricultural industry chain, and it is also the most important link to environmental emissions.(2) Circulation Chain Integration, Reducing Damage, and Increasing Efficiency. The circulation link including processing, storage, and transportation is the link between the effective operation of the production link and the quality and safety of the agricultural products on the market.(3) Brand Building and Precise Promotion. Brand building and precise promotion guide the consumption of green and high-quality agricultural products through precise promotion, cultivate first-class brands, increase the premium of agricultural products, and create a high-quality and high-price marketing system.(4) Improve Policies and Strengthen Support. Given the strong positive externalities of the green production of agricultural products and the low degree of product value display, timely research and release complete supporting policies provide a solid guarantee for the green production of agricultural products and the quality and price of products.


### 2.2.2. The Key Path for Green Development of the Entire Agricultural Industry Chain

The key paths (industrial integration models) for the green development of China's entire agricultural industry chain are mainly divided into four categories: internal circulation integration, horizontal extension and expansion, vertical element integration, and industrial leapfrog integration (Figure3).Figure 3
The key path for the development of the entire agricultural production chain.(1) Internal Circulation Integration. Internal circulation integration refers to changing the straight-chain structure into a circular structure within the entire agricultural industry chain; strengthening the coupling of upstream, middle, and downstream; and promoting internal circulation. In the whole chain, the principle of material recycling and regeneration and the technology of material multilevel utilization are used to reduce the amount of waste generated in the whole agricultural industry chain; promote the recycling and utilization of wastes; realize loss savings, cost reduction, and efficient utilization; and reduce negative effects on the ecological environment.(2) Horizontal Extension Expansion. Horizontal expansion refers to extending the entire agricultural industry based on agriculture, focusing on consumer demand. Extend from primary industries such as raw materials and fresh food to processing/functional industries such as food processing, biological materials, and clean energy, and realize the improvement of the quality and value of agricultural products.(3) Vertical Element Integration. Vertical element integration refers to promoting the active integration of the whole agricultural industry chain into science and technology, data, capital, and other elements.(4) Industry Crossover Integration. Industry crossover integration refers to fully exploiting the functional characteristics of labor and employment security, ecological conservation, farming culture inheritance, cultural tourism and health care, and folk experience in addition to the basic functions of agricultural product supply, and promoting the integration of agriculture and tertiary industries such as tourism, culture, and education. Deep integration will stimulate the endogenous power of agricultural production and broaden the channels for farmers to increase their income.


## 2.2.1. Logic and Key Points of Green Development of the Entire Agricultural Industry Chain

Under the new development pattern, we adhere to the new development concept, enhance the value of each link of the existing industrial chain, seek breakthroughs in systems and mechanisms, and innovate the chain extension and integration mode of the entire agricultural industrial chain. Compared with the current situation and macro demands of green development of the whole agricultural industry chain, the green development of the whole agricultural industry chain in China needs to make key breakthroughs in the following four aspects in terms of value enhancement of the existing industry chain (Figure2).Figure 2
Logical framework model for green development of the whole agricultural chain.(1) Green Production and Improving Quality and Efficiency. Quality improvement and efficiency improvement are mutually integrated and inseparable. Agricultural production is the starting point of the entire agricultural industry chain, and it is also the most important link to environmental emissions.(2) Circulation Chain Integration, Reducing Damage, and Increasing Efficiency. The circulation link including processing, storage, and transportation is the link between the effective operation of the production link and the quality and safety of the agricultural products on the market.(3) Brand Building and Precise Promotion. Brand building and precise promotion guide the consumption of green and high-quality agricultural products through precise promotion, cultivate first-class brands, increase the premium of agricultural products, and create a high-quality and high-price marketing system.(4) Improve Policies and Strengthen Support. Given the strong positive externalities of the green production of agricultural products and the low degree of product value display, timely research and release complete supporting policies provide a solid guarantee for the green production of agricultural products and the quality and price of products.


## 2.2.2. The Key Path for Green Development of the Entire Agricultural Industry Chain

The key paths (industrial integration models) for the green development of China's entire agricultural industry chain are mainly divided into four categories: internal circulation integration, horizontal extension and expansion, vertical element integration, and industrial leapfrog integration (Figure3).Figure 3
The key path for the development of the entire agricultural production chain.(1) Internal Circulation Integration. Internal circulation integration refers to changing the straight-chain structure into a circular structure within the entire agricultural industry chain; strengthening the coupling of upstream, middle, and downstream; and promoting internal circulation. In the whole chain, the principle of material recycling and regeneration and the technology of material multilevel utilization are used to reduce the amount of waste generated in the whole agricultural industry chain; promote the recycling and utilization of wastes; realize loss savings, cost reduction, and efficient utilization; and reduce negative effects on the ecological environment.(2) Horizontal Extension Expansion. Horizontal expansion refers to extending the entire agricultural industry based on agriculture, focusing on consumer demand. Extend from primary industries such as raw materials and fresh food to processing/functional industries such as food processing, biological materials, and clean energy, and realize the improvement of the quality and value of agricultural products.(3) Vertical Element Integration. Vertical element integration refers to promoting the active integration of the whole agricultural industry chain into science and technology, data, capital, and other elements.(4) Industry Crossover Integration. Industry crossover integration refers to fully exploiting the functional characteristics of labor and employment security, ecological conservation, farming culture inheritance, cultural tourism and health care, and folk experience in addition to the basic functions of agricultural product supply, and promoting the integration of agriculture and tertiary industries such as tourism, culture, and education. Deep integration will stimulate the endogenous power of agricultural production and broaden the channels for farmers to increase their income.


## 3. Methodology

The automatic collection and blockchain traceability system based on the agricultural IoT are modularized and classified according to the business content, which is mainly divided into the perception layer module, the storage layer module, the contract layer module, the function layer module, and the visualization module. The overall framework of the system and the details of each module are shown in Figure4.Figure 4
Framework of the trusted traceability system of agricultural IoT.


### 3.1. Perception Layer

The perception layer is based on the IoT technology, which is composed of a large number of agricultural IoT environment acquisition sensors, which record data indicators such as crop light, temperature, pressure, and humidity. In addition, the number of IoT devices that use cameras to collect images and videos is also increasing. The IoT device identity information includes the device ID and the identity ID of the farm user to which it belongs. Farm users store the binding relationship of their equipment on the blockchain through one-to-many association mapping between their identity ID and device ID. When the device data are uploaded to the chain, it needs to be registered to obtain a temporary authorization token before the data can be uploaded to the chain. After the temporary token expires, it needs to apply to the permission control contract again. The crop data collected by IoT devices are transmitted through TCP protocol. The acquisition program starts the protocol connection service to receive sensor data and push it to the data acquisition contract. The collection contract stores the data in the blockchain according to the rules of theK-means algorithm, and the redundant data that do not meet the rules are directly discarded. In addition, the collected image and video data will be pushed to the interplanetary file system (IPFS) storage network, and the image data will also be obtained by taking screenshots through the camera. Pictures and video data are stored in the IPFS distributed private storage network. IPFS generates the unique content index hash of the data and then saves the hash value to the blockchain for proof.Based on partition technology, this paper proposes a dual-chain-based scalable IoT model DB-SIoTM. The model consists of a hash chain and multiple transaction chains that process transactions in parallel, where each transaction chain is managed and stored by an independent partition. Each partition is composed of several nodes that perform a specific function and can process transactions independently. An independent ledger is maintained in each partition, and only transactions related to this partition are stored. Transaction information is not disclosed to the entire network, which ensures the security and privacy of transaction information and reduces the storage pressure of the system. The hash chain contains the block headers of the blocks generated by each partition and a small amount of data description information, which occupies less storage. It is saved by all nodes in the system and realizes global information sharing without revealing partition transaction information. The use of transaction differentiation storage and mutual verification between the two chains further ensures the sequential structure of the blockchains in each partition. This ensures the verifiability and immutability of the blockchain in each partition and improves the security of the system.


### 3.2. Storage Layer

The storage layer consists of Hyperledger Fabric and IPFS. Hyperledger is an open-source consortium blockchain project that promotes trusted computing and has the characteristics of a peer-to-peer network. Distributed ledger technology is shared, transparent, and decentralized. Based on the modular framework design concept, Hyperledger provides a pluggable consensus mechanism, membership management service, node database, endorsement strategy verification strategy, etc., which is very flexible and easy to expand. The core elements of its design are smart contracts (on-chain code), digital assets, record repositories, centralized consensus networks, and cryptographic security.IPFS maps data content into a unique CID (content identity) through technologies such as Merkel directed acyclic graph (DAG) and distributed routing penetration. It removes duplicate content through file block technology, which greatly reduces data redundancy while ensuring data integrity.The traditional Hyperledger currently provides a Raft-based consensus mechanism, which separates the consensus service of the blockchain network through ordering nodes, which is superior to most consortium chains in terms of performance. However, the Raft consensus algorithm can efficiently solve the log content consistency problem of each node in the distributed system and, at the same time, make the cluster to have a certain fault-tolerant ability, but the algorithm does not support fault-tolerant malicious nodes (byzantine nodes). Therefore, this paper proposes a reputation-based parallel multiblock creation protocol (PMCP).


#### 3.2.1. Improved Hyperledger

Aiming at the proposed dual-chain IoT model, this paper proposes a reputation-based parallel multiblock creation protocol (PMCP) to improve the transaction processing capability of IoT. Because PBFT has no computing power requirements, it has lower latency than consensus mechanisms such as PoW and PoS. It has become a commonly used consensus mechanism in IoT applications. However, the high communication complexity of PBFT limits the node scalability of its system. And PBFT is vulnerable to Sybil attacks, and there are security problems. Some scholars improve PBFT through reputation evaluation and select some nodes for consensus block generation. But one-to-one block creation can result in a large number of transactions waiting to be confirmed. Especially in IoT, numerous devices generate huge transaction volumes every second. This improved approach still cannot meet the needs of IoT. PMCP evaluates nodes through a reputation mechanism, selects honest nodes for consensus, and forms multiple consensus groups to produce blocks in parallel. One round of consensus process can produce multiple blocks so that more transactions can be processed quickly and the throughput of the system can be improved.In the design of the consensus mechanism, it must be considered that malicious nodes may have the role of proposers and provide false block proposals, or malicious voters may have the role of validators. However, although the traditional deposit mechanism can raise the threshold for nodes to do evil to a certain extent, malicious nodes willing to sacrifice a small part of their interests to join the blockchain network cannot be identified, resulting in potential security risks in the system. The reputation mechanism of this paper is based on the softsign function. The softsign function is a sigmoid saturation function with a range of (−1,1). Therefore, the reputation value of the node in this paper has an upper limit and a lower limit, and the growth rate of the node reputation value can be adjusted by adjusting the parameters, and honest nodes can obtain a faster growth rate. And the tolerance of nodes for malicious behavior can be set according to the actual situation to adapt to the different needs of nodes’ honesty in actual situations. The mechanism comprehensively considers various role performances of nodes to achieve a reasonable evaluation of node reputation and defines the concept of reputation consumption. If a node does not participate in the consensus process for a long time, its reputation value will be reduced according to the decay ratio, thereby incentivizing the node to maintain its activity. The consensus mechanism in this paper does not require a large number of communication confirmations. It comprehensively considers various behaviors of nodes joining the network, and based on historical records and records of the current cycle, it can effectively identify the honesty of nodes.The trustworthiness assessment model in this paper is(1)Nx=α∑x=1t−1Nrx−γ∑x=1t−1Nmx1+α∑x=1t−1Nx−γ∑x=1t−1Nmx,Nrx=βQCxR+1−βLCxR,Nmx=βQCxM+1−βLCxM,where Nx is the reputation value of the node after the ith round of consensus. Nrx is the score of a node for correct behavior in the x-th round of consensus. Nmx is the score of the malicious behavior of the node in the x-th round of consensus. QCxR and QCxM are the number of correct actions and incorrect actions made by the node in the x-th round of consensus, respectively, when the node acts as a validator. LCxR and LCxM are the number of correct and incorrect actions made by the node in the x-th round of consensus, respectively. β is the weight of these two parts. Nx can adjust the growth trend of the curve by adjusting the step size α. As long as the nodes are honest, the upper limit can be approached after a certain period of time, and it will not cause the phenomenon of excessive reputation of some nodes. α can define different values according to the honesty of the node. γ is the tolerance threshold, which determines the tolerance for malicious behavior. To encourage nodes to actively participate in consensus and maintain network stability, this paper designs a node reputation decay mechanism. When a node does not participate in the consensus for a long time, its reputation value will be attenuated according to the decay ratio λ. The calculation formula of the reputation value is(2)Nx=∑x=1t−1Nrx−γ∑x=1t−1Nmx1+α∑x=1t−1Nrx−γ∑x=1t−1NmxΔH=0,λNx+1ΔH>0where ΔH is the distance between the round of the last consensus process that it participated in and the round of the current consensus process. If its value is greater than 0, each round will reduce its reputation value correspondingly by the decay ratio λ. If the node wants to maintain the reputation value, it cannot be offline for a long time; otherwise, the reputation value will tend to 0.There are three main roles in PMCP: partition leader, leader, and validator. In a partition, there is only one partition leader at the same time, and there are several consensus groups. Each consensus group has a leader and several validators. The person in charge of the partition is mainly responsible for verifying, sorting, and uploading the blocks submitted by each consensus group. Leaders and validators in the consensus group are responsible for consensus blocks. The whole process in PMCP runs with epoch as a major cycle. Each epoch is subdivided into multiple rounds. At the beginning of each epoch, the VRF grouping algorithm is run, and nodes that meet the requirements of the reputation value are randomly divided into different consensus groups. In each subsequent round, each consensus group performs a consensus process. The workflow of PMCP consists of the following steps, looping in epochs.The random grouping algorithm divides nodes into different consensus groups through the VRF algorithm so that each consensus group can process transactions in parallel and generate blocks. Before grouping, the head of the division has to do certain preparations. The person in charge of the partition first counts the node setφ and the number of nodes n that meet the requirements of the reputation value in the node set φ. Then, we calculate the number g of consensus groups in this epoch according to the number of nodes. Finally, the seed for this round is generated. The input public value is the seedx−1 value of the previous epoch and the sequence number of this epoch.(3)seedx,proofx←VRFSZseedx−1∥epoch,where epoch denotes the period of the whole process in PMCP. The partition leader generates the number of consensus groups, seedx and proofx for this round, and then broadcasts them to all nodes in this partition that meet the reputation value requirements for this round. After the node receives the broadcast content, the node calculates a random number u and a random number proof u through the VRF function. And according to the random number r, the consensus group to which it belongs is calculated. The formulas for generating random number r, proof u, and consensus group number CID are as follows:(4)r=Vrf_hashSZ,seedx,u=Vrf_proof−SZ,seedx,CID=r%a,where the partition is responsible for the number of consensus groups a. SZ is the private key of the node. The generated random number r value is unforgeable. Proving u allows any node to verify that r is valid. After the node generates the random number r and proves u, it broadcasts r, u, and CID to other nodes and receives the broadcast information of other nodes to determine its own consensus group member list. When r and u are received from other nodes, the identity of the random number node is verified by r.(5)r=VRF_U2Bu.TheVRF_verifyUZ,seedx,u,r function uses u to verify the validity of r. VRF_verify uses the public key to verify the validity of u. After the node establishes the consensus group table, it begins to enter the first round of this epoch and conduct block production activities.


#### 3.2.2. Network Topology

The underlying Hyperledger is built with Hyperledger fabric v1.4.6 to build a four-node main cluster network. The blockchain network topology is shown in Figure5. Farm users build bookkeeping nodes. IPFS maps data content to a unique CID (Content Identity) through DAG, distributed routing, and other technologies. It removes duplicate content through file chunking technology, which significantly reduces data redundancy while ensuring data integrity.Figure 5
Node network topology.


### 3.3. Contract Layer and Functional Layer

The smart contract layer is mainly responsible for data storage, data retrieval, data filtering, permission control, and other logic. The contract is issued by the main cluster federation manager and then deployed in the blockchain network under the condition that it is authorized and endorsed by other farm nodes.The functional layer is based on Hyperledger fabric SDK to connect smart contracts to realize data storage and retrieval, and at the same time connect to the IPFS distributed gateway to store pictures and videos, and provide functional interfaces for visualization layer services. The functional layer can also implement functions such as data analysis, anomaly detection, and network monitoring.


## 3.1. Perception Layer

The perception layer is based on the IoT technology, which is composed of a large number of agricultural IoT environment acquisition sensors, which record data indicators such as crop light, temperature, pressure, and humidity. In addition, the number of IoT devices that use cameras to collect images and videos is also increasing. The IoT device identity information includes the device ID and the identity ID of the farm user to which it belongs. Farm users store the binding relationship of their equipment on the blockchain through one-to-many association mapping between their identity ID and device ID. When the device data are uploaded to the chain, it needs to be registered to obtain a temporary authorization token before the data can be uploaded to the chain. After the temporary token expires, it needs to apply to the permission control contract again. The crop data collected by IoT devices are transmitted through TCP protocol. The acquisition program starts the protocol connection service to receive sensor data and push it to the data acquisition contract. The collection contract stores the data in the blockchain according to the rules of theK-means algorithm, and the redundant data that do not meet the rules are directly discarded. In addition, the collected image and video data will be pushed to the interplanetary file system (IPFS) storage network, and the image data will also be obtained by taking screenshots through the camera. Pictures and video data are stored in the IPFS distributed private storage network. IPFS generates the unique content index hash of the data and then saves the hash value to the blockchain for proof.Based on partition technology, this paper proposes a dual-chain-based scalable IoT model DB-SIoTM. The model consists of a hash chain and multiple transaction chains that process transactions in parallel, where each transaction chain is managed and stored by an independent partition. Each partition is composed of several nodes that perform a specific function and can process transactions independently. An independent ledger is maintained in each partition, and only transactions related to this partition are stored. Transaction information is not disclosed to the entire network, which ensures the security and privacy of transaction information and reduces the storage pressure of the system. The hash chain contains the block headers of the blocks generated by each partition and a small amount of data description information, which occupies less storage. It is saved by all nodes in the system and realizes global information sharing without revealing partition transaction information. The use of transaction differentiation storage and mutual verification between the two chains further ensures the sequential structure of the blockchains in each partition. This ensures the verifiability and immutability of the blockchain in each partition and improves the security of the system.


## 3.2. Storage Layer

The storage layer consists of Hyperledger Fabric and IPFS. Hyperledger is an open-source consortium blockchain project that promotes trusted computing and has the characteristics of a peer-to-peer network. Distributed ledger technology is shared, transparent, and decentralized. Based on the modular framework design concept, Hyperledger provides a pluggable consensus mechanism, membership management service, node database, endorsement strategy verification strategy, etc., which is very flexible and easy to expand. The core elements of its design are smart contracts (on-chain code), digital assets, record repositories, centralized consensus networks, and cryptographic security.IPFS maps data content into a unique CID (content identity) through technologies such as Merkel directed acyclic graph (DAG) and distributed routing penetration. It removes duplicate content through file block technology, which greatly reduces data redundancy while ensuring data integrity.The traditional Hyperledger currently provides a Raft-based consensus mechanism, which separates the consensus service of the blockchain network through ordering nodes, which is superior to most consortium chains in terms of performance. However, the Raft consensus algorithm can efficiently solve the log content consistency problem of each node in the distributed system and, at the same time, make the cluster to have a certain fault-tolerant ability, but the algorithm does not support fault-tolerant malicious nodes (byzantine nodes). Therefore, this paper proposes a reputation-based parallel multiblock creation protocol (PMCP).


### 3.2.1. Improved Hyperledger

Aiming at the proposed dual-chain IoT model, this paper proposes a reputation-based parallel multiblock creation protocol (PMCP) to improve the transaction processing capability of IoT. Because PBFT has no computing power requirements, it has lower latency than consensus mechanisms such as PoW and PoS. It has become a commonly used consensus mechanism in IoT applications. However, the high communication complexity of PBFT limits the node scalability of its system. And PBFT is vulnerable to Sybil attacks, and there are security problems. Some scholars improve PBFT through reputation evaluation and select some nodes for consensus block generation. But one-to-one block creation can result in a large number of transactions waiting to be confirmed. Especially in IoT, numerous devices generate huge transaction volumes every second. This improved approach still cannot meet the needs of IoT. PMCP evaluates nodes through a reputation mechanism, selects honest nodes for consensus, and forms multiple consensus groups to produce blocks in parallel. One round of consensus process can produce multiple blocks so that more transactions can be processed quickly and the throughput of the system can be improved.In the design of the consensus mechanism, it must be considered that malicious nodes may have the role of proposers and provide false block proposals, or malicious voters may have the role of validators. However, although the traditional deposit mechanism can raise the threshold for nodes to do evil to a certain extent, malicious nodes willing to sacrifice a small part of their interests to join the blockchain network cannot be identified, resulting in potential security risks in the system. The reputation mechanism of this paper is based on the softsign function. The softsign function is a sigmoid saturation function with a range of (−1,1). Therefore, the reputation value of the node in this paper has an upper limit and a lower limit, and the growth rate of the node reputation value can be adjusted by adjusting the parameters, and honest nodes can obtain a faster growth rate. And the tolerance of nodes for malicious behavior can be set according to the actual situation to adapt to the different needs of nodes’ honesty in actual situations. The mechanism comprehensively considers various role performances of nodes to achieve a reasonable evaluation of node reputation and defines the concept of reputation consumption. If a node does not participate in the consensus process for a long time, its reputation value will be reduced according to the decay ratio, thereby incentivizing the node to maintain its activity. The consensus mechanism in this paper does not require a large number of communication confirmations. It comprehensively considers various behaviors of nodes joining the network, and based on historical records and records of the current cycle, it can effectively identify the honesty of nodes.The trustworthiness assessment model in this paper is(1)Nx=α∑x=1t−1Nrx−γ∑x=1t−1Nmx1+α∑x=1t−1Nx−γ∑x=1t−1Nmx,Nrx=βQCxR+1−βLCxR,Nmx=βQCxM+1−βLCxM,where Nx is the reputation value of the node after the ith round of consensus. Nrx is the score of a node for correct behavior in the x-th round of consensus. Nmx is the score of the malicious behavior of the node in the x-th round of consensus. QCxR and QCxM are the number of correct actions and incorrect actions made by the node in the x-th round of consensus, respectively, when the node acts as a validator. LCxR and LCxM are the number of correct and incorrect actions made by the node in the x-th round of consensus, respectively. β is the weight of these two parts. Nx can adjust the growth trend of the curve by adjusting the step size α. As long as the nodes are honest, the upper limit can be approached after a certain period of time, and it will not cause the phenomenon of excessive reputation of some nodes. α can define different values according to the honesty of the node. γ is the tolerance threshold, which determines the tolerance for malicious behavior. To encourage nodes to actively participate in consensus and maintain network stability, this paper designs a node reputation decay mechanism. When a node does not participate in the consensus for a long time, its reputation value will be attenuated according to the decay ratio λ. The calculation formula of the reputation value is(2)Nx=∑x=1t−1Nrx−γ∑x=1t−1Nmx1+α∑x=1t−1Nrx−γ∑x=1t−1NmxΔH=0,λNx+1ΔH>0where ΔH is the distance between the round of the last consensus process that it participated in and the round of the current consensus process. If its value is greater than 0, each round will reduce its reputation value correspondingly by the decay ratio λ. If the node wants to maintain the reputation value, it cannot be offline for a long time; otherwise, the reputation value will tend to 0.There are three main roles in PMCP: partition leader, leader, and validator. In a partition, there is only one partition leader at the same time, and there are several consensus groups. Each consensus group has a leader and several validators. The person in charge of the partition is mainly responsible for verifying, sorting, and uploading the blocks submitted by each consensus group. Leaders and validators in the consensus group are responsible for consensus blocks. The whole process in PMCP runs with epoch as a major cycle. Each epoch is subdivided into multiple rounds. At the beginning of each epoch, the VRF grouping algorithm is run, and nodes that meet the requirements of the reputation value are randomly divided into different consensus groups. In each subsequent round, each consensus group performs a consensus process. The workflow of PMCP consists of the following steps, looping in epochs.The random grouping algorithm divides nodes into different consensus groups through the VRF algorithm so that each consensus group can process transactions in parallel and generate blocks. Before grouping, the head of the division has to do certain preparations. The person in charge of the partition first counts the node setφ and the number of nodes n that meet the requirements of the reputation value in the node set φ. Then, we calculate the number g of consensus groups in this epoch according to the number of nodes. Finally, the seed for this round is generated. The input public value is the seedx−1 value of the previous epoch and the sequence number of this epoch.(3)seedx,proofx←VRFSZseedx−1∥epoch,where epoch denotes the period of the whole process in PMCP. The partition leader generates the number of consensus groups, seedx and proofx for this round, and then broadcasts them to all nodes in this partition that meet the reputation value requirements for this round. After the node receives the broadcast content, the node calculates a random number u and a random number proof u through the VRF function. And according to the random number r, the consensus group to which it belongs is calculated. The formulas for generating random number r, proof u, and consensus group number CID are as follows:(4)r=Vrf_hashSZ,seedx,u=Vrf_proof−SZ,seedx,CID=r%a,where the partition is responsible for the number of consensus groups a. SZ is the private key of the node. The generated random number r value is unforgeable. Proving u allows any node to verify that r is valid. After the node generates the random number r and proves u, it broadcasts r, u, and CID to other nodes and receives the broadcast information of other nodes to determine its own consensus group member list. When r and u are received from other nodes, the identity of the random number node is verified by r.(5)r=VRF_U2Bu.TheVRF_verifyUZ,seedx,u,r function uses u to verify the validity of r. VRF_verify uses the public key to verify the validity of u. After the node establishes the consensus group table, it begins to enter the first round of this epoch and conduct block production activities.


### 3.2.2. Network Topology

The underlying Hyperledger is built with Hyperledger fabric v1.4.6 to build a four-node main cluster network. The blockchain network topology is shown in Figure5. Farm users build bookkeeping nodes. IPFS maps data content to a unique CID (Content Identity) through DAG, distributed routing, and other technologies. It removes duplicate content through file chunking technology, which significantly reduces data redundancy while ensuring data integrity.Figure 5
Node network topology.


## 3.2.1. Improved Hyperledger

Aiming at the proposed dual-chain IoT model, this paper proposes a reputation-based parallel multiblock creation protocol (PMCP) to improve the transaction processing capability of IoT. Because PBFT has no computing power requirements, it has lower latency than consensus mechanisms such as PoW and PoS. It has become a commonly used consensus mechanism in IoT applications. However, the high communication complexity of PBFT limits the node scalability of its system. And PBFT is vulnerable to Sybil attacks, and there are security problems. Some scholars improve PBFT through reputation evaluation and select some nodes for consensus block generation. But one-to-one block creation can result in a large number of transactions waiting to be confirmed. Especially in IoT, numerous devices generate huge transaction volumes every second. This improved approach still cannot meet the needs of IoT. PMCP evaluates nodes through a reputation mechanism, selects honest nodes for consensus, and forms multiple consensus groups to produce blocks in parallel. One round of consensus process can produce multiple blocks so that more transactions can be processed quickly and the throughput of the system can be improved.In the design of the consensus mechanism, it must be considered that malicious nodes may have the role of proposers and provide false block proposals, or malicious voters may have the role of validators. However, although the traditional deposit mechanism can raise the threshold for nodes to do evil to a certain extent, malicious nodes willing to sacrifice a small part of their interests to join the blockchain network cannot be identified, resulting in potential security risks in the system. The reputation mechanism of this paper is based on the softsign function. The softsign function is a sigmoid saturation function with a range of (−1,1). Therefore, the reputation value of the node in this paper has an upper limit and a lower limit, and the growth rate of the node reputation value can be adjusted by adjusting the parameters, and honest nodes can obtain a faster growth rate. And the tolerance of nodes for malicious behavior can be set according to the actual situation to adapt to the different needs of nodes’ honesty in actual situations. The mechanism comprehensively considers various role performances of nodes to achieve a reasonable evaluation of node reputation and defines the concept of reputation consumption. If a node does not participate in the consensus process for a long time, its reputation value will be reduced according to the decay ratio, thereby incentivizing the node to maintain its activity. The consensus mechanism in this paper does not require a large number of communication confirmations. It comprehensively considers various behaviors of nodes joining the network, and based on historical records and records of the current cycle, it can effectively identify the honesty of nodes.The trustworthiness assessment model in this paper is(1)Nx=α∑x=1t−1Nrx−γ∑x=1t−1Nmx1+α∑x=1t−1Nx−γ∑x=1t−1Nmx,Nrx=βQCxR+1−βLCxR,Nmx=βQCxM+1−βLCxM,where Nx is the reputation value of the node after the ith round of consensus. Nrx is the score of a node for correct behavior in the x-th round of consensus. Nmx is the score of the malicious behavior of the node in the x-th round of consensus. QCxR and QCxM are the number of correct actions and incorrect actions made by the node in the x-th round of consensus, respectively, when the node acts as a validator. LCxR and LCxM are the number of correct and incorrect actions made by the node in the x-th round of consensus, respectively. β is the weight of these two parts. Nx can adjust the growth trend of the curve by adjusting the step size α. As long as the nodes are honest, the upper limit can be approached after a certain period of time, and it will not cause the phenomenon of excessive reputation of some nodes. α can define different values according to the honesty of the node. γ is the tolerance threshold, which determines the tolerance for malicious behavior. To encourage nodes to actively participate in consensus and maintain network stability, this paper designs a node reputation decay mechanism. When a node does not participate in the consensus for a long time, its reputation value will be attenuated according to the decay ratio λ. The calculation formula of the reputation value is(2)Nx=∑x=1t−1Nrx−γ∑x=1t−1Nmx1+α∑x=1t−1Nrx−γ∑x=1t−1NmxΔH=0,λNx+1ΔH>0where ΔH is the distance between the round of the last consensus process that it participated in and the round of the current consensus process. If its value is greater than 0, each round will reduce its reputation value correspondingly by the decay ratio λ. If the node wants to maintain the reputation value, it cannot be offline for a long time; otherwise, the reputation value will tend to 0.There are three main roles in PMCP: partition leader, leader, and validator. In a partition, there is only one partition leader at the same time, and there are several consensus groups. Each consensus group has a leader and several validators. The person in charge of the partition is mainly responsible for verifying, sorting, and uploading the blocks submitted by each consensus group. Leaders and validators in the consensus group are responsible for consensus blocks. The whole process in PMCP runs with epoch as a major cycle. Each epoch is subdivided into multiple rounds. At the beginning of each epoch, the VRF grouping algorithm is run, and nodes that meet the requirements of the reputation value are randomly divided into different consensus groups. In each subsequent round, each consensus group performs a consensus process. The workflow of PMCP consists of the following steps, looping in epochs.The random grouping algorithm divides nodes into different consensus groups through the VRF algorithm so that each consensus group can process transactions in parallel and generate blocks. Before grouping, the head of the division has to do certain preparations. The person in charge of the partition first counts the node setφ and the number of nodes n that meet the requirements of the reputation value in the node set φ. Then, we calculate the number g of consensus groups in this epoch according to the number of nodes. Finally, the seed for this round is generated. The input public value is the seedx−1 value of the previous epoch and the sequence number of this epoch.(3)seedx,proofx←VRFSZseedx−1∥epoch,where epoch denotes the period of the whole process in PMCP. The partition leader generates the number of consensus groups, seedx and proofx for this round, and then broadcasts them to all nodes in this partition that meet the reputation value requirements for this round. After the node receives the broadcast content, the node calculates a random number u and a random number proof u through the VRF function. And according to the random number r, the consensus group to which it belongs is calculated. The formulas for generating random number r, proof u, and consensus group number CID are as follows:(4)r=Vrf_hashSZ,seedx,u=Vrf_proof−SZ,seedx,CID=r%a,where the partition is responsible for the number of consensus groups a. SZ is the private key of the node. The generated random number r value is unforgeable. Proving u allows any node to verify that r is valid. After the node generates the random number r and proves u, it broadcasts r, u, and CID to other nodes and receives the broadcast information of other nodes to determine its own consensus group member list. When r and u are received from other nodes, the identity of the random number node is verified by r.(5)r=VRF_U2Bu.TheVRF_verifyUZ,seedx,u,r function uses u to verify the validity of r. VRF_verify uses the public key to verify the validity of u. After the node establishes the consensus group table, it begins to enter the first round of this epoch and conduct block production activities.


## 3.2.2. Network Topology

The underlying Hyperledger is built with Hyperledger fabric v1.4.6 to build a four-node main cluster network. The blockchain network topology is shown in Figure5. Farm users build bookkeeping nodes. IPFS maps data content to a unique CID (Content Identity) through DAG, distributed routing, and other technologies. It removes duplicate content through file chunking technology, which significantly reduces data redundancy while ensuring data integrity.Figure 5
Node network topology.


## 3.3. Contract Layer and Functional Layer

The smart contract layer is mainly responsible for data storage, data retrieval, data filtering, permission control, and other logic. The contract is issued by the main cluster federation manager and then deployed in the blockchain network under the condition that it is authorized and endorsed by other farm nodes.The functional layer is based on Hyperledger fabric SDK to connect smart contracts to realize data storage and retrieval, and at the same time connect to the IPFS distributed gateway to store pictures and videos, and provide functional interfaces for visualization layer services. The functional layer can also implement functions such as data analysis, anomaly detection, and network monitoring.


## 4. Result Analysis and Discussion

### 4.1. Experimental Environment and Parameter Design

The experiment adopts Docker virtualization technology to build a multinode environment of the blockchain. The operating environment of Docker is a DELL R320 server. The software/hardware environment of the entire experiment is shown in Table1. For the convenience of simulation, this paper sets the block size to 1 KB.Table 1
Experimental environment configuration.
Software/hardwareConfigurationDocker engineVersion 18.09.0CPUIntel Xeon® E5-2407@2.2 GHzMemory64 GBOperating systemUbuntu server 14.04


### 4.2. Performance Test

The performance of the system is mainly evaluated from two aspects of throughput and delay. Throughput refers to the transaction volume processed by the entire system per unit time, and latency refers to the time required for a round of consensus within a partition. The compared consensus mechanisms are PoW, PBFT, T-PBFT, CDBFT, and R-PBFT. Among them, the core idea of T-PBFT is to select a part of the nodes with the highest reputation value to become a consensus group to carry out the consensus process, which is the most common idea in improving the PBFT algorithm at present [26]. CDBFT introduces a voting reward penalty and credit evaluation mechanisms [27]. R-PBFT uses different consensus mechanisms for network nodes of different groupings [28].Figure6 shows the comparison of the throughput of the proposed-based multipartition model and the nonpartition blockchain model using other consensus mechanisms. It can be seen from the experimental results that the throughput of proposed method (PMCP) is significantly better than other protocols, and it increases nearly linearly with the increase of the number of nodes. The throughput of the other consensus mechanisms does not increase with the increase of nodes but has a downward trend. The reason for this phenomenon is that each partition in PMCP can process transactions in parallel. As the number of nodes in the network continues to increase, it can divide more partitions and process more transaction requests at the same time, so the throughput of the system will continue to increase. Correspondingly, in the other consensus mechanisms, only one consensus block can be generated per consensus cycle. Even if the number of nodes in the network increases, they do not contribute anything to the throughput of the system, but instead increase the time required for consensus.Figure 6
Comparison of throughput between multipartition and single partition.Figure7 presents the consensus delay of the six consensus mechanisms within a single partition as the number of nodes increases. As the number of nodes in the partition increases, the communication delay of PBFT, CDBFT, and R-PBFT also increases gradually. PoW needs to solve difficult problems and has randomness, so its consensus latency is highly volatile. The consensus delay of T-PBFT is slightly lower than that of the proposed method. But compared with T-PBFT, the proposed method uses the VRF algorithm to increase the randomness, security, and fairness of selecting validators and leaders. However, T-PBFT only selects a part of the nodes with the largest reputation value as the verifier to verify the block, which lacks randomness. This will easily lead to the problem of joint malicious cooperation of nodes and centralized reputation. Once malicious, it will have a greater impact.Figure 7
Consensus time delay comparison.This experiment conducts performance tests on the two interfaces of agricultural product data uploading and traceability query. We evaluate the high availability and stability of the traceability system from latency and throughput rates. To test laboratory JMeter interface stress test software to simulate 2000 users sending requests at the same time, each user repeatedly sends 5 or 10 times as the test conditions of this system. Among them, the average value of the delay represents the response time, and the throughput rate represents the number of data transactions per second, which can evaluate the performance.As shown in Table2, the data reporting and throughput of the data uploading process are, respectively, shown. It can be seen that the response time of the on-chain process is long, and the number of transfers per second is low, but the number of failed transfers is very low. This is because when a large number of users are on the chain at the same time, the consensus mechanism needs to be implemented, and the system cannot process it in time, resulting in the accumulation of requests and staying in memory for a long time.Table 2
Data on-chain summary report.
LabelHTTP requestsOverallSamples (pcs)2000020000Average (ms)2637026370Min (ms)230230Max (ms)8446184461Exception (%)4.624.62Throughput (s−1)50.750.7Receiving (KB/s)12.9112.91Sending (KB/s)26.9226.92Average bytes258.4258.4Standard deviation18443.7718443.77As shown in Table3 and Figure 8, the data report, delay, and throughput rate of the traceability query process are, respectively, shown. It can be seen that the response time of the query process is very short, the number of transfers per second is high, and the number of failed transfers is zero. The query of the blockchain only needs to query the data from one node, and the time required is relatively short.Table 3
Traceability query summary report.
LabelHTTP requestsOverallSamples (pcs)2000020000Average (ms)16251625Min (ms)99Max (ms)52925292Exception (%)4.734.73Throughput (s−1)1088.91088.9Receiving (KB/s)2768.432768.43Sending (KB/s)356.27356.27Average bytes2604.12604.1Standard deviation594.54594.54Figure 8
Delay and throughput of traceability query. (a) Delay of traceability query. (b) Throughput of traceability query.
(a)(b)


## 4.1. Experimental Environment and Parameter Design

The experiment adopts Docker virtualization technology to build a multinode environment of the blockchain. The operating environment of Docker is a DELL R320 server. The software/hardware environment of the entire experiment is shown in Table1. For the convenience of simulation, this paper sets the block size to 1 KB.Table 1
Experimental environment configuration.
Software/hardwareConfigurationDocker engineVersion 18.09.0CPUIntel Xeon® E5-2407@2.2 GHzMemory64 GBOperating systemUbuntu server 14.04


## 4.2. Performance Test

The performance of the system is mainly evaluated from two aspects of throughput and delay. Throughput refers to the transaction volume processed by the entire system per unit time, and latency refers to the time required for a round of consensus within a partition. The compared consensus mechanisms are PoW, PBFT, T-PBFT, CDBFT, and R-PBFT. Among them, the core idea of T-PBFT is to select a part of the nodes with the highest reputation value to become a consensus group to carry out the consensus process, which is the most common idea in improving the PBFT algorithm at present [26]. CDBFT introduces a voting reward penalty and credit evaluation mechanisms [27]. R-PBFT uses different consensus mechanisms for network nodes of different groupings [28].Figure6 shows the comparison of the throughput of the proposed-based multipartition model and the nonpartition blockchain model using other consensus mechanisms. It can be seen from the experimental results that the throughput of proposed method (PMCP) is significantly better than other protocols, and it increases nearly linearly with the increase of the number of nodes. The throughput of the other consensus mechanisms does not increase with the increase of nodes but has a downward trend. The reason for this phenomenon is that each partition in PMCP can process transactions in parallel. As the number of nodes in the network continues to increase, it can divide more partitions and process more transaction requests at the same time, so the throughput of the system will continue to increase. Correspondingly, in the other consensus mechanisms, only one consensus block can be generated per consensus cycle. Even if the number of nodes in the network increases, they do not contribute anything to the throughput of the system, but instead increase the time required for consensus.Figure 6
Comparison of throughput between multipartition and single partition.Figure7 presents the consensus delay of the six consensus mechanisms within a single partition as the number of nodes increases. As the number of nodes in the partition increases, the communication delay of PBFT, CDBFT, and R-PBFT also increases gradually. PoW needs to solve difficult problems and has randomness, so its consensus latency is highly volatile. The consensus delay of T-PBFT is slightly lower than that of the proposed method. But compared with T-PBFT, the proposed method uses the VRF algorithm to increase the randomness, security, and fairness of selecting validators and leaders. However, T-PBFT only selects a part of the nodes with the largest reputation value as the verifier to verify the block, which lacks randomness. This will easily lead to the problem of joint malicious cooperation of nodes and centralized reputation. Once malicious, it will have a greater impact.Figure 7
Consensus time delay comparison.This experiment conducts performance tests on the two interfaces of agricultural product data uploading and traceability query. We evaluate the high availability and stability of the traceability system from latency and throughput rates. To test laboratory JMeter interface stress test software to simulate 2000 users sending requests at the same time, each user repeatedly sends 5 or 10 times as the test conditions of this system. Among them, the average value of the delay represents the response time, and the throughput rate represents the number of data transactions per second, which can evaluate the performance.As shown in Table2, the data reporting and throughput of the data uploading process are, respectively, shown. It can be seen that the response time of the on-chain process is long, and the number of transfers per second is low, but the number of failed transfers is very low. This is because when a large number of users are on the chain at the same time, the consensus mechanism needs to be implemented, and the system cannot process it in time, resulting in the accumulation of requests and staying in memory for a long time.Table 2
Data on-chain summary report.
LabelHTTP requestsOverallSamples (pcs)2000020000Average (ms)2637026370Min (ms)230230Max (ms)8446184461Exception (%)4.624.62Throughput (s−1)50.750.7Receiving (KB/s)12.9112.91Sending (KB/s)26.9226.92Average bytes258.4258.4Standard deviation18443.7718443.77As shown in Table3 and Figure 8, the data report, delay, and throughput rate of the traceability query process are, respectively, shown. It can be seen that the response time of the query process is very short, the number of transfers per second is high, and the number of failed transfers is zero. The query of the blockchain only needs to query the data from one node, and the time required is relatively short.Table 3
Traceability query summary report.
LabelHTTP requestsOverallSamples (pcs)2000020000Average (ms)16251625Min (ms)99Max (ms)52925292Exception (%)4.734.73Throughput (s−1)1088.91088.9Receiving (KB/s)2768.432768.43Sending (KB/s)356.27356.27Average bytes2604.12604.1Standard deviation594.54594.54Figure 8
Delay and throughput of traceability query. (a) Delay of traceability query. (b) Throughput of traceability query.
(a)(b)


## 5. Conclusion

With the emergence of “Internet+” and information technology, the behavior of the whole agricultural industry chain is developing in the direction of cooperation, equality, and sharing. This paper applies “Internet+” to all aspects of the industry chain, constructs a model for the development of the whole agricultural industry chain, and proposes an IoT model for the whole agricultural industry chain in the ecological environment to help realize sustainable development of the agricultural industry chain. The IoT model enables users in the whole agricultural industry chain to make credible traceability queries. Meanwhile, the model designed by the consensus algorithm PMCP in the system has good scalability. The performance analysis demonstrates that this solution can meet the performance requirements of practical applications while ensuring a reliable system and data security, and significantly reducing the storage pressure of the blockchain. The next work will further improve the model and study the related contents of the model such as cross-zone trading and partitioning mechanism to improve the usefulness of the model.



---

*Source: 1443650-2022-06-25.xml*