| With the frequent occurrence of agricultural product quality and safety problems,the product quality and safety traceability system has gradually been recognized by people.However,in the practical application of the traceability system,there are problems such as doubts about the authenticity of the traceability information,the security of data storage and transmission cannot be guaranteed,and the operation efficiency of the traceability system is low,which makes the traceability system face many challenges in practical application and promotion.Based on this,a safe and efficient blockchain traceability model is constructed to optimize the reliability and security of the traditional agricultural product traceability model,realize the secure storage of traceability confidentiality data,and improve data storage and query performance.In this paper,ginger,the most representative agricultural product,is used as the verification object of the model,and a reliable traceability system for the quality and safety of ginger products is designed and implemented.The main research contents and results of this paper are as follows:(1)Research on secure and efficient traceability model based on blockchainIn view of the problems of low data reliability,poor security and low efficiency of blockchain data storage and query in the traditional agricultural product traceability process,a blockchain-based safe and efficient traceability model is constructed.In order to enhance the security of traceability data storage in the model,a security design of traceability model based on multi-chain on the main side is proposed.In order to improve the efficiency of blockchain data storage and query,an efficient data storage structure and fast traceability mechanism based on multiple trees are proposed on the basis of the multi-chain design on the main side.The construction of the model enables the blockchain-based traceability model to take into account the secure storage of confidential data and the efficient storage and query of traceability data.(2)Security design of traceability model based on multi-chain on main sideIn view of the problem that the storage and query efficiency of the main chain is reduced due to the storage requirements of a large number of traceability data,a multi-chain data storage structure on the main side is designed to reduce the storage and query pressure of the main chain.The traceability data types are divided into confidential data and non-confidential data,and the main chain ledger is established respectively.The confidential data book is anchored to the side chain to realize data entry and query operations and synchronize to the main chain,reducing the storage and query pressure on the main chain.In view of the conflict between the openness and transparency of the blockchain and the security storage requirements of enterprise confidential data,the smart contract init and query functions in the side chain are reconstructed by using the SM2 algorithm to enhance the security of the data.And optimize the key derivation function based on concurrent design.The experimental analysis shows that the security and optimization effect of the algorithm have obvious advantages compared with the traditional traceability model,and the time complexity of the KDF algorithm is significantly reduced.(3)Design of efficient data storage structure and fast traceability mechanism based on multiple treesIn view of the problem that the storage and query performance of the blockchain MerkleTree structure increases significantly due to the increase in the amount of traceable data.Based on the detailed analysis of the structural characteristics of MerkleTree,RBTree and B+Tree,combined with the characteristics of the data scale,data query and update frequency of the traceability process of ginger agricultural products.An efficient data storage structure based on MerkleTree,RBTree and B+Tree is designed to realize fast storage and verification of traceability data.In view of the problem of low query efficiency of the traceability system,by embedding the Bloom filter method,a fast traceability mechanism on the chain and off the chain is designed,which further improves the operation efficiency of the traceability system.Through the design of large-scale performance experimental analysis,it is shown that the use of multiple tree storage structures significantly improves data storage and query performance,and the use of Bloom filters significantly improves the query rate of the traceability system.(4)Implementation of ginger product quality,safety and reliable traceability systemOn the basis of the research on the safe and efficient traceability model based on blockchain,taking ginger as the traceability object,the ginger product quality,safety and reliable traceability system is designed and implemented.The system uses the Hyperledger Fabric platform as the underlying architecture of the blockchain,builds the hyperledger,constructs the data storage structure of the main and side chains,and reconstructs the smart contract based on the national secret algorithm.On the basis of optimizing the blockchain storage structure,the system realizes trusted storage of data,fast query and secure storage of confidential data,laying a solid foundation for the popularization and application of a safe and efficient traceability system. |