A blockchain-based full-process traceability method for rural agricultural products

Through spatiotemporal agricultural data compression and adaptive agricultural seasonal consensus algorithm, combined with the Internet of Things and zero-knowledge proof technology, the problems of difficulty in data collection, high storage costs, seasonal impact and insufficient privacy protection in agricultural product traceability systems in rural areas have been solved, and the full process of trusted traceability of agricultural products has been achieved.

CN120278737BActive Publication Date: 2025-08-19ACADEMY OF PLANNING & DESIGNING OF THE MINIST OF AGRI
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510773436.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-11
Publication Date
2025-08-19
Estimated Expiration
2045-06-11

AI Technical Summary

Technical Problem

The existing blockchain-based agricultural product traceability system has problems such as difficulty in collecting data, high storage costs, significant seasonal impact, insufficient privacy protection and single verification methods in rural areas, making it difficult to achieve trusted traceability of agricultural products from the field to the table.

Method used

The space-time agricultural data compression technology and adaptive agricultural season consensus algorithm are used to collect the entire life cycle data of agricultural products through Internet of Things sensing devices, and combine differential privacy protection and zero-knowledge proof technology to achieve efficient data storage and authenticity verification.

Benefits of technology

It significantly reduces blockchain storage costs, improves the system's performance in peak and off-seasons, ensures the reliability of data sources, and uses multi-level anti-counterfeiting verification technology to identify data fraud, which enhances farmers' enthusiasm for participation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120278737B_ABST
    Figure CN120278737B_ABST
Patent Text Reader

Abstract

The present invention discloses a full-process traceability method for rural industrial agricultural products based on blockchain, comprising: collecting process data and environmental parameter data of agricultural products throughout their life cycle through Internet of Things sensing equipment; pre-processing agricultural product traceability data using spatiotemporal agricultural data compression technology; storing compressed key traceability data in a blockchain network, and storing large-capacity original data through a content-addressable interplanetary file system; maintaining the consistency of the blockchain network based on an adaptive agricultural seasonal consensus algorithm; automatically executing data verification and business logic processing through smart contracts; and verifying the authenticity of agricultural product traceability information based on zero-knowledge proof technology, while protecting farmers' sensitive data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of agricultural product quality and safety technology, and specifically relates to a full-process traceability method for rural industry agricultural products based on blockchain. Background Art

[0002] Traditional agricultural product traceability systems mainly adopt a centralized database architecture, which has problems such as easy data tampering, opaque traceability process, and serious information silos, making it difficult to establish consumer trust in the source and quality of agricultural products. In recent years, blockchain technology has shown broad application prospects in the field of agricultural product traceability due to its decentralized, tamper-proof, open and transparent characteristics.

[0003] However, the current blockchain-based agricultural product traceability system still faces many challenges: the network infrastructure in rural areas is weak and the level of digitalization of farmers is limited, which makes it difficult to collect product source data; the agricultural production process generates a large amount of data. If all of it is stored on the chain, it will lead to blockchain data expansion and high storage costs; agricultural production has obvious seasonal characteristics. During the peak and off-season production, the system load varies greatly, and the traditional blockchain consensus mechanism is difficult to respond effectively; farmers are worried about the leakage of sensitive information, such as pesticide use records and income status, which affects their enthusiasm for participation; the existing system mostly relies on manual entry and simple QR code scanning, lacks effective authenticity verification methods, and is difficult to prevent counterfeiting.

[0004] Therefore, there is an urgent need for a full-process traceability method designed specifically for the characteristics of rural agricultural products, which can solve the above-mentioned technical challenges and achieve reliable traceability of agricultural products from field to table. Summary of the Invention

[0005] The purpose of this invention is to provide a full-process traceability method for rural industrial agricultural products based on blockchain. Through innovative technologies such as spatiotemporal agricultural data compression technology and adaptive agricultural seasonal consensus algorithm, it solves technical problems such as difficult data collection, high storage costs, significant seasonal impact, insufficient privacy protection and single verification means in the process of agricultural product traceability.

[0006] In order to achieve the above-mentioned purpose of the invention, the specific technical solutions are as follows:

[0007] A blockchain-based method for tracing the entire process of agricultural products in rural industries, comprising the following steps:

[0008] In step S1, agricultural product traceability data is obtained by collecting agricultural product life cycle process data and environmental parameter data through IoT sensor devices, and the agricultural product traceability data is preprocessed, including: time series similarity extraction, spatial data block compression, and sensor data dimensionality reduction with differential privacy protection.

[0009] In step S2, the compressed key traceability data is stored in the blockchain network, and the original data is stored through the content addressing method; the consistency of the blockchain network is maintained based on the adaptive agricultural season consensus algorithm, and the algorithm dynamically adjusts the block generation cycle, verification node weight and reputation points according to the agricultural production cycle.

[0010] In step S3, data verification and business logic processing are automatically executed through smart contracts, and the authenticity of agricultural product traceability information is verified based on zero-knowledge proof technology, while protecting farmers' sensitive data.

[0011] Furthermore, the pre-processing of agricultural product traceability data includes:

[0012] Execute the time series similarity extraction algorithm to extract the benchmark pattern for the periodic time series data in the agricultural production process and store only the deviation value. The expression is: ,in, is the base cycle mode, For the The deviation value at each time point, This is the data compressed by the time series similarity extraction algorithm.

[0013] The reference period pattern is obtained by multi-scale time decomposition, and the expression is: ,in, For the A complete cycle of data sets, The reference cycle number is 3-5.

[0014] The deviation value is calculated using adaptive threshold compression, and the expression is:

[0015] ,in, is the original data point, is the reference period length, is a dynamic threshold, set to 10%-20% of the data standard deviation; is the expected value at the corresponding time point found from the reference period pattern.

[0016] Execute the spatial data block compression algorithm to divide the farmland spatial data into feature blocks according to the similarity of ground feature characteristics, and only record the block features and differences between blocks. The expression is: ,in, is the benchmark block set, For the The representative features of each feature block; To describe the graph structure of the topological relationship between blocks, is the set of block nodes, is the set of block relationship edges; is the difference set between blocks, Represents a block and blocks The boundary characteristics between them are different.

[0017] The block division adopts the adaptive clustering algorithm based on the characteristics of agricultural land objects, which is expressed as follows:

[0018] , where C is the block division result, For the blocks, is the block center, is the distance function, is the block structure regularization term, It is a balance parameter with a value range of 0.05-0.3, and is dynamically adjusted according to the complexity of farmland features.

[0019] The sensor data dimensionality reduction algorithm that implements differential privacy protection can reduce storage and protect privacy while maintaining the value of data analysis. The expression is: ,in, is the singular value decomposition dimensionality reduction function, is the original sensor data matrix, and Differential privacy protection noise added in the pre-processing and post-processing stages, noise intensity parameter and Set to 1% and 0.5% of the standard deviation of the original data;

[0020] Dimensionality reduction ratio of sensor data matrix Dynamically determined according to the importance of data, the expression is:

