Agricultural product supply chain data storage method based on block chain

By dynamically adjusting the differential coding baseline value and identifying abnormal blocks in the agricultural product supply chain, the data storage of the agricultural product supply chain is optimized, solving the problems of easy tampering and high cost of traditional storage, and realizing efficient and low-cost data storage.

CN121070281APending Publication Date: 2025-12-05GUANGDONG TIANPENG AGRICULTURAL & ANIMAL HUSBANDRY TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511260076.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-04
Publication Date
2025-12-05

AI Technical Summary

Technical Problem

Traditional agricultural product supply chain data stored in centralized systems is easily tampered with and costly. Differential coding is inefficient when data changes, making it difficult to effectively improve storage efficiency.

Method used

By acquiring agricultural product supply chain logistics and distribution data and vehicle temperature data, the data is divided into multiple data blocks. The baseline value of differential coding is dynamically adjusted, and the compression strategy is optimized by combining adjustment factors and anomaly degree. Abnormal blocks are identified and the baseline value is reset to reduce storage overhead.

Benefits of technology

It improves the storage efficiency of agricultural product supply chain data, reduces storage costs and resource consumption on the blockchain, avoids storage fragmentation, and ensures data accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121070281A_ABST
    Figure CN121070281A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of data processing, and more specifically, the invention relates to an agricultural product supply chain data storage method based on a block chain, and the method comprises the steps: obtaining supply chain logistics distribution data of agricultural products, events between transfer points, and a compartment temperature data sequence; dividing the supply chain logistics distribution data into a plurality of data blocks, and determining adjustment factors of the data blocks according to differences between actual logistics distribution data of the data blocks and corresponding theoretical logistics distribution data; determining the abnormal degree of the data block according to the influence factor difference between the data block and other data blocks; the adjustment degree of the data block is obtained by combining the adjustment factor and the abnormal degree of the data block to obtain the reference value of the data block, and the reference value of the data block is used for compression in differential coding to realize storage of the agricultural product supply chain data, so that the storage efficiency of the agricultural product supply chain data is effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data processing. More particularly, the present application relates to a blockchain-based agricultural product supply chain data storage method. BACKGROUND

[0002] Traditional agricultural product supply chain data takes logistics data as the core, covering numerical data of production, processing, warehousing and sales, etc. In centralized storage, it is easy to be tampered with and there are information barriers, which makes it difficult to trace food safety incidents. To solve this problem, blockchain technology is often introduced to achieve tamper-proof storage. The networking devices of each link collect data in real time, and after compression processing by the edge gateway, the data hash value and key metadata are batched and submitted to the blockchain.

[0003] The original data is usually stored in a distributed system off-chain (such as IPFS), and the binding of the hash value can ensure the data's non-tamperability. However, the amount of agricultural product data is relatively large. If temperature data is collected every second during cold chain transportation, 86400 records can be generated in a single day. Even if only the hash value and metadata are stored, the on-chain storage cost is still large.

[0004] To solve the problem of on-chain storage pressure of blockchain, the prior art can use a difference encoding compression algorithm to reduce the amount of data uploaded to the chain. The basic principle of difference encoding is to perform a difference operation on each data and the previous data, and then encode the difference. By utilizing the difference and correlation between the current data and the previous data, the redundancy of the data can be reduced. However, in the agricultural product supply chain, the sensor data may drift due to environmental changes, and the compression rate of difference encoding depends on the stationarity of the data. Therefore, when the adjacent temperature data in the agricultural product transportation process produces mutation, the efficiency of difference encoding will also decrease.

[0005] Therefore, how to effectively improve the storage efficiency of agricultural product supply chain data is a problem to be solved at present. SUMMARY

