欢迎您访问《智慧农业(中英文)》官方网站! English

Smart Agriculture ›› 2023, Vol. 5 ›› Issue (4): 68-78.doi: 10.12133/j.smartag.SA202307004

• 专题--面向智慧农业的人工智能和机器人技术 • 上一篇    下一篇

基于区块链和星际文件系统的种植业农产品溯源模型

陈丹丹1(), 张立杰2, 蒋双丰3, 张恩2, 张杰1,4, 赵晴1,4, 郑国清1,4,5, 李国强1,4,5()   

  1. 1. 河南省农业科学院 农业经济与信息研究所,河南 郑州 450002,中国
    2. 河南师范大学 计算机与信息工程学院,河南 新乡 453007,中国
    3. 信阳市农业科学院,河南 信阳 464099,中国
    4. 农业农村部黄淮海智慧农业技术重点实验室,河南 郑州 450002,中国
    5. 河南省智慧农业工程技术研究中心,河南 郑州 450002,中国
  • 收稿日期:2023-07-12 出版日期:2023-12-30
  • 作者简介:
    陈丹丹,研究方向为区块链农产品溯源。E-mail:

    CHEN Dandan, E-mail:

  • 通信作者:
    李国强,博士,研究员,研究方向为农业信息化。E-mail:

Traceability Model of Plantation Agricultural Products Based on Blockchain and InterPlanetary File System

CHEN Dandan1(), ZHANG Lijie2, JIANG Shuangfeng3, ZHANG En2, ZHANG Jie1,4, ZHAO Qing1,4, ZHENG Guoqing1,4,5, LI Guoqiang1,4,5()   

  1. 1. Institute of Agricultural Economy and Information, Henan Academy of Agricultural Sciences, Zhengzhou 450002, China
    2. College of Computer and Information Engneering, Henan Normal University, Xinxiang 453007, China
    3. Xinyang Academy of Agricultural Sciences, Xinyang 464099, China
    4. Key Laboratory of Huang-Huai-Hai Smart Agricultural Technology, Ministry of Agriculture and Rural Affairs, Zhengzhou 450002, China
    5. Henan Engineering and Technology Research Center for Smart Agriculture, Zhengzhou 450002, China
  • Received:2023-07-12 Online:2023-12-30
  • corresponding author:
    LI Guoqiang, E-mail:
  • Supported by:
    Excellent Youth Science and Technology Fund Project of Henan Academy of Agricultural Sciences(2022YQ28)

摘要:

[目的/意义] 充分体现区块链去中心化的特点,保护敏感数据隐私及缓解区块链存储压力。 [方法] 设计了基于区块链和星际文件系统的种植业农产品溯源模型,从数据隐私角度把溯源数据分为公开数据和敏感数据。公开数据直接上传至区块链;敏感数据上传至区块链中的私有数据集中。从数据类型上把公开数据分为结构化数据和非结构化数据。结构化数据直接上链;非结构化数据上传至分布式数据库星际文件系统中。此方法可在保证数据安全性前提下实现数据的高效存取,提升追溯效率。Hyperledger fabric联盟链作为底层平台对原型系统进行开发,利用测试工具Postman对应用层接口性能进行测试。 [结果和讨论] 在使用同步应用程序接口(Application Programming Interface,API)和异步API情况下,数据上链平均时延分别为2 138.9和37.6 ms;数据查询平均时延为12.3 ms。 [结论] 本研究提出的溯源模型可以保护企业敏感数据隐私,同时具有较高的数据上链和查询效率,可适用在种植业农产品实际溯源环境中,为种植业农产品区块链溯源模型设计提供了新的思路。

关键词: hyperledger fabric联盟链, 私有数据集, 星际文件系统, 种植业农产品, 溯源

Abstract:

[Objective] The InterPlanetary File System (IPFS) is a peer-to-peer distributed file system, aiming to establish a global, open, and decentralized network for storage and sharing. Combining the IPFS and blockchain technology could alleviate the pressure on blockchain storage. The distinct features of the supply chain for agricultural products in the plantation industry, including extended production cycles, multiple, heterogeneous data sources, and relatively fragmented production, which can readily result in information gaps and opacity throughout the supply chain; in the traceability process of agricultural products, there are issues with sensitive data being prone to leakage and a lack of security, and the supply chain of plantation agricultural products is long, and the traceability data is often stored in multiple blocks, which requires frequent block tracing operations during tracing, resulting in low efficiency. Consequently, the aim of this study is to fully encapsulate the decentralized nature of blockchain, safeguard the privacy of sensitive data, and alleviate the storage strain of blockchain. [Method] A traceability model for plantation-based agricultural products was developed, leveraging the hyperledger fabric consortium chain and the IPFS. Based on data type, traceability data was categorized into structured and unstructured data. Given that blockchain ledgers were not optimized for direct storage of unstructured data, such as images and videos, to alleviate the storage strain on the blockchain, unstructured data was persisted in the IPFS, while structured data remains within the blockchain ledger. Based on data privacy categories, traceability data was categorized into public data and sensitive data. Public data was stored in the public ledger of hyperledger fabric, while sensitive data was stored in the private data collection of hyperledger fabric. This method allowed for efficient data access while maintaining data security, enhancing the efficiency of traceability. Hyperledger Fabric was the foundational platform for the development of the prototype system. The front-end website was based on the TCP/IP protocol stack. The website visualization was implemented through the React framework. Smart contracts were crafted using the Java programming language. The performance of the application layer interface was tested using the testing tool Postman. [Conclusions and Discussions] The blockchain-based plantation agricultural product traceability system was structured into a five-tiered architecture, starting from the top: the application layer, gateway layer, contract layer, consensus layer, and data storage layer. The primary service providers at the application layer were the enterprises and consumers involved in each stage of the traceability process. The gateway layer served as the middleware between users and the blockchain, primarily providing interface support for the front-end interface of the application layer. The contract layer mainly included smart contracts for planting, processing, warehousing, transportation, and sales. The consensus layer used the EtcdRaft consensus algorithm. The data storage layer was divided into the on-chain storage layer of the blockchain ledger and the off-chain storage layer of the IPFS cluster. In terms of data types, each piece of traceability data was categorized into structured data items and unstructured data items. Unstructured data was stored in the Interstellar File System cluster, and the returned content identifiers were integrated with the structured data items into the blockchain nodes within the traceability system. In the realm of data privacy, smart contracts were employed to segregate public and sensitive data, with public data directly integrating onto the blockchain, and sensitive data, adhering to predefined sharing policies, being stored in a private dataset designated by hyperledger fabric. In terms of user queries, consumers could retrieve product traceability information via a traceability system overseen by a reputable authority. The developed model website consisted of three parts: a login section, an agricultural product circulation information management and user data management section for enterprises in various links, and a traceability data query section for consumers. When using synchronous and asynchronous Application Program Interfaces, the average data on-chain latency was 2 138.9 and 37.6 ms, respectively, and the average data query latency was 12.3 ms. Blockchain, as the foundational data storage technology, enhances the credibility and transaction efficiency in agricultural product traceability. [Conclusions] This study designed and implemented a plantation agricultural product traceability model leveraging blockchain technology's private dataset and the IPFS cluster. This model ensured secure sharing and storage of traceability data, particularly sensitive data, across all stages. Compared to traditional centralized traceability models, it enhanced the reliability of the traceability data. Based on the evaluation through experimental systems, the traceability model proposed in this study effectively safeguarded the privacy of sensitive data in enterprises. Additionally, it offered high efficiency in data linking and querying. Applicable to the real-world traceability environment of plantation agricultural products, it showed potential for widespread application and promotion, offering fresh insights for designing blockchain traceability models in this sector. The model is still in its experimental phase and lacks applications across various types of crops in the farming industry. The subsequent step is to apply the model in real-world scenarios, continually enhance its efficiency, refine the model, advance the practical application of blockchain technology, and lay the foundation for agricultural modernization.

Key words: hyperledger fabric alliance chain, private data collection, InterPlanetary File system, plantation agricultural products, traceability