| China is the world’s largest rice producer,and the rice supply chain is a matter of national food security.Differences in geographic location and environmental factors lead to differences in rice quality,and rice of high quality origin is more attractive to consumers because of its excellent quality and taste;while the origin of rice in the market is confusing,prices vary and counterfeiting is common in the origin of rice.Therefore,it is important to study the origin traceability of rice and establish a credible traceability system of rice origin.The traditional Io T blockchain traceability system uploads traceability data to a centralized server,which in turn uploads them to the blockchain;this approach not only puts great pressure on the computing and storage resources in the cloud,but also makes the traceability system vulnerable to risks such as source data tampering or data loss.To address the above problems,this paper designs a blockchain and edge computing-based origin traceability model for rice,relying on the edge computing capability of embedded devices,real-time data fusion of sensor data and deployment of blockchain on embedded devices.In addition,the storage scaling method and edge computing workflow of the blockchain network under the edge computing scenario are designed.Finally,the blockchain and edge computing based rice origin traceability system is designed and implemented according to the model.The main research contents are as follows.(1)A rice origin traceability model based on blockchain and edge computing is proposed,and the whole model mainly consists of a perception layer,an edge layer and an application layer.The data collected by the sensors are transmitted to the edge layer through the wireless sensor network,and the embedded devices in the edge layer act as edge nodes and also as blockchain nodes to maintain the corresponding ledgers.The edge layer divides multiple origin regions according to the origin latitude and longitude,and the edge nodes in each origin region maintain an origin region ledger,which is backed up to the core nodes corresponding to each production region,and all the core nodes maintain a core chain,and the registered and backed up data of the edge blockchain nodes are uploaded to the core chain.The application layer is responsible for the various information interaction needs of consumers,regulators and enterprises.The model deeply analyzes the characteristics of the rice supply chain and ensures the authenticity and trustworthiness of rice origin traceability information by integrating blockchain and edge computing technologies,and also reduces the capacity of the blockchain required to be stored by the edge nodes by using the coreedge dual blockchain structure and multi-chain channel isolation mechanism.(2)Designing an edge computing scheme for rice origin traceability.The edge layer first performs data filtering and uses Kalman filtering algorithm for data fusion,second uses SM2 algorithm for differential encryption of traceability data,and finally the edge node submits traceability information to the chain and maintains the blockchain ledger as a bookkeeping node.It solves the problems of source data tampering,high communication delay and high consumption of cloud resources of traditional Io T blockchain traceability system.(3)Design and implement the rice origin traceability system based on blockchain and edge computing.Firstly,we design the overall architecture for the system.Secondly,we conducted an exhaustive design of the system functional modules and clearly elaborated the key business processes of the system,which fully prepared for the subsequent system implementation.Finally,we implemented and tested the system.The test analysis results show that the write and query throughputs are 125 tps and 200tps;the average time of traceability data uploading is 1270 ms,the average query time of public traceability data is 45.84 ms,and the query time of privacy traceability data decryption is 50.92ms;the storage capacity consumption of edge multi-chain is 18% of that of traditional single-chain.Therefore,this system is able to meet the upstream query as well as throughput requirements of the rice origin traceability system,and the system storage performance is also able to meet the requirements of massive Io T data traceability under the edge blockchain scenario. |