[0006] To solve the above technical problem of how to effectively improve the storage efficiency of agricultural product supply chain data, the present application provides a blockchain-based agricultural product supply chain data storage method, which comprises the following steps: The supply chain logistics distribution data of agricultural products and the event and the temperature data sequence of the carriage between the transfer points are acquired, wherein the logistics distribution data comprises actual logistics distribution data and theoretical logistics distribution data corresponding to the actual logistics distribution data; the supply chain logistics distribution data is divided into a plurality of data blocks based on the event between the transfer points, the adjustment factor of the data block is determined according to the difference between the actual logistics distribution data of the data block and the corresponding theoretical logistics distribution data, the influence factor of the data block is acquired according to the difference between adjacent temperature data in the temperature data sequence of the carriage of the data block between the transfer points, and the abnormal degree of the data block is determined through the difference between the influence factors of the data block and other data blocks; the adjustable degree of the data block is obtained by combining the adjustment factor and the abnormal degree of the data block, the reference value of the data block is obtained according to the comparison result of the adjustable degree of the data block and the adjustable threshold, and the reference value of the data block is used in differential coding for compression, so that the storage of the agricultural product supply chain data is realized.

[0007] By dynamically adjusting the reference value in the differential coding, the differential coding efficiency can be effectively improved, and the resource occupation can be reduced. In the process of adjusting the reference value, the logistics event is used for blocking, the transportation data deviation degree in each data block is analyzed, so that the risk degree of temperature change caused by the transportation data deviation can be accurately identified, the reference value selection strategy can be optimized through the adjustment factor, and the storage fragmentation caused by frequent updating can be effectively avoided. On this basis, the temperature data mutation degree of the data block is acquired, and the abnormal block of the temperature data mutation can be accurately identified through the comprehensive analysis of the global other data blocks, and the reference value in the abnormal data block can be reset, so that the difference range can be significantly reduced. The data block needing adjustment is determined by combining the adjustment factor and the abnormal degree, the storage overhead on the chain can be reduced while maintaining high compression rate, and therefore the storage efficiency of the agricultural product supply chain data is effectively improved.

[0008] According to the agricultural product supply chain data storage method based on the block chain provided by the application, the supply chain logistics distribution data of agricultural products and the event and the temperature data sequence of the carriage between the transfer points are acquired, and the method comprises the following steps: acquiring the transfer points in the agricultural product transportation route, and taking the complete operation process between the transfer points as an event; acquiring the theoretical arrival time, the theoretical departure time, the theoretical stay time and the theoretical distance between the transfer points of the event between the transfer points to obtain the theoretical logistics distribution data; acquiring the actual arrival time, the actual departure time, the actual stay time and the actual distance between the transfer points to obtain the actual logistics distribution data; acquiring the temperature data in the carriage during the transportation process of the transfer points, and sorting the preprocessed temperature data according to the acquisition time sequence to obtain each temperature data in the temperature data sequence of the carriage between the transfer points.

[0009] The application can eliminate noise, missing or format inconsistency of original data through preprocessing, improve data quality, and ensure the accuracy of subsequent data block division, volatility calculation and other analysis.

[0010] According to the agricultural product supply chain data storage method based on the blockchain provided by the application, the supply chain logistics distribution data is divided into a plurality of data blocks based on events between transfer points, and the events include departure time of a previous transfer point, arrival time of a current transfer point, stay time, and distance between transfer points.

[0011] According to the agricultural product supply chain data storage method based on the blockchain provided by the application, the adjustment factor of the data block is determined, and the adjustment factor of the data block is determined. ; The adjustment factor of the i th data block is 、 The theoretical arrival time and the actual arrival time of the i th data block are respectively 、 The theoretical departure time and the actual departure time of the i th data block are respectively 、 The theoretical stay time and the actual stay time of the i th data block are respectively 、 The theoretical distance and the actual distance between transfer points of the i th data block are respectively 、 The adjustment factor of the i th data block is 、 The adjustment factor of the i th data block is 、 The adjustment factor of the i th data block is 、 The adjustment factor of the i th data block is 、 The adjustment factor of the i th data block is The absolute value symbol is The exponential function with e as the base is

[0012] The application measures the transportation timeliness, the transfer efficiency and the route execution effect by the time interval deviation, the stay time deviation and the distance deviation respectively, and according to the deviation between the actual logistics performance and the ideal plan of each data block, the risk level of the section of the supply chain can be accurately evaluated.

[0013] According to the agricultural product supply chain data storage method based on the blockchain provided by the application, the influence factor of the data block is obtained according to the difference between adjacent temperature data in the temperature data sequence of the transfer point of the data block, and the influence factor of the data block is obtained. ; The influence factor of the i th data block is The number of temperature data in the temperature data sequence of the transfer point of the i th data block is 、 The number of temperature data in the temperature data sequence of the transfer point of the i th data block is respectively the i-th data block, the j-th temperature data, respectively the i-th data block, the j-th temperature data, respectively the i-th data block, the j-th temperature data, respectively the i-th data block, the j-th temperature data, respectively the i-th data block, the j-th temperature data,