[0021] ,in To preserve the dimension, For the singular values, and are the minimum and maximum retained dimension limits, set to 10% and 40% of the original dimension respectively.

[0022] Furthermore, the adaptive agricultural season consensus algorithm includes the following steps: dynamically adjusting the block generation cycle according to the intensity of agricultural activities, and executing the formula:

[0023] ,in For time point The target block generation period, The base block period is usually 5-10 minutes; is the seasonal adjustment function, , For the The length of the agricultural cycle, is the phase shift, is the weight coefficient, satisfying and ; is the density function of agricultural activities in the entire network, , For nodes In the time window The number of transactions submitted, The largest number of transactions in history. is the number of active nodes; is the seasonal adjustment coefficient, ranging from 0.2 to 0.5. is the activity density response coefficient, with a value range of 0.1-0.3. .

[0024] Analyze the working characteristics of agricultural production nodes based on their data submission mode, and dynamically adjust the verification weight according to the node characteristics. The execution formula is: ,in For nodes At the time point The verification weight of is the benchmark weight; is the node activity function, , For nodes In the time window Number of data submissions within is the maximum number of submissions in the current network, is the uniformity of data submission distribution, is the data uniformity influencing factor, ranging from 1.5 to 3.0; is the correlation function of crop growth stages, , For the A key farming time point, is the time correlation function; For the diversity of node operation types, is the activity influence coefficient, ranging from 0.3 to 0.5. is the professional influence coefficient, with a value range of 0.2-0.4, satisfying .

[0025] Establish a node reputation points mechanism based on multi-dimensional data quality assessment, and execute the formula:

[0026] ,in For nodes At the time point Credit points; is the historical integral attenuation coefficient, which takes a larger value in the agricultural off-season and a smaller value in the agricultural peak season. The expression is: , is the benchmark attenuation coefficient, ranging from 0.6 to 0.7. is the adjustment amplitude, the value range is 0.1-0.2; Score data quality based on assessment of data completeness, consistency, and timeliness; Compliance scoring is based on the assessment of compliance with agricultural production standards; Score verification contributions based on the effectiveness of participating in transaction verification; 、 、 .

[0027] Execute the block proposal priority allocation based on reputation points, the expression is: ,in, For nodes At the time point The block proposal priority of is the resource contribution factor, It is the resource weight coefficient, ranging from 0.1 to 0.3. When multiple nodes in the network propose blocks at the same time, the blocks proposed by nodes with higher priority will be accepted first.

[0028] Furthermore, the process data includes: farming stage data, input usage data, growth stage data, harvesting data, primary processing data, warehousing data, transportation data and sales data; the environmental parameter data includes: soil parameters, meteorological data, water quality parameters, air quality and microbial environment data; the agricultural product characteristic parameters include: agricultural product category identification code, production area code, production season identification, variety characteristic parameter set, quality grade and certification identification information.

[0029] Furthermore, the steps of collecting agricultural product life cycle process data and environmental parameter data include:

[0030] Build a three-level data collection network, including the field sensor network layer, the production process recording layer, and the circulation link tracking layer;

[0031] Environmental parameter data is collected through a field sensor network layer, which consists of soil temperature and humidity sensors, meteorological monitoring stations, irrigation water quality sensors, and crop growth monitoring equipment distributed throughout the production area, using a low-power wide area network communication protocol.

[0032] Collecting agricultural activity data through the production process recording layer, which consists of an intelligent input management system, intelligent agricultural machinery operation recorders, manual operation digital collection terminals and yield monitoring equipment, using narrowband Internet of Things communication technology;

[0033] Product flow data is collected through a circulation tracking layer, which consists of smart packaging tags, environmental monitoring sensors, location tracking modules, and a sales transaction recording system, using a hybrid connection technology of near-field communication and cellular networks;

[0034] The collected data is pre-processed and encrypted through the edge computing gateway and transmitted to the blockchain network.

[0035] Furthermore, the steps for automatically executing data verification and business logic processing through smart contracts include:

[0036] Deploy basic business contracts, execute data input validation, basic business rules and event triggering;

[0037] Deploy business logic contracts to implement agricultural product quality traceability logic, compliance verification, and supply chain collaboration;

[0038] Deploy application interface contracts to provide external system call interfaces and data access control;

[0039] The trigger mechanism is used to realize the linkage of contracts at all levels and form a complete business process control;

[0040] Quality traceability is performed based on the agricultural product quality risk identification model, and the expression of the agricultural product quality risk identification model is: ,in, represents the agricultural product quality risk score, Indicates agricultural product input factors , production process factors , environmental factors and time factors Comprehensive risk assessment function.

[0041] Furthermore, the compressed key traceability data is stored in the blockchain network, and the steps of storing the original data using the content addressing method include:

[0042] Hash key traceability data to generate data integrity proof;

[0043] Store the hash value and metadata index in the blockchain network;

[0044] Store raw data in the InterPlanetary File System;

[0045] Establish a mapping relationship between the blockchain layer hash value and the original data in the InterPlanetary File System;

[0046] The Merkle directed acyclic graph structure is used to organize the stored data and achieve data deduplication.

[0047] Furthermore, the steps for verifying the authenticity of agricultural product traceability information based on zero-knowledge proof technology include:

[0048] Generate attribute-based zero-knowledge proofs to prove that agricultural products meet specific attributes without disclosing specific parameter values;

[0049] Implementing a range certification mechanism to prove that key indicators of agricultural products are within a safe range without disclosing exact values;

[0050] Constructing proof of compliance with production processes to demonstrate that the production process follows specific standards without disclosing detailed operational data;

[0051] Implement anonymous identity verification to verify producer qualifications while protecting identity information;

[0052] Adopt multi-level anti-counterfeiting verification technology, including:

[0053] Perform dynamic environment fingerprint verification by comparing the current environment fingerprint and historical records Verify the authenticity of agricultural products, the expression is: ,in, To verify the threshold, the value range is 0.75-0.85;

[0054] Implement multi-dimensional data consistency verification and identify data anomalies through cross-dimensional data correlation analysis. The expression is: ,in For the The weight coefficient of each dimension, is the consistency threshold, ranging from 0.8 to 0.9;

[0055] Perform biomarker validation by specific biomarkers and agricultural product markers Verify the authenticity of the origin, the expression is: ,in, is the biomarker threshold, ranging from 0.15 to 0.25.

[0056] Furthermore, the time series similarity extraction algorithm further includes:

[0057] Identify cyclical patterns in agricultural activities and extract multi-scale cyclical features in the data through autocorrelation analysis and wavelet transform;

[0058] The seasonal decomposition method is used to separate the trend, seasonal and residual components, which is expressed as: ,in is the original time series, For trend components, For seasonal components, is the residual component;

[0059] The seasonal component is extracted and compressed as follows:

[0060] ,in 、 and Respectively The amplitude, frequency, and phase of the seasonal pattern, For fitting error, the top major seasonal patterns;

