The quality and safety of agricultural products is an important cornerstone of people’s health,and the establishment of an effective agricultural product traceability system is an important method to ensure the quality and safety of agricultural products.Traditional agricultural product traceability has problems such as opaque information,difficult to guarantee data authenticity and privacy leakage.Blockchain technology has become one of the effective means to solve the problems of data sharing and security with its characteristics such as non-tamperability,decentralization and traceability.However,due to the complete transparency of blockchain data transmission and long waiting time for access,there are still defects of low data sharing,lack of transparency and low granularity of access in the existing blockchain traceability.To this end,this thesis proposes a hierarchical access control mechanism for agricultural blockchain traceability data,and the main research contents are as follows:(1)In-depth study of the principle and characteristics of blockchain technology,summary of the current research status of traditional agricultural product traceability at home and abroad,analysis of the current problems of agricultural product blockchain traceability,and taking the actual situation of Huangshan Liubaili tea enterprise as an example,the tea traceability data are classified,grading standards are formulated,and permissions are divided for different access identities,thus improving the access efficiency and security of traceability data.(2)The access control mechanism of agricultural products blockchain traceability data is proposed.Due to the large scale and variety of traceability data,which leads to the lack of flexibility and fine-grained access to agricultural products data,this thesis controls access to different types and levels of data based on the improved attribute-based encryption algorithm of hierarchical ciphertext policy.Enterprises split the original access policy into multiple levels and specify the corresponding attribute requirements for each level,after which the key generation algorithm is modified to generate the public and private keys corresponding to the access policy.When a user applies for access to data,the smart contract matches the corresponding policy to authenticate him/her and obtains the corresponding access privileges after passing.(3)A blockchain traceability data security protection scheme for agricultural products is designed.Aiming at the problem of complete transparency of blockchain transaction information,which causes a large amount of traceability data access leakage and cannot be shared securely,this thesis designs a traceability data encryption scheme.The traceability data is stored within the enterprise after symmetric encryption,and the ciphertext storage address is uploaded to the blockchain,and the key is encrypted using attribute-based encryption.When users access the data,they first register their identity information,after which they use the identity attributes to match the access policy and obtain the data storage address information and the symmetric key after passing it,and the users decrypt the data through the symmetric key and finally access the data successfully.(4)A blockchain traceability data management system for agricultural products was constructed.The system uses the Hyperledger Fabric platform to build a blockchain network,which mainly includes functions such as data access control management,data security sharing and storage.The functional and performance tests of the blockchain traceability system show that the system can operate stably for a long time,indicating that this model can effectively realize fine-grained access and secure sharing of data.The research in this thesis achieves functions such as transparent fine-grained access and secure sharing of data,which guarantees decentralized and credible traceability of agricultural products and positively promotes the development of blockchain in the field of agricultural quality. |