Agricultural product full-life-cycle traceability method and system based on lightweight block chain and Internet of Things equipment
By combining lightweight blockchain with IoT devices, agricultural product data is automatically collected and encrypted, solving the problems of low data collection efficiency and security in traditional traceability systems. This enables reliable traceability of agricultural products throughout their entire lifecycle and improves food safety.
Patent Information
- Application Number
- CN202511032922.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-25
- Publication Date
- 2025-10-31
AI Technical Summary
Traditional agricultural product traceability systems suffer from low data collection efficiency, susceptibility to human error, easy data storage tampering, single point of failure risk in centralized storage, and low data query efficiency, failing to meet real-time traceability requirements.
This paper adopts a method for tracing the entire life cycle of agricultural products based on lightweight blockchain and IoT devices. Data is automatically collected by IoT devices, encrypted with GRS code digital signatures, and combined with the distributed storage and consensus mechanism of lightweight blockchain to achieve secure data storage and retrieval.
It improves the authenticity and security of data, avoids human input errors, ensures that data is tamper-proof, realizes full life-cycle traceability of agricultural products, and enhances the level of food safety.
Smart Images

Figure CN120875904A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of traceability system technology, specifically to a method and system for tracing the entire life cycle of agricultural products based on lightweight blockchain and IoT devices. Background Technology
[0002] Agricultural product quality and safety is a crucial issue concerning the national economy and people's livelihoods. In recent years, frequent agricultural product safety incidents have drawn widespread attention from all sectors of society. Traditional agricultural product traceability systems have many limitations in ensuring agricultural product quality and safety.
[0003] In the data collection stage, manual recording and entry are the primary methods used. This approach is not only inefficient but also prone to human error and deliberate falsification. For example, during agricultural production, information such as the timing and dosage of fertilization and pesticide application can be arbitrarily altered, leading to inaccurate subsequent traceability data.
[0004] In terms of data storage, traditional traceability systems typically employ a centralized database architecture, with data stored centrally on a few servers. This storage method carries the risk of a single point of failure; if a server is attacked or malfunctions, data may be lost or tampered with. Furthermore, centralized storage makes data vulnerable to unauthorized access and alteration by internal personnel or external attackers, reducing the credibility of traceability data.
[0005] Furthermore, with the continuous extension of the agricultural product supply chain and the increase in the number of nodes, traditional traceability systems face significant challenges in terms of data storage and retrieval efficiency. The rapid increase in transaction data on the blockchain leads to increased storage load and slower data retrieval speeds, failing to meet users' demands for real-time traceability information. Therefore, a method and system for tracing the entire lifecycle of agricultural products based on lightweight blockchain and IoT devices is needed to address these issues. Summary of the Invention
[0006] The purpose of this invention is to provide a method and system for tracing the entire life cycle of agricultural products based on lightweight blockchain and IoT devices, so as to solve the problems mentioned in the background art.
[0007] A method for tracing the entire lifecycle of agricultural products based on lightweight blockchain and IoT devices includes the following steps, characterized by: Step 1: using IoT devices to collect data information on agricultural products at various stages such as production, processing, circulation, and sales; preprocessing the collected data information, including data cleaning and format conversion;
[0008] The second step is to encrypt the preprocessed data to generate a digital signature. The encryption process uses a digital signature method based on GRS codes with finite fields.
[0009] The third step is to upload the encrypted data and digital signature to a lightweight blockchain network for storage. The lightweight blockchain network adopts an optimized consensus mechanism and uses the Byzantine Fault Tolerance (PBFT) algorithm.
[0010] The fourth step involves consumers, regulatory agencies, and others initiating query requests through terminal devices to obtain and display relevant agricultural product traceability information from the lightweight blockchain network.
[0011] Preferably, in the first step, the IoT device includes a temperature sensor, a humidity sensor, a light sensor, a camera sensor, and a GPS sensor.
[0012] Preferably, in the second step, a GRS code based on a finite field is constructed; a public key and a private key are generated according to the GRS code; a hash operation is performed on the data information containing timestamps that needs to be digitally signed to obtain a digest value. The hash operation includes performing an initial hash operation on the plaintext that needs to be digitally signed, and then performing a hash operation again on the result obtained from the initial hash operation.
[0013] The digest value is encrypted using the private key to obtain a digital signature. The encryption process includes multiplying a non-singular matrix with the digest value to obtain a corrector to be decoded, decoding the corrector to be decoded using a decoding algorithm in conjunction with the check matrix of the private key to obtain a first error vector, multiplying the first error vector with the inverse of the transformation matrix of the private key to obtain a second error vector, wherein the weight of the second error vector is less than or equal to the error correction capability of the GRS code, and the second error vector is used as the digital signature.
[0014] Preferably, in the first step, during the data collection process, information on soil moisture, temperature, light, fertilization and spraying, and planting location is collected during the planting stage; information on temperature, humidity, processing time, and processing video information is collected during the processing stage; information on transportation location, time, and temperature and humidity changes is collected during the distribution and storage stage; and information on sales time, sales location, and sales target is collected during the sales stage.
[0015] Preferably, in the second step, data transmission uses wireless communication technologies such as ZigBee and Wi-Fi to realize the transmission of data from the sensor node to the master node and then to the server, and uses SSL / TLS encryption protocol to encrypt the data transmission.
[0016] A traceability system for agricultural products throughout their entire lifecycle based on lightweight blockchain and IoT devices includes:
[0017] The data access layer is used to collect data information during the agricultural production process based on Internet of Things (IoT) technology. The data access layer is equipped with devices such as temperature sensors, humidity sensors, light sensors, camera sensors, and GPS sensors.
[0018] The data transmission layer is used to transmit data from sensor nodes to the master node and then to the server. It uses wireless communication technologies such as ZigBee and Wi-Fi, and uses SSL / TLS encryption protocols to encrypt the data during transmission.
[0019] The data storage layer uses lightweight blockchain technology as its underlying architecture to store agricultural product traceability data. It also adopts a dual storage structure of "database + blockchain". The local database mainly stores public information, while the blockchain stores encrypted ciphertext of private information and hash values of public information.
[0020] The data presentation layer is used to present traceability information to customers. It uses QR code technology, allowing consumers to scan the QR code to query the entire life cycle information of agricultural products. It also provides terminal interfaces such as Web or App.
[0021] Preferably, the system further includes production management, processing management, logistics management, sales management, traceability query, and data analysis functions. The production management function records planting information for agricultural products, including seedling information, planting process, and environmental conditions. The processing management function records information such as the classification, weighing, packaging, and QR code label generation of agricultural products, as well as environmental conditions and product transaction data during processing. The logistics management function monitors the logistics transportation and storage environment of agricultural products in real time, recording transportation location, time, and temperature and humidity changes. The sales management function records sales information for agricultural products, including sales time, sales location, and sales recipients. The traceability query function provides traceability query services for agricultural products to consumers, regulatory agencies, etc. The data analysis function analyzes agricultural product traceability data to provide decision support for agricultural production, processing, and distribution.
[0022] Compared with the prior art, the beneficial effects of the present invention are:
[0023] 1. This invention improves data authenticity by automatically collecting agricultural product data through IoT devices, avoiding data errors and falsification issues caused by manual entry. Sensor devices can collect data on the growth environment, processing, and logistics of agricultural products in real time and accurately, ensuring the authenticity and reliability of the data. Simultaneously, lightweight blockchain technology is used to encrypt and store the data on the blockchain; once the data is on the blockchain, it cannot be tampered with, further guaranteeing its authenticity.
[0024] 2. This invention enhances data security by employing a digital signature method based on finite-field GRS codes to encrypt data. Combined with the distributed storage and consensus mechanism of lightweight blockchain, it effectively prevents data tampering and leakage. Digital signature technology ensures data integrity and authenticity, while the distributed storage of blockchain allows data to be stored across multiple nodes, avoiding the risk of single points of failure. Even if some nodes are attacked or malfunction, it will not affect the normal operation of the entire system or the security of the data.
[0025] 3. This invention provides a full lifecycle traceability system covering the entire lifecycle of agricultural products, from production, processing, distribution to sales, enabling comprehensive traceability of each stage. Consumers, regulatory agencies, and others can use the traceability system to query the full lifecycle information of agricultural products, understanding their origin, production process, quality and safety, which helps improve food safety levels and enhance consumer trust. Attached Figure Description
[0026] Figure 1 This is a flowchart illustrating the steps of the present invention's method for tracing the entire lifecycle of agricultural products based on lightweight blockchain and IoT devices. Detailed Implementation
[0027] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0028] Please see Figure 1 This invention provides a technical solution: a method for tracing the entire lifecycle of agricultural products based on lightweight blockchain and IoT devices.
[0029] The first step is to use IoT devices to collect data on agricultural products at various stages of production, processing, distribution, and sales; and to preprocess the collected data, including data cleaning and format conversion.
[0030] Data collection during the planting stage
[0031] In agricultural planting bases, various types of sensor equipment are deployed. Soil moisture sensors employ high-precision capacitive sensors, capable of measuring soil moisture values accurately in real time. Their measurement range covers various soil moisture states from arid to saturated, with a measurement accuracy of ±3%. Temperature sensors utilize thermistor sensors, characterized by rapid response and long-term stability. They can accurately measure soil and air temperature, with a measurement range of -40℃ to +80℃ and an accuracy of ±0.5℃. Light sensors use photodiodes as sensitive elements, accurately measuring light intensity with a measurement range of 0-200,000 Lux and an accuracy of ±5%.
[0032] Simultaneously, sensors on intelligent fertilizer applicators and spraying equipment record information such as the time, dosage, and type of fertilization and spraying. Flow sensors on the fertilizer applicator monitor fertilizer flow in real time, ensuring accurate control of the fertilizer application rate; pressure and flow sensors on the spraying equipment work together to precisely record the dosage and range of the spraying. Furthermore, high-precision GPS positioning equipment records the geographical location information of agricultural products, with positioning accuracy down to the centimeter level, providing accurate geographical location data for subsequent traceability.
[0033] Data collection during processing
[0034] In agricultural product processing plants, temperature sensors, humidity sensors, timers, and other equipment are installed to collect real-time data on temperature, humidity, and processing time during the processing process. The temperature sensors in the processing workshop utilize infrared thermometry technology, enabling rapid and accurate measurement of the surface temperature of the processing equipment and the ambient temperature, with a measurement range of -50℃ to +500℃ and an accuracy of ±1℃. The humidity sensors employ the principle of capacitive humidity sensing to monitor humidity changes in the processing workshop in real time, with a measurement range of 0-100% RH and an accuracy of ±3% RH. The timers use high-precision quartz crystal oscillators to ensure accurate recording of processing time, achieving millisecond-level accuracy.
[0035] Meanwhile, high-definition cameras are installed in the processing workshop to record the entire processing process. These cameras feature high resolution (such as 4K) and wide-angle shooting capabilities, clearly recording information such as agricultural product processing operations and equipment operating status. The video data is transmitted in real-time to the data processing center via a high-speed network, providing direct evidence for subsequent traceability.
[0036] Data collection during distribution and warehousing stages
[0037] GPS positioning devices and temperature and humidity sensors are installed in agricultural product logistics vehicles and warehouses. The GPS positioning devices on the logistics vehicles track the vehicle's location and trajectory in real time, updating the location information every 10 seconds to ensure accurate tracking of the agricultural product's transportation route and time. Temperature and humidity sensors are installed inside the transport compartments and warehouses to monitor the ambient temperature and humidity of the agricultural products in real time. The temperature and humidity sensors inside the transport compartments are waterproof, dustproof, and shockproof, enabling them to operate stably in harsh transportation environments, with the same measurement range and accuracy as the sensors used during the planting stage. The temperature and humidity sensors in the warehouses use wireless transmission technology to send data to the monitoring center in real time, allowing managers to promptly understand the warehouse environment.
[0038] Data transmission
[0039] All data acquisition devices transmit collected data to the data processing center in real time via IoT technology. For short-range communication, ZigBee wireless communication technology is used, which offers advantages such as low power consumption, low cost, and self-organizing networks, making it suitable for data transmission between sensor nodes. The ZigBee network can transmit data over distances of 100-300 meters, meeting the communication needs between devices in locations such as planting bases and processing plants. For long-range communication, 4G or 5G networks are used to transmit data from the data processing center to cloud servers or blockchain networks. 4G networks offer transmission rates up to 100Mbps, while 5G networks offer even higher rates of up to 10Gbps, ensuring fast and stable data transmission.
[0040] Data on the blockchain
[0041] Data preprocessing
[0042] The collected agricultural product data undergoes preprocessing, including data cleaning and format conversion. Data cleaning primarily removes noise, outliers, and duplicate data. For example, for data collected by soil moisture sensors, data exceeding a reasonable threshold range is considered outliers and discarded. Format conversion standardizes data collected from different devices into a unified format for easier subsequent processing and storage. For instance, temperature data collected by temperature sensors is converted from Celsius to Kelvin and stored in JSON format.
[0043] The second step is to encrypt the preprocessed data to generate a digital signature. The encryption process uses a digital signature method based on GRS codes with finite fields.
[0044] Lightweight blockchain technology is used to encrypt preprocessed data and generate digital signatures. The digital signature employs a finite-field GRS code-based digital signature method, with the following specific steps:
[0045] Constructing a GRS code: First, determine parameters such as the size of the finite field and the code length. Then, construct a GRS code based on the finite field using these parameters. GRS codes have good error correction performance and algebraic structure, providing reliable security for digital signatures.
[0046] Generating Public and Private Keys: Based on the constructed GRS code, a public and private key are generated using a specific algorithm. The public key is used to verify the authenticity of the digital signature, and the private key is used to generate the digital signature. The private key must be kept strictly confidential and can only be possessed by the data owner.
[0047] Hash operation: A hash operation is performed on the timestamped data that needs to be digitally signed to obtain a digest value. Specifically, an initial hash operation is performed on the plaintext to be digitally signed using the SHA-256 algorithm, mapping plaintext of any length to a 256-bit hash value. The result of the initial hash operation is then hashed again to further improve the randomness and security of the hash value, resulting in the final digest value.
[0048] Digital Signature Generation: The digest value is encrypted using the private key to obtain the digital signature. Specifically, a non-singular matrix is multiplied by the digest value to obtain the proofreading vector. The proofreading vector is then decoded using a decoding algorithm based on the private key's verification matrix, yielding a first error vector. This first error vector is then multiplied by the inverse of the private key's transformation matrix to obtain a second error vector. The weight of the second error vector is less than or equal to the error-correcting capability of the GRS code. This second error vector, used as the digital signature, is uploaded to the lightweight blockchain network along with the encrypted data.
[0049] The third step involves uploading the encrypted data and digital signature to a lightweight blockchain network for storage. This lightweight blockchain network employs an optimized consensus mechanism and utilizes the Byzantine Fault Tolerance (PBFT) algorithm.
[0050] Blockchain on-chain
[0051] The encrypted data and digital signature are uploaded to a lightweight blockchain network. This lightweight blockchain employs an optimized consensus mechanism, such as the Practical Byzantine Fault Tolerance (PBFT) algorithm. In PBFT, a processing node is first selected from the blockchain cloud platform according to a pre-defined consensus mechanism to construct a new block. The processing node verifies and packages the received data, generating a new block. Then, the encrypted agricultural product information in the new block is broadcast to the blockchains of all nodes on the blockchain cloud platform. Each node generates a new block based on the received encrypted agricultural product information and appends it to the end of the corresponding blockchain, thus updating the blockchain. Through the PBFT algorithm, the consensus efficiency and throughput of the blockchain can be improved while ensuring data consistency and security.
[0052] Fourth, consumers, regulatory agencies, and others initiate query requests through terminal devices to obtain and display relevant agricultural product traceability information from the lightweight blockchain network.
[0053] Data query query request initiated
[0054] Consumers and regulatory agencies can initiate query requests to the traceability system via web or app terminals by scanning the QR code on agricultural product packaging or entering the product ID. The QR code, in QR code format, features high-density encoding, large-capacity storage, and rapid reading, capable of storing unique identification information and a partial summary of traceability data for agricultural products. The product ID is automatically generated by the system, ensuring uniqueness and non-repeatability, allowing users to quickly and accurately query agricultural product information.
[0055] Data acquisition and decryption verification
[0056] Upon receiving a query request, the traceability system retrieves the corresponding agricultural product traceability information from the lightweight blockchain network. First, based on the product ID or QR code information in the query request, it searches for the corresponding block on the blockchain. Then, it retrieves the encrypted agricultural product traceability information and digital signature from the block. The digital signature is verified using a public key to ensure the integrity and authenticity of the data. If the verification passes, the encrypted traceability information is decrypted using the appropriate decryption algorithm to obtain the original traceability data.
[0057] Information Display
[0058] The decrypted and verified traceability information is presented to the user in an intuitive way. The displayed content includes information on the entire lifecycle of agricultural products, from production and processing to distribution and sales, such as planting time and location, fertilization and pesticide application records, processing techniques, transportation routes, and storage environment. The information display interface uses a graphical design, presenting the traceability information of agricultural products intuitively through charts, maps, and other formats, making it easy for users to understand and query.
[0059] Agricultural Product Lifecycle Traceability System Based on Lightweight Blockchain and IoT Devices
[0060] System Architecture
[0061] Data access layer
[0062] The data access layer collects data on agricultural production processes based on IoT technology. At planting bases, a sensor network deployed in the fields collects real-time data on the growing environment of agricultural products, such as temperature, humidity, light intensity, and growing date. The sensor network uses a star topology, with sensor nodes transmitting the collected data to the master node via wireless communication modules. The master node performs preliminary processing and aggregation of the data before transmitting it to the server via wired or wireless means. At processing plants, sensors and cameras installed on processing equipment collect data on processing procedures and production dates. In logistics and warehousing, GPS sensors, temperature and humidity sensors, and other equipment collect data on transportation location, time, and changes in temperature and humidity. Data acquisition equipment includes temperature sensors, humidity sensors, light sensors, camera sensors, and GPS sensors. These devices are characterized by high precision, high reliability, and low power consumption, meeting the needs of agricultural product traceability data collection.
[0063] Data transmission layer
[0064] The data transmission layer employs wireless communication technologies such as ZigBee and Wi-Fi to transmit data from sensor nodes to the master node and then to the server. ZigBee is suitable for scenarios with many network nodes collecting information, low cost, high transmission performance, relatively small device size, and complex terrain. For example, in a sensor network at a planting base, ZigBee nodes can be easily deployed in farmland to achieve reliable data transmission. Wi-Fi has wide coverage and broad applicability, supporting simultaneous transmission from multiple terminal devices. In processing plants and logistics warehouses, Wi-Fi networks can provide high-speed and stable data transmission services. Meanwhile, to ensure data transmission security, SSL / TLS encryption protocols are used to encrypt data transmission, preventing data theft or tampering during transmission.
[0065] Data storage layer
[0066] The data storage layer employs lightweight blockchain technology as its underlying architecture, storing agricultural product traceability data in a chain-like manner. Lightweight blockchain reduces storage and computational overhead by optimizing consensus algorithms and decreasing block size, thereby improving system performance and efficiency. Simultaneously, to optimize storage space and improve query efficiency, a dual storage structure of "database + blockchain" is adopted. The local database (such as MySQL) primarily stores public information, such as basic information about agricultural products and manufacturer information. The blockchain stores encrypted ciphertext of private information and hash values of public information. The SHA256 algorithm is used to hash the public information, generating fixed-length hash values, which helps save blockchain storage space. When querying agricultural product traceability information, the public information is first retrieved from the local database, then the integrity and authenticity of the private information are verified on the blockchain using the hash value, and finally, the encrypted private information is retrieved from the blockchain for decryption and display.
[0067] Data presentation layer
[0068] The data presentation layer primarily utilizes QR code technology to present traceability information to customers in an orderly and logical manner. Consumers can scan the QR code to access the traceability system's web or app interface and view complete information on the production, processing, and distribution of agricultural products. During QR code generation, the unique identifier of the agricultural product, a partial summary of traceability data, and the access link are encoded to ensure the QR code's security and readability. Simultaneously, the system provides web or app-based terminal interfaces for convenient user access to agricultural product traceability information. These interfaces feature a user-friendly design and support multiple query methods, such as searching by product ID and by time range, to meet the needs of different users.
[0069] System Functions
[0070] Production management functions
[0071] Record planting information for agricultural products, including seedling information, planting process, and environmental conditions. Seedling information includes variety, origin, and planting time; planting process records include the time, dosage, and type of fertilization, pesticide application, and irrigation; environmental conditions records include data on soil moisture, temperature, and light exposure. By recording and analyzing this information, scientific management of the agricultural production process can be achieved, providing a basis for improving the quality and yield of agricultural products.
[0072] Processing management function
[0073] This system records information such as the classification, weighing, packaging, and QR code label generation of agricultural products, as well as environmental conditions and product transaction data during processing. Classification information includes the variety and grade of the agricultural product; weighing and packaging information records the product's weight and packaging specifications; the QR code label generation function generates a unique QR code identifier for each agricultural product, facilitating subsequent traceability. Environmental conditions during processing record data such as temperature and humidity in the processing workshop, while product transaction data records information such as sales time and target customers. By recording and analyzing processing management information, the quality and safety of agricultural products during processing are ensured.
[0074] Logistics management function
[0075] The system monitors the logistics, transportation, and storage environment of agricultural products in real time, recording data such as transportation location, time, and temperature and humidity changes. GPS positioning devices track the location and trajectory of transport vehicles in real time, ensuring that agricultural products are delivered to their destinations on time and safely. Temperature and humidity sensors monitor the ambient temperature and humidity of the agricultural products in real time; when the temperature or humidity exceeds the preset range, the system promptly issues an alarm, reminding managers to take appropriate measures. Through the recording and analysis of logistics management information, the quality of agricultural products is guaranteed throughout the distribution process.
[0076] Sales management functions
[0077] Record sales information for agricultural products, including sales time, location, and target customers. This sales information is collected in real-time by sales terminal devices (such as cash registers and barcode scanners) and uploaded to the traceability system. By recording and analyzing sales management information, the system understands the sales situation and market feedback for agricultural products, providing a basis for production and sales decisions.
[0078] Source tracing query function
[0079] This service provides agricultural product traceability inquiry services for consumers and regulatory agencies. Users can query the entire lifecycle information of agricultural products by scanning QR codes or entering product IDs. The traceability inquiry function supports multiple query methods, such as querying by time range or by production stage, allowing users to quickly and accurately obtain the information they need. Furthermore, the traceability inquiry results are displayed in an intuitive graphical interface, enhancing the user experience.
[0080] Data analysis function
[0081] Analyzing agricultural product traceability data provides decision support for agricultural production, processing, and distribution. By analyzing data on planting environment, processing procedures, logistics, and sales, we can uncover underlying patterns and trends, providing a scientific basis for optimizing agricultural production plans, improving processing efficiency, reducing logistics costs, and expanding sales channels. For example, by analyzing the relationship between planting environment data and agricultural product yield and quality, we can adjust production operations such as fertilization and pesticide application to improve the yield and quality of agricultural products.
[0082] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.
[0083] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A method for tracing the entire lifecycle of agricultural products based on lightweight blockchain and IoT devices, comprising the following steps, characterized in that: The first step is to use IoT devices to collect data on agricultural products at various stages of production, processing, distribution, and sales; and to preprocess the collected data, including data cleaning and format conversion. The second step is to encrypt the preprocessed data to generate a digital signature. The encryption process uses a digital signature method based on GRS codes with finite fields. The third step is to upload the encrypted data and digital signature to a lightweight blockchain network for storage. The lightweight blockchain network adopts an optimized consensus mechanism and uses the Byzantine Fault Tolerance (PBFT) algorithm. The fourth step involves consumers, regulatory agencies, and others initiating query requests through terminal devices to obtain and display relevant agricultural product traceability information from the lightweight blockchain network.
2. The method for tracing the entire lifecycle of agricultural products based on lightweight blockchain and IoT devices as described in claim 1, characterized in that: In the first step, the IoT device includes a temperature sensor, a humidity sensor, a light sensor, a camera sensor, and a GPS sensor.
3. The method for tracing the entire lifecycle of agricultural products based on lightweight blockchain and IoT devices according to claim 1, characterized in that: In the second step, a GRS code based on a finite field is constructed; a public key and a private key are generated according to the GRS code; a hash operation is performed on the data information containing timestamps that needs to be digitally signed to obtain a digest value. The hash operation includes performing an initial hash operation on the plaintext that needs to be digitally signed, and then performing a hash operation again on the result obtained from the initial hash operation. The digest value is encrypted using the private key to obtain a digital signature. The encryption process includes multiplying a non-singular matrix with the digest value to obtain a corrector to be decoded, decoding the corrector to be decoded using a decoding algorithm in conjunction with the check matrix of the private key to obtain a first error vector, multiplying the first error vector with the inverse of the transformation matrix of the private key to obtain a second error vector, wherein the weight of the second error vector is less than or equal to the error correction capability of the GRS code, and the second error vector is used as the digital signature.
4. The method for tracing the entire lifecycle of agricultural products based on lightweight blockchain and IoT devices according to claim 1, characterized in that, In the first step, during the data collection process, information on soil moisture, temperature, light, fertilization and spraying, and planting location is collected during the planting stage; information on temperature, humidity, processing time, and processing video information is collected during the processing stage; information on transportation location, time, and temperature and humidity changes is collected during the distribution and storage stage; and information on sales time, sales location, and sales target is collected during the sales stage.
5. The method for tracing the entire lifecycle of agricultural products based on lightweight blockchain and IoT devices according to claim 1, characterized in that, In the second step, data transmission uses wireless communication technologies such as ZigBee and Wi-Fi to realize the transmission of data from sensor nodes to master nodes and then to the server, and uses SSL / TLS encryption protocols to encrypt the data transmission.
6. A traceability system for the entire lifecycle of agricultural products based on lightweight blockchain and IoT devices, characterized in that, include: The data access layer is used to collect data information during the agricultural production process based on Internet of Things (IoT) technology. The data access layer is equipped with devices such as temperature sensors, humidity sensors, light sensors, camera sensors, and GPS sensors. The data transmission layer is used to transmit data from sensor nodes to the master node and then to the server. It uses wireless communication technologies such as ZigBee and Wi-Fi, and uses SSL / TLS encryption protocols to encrypt the data during transmission. The data storage layer uses lightweight blockchain technology as its underlying architecture to store agricultural product traceability data. It also adopts a dual storage structure of "database + blockchain". The local database mainly stores public information, while the blockchain stores encrypted ciphertext of private information and hash values of public information. The data presentation layer is used to present traceability information to customers. It uses QR code technology, allowing consumers to scan the QR code to query the entire life cycle information of agricultural products. It also provides terminal interfaces such as Web or App.
7. The method for tracing the entire lifecycle of agricultural products based on lightweight blockchain and IoT devices according to claim 6, characterized in that, The system also includes production management functions, processing management functions, logistics management functions, sales management functions, traceability query functions, and data analysis functions; The production management function is used to record planting information for agricultural products, including seedling information, planting process, and environmental conditions. The processing management function is used to record information such as the classification, weighing, packaging and QR code label generation of agricultural products, as well as environmental conditions and product transaction data during the processing. The logistics management function is used to monitor the logistics transportation and storage environment of agricultural products in real time, and record data on transportation location, time, and temperature and humidity changes. The sales management function is used to record sales information for agricultural products, including sales time, sales location, and sales recipients; The traceability query function is used to provide traceability query services for agricultural products to consumers, regulatory agencies, etc. The data analysis function is used to analyze agricultural product traceability data and provide decision support for agricultural production, processing, and distribution.
Citation Information
Cited By
Agricultural product traceability processing method and system based on block chain
CN122089338A
