A blockchain-based method and system for agricultural product traceability processing

By using IoT devices and blockchain technology, the automated collection and real-time monitoring of agricultural product lifecycle data are achieved, solving the problems of data authenticity and anomaly detection in agricultural product traceability systems, and improving the transparency and anomaly handling efficiency of the traceability system.

CN122089338APending Publication Date: 2026-05-26北京思普艾斯科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
北京思普艾斯科技有限公司
Filing Date
2026-02-06
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

The existing agricultural product traceability system suffers from difficulties in ensuring data authenticity, real-time detection of anomalies, and low efficiency in tracing responsibility, resulting in insufficient transparency and security in the supply chain.

Method used

Environmental data from agricultural product planting, storage, and logistics is collected through IoT devices, encrypted and stored using a consortium blockchain, and traceability QR codes are generated. With the help of smart contracts to define permissions, data is monitored in real time and early warnings are pushed out. Hash signatures and consensus mechanisms are used to ensure that the data is tamper-proof and consistent.

Benefits of technology

It has enabled the automated collection and real-time monitoring of agricultural product lifecycle data, improved the transparency and anomaly handling efficiency of the traceability system, ensured the authenticity and consistency of data, and provided efficient and reliable traceability assurance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122089338A_ABST
    Figure CN122089338A_ABST
Patent Text Reader

Abstract

This application provides a blockchain-based method and system for agricultural product traceability, comprising: collecting environmental and operational data of agricultural products during planting, storage, and logistics stages via IoT devices to generate end-to-end raw data; encrypting the raw data and storing it on a consortium blockchain to generate a traceability QR code containing a data index; generating end-to-end traceability information based on the consortium blockchain data, allowing consumers to query by scanning the code; and monitoring the consortium blockchain data in real time, identifying anomalies based on preset thresholds, and pushing early warning information to relevant entities. This method improves the transparency, authenticity, and efficiency of anomaly handling in agricultural product traceability, providing efficient and reliable technical support for the agricultural supply chain.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of information technology, and in particular to a blockchain-based method and system for tracing agricultural products. Background Technology

[0002] Agricultural product traceability is a core area of ​​modern agricultural supply chain management, playing a crucial role in ensuring food safety, enhancing consumer trust, and optimizing supply chain efficiency. As consumers become increasingly concerned about food origin and quality, building a transparent and reliable traceability system has become an important direction for agricultural modernization. Whether in planting, storage, or logistics, the traceability system needs to cover the entire chain, ensuring the authenticity and verifiability of data, thereby providing a reliable basis for enterprise supervision and consumer inquiries. However, current traceability technologies still face significant challenges in practical applications and urgently require breakthroughs to meet the complex needs of the agricultural supply chain.

[0003] Existing traceability methods have significant shortcomings in data collection and storage. Traditional systems often rely on manual data entry or single-device data collection, making them susceptible to human intervention or equipment malfunction, thus compromising data accuracy. For example, soil moisture data during planting and temperature and humidity data during transportation may be distorted due to sensor malfunction or human intervention. Furthermore, data storage typically relies on centralized databases, lacking effective tamper-proof mechanisms; once data is modified, consumers and regulators are unlikely to detect it. These issues reduce the credibility of traceability information, directly impacting supply chain transparency and the efficiency of accountability.

[0004] A deeper technical challenge lies in ensuring the dynamic reliability of data across the entire supply chain and the real-time detection of anomalies. Data authenticity is not only a matter of accuracy during data collection but also involves the integrity and consistency of data throughout transmission, storage, and retrieval. Taking logistics as an example, temperature and humidity data during transportation may deviate due to improper equipment calibration or external interference. However, existing systems often cannot detect these anomalies in real time, let alone quickly pinpoint the specific stage where the anomaly occurred and the responsible party. This lack of dynamic reliability allows anomalous data to potentially flow downstream in the supply chain, affecting product quality and even triggering safety issues.