[0061] The trend component is expressed in piecewise linear form, as follows: ,in is the time and value of the segment point, is the slope of the line segment;

[0062] Selectively retain important residual points, the expression is: ,in is the residual retention threshold, ranging from 1.5 to 2.5. is the residual standard deviation.

[0063] Furthermore, the adaptive agricultural season consensus algorithm further includes:

[0064] In the off-season of agricultural production, it automatically switches to a high-efficiency and low-energy consumption consensus mode, expressed as:

[0065] ,in, For time point The node energy consumption target value, is the baseline energy consumption value; it automatically switches to high-throughput consensus mode during the peak agricultural production season, by dynamically adjusting the block size and the number of verification nodes. The expression is:

[0066] , ,in, For time point The block size of The block size adjustment is set to 30% of the base value; For time point The number of verification nodes, is the number of benchmark verification nodes, The node quantity adjustment is set to 20% of the baseline value.

[0067] Compared with the prior art, the present invention has the following beneficial effects:

[0068] The method of the present invention uses innovative spatiotemporal agricultural data compression technology to specifically optimize the periodicity and spatial correlation characteristics of agricultural data, reducing data storage space by 60%-85%, significantly reducing blockchain storage costs; the adaptive agricultural seasonal consensus algorithm dynamically adjusts the block generation cycle and verification node weights according to the agricultural production cycle, so that the system can maintain good performance in both the peak and off-seasons of agriculture, and the fluctuation of transaction confirmation time is reduced by more than 70%; through the three-level data collection network and Internet of Things technology, human intervention is reduced, the data source is more reliable, and multi-level anti-counterfeiting verification technology effectively identifies data falsification; the verification mechanism based on zero-knowledge proof technology allows for proof that agricultural products meet specific standards without disclosing specific parameter values, solving the problem of low farmer participation. BRIEF DESCRIPTION OF THE DRAWINGS

[0069] Figure 1 This is a flow chart of the blockchain-based full-process traceability method for rural industrial agricultural products of the present invention. DETAILED DESCRIPTION

[0070] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention are described clearly and completely below. Obviously, the embodiments described are only part of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0071] It should be noted that the full-process traceability method for rural industrial agricultural products provided by the present invention includes six main steps: data collection, data compression, data storage, consensus maintenance, smart contract processing and traceability verification.

[0072] like Figure 1 As shown in FIG, a whole-process traceability method of rural agricultural products based on blockchain of the present invention comprises the following steps:

[0073] In step S1, agricultural product traceability data is obtained by collecting agricultural product life cycle process data and environmental parameter data through IoT sensor devices, and the agricultural product traceability data is preprocessed, including: time series similarity extraction, spatial data block compression, and sensor data dimensionality reduction with differential privacy protection.

[0074] The steps for collecting agricultural product life cycle process data and environmental parameter data include:

[0075] Build a three-level data collection network, including the field sensor network layer, the production process recording layer, and the circulation link tracking layer;

[0076] Environmental parameter data is collected through a field sensor network layer, which consists of soil temperature and humidity sensors, meteorological monitoring stations, irrigation water quality sensors, and crop growth monitoring equipment distributed throughout the production area, using a low-power wide area network communication protocol.

[0077] Collecting agricultural activity data through the production process recording layer, which consists of an intelligent input management system, intelligent agricultural machinery operation recorders, manual operation digital collection terminals and yield monitoring equipment, using narrowband Internet of Things communication technology;

[0078] Product flow data is collected through a circulation tracking layer, which consists of smart packaging tags, environmental monitoring sensors, location tracking modules, and a sales transaction recording system, using a hybrid connection technology of near-field communication and cellular networks;

[0079] The collected data is pre-processed and encrypted through the edge computing gateway and transmitted to the blockchain network.

[0080] This method first uses IoT sensor devices to collect agricultural product lifecycle process data and environmental parameter data. Data collection adopts a three-level data collection network architecture, including a field sensor network layer, a production process recording layer, and a circulation link tracking layer.

[0081] The field sensor network layer consists of soil temperature and humidity sensors, meteorological monitoring stations, irrigation water quality sensors, and crop growth monitoring equipment distributed throughout the production area. For example, in rice cultivation bases, 4-6 soil sensor nodes are deployed per hectare to monitor soil temperature, humidity, pH, and nutrient content. A meteorological monitoring station is set up every 10-15 hectares to record meteorological parameters such as temperature, humidity, light intensity, and rainfall. Water quality monitoring equipment is installed at the entrance of irrigation channels to monitor water quality parameters in real time. These devices use the Low Power Wide Area Network (LoRaWAN) communication protocol and can operate continuously on battery power for 6-12 months, making them suitable for rural environments with weak power infrastructure.

[0082] The production process recording layer consists of an intelligent input management system, intelligent agricultural machinery operation recorders, digital data collection terminals for manual operations, and yield monitoring equipment. For example, the intelligent input management system uses RFID identification technology to record the use of inputs such as pesticides and fertilizers. Intelligent agricultural machinery operation recorders installed on agricultural machinery such as tractors and harvesters automatically record operation time, location, and parameters. For manual operations, farmers use a simple mobile terminal app to record their work in audio or image format. This layer utilizes narrowband Internet of Things (NB-IoT) communication technology, which offers wide coverage, low power consumption, and low cost, making it suitable for complex rural terrain.

[0083] The tracking layer in the distribution process consists of smart packaging tags, environmental monitoring sensors, location tracking modules, and a sales transaction recording system. For example, smart packaging tags use NFC and anti-counterfeiting QR code technology to record information such as product batch and packaging time. Transport vehicles are equipped with environmental monitoring sensors to record parameters such as temperature and humidity during transportation. Point-of-sale (POS) machines at the sales stage are connected to the blockchain system to automatically record sales information. This layer uses a hybrid connection technology of near-field communication (NFC) and cellular networks to ensure data continuity throughout the distribution process.

[0084] All collected data is pre-processed and encrypted by the edge computing gateway, including data filtering, anomaly detection, and privacy protection, before being transmitted to the blockchain network. The edge computing gateway can cache data in weak or offline environments and upload it synchronously when the network is restored, solving the problem of unstable networks in rural areas.

[0085] The collected raw data is processed using spatiotemporal agricultural data compression technology, significantly reducing storage space requirements. This technology includes three main algorithms: a time series similarity extraction algorithm, a spatial data block compression algorithm, and a sensor data dimensionality reduction algorithm with differential privacy protection.

[0086] Many parameters in the agricultural production process have obvious periodicity, such as daily temperature changes and water requirements during the growth cycle. The algorithm processes this type of data through the following steps: identifying the periodic patterns in agricultural data, and extracting multi-scale periodic features from time series data through autocorrelation analysis and wavelet transform. For example, when analyzing temperature data, obvious 24-hour cycles and seasonal cycles are found. A seasonal decomposition method is used: the original data is decomposed into trend components, seasonal components, and residual components. For example, the water requirement data during the rice growth period can be decomposed into an overall increasing trend (with increasing water demand as growth occurs), periodic changes (caused by the difference in day and night temperatures), and random fluctuations. Pattern extraction and compression of seasonal components: Fourier analysis is used to extract the main periodic patterns. Generally, the top K main seasonal patterns with a contribution rate of more than 90% are retained. Often, a good fitting effect can be obtained when K<5.

