Abstract:Aiming at the trusted access of agricultural product quality inspection data at this stage, as well as the high throughput and low transaction delay of data. The authors propose an on-chain and off-chain classification storage method for trusted detection data of agricultural products based on blockchain. First, according to the decentralization, non-tampering, and time stamp characteristics of the blockchain, the sensitive small file detection data is stored on the blockchain to provide storage credit support; secondly, the non-sensitive large file data is stored in off-chain database to alleviate the high throughput of data brought by storing the entire detection record on the chain. Finally, the hash functions of the Bloom filter are used to quickly determine whether the query element is in the specified data set, so as to improve the query efficiency of the detection data on the chain. In order to verify the query efficiency of the method, the authors compared two sets of experimental schemes with or without the Bloom filter in the same blockchain data storage environment. The results show that the data query speed on the chain of the former is higher than that of the latter. Therefore, the method can provide an effective and credible access method for the detection data of agricultural products.