[0005] Therefore, how to achieve dynamic and reliable data verification and real-time anomaly detection throughout the entire supply chain has become a key issue in the field of agricultural product traceability. In the planting stage, anomalies in soil moisture and pH data may reflect irrigation or fertilization problems; in the logistics stage, excessive temperature and humidity may lead to product spoilage. If these anomalies cannot be captured in a timely manner and traced back to the specific responsible party, it will undermine consumer trust in traceability information and increase the difficulty of supervision for enterprises. Ensuring the authenticity and consistency of data at every stage and quickly locating the source of anomalies has become a core technical problem that the traceability system urgently needs to solve. Summary of the Invention

[0006] This invention provides a blockchain-based method for agricultural product traceability, comprising the following steps:

[0007] By collecting environmental and operational data of agricultural products in the planting, storage, and logistics stages through IoT devices, raw data of the entire chain can be generated.

[0008] The original data is encrypted and stored in the consortium blockchain, generating a traceability QR code containing a data index;

[0009] Based on the consortium blockchain data, full-chain traceability information is generated, which supports consumers to query by scanning a code;

[0010] The consortium blockchain data is monitored in real time, and anomalies are identified based on preset thresholds, with early warning information pushed to related entities.

[0011] Furthermore, the collection of environmental and operational data on agricultural products during the planting, storage, and logistics stages via IoT devices includes:

[0012] Data on the planting environment, including soil moisture, pH value, and duration of light, is collected through soil moisture sensors, light sensors, and smart irrigation equipment.

[0013] Data on the transportation environment, including transportation temperature and humidity, and transportation duration, is collected using a logistics temperature and humidity recorder.

[0014] Combined with operational data entered by farmers and testing agencies, including fertilizer application and pesticide usage;

[0015] The status of the IoT device is monitored to determine whether the device is offline and trigger an alarm.

[0016] Furthermore, the step of encrypting the original data and storing it on the consortium blockchain includes:

[0017] The original data is format-validated, outliers are removed, and timestamps and data units are standardized.

[0018] Sensitive data in the original data is encrypted using an asymmetric encryption algorithm to generate a data digest.

[0019] Based on a consortium blockchain architecture, the encrypted data is written into blocks, and the consortium blockchain consists of nodes composed of cooperatives, testing institutions, logistics companies, and regulatory departments.

[0020] The write permissions and query rules of the node are defined through smart contracts.

[0021] Furthermore, generating the traceability QR code containing the data index includes:

[0022] Generate a unique identifier for each agricultural product batch, including the agricultural product name and batch number;

[0023] Associate the unique identifier with the consortium blockchain data index to generate a traceability QR code;

[0024] The traceability QR code is linked to the agricultural product through labeling or laser marking.

[0025] The information of the traceability QR code is dynamically synchronized based on the updated consortium blockchain data.

[0026] Furthermore, the feature allowing consumers to query via QR code includes:

[0027] Scanning the QR code via WeChat or a dedicated application triggers a query request for the consortium blockchain data index;

[0028] Call the alliance link to obtain the full-link traceability information associated with the traceability QR code;

[0029] The entire traceability information is displayed in a timeline format, including planting, testing, logistics, and sales.

[0030] The display interface indicates the place of origin and provides a preview of the test report.

[0031] Furthermore, the step of determining anomalies based on preset thresholds and pushing early warning information to related entities includes:

[0032] Preset abnormal thresholds, including pesticide residue standards and logistics temperature and humidity ranges;

[0033] Real-time monitoring of the consortium blockchain data to determine whether it exceeds the abnormal threshold;

[0034] If the consortium blockchain data exceeds the abnormal threshold, an early warning message is generated, which includes the abnormal data value and the time of occurrence.

[0035] The warning information will be sent to cooperatives and regulatory authorities via SMS or a regulatory platform.

[0036] Furthermore, defining the write permissions and query rules of the node through a smart contract includes:

[0037] Assign permissions to testing organizations to write test reports, and restrict the writing of other data;