[0014] The present application considers that the abnormal block usually corresponds to an event that causes the temperature data to produce a distribution drift, thereby affecting the compression efficiency of the differential encoding, so that the abnormal block is obtained through the influence factor, and the similarity of the influence factors between multiple blocks can accurately identify the abnormal block in the global perspective.

[0015] According to the present application, a blockchain-based agricultural product supply chain data storage method is provided, which determines the abnormality degree of the data block through the difference between the influence factors of the data block and other data blocks, comprising: ; respectively the i-th data block, the j-th temperature data, respectively the i-th data block, the j-th temperature data, respectively the i-th data block, the j-th temperature data, 、 respectively the i-th data block, the j-th temperature data, respectively the i-th data block, the j-th temperature data, respectively the i-th data block, the j-th temperature data.

[0016] According to the present application, a blockchain-based agricultural product supply chain data storage method is provided, which obtains the adjustable degree of the data block by combining the adjustment factor and the abnormality degree of the data block, comprising: ; 、 、 respectively the i-th data block, the j-th temperature data, 、 respectively the i-th data block, the j-th temperature data.

[0017] According to the present application, a blockchain-based agricultural product supply chain data storage method is provided, which obtains the reference value of the data block according to the comparison result of the adjustable degree of the data block and the adjustable threshold, comprising: the data block to be compressed is recorded as the target block; the last temperature data in the last data block of the target block is recorded as the initial reference value of the target block; if the adjustable degree of the target block is greater than or equal to the adjustable threshold, the initial reference value of the target block is reset, and the first temperature data of the target block is taken as the reference value of the target block; otherwise, the initial reference value of the target block is taken as the reference value of the target block.

[0018] The application provides a blockchain-based agricultural product supply chain data storage method, which uses a reference value of a data block in differential coding for compression to realize storage of agricultural product supply chain data.

[0019] The application resets the reference value of each data block, so that different data blocks do not accumulate large difference values before data fluctuation when starting compression, thereby avoiding bit overhead of storing large difference values and effectively improving data storage efficiency.

[0020] The application provides a blockchain-based agricultural product supply chain data storage method, which realizes storage of agricultural product supply chain data, and further comprises the following steps of: when querying agricultural product transportation data stored in the blockchain, recording a time to be queried as a target time, positioning a data block to which the target time belongs, reading the reference value and the difference value sequence of the data block according to the marking result of the data block, and realizing data query.

[0021] The application has the following beneficial effects: Based on the above technical solution, the application provides a blockchain-based agricultural product supply chain data storage method, which can effectively improve differential coding efficiency and reduce resource occupation by dynamically adjusting the reference value in differential coding. In the process of adjusting the reference value, the application analyzes the transportation data deviation degree in each data block by block division based on logistics events, thereby accurately identifying the risk degree of temperature change caused by transportation data deviation, and effectively avoiding storage fragmentation caused by frequent updates by adjusting the reference value selection strategy through an adjustment factor. On this basis, the application can accurately identify abnormal blocks of temperature data mutation by obtaining the temperature data mutation degree of the data block and comprehensively analyzing other data blocks in the whole world, and can significantly reduce the difference value range by resetting the reference value in the abnormal data block. In combination with the adjustment factor and the abnormal degree, the data block to be adjusted can be determined, so that the storage overhead on the chain can be reduced while maintaining high compression rate, thereby effectively improving the storage efficiency of the agricultural product supply chain data. BRIEF DESCRIPTION OF DRAWINGS

[0022] Figure 1 is a step flow chart of a blockchain-based agricultural product supply chain data storage method according to an embodiment of the application. DETAILED DESCRIPTION

[0023] With reference to the drawings of the embodiments of the present application, the technical solutions in the embodiments of the present application will be described clearly and completely. Obviously, the described embodiments are some but not all of the embodiments of the present application.

[0024] Please refer to Figure 1 , Figure 1 is a step flow chart of a blockchain-based agricultural product supply chain data storage method according to an embodiment of the present application, which comprises the following steps: S1: Obtain the supply chain logistics distribution data of agricultural products, wherein the logistics distribution data includes actual logistics distribution data and theoretical logistics distribution data corresponding to the actual logistics distribution data.