[0087] A piecewise linear representation is used for trend components: instead of storing the trend value at each time point, the turning points of the trend are recorded. For example, the growth trend of rice from sowing to harvesting only needs to record the data points of the key growth stages (seedling stage, tillering stage, heading stage, and maturity stage), and the intermediate values can be restored by linear interpolation.

[0088] Selectively retain important residual points: only retain abnormal fluctuation points that exceed a specific threshold. For example, abnormal data points caused by sudden extreme weather events (heavy rain, frost) need to be retained, while random fluctuations within the normal range can be ignored.

[0089] Preprocessing of agricultural product traceability data includes:

[0090] Execute the time series similarity extraction algorithm to extract the benchmark pattern for the periodic time series data in the agricultural production process and store only the deviation value. The expression is: ,in, is the base cycle mode, For the The deviation value at each time point, This is the data compressed by the time series similarity extraction algorithm.

[0091] The reference period pattern is obtained by multi-scale time decomposition, and the expression is: ,in, For the A complete cycle of data sets, The reference cycle number is 3-5.

[0092] The deviation value is calculated using adaptive threshold compression, and the expression is:

[0093] ,in, is the original data point, is the reference period length, is a dynamic threshold, set to 10%-20% of the data standard deviation; is the expected value at the corresponding time point found from the reference period pattern.

[0094] Execute the spatial data block compression algorithm to divide the farmland spatial data into feature blocks according to the similarity of ground feature characteristics, and only record the block features and differences between blocks. The expression is: ,in, is the benchmark block set, For the The representative features of each feature block; To describe the graph structure of the topological relationship between blocks, is the set of block nodes, is the set of block relationship edges; is the difference set between blocks, Represents a block and blocks The boundary characteristics between them are different.

[0095] The block division adopts the adaptive clustering algorithm based on the characteristics of agricultural land objects, which is expressed as follows:

[0096] , where C is the block division result, For the blocks, is the block center, is the distance function, is the block structure regularization term, It is a balance parameter with a value range of 0.05-0.3, and is dynamically adjusted according to the complexity of farmland features.

[0097] The sensor data dimensionality reduction algorithm that implements differential privacy protection can reduce storage and protect privacy while maintaining the value of data analysis. The expression is: ,in, is the singular value decomposition dimensionality reduction function, is the original sensor data matrix, and Differential privacy protection noise added in the pre-processing and post-processing stages, noise intensity parameter and Set to 1% and 0.5% of the standard deviation of the original data;

[0098] Dimensionality reduction ratio of sensor data matrix Dynamically determined according to the importance of data, the expression is:

[0099] ,in To preserve the dimension, For the singular values, and are the minimum and maximum retained dimension limits, set to 10% and 40% of the original dimension respectively.

[0100] The time series similarity extraction algorithm further includes:

[0101] Identify cyclical patterns in agricultural activities and extract multi-scale cyclical features in the data through autocorrelation analysis and wavelet transform;

[0102] The seasonal decomposition method is used to separate the trend, seasonal and residual components, which is expressed as: ,in is the original time series, For trend components, For seasonal components, is the residual component;

[0103] The seasonal component is extracted and compressed as follows:

[0104] ,in 、 and Respectively The amplitude, frequency, and phase of the seasonal pattern, For fitting error, the top major seasonal patterns;

[0105] The trend component is expressed in piecewise linear form, as follows: ,in is the time and value of the segment point, is the slope of the line segment;

[0106] Selectively retain important residual points, the expression is: ,in is the residual retention threshold, ranging from 1.5 to 2.5. is the residual standard deviation.

[0107] The spatial data block compression algorithm is based on the fact that farmland spatial data (such as soil composition distribution, crop growth status distribution, etc.) usually have local similarity and gradual variation characteristics. The algorithm uses this feature to perform compression:

[0108] Block division uses an adaptive clustering algorithm based on agricultural features to divide farmland space into blocks with similar characteristics. For example, a 50-mu (approximately 1,000 hectare) rice paddy field can be divided into 5-8 blocks based on soil texture and moisture characteristics, with similar internal characteristics within each block. The λ value is dynamically adjusted based on the complexity of the farmland characteristics. For high complexity (e.g., large terrain and diverse soil types), a smaller value, such as 0.05-0.1, is used; for low complexity, a value of 0.2-0.3 is used.

[0109] Block feature extraction extracts representative features from each block to form a benchmark block set. For example, key parameters such as average organic matter content, pH value, nitrogen, phosphorus and potassium content are extracted from each soil block.

[0110] Block relationship modeling constructs a graph structure that describes the topological relationship between blocks and records the difference set between blocks, such as the gradual relationship between soil parameters and boundary characteristics between adjacent blocks.

[0111] Taking the soil nutrient distribution map of a 50-mu multi-variety orchard as an example, traditional methods require 1-meter-precision raster data (approximately 20,000 data points). Using a spatial data block compression algorithm, the orchard is divided into 12 characteristic blocks, each storing 5-8 key characteristic parameters. Combined with inter-block relationship data, the total data volume is reduced to approximately 200 data points, achieving a compression rate of 99%. The reconstructed spatial distribution map is over 95% similar to the original data.

[0112] Differential privacy-preserving sensor data dimensionality reduction algorithms reduce storage and protect privacy while maintaining data analysis value:

[0113] Data matrix construction constructs the time series data of multiple related sensors into a matrix $M_{original}$, where rows represent time points and columns represent different sensors or parameters.

[0114] Preprocessing noise adds subtle noise to protect the privacy of the original data. The noise intensity parameter is usually set to 1% of the standard deviation of the original data, which is sufficient to prevent inference of specific values without affecting the value of data analysis.

[0115] Singular Value Decomposition (SVD) dimensionality reduction uses the SVD function to reduce dimensionality and save storage space. The reduction ratio is dynamically determined based on the importance of the data, typically retaining 10%-40% of the original dimensionality and explaining more than 95% of the data variance.

[0116] Post-processing noise adds a small amount of noise to further enhance privacy protection. It is usually set to 0.5% of the standard deviation of the original data.

[0117] Taking vineyard environmental monitoring as an example, 20 monitoring points were set up, each monitoring 15 parameters (temperature, humidity, light, etc.). Data was collected hourly, forming a 24×300 daily data matrix. After processing the sensor data using a differential privacy-preserving dimensionality reduction algorithm, the dimensions were reduced to 24×5, retaining only five principal components, reducing storage space by 83% while explaining 98% of the variance in the original data. Importantly, even with this data, it is impossible to accurately infer the original sensor readings, protecting the privacy of growers' production details.