[0038] Assign consumers permissions to access publicly available information and restrict access to sensitive data;

[0039] The integrity of the consortium blockchain data is verified by maintaining the block hash chain through smart contracts;

[0040] Data access permissions are dynamically adjusted based on the role of the node.

[0041] Furthermore, it also includes:

[0042] Generate data binding keys for agricultural product batches, and generate batch data packages by combining collection timestamps and device identifiers;

[0043] Calculate the hash value of the batch data packets and verification reports, sign them with the device's private key, and upload them to the blockchain node for verification.

[0044] Furthermore, the step of calculating hash values ​​for batch data packets and verification reports and signing them using the device's private key includes:

[0045] A hash algorithm is used to generate the first hash value from the batch data packets and verification reports;

[0046] Use the device's private key to sign the first hash value to generate a signature hash;

[0047] The signature hash is uploaded to the blockchain node, and the signature's legitimacy is verified using the device's public key.

[0048] The first hash value is cross-validated through a multi-node consensus mechanism, and a data storage index is generated after successful verification.

[0049] Furthermore, generating data binding keys for agricultural product batches includes: generating a unique data binding key for each agricultural product batch through a smart contract; embedding the data binding key into the batch data packet during data collection; and comparing the collection timestamp with the global timestamp of the blockchain to calibrate the timestamp to ensure data consistency.

[0050] Accordingly, the present invention provides a blockchain-based agricultural product traceability system, including an infrastructure layer, a data layer, an AI model layer, an application service layer, a user layer, and a security layer;

[0051] The infrastructure layer includes local servers, terminal devices, and networks at the grassroots level; the data layer includes local databases and cloud databases; the user layer includes web, mobile app, and mini-program modules; the AI ​​model layer is used to build intelligent processing modules; the application service layer is used to receive patient symptom and sign data input by doctors, extract key information through the intelligent processing module, and generate preliminary diagnostic suggestions; the current medical system provides a remote consultation channel. After receiving a consultation request, the medical system at the remote location initiates a consultation with one click and automatically transmits the patient's symptom and sign data to the expert node's medical system at the remote location; after the expert makes a diagnosis, the medical system at the remote location fills out a consultation report and synchronizes the generated consultation report to the patient's file and the current medical system.

[0052] Furthermore, the network includes 4G / 5G networks and satellite networks; the terminal device includes any one of computers, tablets, and smartphones.

[0053] The technical solutions provided by the embodiments of the present invention may include the following beneficial effects:

[0054] This invention discloses a blockchain-based method for agricultural product traceability, addressing the challenges of ensuring data authenticity, real-time anomaly detection, and low efficiency in responsibility tracing in traditional agricultural product traceability systems. It proposes a comprehensive, trustworthy traceability solution. This invention collects data such as soil moisture, pH value, and transportation temperature and humidity during planting, storage, and logistics using IoT sensors. Outliers are filtered using edge detection algorithms and a crop growth model threshold library to ensure data authenticity. Combined with the blockchain's PBFT consensus mechanism and SHA-256 hash signature, data encryption and batch binding are implemented to form an immutable traceability data package. Based on a consortium blockchain architecture, this invention defines permissions through smart contracts and generates dynamic QR codes for easy consumer inquiry and enterprise supervision. Simultaneously, this invention employs an anomaly warning mechanism combining static thresholds and LSTM time-series trend prediction to monitor data deviations in real time, generating tiered warnings and handling instructions, such as e-commerce platform removal and logistics interception, enabling rapid tracing of responsibility for anomalies. This invention significantly improves the transparency, authenticity, and anomaly handling efficiency of agricultural product traceability, providing efficient and reliable technical support for the agricultural supply chain. Attached Figure Description

[0055] Figure 1 This is a flowchart of a blockchain-based agricultural product traceability processing method according to the present invention;

[0056] Figure 2 This is another operation flowchart of a blockchain-based agricultural product traceability processing method according to the present invention;