[0025] It should be noted that in the process of transporting agricultural products, the temperature data inside the cold chain carriage is prone to abnormal drift, which affects the differential encoding efficiency before the data is chained. In order to accurately identify the temperature data with abnormal drift, the present embodiment can analyze the supply chain logistics distribution data in the transportation process to analyze the possibility of temperature abnormal drift caused by transportation behavior, so as to adjust the reference value of the temperature data at the temperature with abnormal drift, realize the resetting of the reference value, reduce the gap between the temperature data and the reference value, and thus effectively reduce the possibility of reducing the differential encoding efficiency caused by the abnormal drift of the temperature data.

[0026] It can be understood that in the process of transporting agricultural products, each complete transportation process includes agricultural products from the starting point, passing through multiple transfer points, and arriving at the terminal point. The present embodiment takes the compression of temperature data in a complete transportation process as an example for illustration. In this process, the theoretical logistics distribution data of agricultural products will be set at each point according to the actual situation, including the theoretical arrival time, the theoretical departure time, the theoretical stay time at each transfer point, and the theoretical distance between the transfer points. The theoretical logistics distribution data has corresponding actual logistics distribution data. By analyzing the difference between the actual logistics distribution data and the theoretical logistics distribution data, the possibility of temperature data drift caused by logistics distribution data in the transportation process can be accurately evaluated.

[0027] If the theoretical stay time of the transfer point is 0, it means that this place is only a passing point and is not a transfer point that needs to be processed by the present embodiment, so it is not processed.

[0028] For example, in the embodiment of the present application, the supply chain logistics distribution data of agricultural products and the events between transfer points are obtained, including: obtaining the transfer points in the agricultural product transportation route, taking the complete operation process between the transfer points as an event; obtaining the theoretical arrival time, the theoretical departure time, the theoretical stay time, and the theoretical distance between the transfer points to obtain the theoretical logistics distribution data; obtaining the actual arrival time, the actual departure time, the actual stay time, and the actual distance between the transfer points to obtain the actual logistics distribution data.

[0029] The collected logistics distribution data can be preprocessed.

[0030] Specifically, the pre-set distribution transfer points and the time stamps of each distribution transfer point corresponding to the departure, arrival and departure can be obtained according to the logistics information data. In order to facilitate understanding, the points in the supply chain including the starting point and the ending point are all recorded as transfer points in the embodiment of the present application. The collected data is data cleaned, and the transfer point events repeatedly recorded in the logistics information data are removed. The records of the missing logistics distribution data time stamps in the logistics information can be completed by the nearest neighbor interpolation method. The preprocessing mode and the specific implementation mode can be set according to actual needs, and will not be repeated here.

[0031] S2: obtaining the events between the transfer points, dividing the supply chain logistics distribution data into multiple data blocks based on the events between the transfer points, and determining the adjustment factor of the data block according to the difference between the actual logistics distribution data of the data block and the corresponding theoretical logistics distribution data.

[0032] The events include the departure time of the previous transfer point, the arrival time of the current transfer point, the stay time, and the distance between the transfer points.

[0033] It should be further explained that the traditional differential encoding compression method can split the operation data of different transfer points into multiple windows, resulting in mixed data between multiple transfer points in the window, and possible data redundancy.

[0034] Based on this, this invention provides a method for compressing and uploading temperature data in an agricultural product supply chain. This method divides the overall supply chain transportation process into data blocks between multiple transit points. Each data block includes a complete transportation process between transit points, i.e., a continuous process from the previous transit point, to the current transit point, and then to departure. This complete process constitutes one event. Differential compression within the data block avoids invalid differentials across stages, ensuring that differentials only occur in continuous data within the same stage, reducing the storage of large differences. An adjustment factor is calculated by assessing the risk level of each data block. This allows for accurate adjustment of the likelihood of resetting the baseline value of the data block based on the adjustment factor; a higher adjustment factor indicates a higher risk.

[0035] For example, in an embodiment of the present invention, supply chain logistics and distribution data is divided into multiple data blocks based on events between transit points, including: dividing supply chain logistics and distribution data based on events between transit points in the supply chain, with each data block containing one event.

