杨信廷, 王明亭, 徐大明, 罗娜, 孙传恒. 基于区块链的农产品追溯系统信息存储模型与查询方法[J]. 农业工程学报, 2019, 35(22): 323-330. DOI: 10.11975/j.issn.1002-6819.2019.22.038
    引用本文: 杨信廷, 王明亭, 徐大明, 罗娜, 孙传恒. 基于区块链的农产品追溯系统信息存储模型与查询方法[J]. 农业工程学报, 2019, 35(22): 323-330. DOI: 10.11975/j.issn.1002-6819.2019.22.038
    Yang Xinting, Wang Mingting, Xu Daming, Luo Na, Sun Chuanheng. Data storage and query method of agricultural products traceability information based on blockchain[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2019, 35(22): 323-330. DOI: 10.11975/j.issn.1002-6819.2019.22.038
    Citation: Yang Xinting, Wang Mingting, Xu Daming, Luo Na, Sun Chuanheng. Data storage and query method of agricultural products traceability information based on blockchain[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2019, 35(22): 323-330. DOI: 10.11975/j.issn.1002-6819.2019.22.038

    基于区块链的农产品追溯系统信息存储模型与查询方法

    Data storage and query method of agricultural products traceability information based on blockchain

    • 摘要: 针对区块链追溯系统信息数据存储负载过大、查询效率低等问题,该文以果蔬菜类农产品为例,基于Hyperledger Fabric设计了一种区块链农产品追溯信息存储模型和查询方法。提出"数据库+区块链"的链上链下追溯信息双存储设计,本地数据库存储追溯明文数据,区块链上存储追溯数据加密后的哈希值,并在此基础上建立了外联数据库索引的查询方法。通过该方法与基于key键遍历查询和批次号字段查询的2种传统区块链数据查询方法进行对比测试,结果表明当区块链追溯记录总量达到11×104条,批次追溯记录条数为400时,该方法查询效率分别提高了70.56%和88.66%,有效解决了区块链链式结构中数据查询效率低的问题,保证了数据隐私安全,提高了追溯信息的可靠性与时效性。

       

      Abstract: Abstract: Food safety has become an important topic in people's daily lives. In recent years, the frequent occurrence of food safety incidents have caused a crisis of trust between consumers and the food industry. Accordingly, there is an urgent need to establish an efficient and trusted traceability system for agricultural products. In the practical application of the traditional traceability system, the data of the production, processing, packaging, transportation, storage and sales of agricultural products are stored in the local database of each node, data in traditional traceability systems is centralized, and authoritative agencies manage the central database of the traceability system. Because the traceability data of each supply chain node is managed by the enterprise itself, the data is easy to be tampered with. Therefore, it is necessary to improve the reliability of information transmission between different roles in agricultural supply chain.Blockchain has the characteristics of decentralization, non-tampering, traceability, and high availability. Using these characteristics of blockchain and using blockchain technology to trace agricultural products, it is possible to solve the problems existing in the current traditional traceability system.At present, Scholars in China and abroad have studied the application of blockchain in the field of traceability. However, the traceability system of blockchain have some problems, such as low query efficiency, high data-storage load, and poor data privacy and security. In order to solve the above problems, this study designed a storage structure for a blockchain-based traceability system for agricultural products based on Hyperledger Fabric and proposed an index storage and query method for gtraceability information. In this method, "On chain and off chain" data storage technology is used, the enterprise first digitally signs the hash value of the traceability information of agricultural products, writes the hash value into the blockchain, and returns the block number to the blockchain where the hash value is located. Then, the traceability information of agricultural products and the block number are stored in the local database of each node. If the information of agricultural products needs to be modified, it is necessary to rewrite the hash value of the traceability information to the blockchain and update the block number. When consumers scan the QR code of agricultural products, the traceability information and block number is obtained from the local database, the value is calculated by hash algorithm for the acquired traceability information, and compare it with this newly acquired hash value with the hash value stored in the blockchain by block number to verify the authenticity of traceability information of agricultural products. The result showed that, when the number of total traceability records reached 11×104 in the blockchain and the number of batch traceability records was 400 respectively, the query efficiency of the newly proposed method was increased by 70.56% and 88.66% compared to two traditional blockchain-based data query methods of query performed using the value of key attribute and querying performed using the batch number of agricultural products through the rich query of the CouchDB database, respectively. The approach of this paper effectively solves the problem of excessive load pressure of blockchain data storage, ensures data privacy and security, and improves the reliability and timeliness of traceability information.

       

    /

    返回文章
    返回