[0057] Figure 3 This is another operation flowchart of a blockchain-based agricultural product traceability processing method according to the present invention;

[0058] Figure 4 This is a schematic diagram of a blockchain-based agricultural product traceability system according to the present invention. Detailed Implementation

[0059] To further understand the content of this invention, a detailed description of the invention is provided in conjunction with the accompanying drawings and embodiments. The specific embodiments described herein are for illustrative purposes only and are not intended to limit the invention. It should also be noted that, for ease of description, only the parts relevant to the invention are shown in the accompanying drawings.

[0060] The technical solutions of the embodiments of the present invention will be clearly and thoroughly described below with reference to the accompanying drawings. The described embodiments are merely some embodiments of the present invention.

[0061] like Figure 1 This embodiment of a blockchain-based agricultural product traceability processing method may specifically include:

[0062] S1. Collect environmental and operational data of agricultural products in the planting, storage, and logistics stages through IoT devices to generate raw data for the entire supply chain;

[0063] S2. The original data is encrypted and stored in the consortium blockchain to generate a traceability QR code containing a data index;

[0064] S3. Based on the consortium blockchain data, generate full-chain traceability information, which supports consumers to query by scanning a code;

[0065] S4. Monitor the consortium blockchain data in real time, identify anomalies based on preset thresholds, and push early warning information to related entities.

[0066] Analysis of the above technical solutions reveals the following: S1. By collecting environmental and operational data of agricultural products during planting, storage, and logistics through IoT devices, full-chain raw data is generated. The technical purpose is to achieve automated and uninterrupted collection of data throughout the entire lifecycle of agricultural products. Using IoT devices such as sensors to automatically collect environmental and operational data avoids the delays, omissions, and subjective tampering that may occur with traditional manual recording methods, achieving automated and objective data collection. High-timeliness raw data covering the entire chain of planting, storage, and logistics is obtained, providing a real and comprehensive data foundation for the entire traceability system. Step S2. The raw data is encrypted and stored on the consortium blockchain, generating a traceability QR code containing a data index. The technical purpose is to permanently and securely bind agricultural products in the physical world with trusted data on the blockchain, providing a convenient query entry point. S3. Based on the consortium blockchain data, full-chain traceability information is generated, supporting consumers to query by scanning the code. S4. The consortium blockchain data is monitored in real time, and anomalies are judged based on preset thresholds, pushing early warning information to related entities.

[0067] See Figure 2 The collection of environmental and operational data on agricultural products during planting, storage, and logistics via IoT devices includes:

[0068] S11. Collect planting environment data, including soil moisture, pH value, and light duration, through soil moisture sensors, light sensors, and intelligent irrigation equipment;

[0069] S12. Collect transportation environment data, including transportation temperature and humidity, and transportation time, through a logistics temperature and humidity recorder;

[0070] S13. Combine the operational data entered by farmers and testing agencies, including fertilizer application rate and pesticide usage rate;

[0071] S14. Monitor the status of the IoT device, determine whether the device is offline and trigger an alarm.

[0072] It should be noted that S11-S14 are the main data collection stages; the technical purpose of this process is to ensure the diversity and reliability of data sources and to monitor the data collection process itself, further improving data credibility. This involves integrating data from multiple sensors, such as soil moisture, light intensity, and temperature and humidity, and incorporating it into authorized human operation records, while simultaneously monitoring the status of IoT devices. This process not only ensures the multidimensionality and richness of the collected data, but more importantly, by monitoring the data collection "pipeline," it eliminates the risk of data distortion due to equipment failure at the source, strengthening the overall reliability of the data system.

[0073] See Figure 3 The step of encrypting the original data and storing it on the consortium blockchain includes:

[0074] S21. Perform format validation on the original data, remove outliers, and standardize timestamps and data units;

[0075] S22. Use an asymmetric encryption algorithm to encrypt the sensitive data in the original data and generate a data digest;