[0036] For example, in an embodiment of the present invention, determining the adjustment factor of a data block includes: ; The adjustment factor for the i-th data block. Let be the theoretical arrival time of the i-th data block. For the first The theoretical departure time of each data block, The actual arrival time of the i-th data block. For the first The actual departure time of each data block Let be the theoretical dwell time for the i-th data block. The actual dwell time of the i-th data block. The theoretical distance between the transit points of the i-th data block is... This represents the actual distance between the transfer points of the i-th data block. It is the absolute value symbol. It is an exponential function with base e.

[0037] in, It is a relative deviation in transportation time, reflecting abnormalities in the route (such as traffic delays). The relative deviation in dwell time reflects unloading efficiency. It is a deviation in the transportation route, reflecting the risk of deviating from the route. , and The corresponding risk weight is respectively, when staying for loading and unloading, the cold chain vehicle door needs to be opened, which is the most vulnerable and most likely to cause sharp data mutation in the temperature control environment, and the deviation of the actual driving distance from the ideal distance may be caused by route change (such as detouring), indirectly affecting the time and fuel consumption, but the importance is usually lower than the time factor. Therefore, the risk weight of the staying stage should be the largest, the risk weight of the relative deviation of the transportation time is smaller, and the risk weight of the relative deviation of the distance is the smallest, and the risk weight can be set according to actual needs.

[0038] Based on the above steps, the relative deviation of the transportation time, the relative deviation of the staying time and the transportation path deviation are comprehensively considered to accurately obtain the adjustment factor of each data block, so as to reflect the deviation of the actual logistics performance of each data block from the ideal plan, and thus reflect the risk degree of the data block. The greater the risk degree, the more likely it is that there are factors such as delay and damage to cause abnormal temperature drift.

[0039] S3: Obtain the temperature data sequence of the vehicle compartment between the transfer points, obtain the influence factor of the data block according to the difference between the adjacent temperature data in the temperature data sequence of the vehicle compartment between the transfer points, and determine the abnormal degree of the data block through the difference between the influence factors of the data block and other data blocks.

[0040] For example, the internal temperature data of the vehicle compartment in the transportation process of the transfer point is collected, and after preprocessing, each temperature data in the temperature data sequence between the transfer points is obtained according to the collection time sequence.

[0041] The sampling frequency can be set to collect once every second; during preprocessing, records with continuous missing of more than 5 minutes in the temperature data collected by the sensor can be marked as invalid data segments and removed. The time stamp corresponding to the logistics distribution data and the time stamp corresponding to the supply chain sensor data are aligned, and the sensor data time stamp is matched to the time stamp of the corresponding data block.

[0042] It should be noted that according to the above steps, the supply chain data can be divided into a plurality of data blocks, each data block has temperature data generated in the transportation process between the transfer points, the volatility of the temperature data of each data block is quantified, and the abnormal data block is identified based on this, and the obtained abnormal block usually corresponds to a physical event causing abnormal temperature drift, for example, temperature mutation caused by opening and closing of the cold chain transportation vehicle door, etc., which finally affects the compression efficiency of the differential encoding.

[0043] Based on this, the embodiment of the present application can analyze the temperature data generated in the transportation process between the transfer points in the data block, and calculate the corresponding influence factor according to the fluctuation degree of the corresponding temperature data in each data block.

[0044] For example, in the embodiment of the present application, the influence factor of the data block is calculated, including: ; Let i be the influence factor of the i-th data block. Let be the number of temperature data points in the temperature data sequence of the transfer point carriage in the i-th data block. For the i-th data block, the first... One temperature data point, For the j-th temperature data in the i-th data block, To preset the temperature change threshold, It is the absolute value symbol. Let f(x) be a logarithmic function with base e, where e is the natural constant.

[0045] The preset temperature change threshold can be set to 2; the specific temperature change threshold can be set according to the normal temperature changes allowed in the cold chain of agricultural products, and the present invention does not impose too many restrictions here.

[0046] It represents the absolute temperature change between adjacent temperature data. It is an amplification factor for the degree of temperature data fluctuation within the data block. When the temperature change in the compartment is less than or equal to the normal temperature change threshold allowed in the cold chain of agricultural products, the amplification factor will be less than or equal to 1, and the corresponding influence factor is approximately linear; when the temperature change is greater than the normal temperature change threshold allowed in the cold chain of agricultural products, the amplification factor will be greater than 1, and the corresponding influence factor will show a non-linear growth.