[0118] The adaptive agricultural season consensus algorithm further includes:

[0119] In the off-season of agricultural production, it automatically switches to a high-efficiency and low-energy consumption consensus mode, expressed as:

[0120] ,in, For time point The node energy consumption target value, is the baseline energy consumption value; it automatically switches to high-throughput consensus mode during the peak agricultural production season, by dynamically adjusting the block size and the number of verification nodes. The expression is:

[0121] , ,in, For time point The block size of The block size adjustment is set to 30% of the base value; For time point The number of verification nodes, is the number of benchmark verification nodes, The node quantity adjustment is set to 20% of the baseline value.

[0122] Taking the temperature and humidity monitoring of greenhouse vegetable growing environments as an example, the raw data consists of temperature and humidity values collected every 5 minutes, generating approximately 25,920 data points over a single growth cycle (approximately 90 days). After processing using a time series similarity extraction algorithm, only 50 data points, including daily pattern parameters (5-10 parameters), growth phase turning points (10-15 points), and key abnormal events (usually no more than 20 points), are needed to accurately reconstruct the complete sequence. This achieves a compression rate of 99.8%, and the root mean square error between the reconstructed data and the original data is less than 2%.

[0123] Through the combined application of the above three algorithms, this method can reduce the storage requirements of agricultural production data by 60%-85% while maintaining the value of data analysis, while providing strong privacy protection.

[0124] In step S2, the compressed key traceability data is stored in the blockchain network, and the original data is stored through the content addressing method; the consistency of the blockchain network is maintained based on the adaptive agricultural season consensus algorithm, and the algorithm dynamically adjusts the block generation cycle, verification node weight and reputation points according to the agricultural production cycle.

[0125] The compressed data adopts a secondary storage architecture: key traceability data is stored in the blockchain network, and large-capacity original data is stored in the content-addressable InterPlanetary File System (IPFS).

[0126] Key traceability data, including core production parameters, quality inspection results, and transaction records, is first hashed to generate a proof of data integrity. The hash value and metadata index are then stored directly on the blockchain network. For example, key traceability data for organic rice includes: variety information (such as Daohuaxiang No. 2), planting plot coordinates, key growth phase time points, pesticide use record summaries, harvest dates, processing batch numbers, and quality inspection report summaries.

[0127] Large volumes of raw data, such as high-resolution farmland images, detailed environmental monitoring data, and operational video records, are stored in the InterPlanetary File System (IPFS). IPFS uses content-addressing technology to generate a unique content identifier (CID) for each file. Only these CIDs and associated metadata are stored on the blockchain. Data integrity and accessibility are ensured by establishing a mapping between blockchain-layer hash values and the original data in IPFS. For example, detailed images of the organic rice growth process, original soil test reports, and detailed records of pesticide use are stored in IPFS, while the blockchain only stores the CIDs pointing to these files.

[0128] Data in IPFS is organized using a Merkle Directed Acyclic Graph (DAG) structure, enabling data deduplication and efficient access. This storage architecture allows the system to significantly reduce storage costs while balancing data integrity and blockchain execution efficiency.

[0129] For example, in a traceability system covering 1,000 mu (approximately 1,000 hectares) of tea plantations, traditional methods generate approximately 5TB of raw data annually. With this approach, only approximately 50MB of key data and hash indexes are stored on the blockchain, with the remaining data stored in IPFS. Through data compression technology, the total storage requirement is reduced to approximately 1TB, reducing storage costs by 80%.

[0130] The Adaptive Agricultural Season Consensus Algorithm (ASCA) is used to maintain the consistency of the blockchain network. The algorithm dynamically adjusts consensus parameters according to the agricultural production cycle, including the block generation cycle, verification node weight and reputation points, effectively resolving the contradiction between the seasonal characteristics of agricultural production and the consistency requirements of the blockchain.

[0131] The adaptive agricultural season consensus algorithm includes the following steps: dynamically adjusting the block generation cycle according to the intensity of agricultural activities, and executing the formula:

[0132] ,in For time point The target block generation period, The base block period is usually 5-10 minutes; is the seasonal adjustment function, , For the The length of the agricultural cycle, is the phase shift, is the weight coefficient, satisfying and ; is the density function of agricultural activities in the entire network, , For nodes In the time window The number of transactions submitted, The largest number of transactions in history. is the number of active nodes; is the seasonal adjustment coefficient, ranging from 0.2 to 0.5. is the activity density response coefficient, with a value range of 0.1-0.3. .

[0133] Analyze the working characteristics of agricultural production nodes based on their data submission mode, and dynamically adjust the verification weight according to the node characteristics. The execution formula is: ,in For nodes At the time point The verification weight of is the benchmark weight; is the node activity function, , For nodes In the time window Number of data submissions within is the maximum number of submissions in the current network, is the uniformity of data submission distribution, is the data uniformity influencing factor, ranging from 1.5 to 3.0; is the correlation function of crop growth stages, , For the A key farming time point, is the time correlation function; For the diversity of node operation types, is the activity influence coefficient, ranging from 0.3 to 0.5. is the professional influence coefficient, with a value range of 0.2-0.4, satisfying .

[0134] Establish a node reputation points mechanism based on multi-dimensional data quality assessment, and execute the formula:

[0135] ,in For nodes At the time point Credit points; is the historical integral attenuation coefficient, which takes a larger value in the agricultural off-season and a smaller value in the agricultural peak season. The expression is: , is the benchmark attenuation coefficient, ranging from 0.6 to 0.7. is the adjustment amplitude, the value range is 0.1-0.2; Score data quality based on assessment of data completeness, consistency, and timeliness; Compliance scoring is based on the assessment of compliance with agricultural production standards; Score verification contributions based on the effectiveness of participating in transaction verification; 、 、 .

[0136] Execute the block proposal priority allocation based on reputation points, the expression is: ,in, For nodes At the time point The block proposal priority of is the resource contribution factor, It is the resource weight coefficient, ranging from 0.1 to 0.3. When multiple nodes in the network propose blocks at the same time, the blocks proposed by nodes with higher priority will be accepted first.

[0137] The process data includes: farming stage data, input usage data, growth stage data, harvesting data, primary processing data, warehousing data, transportation data and sales data; the environmental parameter data includes: soil parameters, meteorological data, water quality parameters, air quality and microbial environment data; the agricultural product characteristic parameters include: agricultural product category identification code, production area code, production season identification, variety characteristic parameter set, quality grade and certification identification information.

[0138] In step S3, data verification and business logic processing are automatically executed through smart contracts, and the authenticity of agricultural product traceability information is verified based on zero-knowledge proof technology, while protecting farmers' sensitive data.

[0139] The steps for automating data verification and business logic processing through smart contracts include:

[0140] Deploy basic business contracts, execute data input validation, basic business rules and event triggering;

[0141] Deploy business logic contracts to implement agricultural product quality traceability logic, compliance verification, and supply chain collaboration;