[0076] S23. Based on a consortium blockchain architecture, the encrypted data is written into a block, wherein the consortium blockchain consists of nodes composed of cooperatives, testing institutions, logistics companies, and regulatory departments;

[0077] S24. Define the write permissions and query rules of the node through a smart contract.

[0078] It should be noted that the above technical process involves data cleaning and encryption, and node permissions are managed on the consortium blockchain through smart contracts. Data standardization ensures data quality, while asymmetric encryption protects privacy, thereby establishing a trusted collaborative platform that guarantees both data sharing and transparency, while also protecting business privacy and compliance.

[0079] Furthermore, generating the traceability QR code containing the data index includes:

[0080] S31. Generate a unique identifier for each agricultural product batch, including the agricultural product name and batch number;

[0081] S32. Associate the unique identifier with the consortium blockchain data index to generate a traceability QR code;

[0082] S33. The traceability QR code is linked to the agricultural product by labeling or laser marking;

[0083] S34. Update the traceability QR code information dynamically based on the consortium blockchain data.

[0084] It should be noted that the above technical solution realizes the QR code generation and query display process; its technical purpose is to provide consumers with an intuitive and immersive traceability information query experience, generate a unique identifier bound to a QR code, and display the full-link information through an App / WeChat in the form of a timeline, etc.; its technical process transforms complex blockchain data into a storyline (timeline) and visual information (map, report preview) that is easy for ordinary users to understand, significantly reducing the cognitive and technical threshold for consumers to obtain traceability information.

[0085] Furthermore, the feature allowing consumers to query via QR code includes:

[0086] S41. Scan the QR code via WeChat or a dedicated application to trigger a query request for the consortium blockchain data index;

[0087] S42. Call the alliance link port to obtain the full-link traceability information associated with the traceability QR code;

[0088] S43. Display the full-chain traceability information in a timeline format, including planting, testing, logistics, and sales stages;

[0089] S44. Mark the place of origin in the display interface and provide a preview of the test report.

[0090] Furthermore, the step of determining anomalies based on preset thresholds and pushing early warning information to related entities includes:

[0091] S51. Preset abnormal thresholds, including pesticide residue standard values ​​and logistics temperature and humidity range;

[0092] S52. Monitor the consortium blockchain data in real time to determine whether it exceeds the abnormal threshold;

[0093] S53. If the consortium blockchain data exceeds the abnormal threshold, an early warning message is generated, including the abnormal data value and the time of occurrence;

[0094] S54. Push the aforementioned warning information to the cooperative and regulatory authorities via SMS or regulatory platform.

[0095] It should be noted that the above technical solution achieves monitoring and early warning functions. The execution process involves preset thresholds, real-time monitoring of on-chain data, automatic triggering of early warnings and push notifications. The system can automatically compare key indicators (such as pesticide residues, temperature, and humidity) 24 / 7, and immediately notify the responsible party upon detecting any anomalies. This changes the traditional passive approach of traceability, which can only assign responsibility after a problem occurs. For example, if temperature and humidity exceed standards during transportation, regulatory authorities can immediately become aware and intervene, preventing the entire batch of goods from spoiling, achieving a qualitative shift from "traceability" to "control." These steps transform the traceability system from post-event traceability into a proactive management tool for pre-event early warning and in-event intervention, enhancing supply chain risk management capabilities.

[0096] Furthermore, defining the write permissions and query rules of the node through a smart contract includes:

[0097] S241. Assign the testing agency permission to write test reports, and restrict the writing of other data;

[0098] S242. Assign consumers permission to query publicly available information and restrict access to sensitive data;

[0099] S243. Maintain the block hash chain through a smart contract and verify the integrity of the consortium blockchain data;

[0100] S244. Dynamically adjust data access permissions according to the role of the node.

[0101] Furthermore, it also includes:

[0102] S13. Generate a data binding key for agricultural product batches, and generate batch data packets by combining the collection timestamp and device identifier;