[0047] For example, when the temperature change is 5.0 degrees Celsius, the amplification factor is about 1.25. This can smooth out small temperature fluctuations and significantly amplify larger abrupt changes, thus better meeting the needs of actual situations and accurately obtaining the impact factor of the data block.

[0048] The impact factor for each data block can be obtained based on the above steps.

[0049] It should be further noted that the impact factor of the data blocks obtained in the above steps can reflect the volatility of temperature data between data blocks. High volatility may indicate abnormal events (such as a sudden temperature rise caused by opening a door), but there may also be small volatility during normal transportation and logistics stages. Therefore, the impact factor of the data blocks can capture the intensity of volatility, but cannot directly determine anomalies.

[0050] Based on this, embodiments of the present invention can identify anomalous blocks from a global perspective by comparing the similarity between the influence factors of each data block and the influence factors of other data blocks. If the fluctuation pattern of a data block is significantly different from that of most data blocks, its degree of anomalousness is relatively high.

[0051] The anomaly level calculation is performed only when the number of data blocks is greater than 1; otherwise, the anomaly level is set to 0 by default.

[0052] For example, in the embodiment of the application, the abnormality degree of the data block is determined by the difference between the influence factor of the data block and the influence factor of other data blocks, including: ; The abnormality degree of the i-th data block is The number of data blocks is The sensitive coefficient is The influence factor of the i-th data block is The influence factor of the j-th data block is The exponential function with base e is The absolute value symbol is.

[0053] Wherein, The sensitive coefficient can be 0.5, which is used to control the size of the exponential decay degree; it can be set according to actual needs.

[0054] The fluctuation similarity score between the i-th data block and the j-th data block is smaller, and the similarity is larger. The fluctuation difference score between the i-th data block and the j-th data block is larger, which means that the fluctuation difference between the i-th data block and the j-th data block is larger, the similarity is smaller, and the possibility of the i-th data block being an abnormal block is higher.

[0055] S4: Obtain the adjustable degree of the data block by combining the adjustment factor of the data block and the abnormality degree, obtain the reference value of the data block according to the comparison result of the adjustable degree of the data block and the adjustable threshold, and use the reference value of the data block in the differential encoding to realize the storage of the agricultural product supply chain data.

[0056] It should be noted that the risk degree of the supply chain logistics distribution data in the agricultural product transportation process and the abnormal temperature data fluctuation between the transfer points in the data block can be obtained by analyzing the risk degree of the supply chain logistics distribution data in the agricultural product transportation process and the abnormal temperature data fluctuation between the transfer points in the data block according to the above steps. The final reset score of each data block can be accurately obtained by weighting and fusing the two, which can comprehensively reflect the necessity and urgency of resetting the differential encoding reference value judged from the two dimensions of business and data.

[0057] For example, in the embodiment of the application, the adjustable degree of the data block is obtained by combining the adjustment factor of the data block and the abnormality degree, including: ; The adjustable degree of the i-th data block is The adjustment factor of the i-th data block is anomaly degree of the i th data block, adjustment factor weight, anomaly degree weight.

[0058] In the setting of the weight, the anomaly degree weight can be greater than the adjustment factor weight, which reflects the degree of emphasis on the abnormal performance of the temperature data itself. As an example, the adjustment factor weight can be set to 0.4, and the anomaly degree weight can be set to 0.6, which can be set according to actual needs.

[0059] The adjustable degree obtained according to the above formula can reflect the degree of resetting the reference value of each data block. The third and fourth quartiles of the sorted descending order of the adjustable degree of all data blocks are taken as the adjustable threshold, and the adjustable degree of resetting the reference value of all data blocks is compared with the adjustable threshold, so that the accurate adjustment of the reference value can be realized.

[0060] For example, in the embodiment of the present application, the reference value of the data block is obtained according to the comparison result of the adjustable degree of the data block and the adjustable threshold, which includes: taking the data block to be compressed as the target block; taking the last temperature data in the last data block car temperature data sequence of the target block as the initial reference value of the target block; if the adjustable degree of the target block is greater than or equal to the adjustable threshold, the initial reference value of the target block is reset, and the first temperature data of the target block is taken as the reference value of the target block; otherwise, the initial reference value of the target block is taken as the reference value of the target block.