[0142] Deploy application interface contracts to provide external system call interfaces and data access control;

[0143] The trigger mechanism is used to realize the linkage of contracts at all levels and form a complete business process control;

[0144] Quality traceability is performed based on the agricultural product quality risk identification model, and the expression of the agricultural product quality risk identification model is: ,in, represents the agricultural product quality risk score, Indicates agricultural product input factors , production process factors , environmental factors and time factors Comprehensive risk assessment function.

[0145] The steps of storing the compressed key traceability data in the blockchain network and storing the original data using the content addressing method include:

[0146] Hash key traceability data to generate data integrity proof;

[0147] Store the hash value and metadata index in the blockchain network;

[0148] Store raw data in the InterPlanetary File System;

[0149] Establish a mapping relationship between the blockchain layer hash value and the original data in the InterPlanetary File System;

[0150] The Merkle directed acyclic graph structure is used to organize the stored data and achieve data deduplication.

[0151] Furthermore, the steps for verifying the authenticity of agricultural product traceability information based on zero-knowledge proof technology include:

[0152] Generate attribute-based zero-knowledge proofs to prove that agricultural products meet specific attributes without disclosing specific parameter values;

[0153] Implementing a range certification mechanism to prove that key indicators of agricultural products are within a safe range without disclosing exact values;

[0154] Constructing proof of compliance with production processes to demonstrate that the production process follows specific standards without disclosing detailed operational data;

[0155] Implement anonymous identity verification to verify producer qualifications while protecting identity information;

[0156] This method automatically performs data verification and business logic processing through smart contracts to ensure the standardization and automation of the agricultural product traceability process. Smart contract processing includes the following steps:

[0157] Executes data input validation, basic business rules, and event triggering. This includes agricultural product registration contracts, production entity registration contracts, input record contracts, production process record contracts, quality inspection record contracts, circulation record contracts, and sales record contracts.

[0158] For example, the input record contract automatically verifies whether the use of inputs complies with regulations. When a banned pesticide record is detected, an early warning event is automatically triggered and recorded on the blockchain; the quality inspection record contract automatically links product batch information to ensure that each batch of products has a corresponding quality inspection report.

[0159] Implement agricultural product quality traceability logic, compliance verification, and supply chain collaboration. The core is the agricultural product quality risk identification model, which comprehensively assesses the impact of input factors, production process factors, environmental factors, and time factors on agricultural product quality. After the system calculates the risk score $R$, it determines the product quality level based on the preset threshold, for example: Judged as high-quality products, Judged as a good product, Determined to be a qualified product, This automated rating process reduces human intervention and subjective judgment.

[0160] Taking organic vegetables as an example, the input risk assessment function focuses on the use of fertilizers, pesticides, etc.; the production process risk assessment function focuses on key links such as irrigation, fertilization, pest and disease control; the environmental risk assessment function evaluates environmental conditions such as soil, water sources, and air; the time risk assessment function considers time-related factors such as product shelf life and storage conditions.

[0161] Application interface contracts provide external system call interfaces and data access control. These include query interface contracts, authorization management contracts, data access control contracts, and cross-chain interaction contracts. These contracts ensure secure and flexible data access while supporting interoperability with other blockchain systems.

[0162] The smart contract system uses trigger mechanisms to link various contract layers, creating a complete business process control. For example, when a production process recording contract detects the completion of a key agricultural activity, it automatically triggers a quality assessment and updates the product status. When a quality inspection contract records a failure result, an alert mechanism is automatically triggered, preventing the product from circulating.

[0163] The traceability verification process includes the following key technologies:

[0164] Attribute-based zero-knowledge proofs are used to prove that agricultural products meet specific attributes without disclosing specific parameter values. For example, they can prove that pesticide residues in fruits are below safety standards without disclosing specific pesticide usage records; or prove that organic vegetables are completely free of chemical pesticides without disclosing detailed growing processes.

[0165] The interval certification mechanism verifies that key indicators of agricultural products are within safe ranges without disclosing precise values. For example, it can prove that the heavy metal content of rice is below national standards without revealing the specific content value; or it can prove that the protein content of dairy products meets high-quality standards without disclosing the specific protein percentage.

[0166] Production process compliance certificates are used to demonstrate that a production process adheres to specific standards without disclosing detailed operational data. For example, they can demonstrate that tea cultivation meets organic certification standards without disclosing detailed records of every fertilization and irrigation application; or they can demonstrate that meat farming meets animal welfare standards without disclosing specific farm information.

[0167] Anonymous identity verification verifies producer qualifications while protecting their identity. For example, it can prove that agricultural products come from certified organic producers without revealing their identities, or prove that products come from a specific geographical indication protected area without revealing the specific farmer information.

[0168] To ensure the authenticity and reliability of traceability information, this method also uses multi-level anti-counterfeiting verification technology:

[0169] Perform dynamic environment fingerprint verification by comparing the current environment fingerprint and historical records Verify the authenticity of agricultural products, the expression is: ,in, To verify the threshold, the value range is 0.75-0.85;

[0170] Implement multi-dimensional data consistency verification and identify data anomalies through cross-dimensional data correlation analysis. The expression is: ,in For the The weight coefficient of each dimension, is the consistency threshold, ranging from 0.8 to 0.9;

[0171] Perform biomarker validation by specific biomarkers and agricultural product markers Verify the authenticity of the origin, the expression is: ,in, is the biomarker threshold, ranging from 0.15 to 0.25.

[0172] For example, the authenticity of wines claimed to be from a specific region is determined by comparing their trace element composition (environmental fingerprint) with historical samples from that region. Experiments have shown that environmental fingerprints vary significantly between regions, making them extremely difficult to forge.

[0173] The system analyzes multi-dimensional data, including temperature records, irrigation records, and growth status records, during the rice growing process, checking for logical consistency. If a record shows a temperature of only 10°C on a certain day, but the rice is heading normally, the system will identify this as unreasonable and determine that the data may have been tampered with.

[0174] Taking a specialty fruit (such as kiwi) from a remote mountainous area as an example, the method of the present invention is applied to realize full-process traceability.

[0175] (1) Field sensor network: 20 soil sensor nodes were deployed in a 100-mu kiwifruit orchard to monitor soil temperature, humidity, pH, and other parameters. Two weather monitoring stations were installed to record temperature, rainfall, and other meteorological data. Water quality monitoring equipment was installed at the entrance of the irrigation system. All equipment uses the LoRaWAN protocol and is powered by solar energy to ensure long-term stable operation.

[0176] (2) Production process recording: Farmers use a simple mobile APP to record activities such as fertilization, irrigation, and pest control. It supports offline operation and voice input to reduce the impact of the digital divide. Key agricultural operations (such as pollination and pruning) are recorded through smart bracelets. Operation time and GPS location.

[0177] (3) Tracking in the circulation process: After harvesting, the fruit boxes are affixed with NFC tags to record information such as the harvest time and orchard area; the transportation vehicles are equipped with GPS and temperature and humidity monitoring equipment; anti-counterfeiting QR code labels are used in the packaging process, and consumers can scan the code to view the complete traceability information.