[0103] S14. Calculate the hash value of the batch data packets and verification reports, sign them with the device's private key, and upload them to the blockchain node for verification.

[0104] Furthermore, the step of calculating the hash value of the batch data packets and the verification report and signing them with the device private key includes: S141. Generating a first hash value for the batch data packets and the verification report using a hash algorithm;

[0105] S142. Use the device private key to sign the first hash value to generate a signature hash;

[0106] S143. Upload the signature hash to the blockchain node and verify the signature's validity using the device's public key;

[0107] S144. The first hash value is cross-validated through a multi-node consensus mechanism. After successful verification, a data storage index is generated.

[0108] S141-S144 primarily implement security and enhanced access control functions. These steps utilize hash algorithms, digital signatures, timestamp calibration, and consensus mechanisms. Through cryptography and consensus mechanisms, they construct a self-verifying, tamper-proof, and non-repudiable data security system. The hash values ​​guarantee data integrity (whether the data has been modified); digital signatures verify the data's origin (who wrote the data); timestamp calibration ensures the data's temporal authenticity (when the data was generated); and the consensus mechanism ensures that these judgments are not made by a single entity. No party (including the data provider) can deny or tamper with the data already on the blockchain. Any queryer can verify that the data they see is original and undisturbed. This provides the strongest guarantee of trust for the entire traceability system, making it more persuasive from a legal and regulatory perspective.

[0109] Furthermore, the step of generating data binding keys for agricultural product batches includes: S131. Generating a unique data binding key for each agricultural product batch through a smart contract;

[0110] S132. The data binding key is embedded into the batch data packet during data acquisition;

[0111] S133. Compare the collected timestamp with the global timestamp of the blockchain and calibrate the timestamp to ensure data consistency.

[0112] In the above technical solution, a unique data binding key is generated for each batch through a smart contract (an automatically executed program deployed on the blockchain), and this key is embedded in the data packet at the source of data collection. Embedding the key at the time of collection means that the "digital identity" of agricultural products is established from the very first moment data is generated. All subsequent data must carry this key, thus locking it to this unique physical batch. The above process realizes the functions and operations from "generating the key" to "strengthening identity uniqueness and anti-counterfeiting." The system time of IoT devices can be arbitrarily modified, resulting in low reliability of their timestamps. In contrast, the global timestamp of a blockchain is formed through network consensus, possessing the characteristics of immutability and global consistency.

[0113] Example 2

[0114] See Figure 4 This invention provides a blockchain-based agricultural product traceability system, comprising an infrastructure layer 10, a data layer 20, an AI model layer 30, an application service layer 40, a user layer 50, and a security layer 60.

[0115] The infrastructure layer includes local servers, terminal devices, and networks at the grassroots level; the data layer includes local databases and cloud databases; the user layer includes web, mobile app, and mini-program modules; the AI ​​model layer is used to build intelligent processing modules; the application service layer is used to receive patient symptom and sign data input by doctors, extract key information through the intelligent processing module, and generate preliminary diagnostic suggestions; the current medical system provides a remote consultation channel. After receiving a consultation request, the medical system at the remote location initiates a consultation with one click and automatically transmits the patient's symptom and sign data to the expert node's medical system at the remote location; after the expert makes a diagnosis, the medical system at the remote location fills out a consultation report and synchronizes the generated consultation report to the patient's file and the current medical system.

[0116] Furthermore, the network includes 4G / 5G networks and satellite networks; the terminal device includes any one of computers, tablets, and smartphones.

[0117] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.

Claims

1. A blockchain-based agricultural product traceability processing method, characterized in that, The following steps are included: By collecting environmental and operational data of agricultural products in the planting, storage, and logistics stages through IoT devices, raw data of the entire chain can be generated. The original data is encrypted and stored in the consortium blockchain, generating a traceability QR code containing a data index; Based on the consortium blockchain data, full-chain traceability information is generated, which supports consumers to query by scanning a code; The consortium blockchain data is monitored in real time, and anomalies are identified based on preset thresholds, with early warning information pushed to related entities.