[0061] For example, in the embodiment of the present application, the reference value of the data block is used in the differential encoding for compression to realize the storage of the agricultural product supply chain data, which includes: in the data block, the difference between each temperature data in the data block and the reference value is calculated in sequence from the reference value of the data block to obtain a difference sequence; the reference value of the data block and the difference sequence are packaged, and marked according to the comparison result of the adjustable degree of the data block and the adjustable threshold, to obtain the packaged agricultural product transportation data and submit it to the block chain for storage.

[0062] In which, the data block after resetting the reference value can be marked as a reset block, and the data block without resetting can be marked as a non-reset block.

[0063] It can be understood that the temperature data sequence between the transfer points in the data block corresponds to a time window. When the data mutates, the mutation occurs in the time window corresponding to the data block, resulting in a large fluctuation, and the fluctuation will continue to rise in the time window corresponding to the next data block. Therefore, the embodiment of the present application resets the reference value in the data block with large fluctuation, which can effectively avoid the large difference caused by the accumulation of difference and reduce the cost of storage resources.

[0064] For example, in the embodiment of the present application, the storage of the agricultural product supply chain data is implemented, and then the method further comprises: when the agricultural product transportation data stored in the blockchain is queried, the time to be queried is recorded as a target time, the data block to which the target time belongs is located, and the reference value and the difference value sequence of the data block are read according to the marking result of the data block, so as to realize data query.

[0065] It can be understood that when the temperature data of the agricultural product supply chain is queried, the collection time corresponding to the temperature data to be acquired can be taken as a target time point, the data block in which the target time point is located is acquired, if the data block is marked as a reset block, the difference value is accumulated from the reference value of the reset block until the target time point; otherwise, if the data block is marked as an unreset block, the last temperature data of the previous data block of the unreset block is traced back to obtain the reference value of the unreset block, and the difference value is continuously accumulated until the target time point, and finally the data of the target data point is obtained.

[0066] It can be seen that in the embodiment of the present application, the supply chain logistics distribution data of the agricultural product and the event and the temperature data sequence of the carriage between the transfer points can be acquired, wherein the logistics distribution data comprises actual logistics distribution data and theoretical logistics distribution data corresponding to the actual logistics distribution data; the supply chain logistics distribution data is divided into a plurality of data blocks based on the events between the transfer points, the adjustment factor of the data block is determined according to the difference between the actual logistics distribution data and the corresponding theoretical logistics distribution data of the data block, the influence factor of the data block is acquired according to the difference between adjacent temperature data in the carriage temperature data sequence of the data block, and the abnormality degree of the data block is determined through the difference between the influence factors of the data block and other data blocks; the adjustable degree of the data block is obtained by combining the adjustment factor and the abnormality degree of the data block, the reference value of the data block is obtained according to the comparison result of the adjustable degree of the data block and the adjustable threshold, the reference value of the data block is used for compression in the differential encoding, so as to realize the storage of the agricultural product supply chain data, and the storage efficiency of the agricultural product supply chain data is effectively improved.

[0067] The above merely describes the preferred embodiments of the present application and is not used to limit the present application, and any modification, equivalent replacement, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.

Claims

