Abstract:
The adoption of blockchain technology can guarantee the safe and reliable storage of IoT data. In the agricultural products traceability system based on blockchain + Internet of Things, the storage method used in most existing schemes is to save the original data in the off-chain database system, but the real data cannot be agreed on the blockchain. However, if all the data in the production Internet of things are stored directly on the blockchain, it will cause great storage pressure. In order to balance the reliability and storage pressure of the IoT data stored on blockchain in the agricultural industry chain, a high-value density blockchain compression storage scheme for agricultural IoT data is proposed. This paper connects all production links of the agricultural product chain based on consortium blockchain and collects field data based on the Internet of Things composed of sensors. Firstly, a blockchain storage framework for agricultural Internet of Things data is proposed. The collected Internet of Things data is summarized through gateways or edge server devices before being stored in the blockchain. The value density of on-chain data is increased by compression method. An adaptive lossy compression method with outliers is designed for the data compression process. The agricultural IoT data is divided into normal values and outliers based on the outlier separation method. According to the time correlation between sensor data and the sparse of abnormal data, an adaptive compression algorithm for normal data and outlier data compression algorithm is designed to compress normal data and outlier data respectively. Compressed data are stored in the blockchain instead of original data, reducing storage space occupation; The application service platform can obtain the data on the blockchain and reconstruct the data that meets the accuracy need. The results of experiments show that when the proposed scheme is used for data compression, k values can be adaptively selected for different data sets, and good compression effects can be obtained, on-chain storage space can be reduced, and the value density of data can be improved, satisfying the reconstruction accuracy of users. This method has a good compression effect for data with low change frequency, such as temperature and humidity data, but fails to achieve a high compression effect for data with high change frequency such as wind speed data. In the scheme, storing data on the blockchain can solve the problem of traceability data caused by off-chain storage. In view of the storage redundancy caused by storing all the data on the blockchain, lossy compression method is adopted to reduce the data volume and improve the value density of on-chain data within the acceptable error range of the Internet of Things data provider. Experiments show that suppose the compression ratio of mormal data is 10:1, this method saves about 85% of on-chain storage space and increases the corresponding data value density by about 85%. The scheme only stores data with a compression factor through the blockchain network, reducing the storage and management overhead of on-chain data. At the same time, the scheme has the characteristics of availability, data traceability and non-repudiation. Apart from being a mere technical solution, this research endeavor emerges as a robust response to the imperatives of secure and reliable IoT data storage within the agricultural product traceability landscape. Looking ahead to the agricultural product traceability scenario based on blockchain, this innovative solution calls for the possibility of harmonious integration with technologies such as sidechain and data offloading. This integration will further mitigate blockchain storage redundancy while ensuring data consensus on the blockchain. The ultimate goal is to ensure the transparency and traceability of the entire agricultural product data traceability process. With the development of the industry and the continuous progress of the technology field, it provides technical support for the realization of distributed agricultural Internet of Things data compression storage.