2. The method of claim 1, wherein, The collection of environmental and operational data on agricultural products during planting, storage, and logistics via IoT devices includes: Data on the planting environment, including soil moisture, pH value, and duration of light, is collected through soil moisture sensors, light sensors, and smart irrigation equipment. Data on the transportation environment, including transportation temperature and humidity, and transportation duration, is collected using a logistics temperature and humidity recorder. Combined with operational data entered by farmers and testing agencies, including fertilizer application and pesticide usage; The status of the IoT device is monitored to determine whether the device is offline and trigger an alarm.

3. The method of claim 1, wherein, The process of encrypting the original data and storing it on the consortium blockchain includes: The original data is format-validated, outliers are removed, and timestamps and data units are standardized. Sensitive data in the original data is encrypted using an asymmetric encryption algorithm to generate a data digest. Based on a consortium blockchain architecture, the encrypted data is written into blocks, and the consortium blockchain consists of nodes composed of cooperatives, testing institutions, logistics companies, and regulatory departments. The write permissions and query rules of the node are defined through smart contracts.

4. The method as described in claim 1, characterized in that, The generation of the traceability QR code containing the data index includes: Generate a unique identifier for each agricultural product batch, including the agricultural product name and batch number; Associate the unique identifier with the consortium blockchain data index to generate a traceability QR code; The traceability QR code is linked to the agricultural product through labeling or laser marking. The information of the traceability QR code is dynamically synchronized based on the updated consortium blockchain data.

5. The method as described in claim 1, characterized in that, The ability for consumers to query via QR code includes: Scanning the QR code via WeChat or a dedicated application triggers a query request for the consortium blockchain data index; Call the alliance link to obtain the full-link traceability information associated with the traceability QR code; The entire traceability information is displayed in a timeline format, including planting, testing, logistics, and sales. The display interface indicates the place of origin and provides a preview of the test report.

6. The method as described in claim 1, characterized in that, The step of determining anomalies based on preset thresholds and pushing early warning information to related entities includes: Preset abnormal thresholds, including pesticide residue standards and logistics temperature and humidity ranges; Real-time monitoring of the consortium blockchain data to determine whether it exceeds the abnormal threshold; If the consortium blockchain data exceeds the abnormal threshold, an early warning message is generated, which includes the abnormal data value and the time of occurrence. The warning information will be sent to cooperatives and regulatory authorities via SMS or a regulatory platform.

7. The method as described in claim 3, characterized in that, The definition of write permissions and query rules for the node via smart contracts includes: Assign permissions to testing organizations to write test reports, and restrict the writing of other data; Assign consumers permissions to access publicly available information and restrict access to sensitive data; The integrity of the consortium blockchain data is verified by maintaining the block hash chain through smart contracts; Data access permissions are dynamically adjusted based on the role of the node.

8. The method as described in claim 3, characterized in that, Also includes: Generate data binding keys for agricultural product batches, and generate batch data packages by combining collection timestamps and device identifiers; Calculate the hash value of the batch data packets and verification reports, sign them with the device's private key, and upload them to the blockchain node for verification.

9. The method as described in claim 2, characterized in that, The step of calculating hash values ​​for batch data packets and verification reports and signing them using the device's private key includes: A hash algorithm is used to generate the first hash value from the batch data packets and verification reports; Use the device's private key to sign the first hash value to generate a signature hash; The signature hash is uploaded to the blockchain node, and the signature's legitimacy is verified using the device's public key. The first hash value is cross-validated through a multi-node consensus mechanism, and a data storage index is generated after successful verification.

10. The method as described in claim 2, characterized in that, The process of generating data binding keys for agricultural product batches includes: generating a unique data binding key for each agricultural product batch through a smart contract; embedding the data binding key into the batch data packet during data collection; and comparing the collection timestamp with the global timestamp of the blockchain to calibrate the timestamp and ensure data consistency.