1. A blockchain-based data storage method for an agricultural product supply chain, characterized by, include: Acquire supply chain logistics and distribution data for agricultural products, as well as event and compartment temperature data sequences between transit points. The logistics and distribution data includes actual logistics and distribution data and theoretical logistics and distribution data corresponding to the actual logistics and distribution data. Based on events between transit points, supply chain logistics and distribution data are divided into multiple data blocks. Adjustment factors for data blocks are determined based on the differences between the actual logistics and distribution data of the data blocks and the corresponding theoretical logistics and distribution data. The influence factor of the data block is obtained by the difference between adjacent temperature data in the temperature data sequence of the transfer point carriage in the data block, and the degree of anomaly of the data block is determined by the difference of the influence factor between the data block and other data blocks. The adjustability of a data block is obtained by combining its adjustment factor and anomaly level. Based on the comparison between the adjustability of the data block and the adjustability threshold, a baseline value for the data block is obtained. The baseline value of the data block is then used for compression in differential coding to achieve the storage of agricultural product supply chain data. 2.The blockchain-based agricultural product supply chain data storage method of claim 1, wherein, The acquisition of agricultural product supply chain logistics and distribution data, as well as event and carriage temperature data sequences between transit points, includes: The system identifies transit points along agricultural product transportation routes and treats the complete operation between transit points as an event. It collects the theoretical arrival time, theoretical departure time, theoretical dwell time, and theoretical distance between transit points to obtain theoretical logistics and distribution data. It also collects the actual arrival time, actual departure time, actual dwell time, and actual distance between transit points to obtain actual logistics and distribution data. Temperature data inside the carriages during transportation at transfer points are collected, preprocessed, and sorted according to the collection time sequence to obtain the temperature data of each carriage in the temperature data sequence between transfer points. 3.The blockchain-based agricultural product supply chain data storage method of claim 2, wherein, The events based on transit points divide the supply chain logistics and distribution data into multiple data blocks, including: The events include the departure time of the previous transit point, the arrival time of the current transit point, the dwell time, and the distance between transit points; based on the events between the delivery transit points in the supply chain, the supply chain logistics and delivery data is divided, and each data block contains one event. 4.The blockchain-based agricultural product supply chain data storage method of claim 1, wherein, The adjustment factor for determining the data block includes: ; The adjustment factor for the i-th data block. , Let be the theoretical arrival time and the actual arrival time of the i-th data block, respectively. , The first The theoretical departure time and actual departure time of each data block. , These are the theoretical and actual dwell times for the i-th data block, respectively. , Let be the theoretical distance and the actual distance between the transfer points of the i-th data block, respectively. It is the absolute value symbol. It is an exponential function with base e. 5.The blockchain-based agricultural product supply chain data storage method of claim 1, wherein, The step of obtaining the influence factor of the data block based on the difference between adjacent temperature data in the transfer point carriage temperature data sequence includes: ; Let i be the influence factor of the i-th data block. Let be the number of temperature data points in the temperature data sequence of the transfer point carriage in the i-th data block. , The i-th data block contains the first... The j-th temperature data, To preset the temperature change threshold, It is the absolute value symbol. It is a logarithmic function with base e. 6.The blockchain-based agricultural product supply chain data storage method of claim 1, wherein, The method of determining the degree of anomaly of a data block by analyzing the difference in influence factors between the data block and other data blocks includes: ; is the abnormality degree of the i-th data block, is the number of data blocks, is the sensitive coefficient, , are the influence factors of the i-th and j-th data blocks, respectively, is the exponential function with base e, is the absolute value symbol.

7. The method of claim 1, wherein, The method of determining the adjustability of a data block by combining its adjustment factor and anomaly level includes: ; , , are the adjustable degree, the adjustment factor, the abnormality degree of the i-th data block, respectively, , are the adjustment factor weight, the abnormality degree weight, respectively. 8.The method of claim 1, wherein, The step of obtaining the baseline value of the data block based on the comparison between the adjustability of the data block and the adjustability threshold includes: The data block to be compressed is designated as the target block; the last temperature data in the previous data block's carriage temperature data sequence is designated as the initial reference value of the target block; if the adjustability of the target block is greater than or equal to the adjustable threshold, the initial reference value of the target block is reset, and the first temperature data of the target block is used as the reference value of the target block; otherwise, the initial reference value of the target block is used as the reference value of the target block. 9.The method of claim 1, wherein, The reference value of the data block is used for compression in differential coding to realize storage of the agricultural product supply chain data, and the method comprises the following steps: In the data block, the difference between each temperature data in the data block and the reference value is calculated in sequence from the reference value of the data block to obtain a difference sequence; the reference value of the data block and the difference sequence are packaged, and marked according to the comparison result of the adjustable degree of the data block and the adjustable threshold value to obtain packaged agricultural product transportation data and submit the data to the block chain for storage. 10.The method of claim 1, wherein, The method further comprises the following steps after realizing the storage of the agricultural product supply chain data: When querying the agricultural product transportation data stored in the block chain, the time to be queried is recorded as a target time, the data block to which the target time belongs is located, the reference value and the difference sequence of the data block are read according to the marking result of the data block, so as to realize data query.