[0178] A time series similarity extraction algorithm was applied to daily temperature and humidity data to extract diurnal cycle patterns and growing season patterns, compressing more than 50,000 temperature and humidity data points over a 180-day growing period into approximately 200 feature parameters, with a compression rate exceeding 99.5%.

[0179] The 100-acre orchard is divided into 8 characteristic blocks according to soil characteristics and terrain features. Each block records core characteristic parameters, compressing the storage space by more than 85%.

[0180] SVD dimensionality reduction and differential privacy protection were applied to 15 sensor parameters, which not only maintained the value of data analysis but also protected the privacy of farmers' production details, with a dimensionality reduction rate of 70%.

[0181] Key traceability data is stored directly on the blockchain network, including basic orchard information, organic certification number, key agricultural operation records (such as pollination date and fertilization record summary), harvest batch information, quality inspection result summary, and key logistics node information. Raw, detailed data is stored on IPFS, including high-resolution orchard images, complete sensor data history, detailed fertilization formulas, pest and disease treatment details, and full quality inspection reports. Only the CID hash values pointing to these files are stored on the blockchain.

[0182] The adaptive agricultural seasonal consensus algorithm automatically adjusts to high-throughput mode during key agricultural periods (such as flowering, fruit expansion, and harvesting) based on the characteristics of the kiwifruit growth cycle. The block generation cycle is shortened to 6-7 minutes, and the number of verification nodes increases by 30%. During the slack season, it switches to low-energy consumption mode, extending the block generation cycle to 10-12 minutes and reducing energy consumption by about 40%.

[0183] Farmer nodes receive different verification weights based on the quality and activity of data submission. Actively participating professional cooperatives have the highest verification weight, which can reach 1.6 times the benchmark value, and have greater voice.

[0184] A kiwifruit quality risk identification model was deployed, focusing on factors such as pesticide use (weight 0.4), growing environment (weight 0.3), post-harvest handling (weight 0.2), and storage time (weight 0.1). The system automatically calculates a quality risk score for each batch of product and categorizes it into different levels.

[0185] The organic certification smart contract automatically monitors whether the production process complies with organic standards. Once violations are found (such as the use of banned pesticides), an early warning is immediately triggered and the product status is updated.

[0186] Consumers can obtain traceability information by scanning the QR code on the product packaging. The system provides multi-level verification results:

[0187] (1) Basic product information: variety, origin, harvest date, organic certification status, etc.

[0188] (2) Zero-knowledge proof results: prove that the product meets organic standards, proves that pesticide residues are below safety limits, and proves that the product comes from a specific geographical indication protection area without disclosing farmers' private data.

[0189] (3) Anti-counterfeiting verification results: Environmental fingerprint verification confirms that the product is indeed from the claimed production area; multi-dimensional data consistency verification confirms that the traceability data is authentic and not tampered with; optional isotope testing provides additional authenticity assurance.

[0190] (4) Product quality score: A comprehensive score based on the quality risk model that intuitively displays the product quality level.

[0191] After applying this method, the specialty fruit traceability system achieved the following results: blockchain storage costs were reduced by 82%; the fluctuation in the system's transaction confirmation time was controlled within 15% throughout the year; the anti-counterfeiting verification success rate reached 99.7%; consumer trust was significantly improved, and the product premium rate increased by 25-40%; farmer participation enthusiasm was greatly increased, and the system data integrity and timeliness were significantly improved.

[0192] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A blockchain-based method for tracing the entire process of agricultural products in rural industries, characterized by: The method comprises the following steps: Step S1: collect agricultural product life cycle process data and environmental parameter data through IoT sensor devices to obtain agricultural product traceability data, and preprocess the agricultural product traceability data, including: time series similarity extraction, spatial data block compression, and sensor data dimensionality reduction with differential privacy protection; Step S2: Storing the compressed key traceability data in the blockchain network, and storing the original data using a content-addressed method; maintaining the consistency of the blockchain network based on an adaptive agricultural season consensus algorithm, which dynamically adjusts the block generation cycle, verification node weights, and reputation points according to the agricultural production cycle; Step S3: Data verification and business logic processing are automatically executed through smart contracts, verifying the authenticity of agricultural product traceability information based on zero-knowledge proof technology while protecting farmers' sensitive data; Execute the time series similarity extraction algorithm to extract the benchmark pattern for the periodic time series data in the agricultural production process and store only the deviation value. The expression is: ,in, is the base cycle mode, For the The deviation value at each time point, This is the data compressed by the time series similarity extraction algorithm; The reference period pattern is obtained by multi-scale time decomposition, and the expression is: ,in, For the A complete cycle of data sets, is the number of reference cycles, ranging from 3 to 5; The deviation value is calculated using adaptive threshold compression, and the expression is: ,in, is the original data point, is the reference period length, is a dynamic threshold, set to 10%-20% of the data standard deviation; is the expected value at the corresponding time point found from the reference period pattern; Execute the spatial data block compression algorithm to divide the farmland spatial data into feature blocks according to the similarity of ground feature characteristics, and only record the block features and differences between blocks. The expression is: ,in, is the benchmark block set, For the The representative features of each feature block; To describe the graph structure of the topological relationship between blocks, is the set of block nodes, is the set of block relationship edges; is the difference set between blocks, Represents a block and blocks Differences in boundary characteristics between The block division adopts the adaptive clustering algorithm based on the characteristics of agricultural land objects, which is expressed as follows: ,in, is the block division result, For the blocks, is the block center, is the distance function, is the block structure regularization term, It is a balance parameter with a value range of 0.05-0.3, which is dynamically adjusted according to the complexity of farmland features; The sensor data dimensionality reduction algorithm that implements differential privacy protection can reduce storage and protect privacy while maintaining the value of data analysis. The expression is: ,in, is the singular value decomposition dimensionality reduction function, is the original sensor data matrix, and Differential privacy protection noise added in the pre-processing and post-processing stages, noise intensity parameter and Set to 1% and 0.5% of the standard deviation of the original data; Dimensionality reduction ratio of sensor data matrix Dynamically determined according to the importance of data, the expression is: ,in To preserve the dimension, For the singular values, and are the minimum and maximum retained dimension limits, set to 10% and 40% of the original dimension respectively.

2. The method according to claim 1, characterized in that The adaptive agricultural season consensus algorithm includes the following steps: The block generation cycle is dynamically adjusted according to the intensity of agricultural activities. The formula is: ,in For time point The target block generation period, The base block period is 5-10 minutes; is the seasonal adjustment function, , For the The length of the agricultural cycle, is the phase shift, is the weight coefficient, satisfying and ; is the density function of agricultural activities in the entire network, , For nodes In the time window The number of transactions submitted, The largest number of transactions in history. is the number of active nodes; is the seasonal adjustment coefficient, ranging from 0.2 to 0.

5. is the activity density response coefficient, with a value range of 0.1-0.

3. ; Analyze the working characteristics of agricultural production nodes based on their data submission mode, and dynamically adjust the verification weight according to the node characteristics. The execution formula is: ,in For nodes At the time point The verification weight of is the benchmark weight; is the node activity function, , For nodes In the time window Number of data submissions within is the maximum number of submissions in the current network, is the uniformity of data submission distribution, is the data uniformity influencing factor, ranging from 1.5 to 3.0; is the correlation function of crop growth stages, , For the A key farming time point, is the time correlation function; For the diversity of node operation types, is the activity influence coefficient, ranging from 0.3 to 0.

5. is the professional influence coefficient, with a value range of 0.2-0.4, satisfying ; Establish a node reputation points mechanism based on multi-dimensional data quality assessment, and execute the formula: ,in For nodes At the time point Credit points; is the historical integral attenuation coefficient, which takes a larger value in the agricultural off-season and a smaller value in the agricultural peak season. The expression is: , is the benchmark attenuation coefficient, ranging from 0.6 to 0.

7. is the adjustment amplitude, the value range is 0.1-0.2; Score data quality based on assessment of data completeness, consistency, and timeliness; Compliance scoring is based on the assessment of compliance with agricultural production standards; Score verification contributions based on the effectiveness of participating in transaction verification; 、 、 ; Execute the block proposal priority allocation based on reputation points, the expression is: ,in, For nodes At the time point The block proposal priority of is the resource contribution factor, It is the resource weight coefficient, ranging from 0.1 to 0.

3. When multiple nodes in the network propose blocks at the same time, the blocks proposed by nodes with higher priority will be accepted first.

3. The method according to claim 2, characterized in that The process data includes: farming stage data, input usage data, growth stage data, harvesting data, primary processing data, warehousing data, transportation data and sales data; the environmental parameter data includes: soil parameters, meteorological data, water quality parameters, air quality and microbial environment data; the agricultural product characteristic parameters include: agricultural product category identification code, production area code, production season identification, variety characteristic parameter set, quality grade and certification identification information.

4. The method according to claim 3, characterized in that The steps for collecting agricultural product life cycle process data and environmental parameter data include: Build a three-level data collection network, including the field sensor network layer, the production process recording layer, and the circulation link tracking layer; Environmental parameter data is collected through a field sensor network layer, which consists of soil temperature and humidity sensors, meteorological monitoring stations, irrigation water quality sensors, and crop growth monitoring equipment distributed throughout the production area, using a low-power wide area network communication protocol; Collecting agricultural activity data through the production process recording layer, which consists of an intelligent input management system, intelligent agricultural machinery operation recorders, manual operation digital collection terminals and yield monitoring equipment, using narrowband Internet of Things communication technology; Product flow data is collected through a circulation tracking layer, which consists of smart packaging tags, environmental monitoring sensors, location tracking modules, and a sales transaction recording system, using a hybrid connection technology of near-field communication and cellular networks; The collected data is pre-processed and encrypted through the edge computing gateway and transmitted to the blockchain network.

5. The method according to claim 4, characterized in that The steps for automating data verification and business logic processing through smart contracts include: Deploy basic business contracts, execute data input validation, basic business rules and event triggering; Deploy business logic contracts to implement agricultural product quality traceability logic, compliance verification, and supply chain collaboration; Deploy application interface contracts to provide external system call interfaces and data access control; The trigger mechanism is used to realize the linkage of contracts at all levels and form a complete business process control; Quality traceability is performed based on the agricultural product quality risk identification model, and the expression of the agricultural product quality risk identification model is: ,in, represents the agricultural product quality risk score, Indicates agricultural product input factors , production process factors , environmental factors and time factors Comprehensive risk assessment function.

6. The method according to claim 5, characterized in that The steps of storing the compressed key traceability data in the blockchain network and storing the original data using the content addressing method include: Hash key traceability data to generate data integrity proof; Store the hash value and metadata index in the blockchain network; Store raw data in the InterPlanetary File System; Establish a mapping relationship between the blockchain layer hash value and the original data in the InterPlanetary File System; The Merkle directed acyclic graph structure is used to organize the stored data and achieve data deduplication.

7. The method according to claim 6, characterized in that The steps to verify the authenticity of agricultural product traceability information based on zero-knowledge proof technology include: Generate attribute-based zero-knowledge proofs to prove that agricultural products meet specific attributes without disclosing specific parameter values; Implementing a range certification mechanism to prove that key indicators of agricultural products are within a safe range without disclosing exact values; Constructing proof of compliance with production processes to demonstrate that the production process follows specific standards without disclosing detailed operational data; Implement anonymous identity verification to verify producer qualifications while protecting identity information; Adopt multi-level anti-counterfeiting verification technology, including: Perform dynamic environment fingerprint verification by comparing the current environment fingerprint and historical records Verify the authenticity of agricultural products, the expression is: ,in, To verify the threshold, the value range is 0.75-0.85; Implement multi-dimensional data consistency verification and identify data anomalies through cross-dimensional data correlation analysis. The expression is: ,in For the The weight coefficient of each dimension, is the consistency threshold, ranging from 0.8 to 0.9; Perform biomarker validation by specific biomarkers and agricultural product markers Verify the authenticity of the origin, the expression is: ,in, is the biomarker threshold, ranging from 0.15 to 0.

25.

8. The method according to claim 7, characterized in that The time series similarity extraction algorithm further includes: Identify cyclical patterns in agricultural activities and extract multi-scale cyclical features in the data through autocorrelation analysis and wavelet transform; The seasonal decomposition method is used to separate the trend, seasonal and residual components, which is expressed as: ,in is the original time series, For trend components, For seasonal components, is the residual component; The seasonal component is extracted and compressed as follows: ,in 、 and Respectively The amplitude, frequency, and phase of the seasonal pattern, For fitting error, the top major seasonal patterns; The trend component is expressed in piecewise linear form, as follows: ,in is the time and value of the segment point, is the slope of the line segment; Selectively retain important residual points, the expression is: ,in is the residual retention threshold, ranging from 1.5 to 2.

5. is the residual standard deviation.

9. The method according to claim 8, characterized in that The adaptive agricultural season consensus algorithm further includes: In the off-season of agricultural production, it automatically switches to a high-efficiency and low-energy consumption consensus mode, expressed as: ,in, For time point The node energy consumption target value, is the benchmark energy consumption value; During the peak agricultural production season, the system automatically switches to high-throughput consensus mode by dynamically adjusting the block size and the number of verification nodes. The expression is: , ,in, For time point The block size of The block size adjustment is set to 30% of the base value; For time point The number of verification nodes, is the number of benchmark verification nodes, The node quantity adjustment is set to 20% of the baseline value.

Citation Information

Patent Citations

  • Agricultural product supply chain credible tracing model based on PBFT consensus mechanism and implementation method

    CN116383869A

  • Agricultural product quality tracing system based on block chain technology

    CN119379315A