Agricultural product detection management method, system and program product

By using a chain-based data processing and separation of responsibilities mechanism, and by employing unique sample identification codes and QR code technology, the problems of poor traceability, weak anti-tampering, and unclear responsibilities in traditional agricultural product testing management have been solved. This has enabled traceability, anti-tampering, and clear division of responsibilities in the agricultural product testing process, thereby improving the efficiency of testing management and the authenticity and credibility of the data.

CN122199003APending Publication Date: 2026-06-12HEBEI CHENGXIAN TECHNOLOGY CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HEBEI CHENGXIAN TECHNOLOGY CO LTD
Filing Date
2026-03-16
Publication Date
2026-06-12

AI Technical Summary

Technical Problem

Traditional agricultural product testing and management suffers from poor traceability, weak tamper resistance, and unclear division of responsibilities. Existing technologies have failed to construct a closed-loop management logic with interconnected links, making it difficult to achieve traceability, tamper resistance, and clear division of responsibilities in the testing process.

Method used

By adopting a chain-like data processing logic and a responsibility separation mechanism, agricultural products are deeply bound through a unique sample identification code, and QR codes are used to record and transfer data. Data is encrypted, verified, and stored at each stage to ensure data integrity and traceability.

🎯Benefits of technology

It has achieved traceability, tamper-proofing, and clear division of responsibilities throughout the entire agricultural product testing process, improved testing management efficiency, ensured the authenticity and credibility of testing data, and achieved standardized processing of the testing process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122199003A_ABST
    Figure CN122199003A_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of agricultural product detection, and specifically discloses an agricultural product detection management method, system and program product. Through a chain data processing logic and a responsibility separation mechanism, the agricultural products to be detected are deeply bound with unique sample identification codes, and the corresponding node recording circulation is performed through the two-dimensional codes of each link, so that the data of each link from sample collection to completion of auditing is automatically recorded, encrypted and checked, and the responsibilities are clear. The complex offline detection process is converted into clear online digital track, and traceability, tamper-proof and credibility management of the agricultural product detection process are realized. Through effective closed-loop management, the application can realize the traceability of the whole process of agricultural product detection. Through the corresponding data security and tamper-proof mechanism, the authenticity, integrity and credibility of the agricultural product quality and safety detection data are greatly guaranteed. Moreover, the application improves the agricultural product detection management efficiency and realizes the standardized processing of the detection process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of agricultural product testing technology, specifically relating to an agricultural product testing management method, system, and program product. Background Technology

[0002] Currently, agricultural product quarantine and testing (such as pesticide residue testing) is a crucial link in ensuring food safety. Traditional agricultural product testing management relies heavily on manual paper records and electronic forms, which have the following significant drawbacks: 1. Poor traceability: The links between the various stages of the testing process are loose, making it difficult to quickly and accurately trace back to the specific stage and responsible person once a problem occurs.

[0003] 2. Weak tamper resistance: The detection data is easily modified or forged, and there is a lack of effective technical means to ensure the originality and authenticity of the data flow.

[0004] 3. Unclear definition of responsibilities: There is overlap or confusion of responsibilities in the sampling, sample preparation, testing, and review processes, which makes it impossible to achieve effective technical isolation and supervision, and poses internal operational risks.

[0005] Although existing technologies use QR codes to bind agricultural product information, they are mostly limited to information display and query functions. They fail to build an interlocking and tamper-proof closed-loop management logic in the generation, flow and storage of testing data, and fail to fundamentally solve the corresponding problems in the testing process. Summary of the Invention

[0006] The purpose of this invention is to provide a method, system, and program for agricultural product testing and management, in order to solve the aforementioned problems existing in the prior art.

[0007] To achieve the above objectives, the present invention adopts the following technical solution: Firstly, a method for the testing and management of agricultural products is provided, including: Obtain the sampler's identity information and the sampling record information of the corresponding batch of agricultural products uploaded by the sampling terminal; The identity information of the sampler is verified. After the verification is successful, a unique sample identification code for the corresponding batch of agricultural products is generated. The sampling data verification code is calculated using the sampling record information. The sampling label QR code is generated using the sampling data verification code and the unique sample identification code. The sampling label QR code is sent to the sampling terminal, and the sampling record information is encrypted using the unique sample identification code to obtain encrypted sampling record information. The encrypted sampling record information is then associated with the unique sample identification code and saved to the database. After scanning the QR code on the sampling label at the sample preparation end, the sample preparation staff's identity information, sample preparation record information, sampling data verification code, and unique sample identification code are uploaded. The identity information of the sample preparer and the verification code of the sampling data are verified. After the verification is successful, the sample preparation data verification code is calculated using the sample preparation record information and the sampling data verification code. The sample preparation label QR code is generated using the sample preparation data verification code and the unique sample identification code. Send the sample preparation label QR code to the sample preparation terminal, and use the unique sample identification code to encrypt the sample preparation record information to obtain encrypted sample preparation record information. Save the encrypted sample preparation record information to the database and associate it with the unique sample identification code. After scanning the sample preparation label QR code at the testing terminal, the uploaded information includes the tester's identity, testing record, sample preparation data verification code, and unique sample identification code. The identity information of the tester and the sample preparation data verification code are verified. After the verification is passed, the test data verification code is calculated using the test record information and the sample preparation data verification code. The test data verification code and the unique sample identification code are used to generate a test label QR code. The detection label QR code is sent to the detection terminal, and the detection record information is encrypted using the unique sample identification code to obtain encrypted detection record information. The encrypted detection record information is then saved in the database and associated with the unique sample identification code. Obtain the auditor's identity information, audit record information, test data verification code, and unique sample identifier code uploaded after the auditing end scans the QR code on the test label; The auditor's identity information and the test data verification code are verified. After the verification is passed, the query data verification code is calculated using the audit record information and the test data verification code. The query data verification code and the unique sample identification code are used to generate the test query QR code for the corresponding batch of agricultural products. The QR code for the corresponding batch of agricultural products is pushed to the user terminal, and the audit record information is encrypted using the unique sample identification code to obtain encrypted audit record information. The encrypted audit record information is then saved in the database and associated with the unique sample identification code.

[0008] In one possible design, the method further includes: The system receives agricultural product testing query requests sent by users after scanning the corresponding testing query QR code. The agricultural product testing query request includes a query data verification code and a unique sample identifier code. Based on the unique sample identifier, retrieve the associated encrypted sampling record information, encrypted sample preparation record information, encrypted testing record information, and encrypted review record information from the database; The encrypted sampling record information, encrypted sample preparation record information, encrypted testing record information, and encrypted review record information are decrypted using a unique sample identifier to obtain the sampling record information, sample preparation record information, testing record information, and review record information. Calculate the sampling data verification code using sampling record information; calculate the sample preparation data verification code using sample preparation record information and sampling data verification code; calculate the test data verification code using test record information and sample preparation data verification code; calculate the query data verification code using audit record information and test data verification code. The query data verification code is compared with the query data check code. If they match, the agricultural product testing report is generated using the sampling record information, sample preparation record information, testing record information, and review record information. The agricultural product testing report is sent to the user's device.

[0009] In one possible design, the process of decrypting the encrypted sampling record information, encrypted sample preparation record information, encrypted testing record information, and encrypted review record information using a unique sample identifier to obtain the sampling record information, sample preparation record information, testing record information, and review record information includes: The unique sample identifier is converted to obtain a converted data string, and the query array is extracted from the converted data string. The query array is hashed to obtain a hash value, and the hash value is then substituted into a pre-defined hash ring for matching to determine the position of the hash value in the hash ring. Based on the position of the hash value in the hash ring, find the node to which the hash value belongs in the hash ring in a clockwise direction, and determine the node key value corresponding to the node to which the hash value belongs; Retrieve the key associated with the node key value from the key store, and use the key to decrypt the encrypted sampling record information, encrypted sample preparation record information, encrypted testing record information, and encrypted audit record information respectively, to obtain the sampling record information, sample preparation record information, testing record information, and audit record information.

[0010] In one possible design, the process of performing data transformation on the unique sample identifier to obtain a transformed data string, and extracting a query array from the transformed data string, includes: The unique sample identifier is processed by data mapping, data shifting and / or data encoding to obtain a transformed data string; Extract a specified number of bits from the converted data string and combine them to obtain a query array.

[0011] In one possible design, the sampling record information includes the name of the agricultural product, the category of the agricultural product, the place of origin of the agricultural product, the submitting unit, the sampling time, and the sampler's number; the sample preparation record information includes sampling operation data, sample status data, sample crushing weight, sample image summary, sample preparation time, and the sampler's number; the detection record information includes each pesticide residue component, the corresponding detection value of each pesticide residue component, the detection time, and the tester's number; and the review record information includes the compliance range of the detection value corresponding to each pesticide residue component, the review result corresponding to each pesticide residue component, the review time, and the reviewer's number.

[0012] In one possible design, the calculation of a sampling data verification code using sampling record information, the calculation of a sample preparation data verification code using sample preparation record information and the sampling data verification code, the calculation of a test data verification code using test record information and the sample preparation data verification code, and the calculation of a query data verification code using audit record information and the test data verification code include: The SHA-256 algorithm is used to calculate the sampled record information to obtain the sampled data verification code; The sample data verification code is combined with the sample preparation record information to obtain the sample preparation combination array, and the SHA-256 algorithm is used to calculate the sample preparation data verification code. The sample preparation data verification code is combined with the test record information to obtain the test combination array, and the SHA-256 algorithm is used to calculate the test data verification code. The verification code of the detection data is combined with the audit record information to obtain the audit combination array, and the SHA-256 algorithm is used to calculate the verification code of the query data.

[0013] In one possible design, the verification of the sampler's identity information includes: extracting the sampler's identity token from the sampler's identity information, comparing the sampler's identity token with each preset token in the token library, and if there is a preset token in the token library that matches the sampler's identity token, the verification is successful. The verification of the sampler's identity information and the sampling data verification code includes: extracting the sampler's identity token from the sampler's identity information, comparing the sampler's identity token with each preset token in the token library, retrieving the associated encrypted sampling record information from the database according to the unique sample identifier, decrypting the encrypted sampling record information using the unique sample identifier to obtain the sampling record information, calculating the sampling data verification code using the sampling record information, comparing the sampling data verification code with the sampling data verification code, and if there is a preset token in the token library that is consistent with the sampler's identity token, and the sampling data verification code is consistent with the sampling data verification code, then the verification is successful. The verification of the inspector's identity information and the sample preparation data verification code includes: extracting the inspector's identity token from the inspector's identity information, comparing the inspector's identity token with each preset token in the token library, retrieving the associated encrypted sampling record information and encrypted sample preparation record information from the database based on the unique sample identifier, decrypting the encrypted sampling record information and encrypted sample preparation record information using the unique sample identifier to obtain the sampling record information and sample preparation record information, calculating the sampling data verification code using the sampling record information, calculating the sample preparation data verification code using the sample preparation record information and the sampling data verification code, comparing the sample preparation data verification code with the sample preparation data verification code, and if there is a preset token in the token library that is consistent with the inspector's identity token, and the sample preparation data verification code is consistent with the sample preparation data verification code, then the verification is successful; The verification of auditor identity information and test data verification code includes: extracting auditor identity token from auditor identity information, comparing the auditor identity token with each preset token in the token library, retrieving associated encrypted sampling record information, encrypted sample preparation record information, and encrypted test record information from the database based on the unique sample identifier, decrypting the encrypted sampling record information, encrypted sample preparation record information, and encrypted test record information using the unique sample identifier to obtain sampling record information, sample preparation record information, and test record information, calculating the sampling data verification code using the sampling record information, calculating the sample preparation data verification code using the sample preparation record information and the sampling data verification code, calculating the test data verification code using the test record information and the sample preparation data verification code, and comparing the test data verification code with the test data verification code. If a preset token consistent with the auditor identity token exists in the token library, and the test data verification code is consistent with the test data verification code, then the verification is successful.

[0014] Secondly, an agricultural product testing and management system is provided, comprising a data receiving unit, an information verification unit, a verification calculation unit, an information generation unit, a data sending unit, and a data storage unit, wherein: The data receiving unit is used to acquire the sampler's identity information and the sampling record information of the corresponding batch of agricultural products uploaded by the sampling end; to acquire the sampler's identity information, sample preparation record information, sampling data verification code and unique sample identification code uploaded by the sample preparation end after scanning the sampling label QR code; to acquire the tester's identity information, test record information, sample preparation data verification code and unique sample identification code uploaded by the testing end after scanning the sample preparation label QR code; and to acquire the reviewer's identity information, review record information, test data verification code and unique sample identification code uploaded by the review end after scanning the test label QR code. The information verification unit is used to verify the identity information of the sampler, the identity information of the sampler and the verification code of the sampling data, the identity information of the tester and the verification code of the sampler and the verification code of the test data; The verification calculation unit is used to calculate the sample data verification code using the sampling record information, to calculate the sample preparation data verification code using the sample preparation record information and the sample data verification code, to calculate the test data verification code using the test record information and the sample preparation data verification code, and to calculate the query data verification code using the audit record information and the test data verification code. The information generation unit is used to generate sampling label QR codes using sampling data verification codes and unique sample identification codes, to generate sample preparation label QR codes using sample preparation data verification codes and unique sample identification codes, to generate test label QR codes using test data verification codes and unique sample identification codes, and to generate test query QR codes for the corresponding batch of agricultural products using query data verification codes and unique sample identification codes. The data sending unit is used to send the sampling label QR code to the sampling end, the sample preparation label QR code to the sample preparation end, the test label QR code to the test end, and push the test query QR code of the corresponding batch of agricultural products to the user end; The data storage unit is used to encrypt sampling record information using a unique sample identifier to obtain encrypted sampling record information, associate the encrypted sampling record information with the unique sample identifier, and save it to the database; to encrypt sample preparation record information using the unique sample identifier to obtain encrypted sample preparation record information, save the encrypted sample preparation record information to the database and associate it with the unique sample identifier; to encrypt detection record information using the unique sample identifier to obtain encrypted detection record information, save the encrypted detection record information to the database and associate it with the unique sample identifier; and to encrypt audit record information using the unique sample identifier to obtain encrypted audit record information, save the encrypted audit record information to the database and associate it with the unique sample identifier.

[0015] Thirdly, an agricultural product testing and management system is provided, including: Memory, used to store instructions; The processor is configured to read instructions stored in the memory and execute any one of the agricultural product testing and management methods described in the first aspect above, according to the instructions.

[0016] Fourthly, a computer-readable storage medium is provided, on which instructions are stored, which, when executed on a computer, cause the computer to perform any one of the agricultural product testing and management methods described in the first aspect. Simultaneously, a computer program product is also provided, which, when executed on a computer, performs any one of the agricultural product testing and management methods described in the first aspect.

[0017] Beneficial Effects: This invention, through chain-like data processing logic and a separation of responsibilities mechanism, deeply binds the agricultural products to be inspected with unique sample identification codes. It uses QR codes at each stage to record and transfer data at corresponding nodes, ensuring that data at every stage from sample collection to final review is automatically recorded, encrypted, verified, and clearly defined in terms of responsibility. This transforms the complex offline testing process into a clear online digital trajectory, achieving traceability, tamper-proofing, and reliable management of the agricultural product testing process. Through effective closed-loop management, this invention enables traceability throughout the entire agricultural product testing process; through corresponding data security and tamper-proof mechanisms, it greatly guarantees the authenticity, integrity, and credibility of agricultural product quality and safety testing data; and it improves the efficiency of agricultural product testing management, achieving standardized processing of the testing process. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is a schematic diagram of the agricultural product testing and management method of the present invention; Figure 2 This is a flowchart illustrating the management method of the present invention during the query phase. Figure 3 This is a schematic diagram of the agricultural product testing and management system in Example 2; Figure 4 This is a schematic diagram of the agricultural product testing and management system in Example 3. Detailed Implementation

[0020] It should be noted that the descriptions of these embodiments are intended to aid in understanding the invention and do not constitute a limitation thereof. The specific structural and functional details disclosed herein are merely for describing exemplary embodiments of the invention. However, the invention may be embodied in many alternative forms and should not be construed as being limited to the embodiments described herein.

[0021] It should be understood that, unless otherwise explicitly specified and limited, the corresponding terms should be interpreted broadly. For example, "connection" can be a fixed connection, a detachable connection, or an integral connection; it can be a direct connection or an indirect connection through an intermediate medium; it can be a connection within two components. Those skilled in the art can understand the specific meaning of the above terms in the embodiments according to the specific circumstances.

[0022] Specific details are provided in the following description to provide a complete understanding of the exemplary embodiments. However, those skilled in the art will understand that the exemplary embodiments can be implemented without these specific details. For example, the system may be shown in block diagrams to avoid obscuring the example with unnecessary details. In other embodiments, well-known processes, structures, and techniques may be shown without non-essential details to avoid obscuring the embodiments.

[0023] Example 1: This embodiment provides a method for agricultural product testing and management, which can be applied to a corresponding agricultural product testing and management platform, such as... Figure 1 As shown, the method includes the following steps: S101. Obtain the sampler's identity information and the sampling record information of the corresponding batch of agricultural products uploaded by the sampling terminal.

[0024] After completing the sampling of the corresponding batch of agricultural products at the front end, the sampler uploads their identity information and the sampling record information of the corresponding batch of agricultural products to the platform through the sampling terminal. The sampling record information includes, but is not limited to, the name of the agricultural product, the category of the agricultural product, the place of origin of the agricultural product, the submitting unit, the sampling time, and the sampler's number.

[0025] S102. Verify the identity information of the sampler. After successful verification, generate a unique sample identification code for the corresponding batch of agricultural products, calculate the sampling data verification code using the sampling record information, and generate a sampling label QR code using the sampling data verification code and the unique sample identification code.

[0026] The sampler's identity information includes a sampler identity token. The platform verifies the sampler's identity information by: extracting the sampler identity token from the sampler's identity information and comparing it with pre-set tokens in a token library. If a pre-set token matching the sampler's identity token exists in the library, the verification is successful. After successful verification, the platform generates a unique sample identifier (unique sample number) for the corresponding batch of agricultural products and calculates a sample data check code using the sampling record information, such as using the SHA-256 algorithm. Then, the platform generates a sampling label QR code using the sample data check code and the unique sample identifier.

[0027] S103. Send the sampling label QR code to the sampling terminal, and encrypt the sampling record information using the unique sample identification code to obtain encrypted sampling record information. After associating the encrypted sampling record information with the unique sample identification code, save it to the database.

[0028] The platform sends the sampling label QR code to the sampling end, enabling the front-end sampler to print the sampling label QR code and attach it to the corresponding batch of agricultural products before sending it to the next stage (i.e., the sample preparation stage). Simultaneously, the platform can use a unique sample identifier to encrypt the sampling record information, including: performing data mapping, data shifting, and / or data encoding on the unique sample identifier to obtain a converted data string; extracting several specified bits of data from the converted data string and combining them to obtain a query array; performing hash calculation on the query array to obtain a hash value, and substituting the hash value into a pre-set hash ring for matching to determine the hash value's position in the hash ring; based on the hash value's position in the hash ring, searching clockwise for the node to which the hash value belongs in the hash ring, and determining the node key value corresponding to that node; retrieving the key associated with the node key value from the key library, and using this key to encrypt the sampling record information; obtaining encrypted sampling record information; and then saving the encrypted sampling record information, associated with the unique sample identifier, to the database.

[0029] S104. Obtain the sample preparation operator's identity information, sample preparation record information, sampling data verification code, and unique sample identification code uploaded after scanning the sampling label QR code at the sample preparation end.

[0030] In the sample preparation stage, after completing the sample preparation work for the corresponding batch of agricultural products, the sample preparation staff obtains the corresponding sample preparation record information. Then, they can scan the QR code on the sampling label through the sample preparation terminal to obtain the sampling data verification code and unique sample identification code. The sample preparation staff's identity information, sample preparation record information, sampling data verification code, and unique sample identification code are then uploaded to the platform. The sample preparation record information includes, but is not limited to, sampling operation data, sample status data, sample crushing weight, sample image summary, sample preparation time, and sample preparation staff number.

[0031] S105. Verify the identity information of the sample preparer and the verification code of the sampling data. After the verification is successful, calculate the sample preparation data verification code using the sample preparation record information and the verification code of the sampling data. Generate a sample preparation label QR code using the sample preparation data verification code and the unique sample identification code.

[0032] The sample maker's identity information includes a sample maker identity token. The platform's verification process for the sample maker's identity information and the sampling data verification code includes: extracting the sample maker's identity token from the sample maker's identity information, comparing the sample maker's identity token with each preset token in the token library, retrieving the associated encrypted sampling record information from the database based on the unique sample identifier code, decrypting the encrypted sampling record information using the unique sample identifier code (the decryption process refers to the encryption process in step S103 above), obtaining the sampling record information, calculating the sampling data verification code using the sampling record information (SHA-256 algorithm calculation), comparing the sampling data verification code with the sampling data verification code, and if there is a preset token in the token library that matches the sample maker's identity token, and the sampling data verification code matches the sampling data verification code, then the verification is successful.

[0033] After verification, the platform combines the sample data verification code with the sample preparation record information to obtain a sample preparation combination array. It then uses the SHA-256 algorithm to calculate the sample preparation combination array to obtain the sample preparation data verification code. Finally, it uses the sample preparation data verification code and the unique sample identification code to generate a sample preparation label QR code.

[0034] S106. Send the sample preparation label QR code to the sample preparation terminal, and use the unique sample identification code to encrypt the sample preparation record information to obtain encrypted sample preparation record information. Save the encrypted sample preparation record information to the database and associate it with the unique sample identification code.

[0035] The platform sends the sample preparation label QR code to the sample preparation end, enabling the sample preparation staff to print the QR code and attach it to the corresponding sample before sending it to the next stage (i.e., the testing stage). Simultaneously, the platform can encrypt the sample preparation record information using a unique sample identifier (the encryption process is described in step S103 above), obtaining encrypted sample preparation record information. This encrypted record information is then saved in the database and associated with the unique sample identifier.

[0036] S107. Obtain the inspector's identity information, inspection record information, sample preparation data verification code, and unique sample identification code uploaded after the inspection terminal scans the sample preparation label QR code.

[0037] During the testing process, after completing the testing of the corresponding samples, the tester obtains the test record information. Then, by scanning the QR code on the sample preparation label using the testing terminal, the tester obtains the sample preparation data verification code and the unique sample identification code. The tester then uploads the tester's identity information, test record information, sample preparation data verification code, and unique sample identification code to the platform via the testing terminal. The test record information includes, but is not limited to, each pesticide residue component, the corresponding test value for each pesticide residue component, the test time, and the tester's number.

[0038] S108. Verify the inspector's identity information and the sample preparation data verification code. After verification, calculate the test data verification code using the test record information and the sample preparation data verification code. Generate a test label QR code using the test data verification code and the unique sample identification code.

[0039] The inspector's identity information includes an inspector identity token. The platform's verification process for the inspector's identity information and the sample preparation data verification code includes: extracting the inspector identity token from the inspector's identity information and comparing it with each preset token in the token library; retrieving the associated encrypted sampling record information and encrypted sample preparation record information from the database based on the unique sample identifier; decrypting the encrypted sampling record information and encrypted sample preparation record information using the unique sample identifier (the decryption process refers to the encryption process in step S103 above); obtaining the sampling record information and sample preparation record information; calculating the sampling data verification code using the sampling record information (SHA-256 algorithm); calculating the sample preparation data verification code using the sample preparation record information and the sampling data verification code; comparing the sample preparation data verification code with the sample preparation data verification code; if a preset token consistent with the inspector's identity token exists in the token library, and the sample preparation data verification code is consistent with the sample preparation data verification code, then the verification is successful.

[0040] After successful verification, the platform calculates the test data verification code using the test record information and the sample preparation data verification code: First, the sample preparation data verification code is combined with the test record information to obtain a test combination array, and then the SHA-256 algorithm is used to calculate the test data verification code. Finally, the test data verification code and the unique sample identifier code are used to generate a test label QR code.

[0041] S109. Send the detection label QR code to the detection terminal, and encrypt the detection record information using the unique sample identification code to obtain encrypted detection record information. Save the encrypted detection record information to the database and associate it with the unique sample identification code.

[0042] The platform sends the test label QR code to the testing terminal, enabling the tester to print the QR code and attach it to the corresponding sample and test results before proceeding to the next stage (i.e., the review stage). Simultaneously, the platform can encrypt the test record information using a unique sample identifier (the encryption process is described in step S103 above), obtaining encrypted test record information. This encrypted test record information is then saved to the database and associated with the unique sample identifier.

[0043] S110. Obtain the auditor's identity information, audit record information, test data verification code, and unique sample identifier code uploaded after the auditing end scans the QR code of the test label.

[0044] During the review process, after reviewing the test results, the auditor obtains the review record information. They then scan the QR code on the test label using the review terminal to obtain the test data verification code and unique sample identification code. Finally, the auditor uploads the auditor's identity information, review record information, test data verification code, and unique sample identification code to the platform via the review terminal. The review record information includes the compliance range of the test values ​​for each pesticide residue, the review result for each pesticide residue, the review time, and the auditor's number.

[0045] S111. Verify the auditor's identity information and the test data verification code. After verification, calculate the query data verification code using the audit record information and the test data verification code. Use the query data verification code and the unique sample identification code to generate the corresponding batch of agricultural products' test query QR code.

[0046] The auditor's identity information includes an auditor's identity token. The platform verifies the auditor's identity information and the test data verification code, including: extracting the auditor's identity token from the auditor's identity information and comparing it with each pre-set token in the token library; retrieving associated encrypted sampling record information, encrypted sample preparation record information, and encrypted test record information from the database based on the unique sample identifier; decrypting the encrypted sampling record information, encrypted sample preparation record information, and encrypted test record information using the unique sample identifier (the decryption process refers to the encryption process in step S103 above), obtaining the sampling record information, sample preparation record information, and test record information; calculating the sampling data verification code using the sampling record information (SHA-256 algorithm); calculating the sample preparation data verification code using the sample preparation record information and the sampling data verification code; calculating the test data verification code using the test record information and the sample preparation data verification code; comparing the test data verification code with the test data verification code; if a pre-set token consistent with the auditor's identity token exists in the token library, and the test data verification code is consistent with the test data verification code, then the verification is successful.

[0047] After successful verification, the query data verification code is calculated using the audit record information and the test data verification code: First, the test data verification code is combined with the audit record information to obtain an audit combination array, and then the SHA-256 algorithm is used to calculate the query data verification code. Finally, the query data verification code and the unique sample identifier code are used to generate a test query QR code for the corresponding batch of agricultural products. S112. Push the QR code for the corresponding batch of agricultural products to the user terminal, and use the unique sample identification code to encrypt the audit record information to obtain encrypted audit record information. Save the encrypted audit record information to the database and associate it with the unique sample identification code.

[0048] The platform encrypts the audit record information using a unique sample identifier (refer to the encryption process in step S103 above) to obtain encrypted audit record information, which is then saved in the database and associated with the unique sample identifier. Simultaneously, a QR code for the corresponding batch of agricultural products is pushed to the relevant user terminal, allowing users to scan the QR code to query the full-process testing and management information of the corresponding batch of agricultural products.

[0049] During the query phase, such as Figure 2 As shown, this method also includes the following steps: S201. Receive an agricultural product testing query request sent by the user terminal after scanning the corresponding testing query QR code. The agricultural product testing query request includes a query data verification code and a unique sample identifier code.

[0050] S202. Retrieve the associated encrypted sampling record information, encrypted sample preparation record information, encrypted testing record information, and encrypted audit record information from the database based on the unique sample identifier.

[0051] S203. Use the unique sample identifier to decrypt the encrypted sampling record information, encrypted sample preparation record information, encrypted testing record information, and encrypted review record information to obtain the sampling record information, sample preparation record information, testing record information, and review record information.

[0052] The platform performs data mapping, data shifting, and / or data encoding on the unique sample identifier to obtain a converted data string. It then extracts several specified bits of data from the converted data string and combines them to obtain a query array. The query array is hashed to obtain a hash value, which is then substituted into a pre-set hash ring for matching to determine its position within the hash ring. Based on the hash value's position on the hash ring, the platform searches clockwise for the node to which the hash value belongs within the hash ring and determines the corresponding node key. Finally, the platform retrieves the key associated with the node key from the keystore and uses this key to decrypt the encrypted sampling record information, encrypted sample preparation record information, encrypted testing record information, and encrypted audit record information, respectively, to obtain the sampling record information, sample preparation record information, testing record information, and audit record information.

[0053] S204. Calculate the sampling data verification code using the sampling record information, calculate the sample preparation data verification code using the sample preparation record information and the sampling data verification code, calculate the test data verification code using the test record information and the sample preparation data verification code, and calculate the query data verification code using the audit record information and the test data verification code.

[0054] The platform uses the SHA-256 algorithm to calculate the sampling data verification code from the sampling record information. It then combines the sampling data verification code with the sample preparation record information to obtain a sample preparation combination array, and uses the SHA-256 algorithm to calculate the sample preparation data verification code. Next, it combines the sample preparation data verification code with the detection record information to obtain a detection combination array, and uses the SHA-256 algorithm to calculate the detection combination array to obtain the detection data verification code. Finally, it combines the detection data verification code with the audit record information to obtain an audit combination array, and uses the SHA-256 algorithm to calculate the audit combination array to obtain the query data verification code.

[0055] S205. Compare the query data verification code with the query data check code. If they match, generate an agricultural product testing report using the sampling record information, sample preparation record information, testing record information, and audit record information.

[0056] S206. Send the agricultural product testing report to the user's terminal.

[0057] This embodiment of the method deeply binds the agricultural products to be inspected with unique sample identification codes through chain-like data processing logic and a separation of responsibilities mechanism. It uses QR codes at each stage to record and transfer data at corresponding nodes, ensuring that data at every stage from sample collection to final review is automatically recorded, encrypted, verified, and clearly assigned responsibilities. This transforms the complex offline testing process into a clear online digital trajectory, achieving traceability, tamper-proofing, and reliable management of the agricultural product testing process. Through effective closed-loop management, this method enables traceability throughout the entire agricultural product testing process. Through corresponding data security and tamper-proof mechanisms, it greatly ensures the authenticity, integrity, and credibility of agricultural product quality and safety testing data (i.e., through the mandatory binding of unique sample identification codes and process sequence control, it technically ensures the separation of "collection, preparation, inspection, and review," preventing operators from exceeding their authority or falsifying data from other stages, effectively reducing internal risks). Furthermore, it improves the efficiency of agricultural product testing management and achieves standardized processing of the testing process.

[0058] Example 2: This embodiment provides an agricultural product testing and management system, such as... Figure 3 As shown, it includes a data receiving unit, an information verification unit, a verification calculation unit, an information generation unit, a data sending unit, and a data storage unit, wherein: The data receiving unit is used to acquire the sampler's identity information and the sampling record information of the corresponding batch of agricultural products uploaded by the sampling end; to acquire the sampler's identity information, sample preparation record information, sampling data verification code and unique sample identification code uploaded by the sample preparation end after scanning the sampling label QR code; to acquire the tester's identity information, test record information, sample preparation data verification code and unique sample identification code uploaded by the testing end after scanning the sample preparation label QR code; and to acquire the reviewer's identity information, review record information, test data verification code and unique sample identification code uploaded by the review end after scanning the test label QR code. The information verification unit is used to verify the identity information of the sampler, the identity information of the sampler and the verification code of the sampling data, the identity information of the tester and the verification code of the sampler and the verification code of the test data; The verification calculation unit is used to calculate the sample data verification code using the sampling record information, to calculate the sample preparation data verification code using the sample preparation record information and the sample data verification code, to calculate the test data verification code using the test record information and the sample preparation data verification code, and to calculate the query data verification code using the audit record information and the test data verification code. The information generation unit is used to generate sampling label QR codes using sampling data verification codes and unique sample identification codes, to generate sample preparation label QR codes using sample preparation data verification codes and unique sample identification codes, to generate test label QR codes using test data verification codes and unique sample identification codes, and to generate test query QR codes for the corresponding batch of agricultural products using query data verification codes and unique sample identification codes. The data sending unit is used to send the sampling label QR code to the sampling end, the sample preparation label QR code to the sample preparation end, the test label QR code to the test end, and push the test query QR code of the corresponding batch of agricultural products to the user end; The data storage unit is used to encrypt sampling record information using a unique sample identifier to obtain encrypted sampling record information, associate the encrypted sampling record information with the unique sample identifier, and save it to the database; to encrypt sample preparation record information using the unique sample identifier to obtain encrypted sample preparation record information, save the encrypted sample preparation record information to the database and associate it with the unique sample identifier; to encrypt detection record information using the unique sample identifier to obtain encrypted detection record information, save the encrypted detection record information to the database and associate it with the unique sample identifier; and to encrypt audit record information using the unique sample identifier to obtain encrypted audit record information, save the encrypted audit record information to the database and associate it with the unique sample identifier.

[0059] Furthermore, the data receiving unit is also used to receive agricultural product testing query requests sent by the user terminal after scanning the corresponding testing query QR code. The agricultural product testing query request includes a query data verification code and a unique sample identification code. The verification calculation unit is also used to retrieve associated encrypted sampling record information, encrypted sample preparation record information, encrypted testing record information, and encrypted review record information from the database based on the unique sample identifier; to decrypt the encrypted sampling record information, encrypted sample preparation record information, encrypted testing record information, and encrypted review record information using the unique sample identifier to obtain sampling record information, sample preparation record information, testing record information, and review record information; to calculate the sampling data verification code using the sampling record information; to calculate the sample preparation data verification code using the sample preparation record information and the sampling data verification code; to calculate the testing data verification code using the testing record information and the sample preparation data verification code; and to calculate the query data verification code using the review record information and the testing data verification code. The information generation unit is also used to compare the query data verification code with the query data check code. If the two are consistent, an agricultural product testing report is generated using the sampling record information, sample preparation record information, testing record information, and review record information. The data sending unit is also used to send agricultural product testing reports to the user terminal.

[0060] Example 3: This embodiment provides an agricultural product testing and management system, such as... Figure 4 As shown, at the hardware level, it includes: The data interface is used to establish data communication between the processor and external data terminals; Memory, used to store instructions; The processor is used to read instructions stored in the memory and execute the agricultural product testing and management method in Embodiment 1 according to the instructions.

[0061] Optionally, the system also includes an internal bus, through which the processor, memory, and data interface can be interconnected. This internal bus can be a PCIe (Peripheral Component Interconnect Eexpress) bus, which can be divided into an address bus, a data bus, a control bus, etc. The memory can include, but is not limited to, Random Access Memory (RAM), Read Only Memory (ROM), Flash Memory, First Input First Output (FIFO), and / or First In Last Out (FILO). The processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0062] Example 4: This embodiment provides a computer-readable storage medium storing instructions. When the instructions are executed on a computer, the computer performs the agricultural product testing and management method of Embodiment 1. The computer-readable storage medium refers to a data storage medium, which may include, but is not limited to, floppy disks, optical disks, hard disks, flash memory, USB flash drives, and / or Memory Sticks. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable systems.

[0063] This embodiment also provides a computer program product that, when run on a computer, executes the agricultural product testing and management method in Embodiment 1. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable system.

[0064] Finally, it should be noted that the above description is merely a preferred embodiment 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 within the scope of protection of the present invention.

Claims

1. A method for the testing and management of agricultural products, characterized in that, include: Obtain the sampler's identity information and the sampling record information of the corresponding batch of agricultural products uploaded by the sampling terminal; The identity information of the sampler is verified. After the verification is successful, a unique sample identification code for the corresponding batch of agricultural products is generated. The sampling data verification code is calculated using the sampling record information. The sampling label QR code is generated using the sampling data verification code and the unique sample identification code. The sampling label QR code is sent to the sampling terminal, and the sampling record information is encrypted using the unique sample identification code to obtain encrypted sampling record information. The encrypted sampling record information is then associated with the unique sample identification code and saved to the database. After scanning the QR code on the sampling label at the sample preparation end, the sample preparation staff's identity information, sample preparation record information, sampling data verification code, and unique sample identification code are uploaded. The identity information of the sample preparer and the verification code of the sampling data are verified. After the verification is successful, the sample preparation data verification code is calculated using the sample preparation record information and the sampling data verification code. The sample preparation label QR code is generated using the sample preparation data verification code and the unique sample identification code. Send the sample preparation label QR code to the sample preparation terminal, and use the unique sample identification code to encrypt the sample preparation record information to obtain encrypted sample preparation record information. Save the encrypted sample preparation record information to the database and associate it with the unique sample identification code. After scanning the sample preparation label QR code at the testing terminal, the uploaded information includes the tester's identity, testing record, sample preparation data verification code, and unique sample identification code. The identity information of the tester and the sample preparation data verification code are verified. After the verification is passed, the test data verification code is calculated using the test record information and the sample preparation data verification code. The test data verification code and the unique sample identification code are used to generate a test label QR code. The detection label QR code is sent to the detection terminal, and the detection record information is encrypted using the unique sample identification code to obtain encrypted detection record information. The encrypted detection record information is then saved in the database and associated with the unique sample identification code. Obtain the auditor's identity information, audit record information, test data verification code, and unique sample identifier code uploaded after the auditing end scans the QR code on the test label; The auditor's identity information and the test data verification code are verified. After the verification is passed, the query data verification code is calculated using the audit record information and the test data verification code. The query data verification code and the unique sample identification code are used to generate the test query QR code for the corresponding batch of agricultural products. The QR code for the corresponding batch of agricultural products is pushed to the user terminal, and the audit record information is encrypted using the unique sample identification code to obtain encrypted audit record information. The encrypted audit record information is then saved in the database and associated with the unique sample identification code.

2. The method for agricultural product testing and management according to claim 1, characterized in that, The method further includes: The system receives agricultural product testing query requests sent by users after scanning the corresponding testing query QR code. The agricultural product testing query request includes a query data verification code and a unique sample identifier code. Based on the unique sample identifier, retrieve the associated encrypted sampling record information, encrypted sample preparation record information, encrypted testing record information, and encrypted review record information from the database; The encrypted sampling record information, encrypted sample preparation record information, encrypted testing record information, and encrypted review record information are decrypted using a unique sample identifier to obtain the sampling record information, sample preparation record information, testing record information, and review record information. Calculate the sampling data verification code using sampling record information; calculate the sample preparation data verification code using sample preparation record information and sampling data verification code; calculate the test data verification code using test record information and sample preparation data verification code; calculate the query data verification code using audit record information and test data verification code. The query data verification code is compared with the query data check code. If they match, the agricultural product testing report is generated using the sampling record information, sample preparation record information, testing record information, and review record information. The agricultural product testing report is sent to the user's device.

3. The method for agricultural product testing and management according to claim 2, characterized in that, The process of decrypting the encrypted sampling record information, encrypted sample preparation record information, encrypted testing record information, and encrypted review record information using a unique sample identifier code yields the sampling record information, sample preparation record information, testing record information, and review record information, including: The unique sample identifier is processed to obtain a transformed data string, and the query array is extracted from the transformed data string. The query array is hashed to obtain a hash value, and the hash value is then substituted into a pre-defined hash ring for matching to determine the position of the hash value in the hash ring. Based on the position of the hash value in the hash ring, find the node to which the hash value belongs in the hash ring in a clockwise direction, and determine the node key value corresponding to the node to which the hash value belongs; Retrieve the key associated with the node key value from the key store, and use the key to decrypt the encrypted sampling record information, encrypted sample preparation record information, encrypted testing record information, and encrypted audit record information respectively, to obtain the sampling record information, sample preparation record information, testing record information, and audit record information.

4. The method for agricultural product testing and management according to claim 3, characterized in that, The process of converting the unique sample identifier to obtain a converted data string and extracting a query array from the converted data string includes: The unique sample identifier is processed by data mapping, data shifting and / or data encoding to obtain a transformed data string; Extract a specified number of bits from the converted data string and combine them to obtain a query array.

5. The method for agricultural product testing and management according to claim 2, characterized in that, The sampling record information includes the name of the agricultural product, the category of the agricultural product, the place of origin of the agricultural product, the submitting unit, the sampling time, and the sampler's number; the sample preparation record information includes sampling operation data, sample status data, sample crushing weight, sample image summary, sample preparation time, and the sampler's number; the testing record information includes each pesticide residue component, the corresponding test value for each pesticide residue component, the testing time, and the tester's number; the review record information includes the compliance range of the test value for each pesticide residue component, the review result for each pesticide residue component, the review time, and the reviewer's number.

6. The method for agricultural product testing and management according to claim 2, characterized in that, The process of calculating a sampling data verification code using sampling record information, calculating a sample preparation data verification code using sample preparation record information and the sampling data verification code, calculating a test data verification code using test record information and the sample preparation data verification code, and calculating a query data verification code using audit record information and the test data verification code includes: The SHA-256 algorithm is used to calculate the sampled record information to obtain the sampled data verification code; The sample data verification code is combined with the sample preparation record information to obtain the sample preparation combination array, and the SHA-256 algorithm is used to calculate the sample preparation data verification code. The sample preparation data verification code is combined with the test record information to obtain the test combination array, and the SHA-256 algorithm is used to calculate the test data verification code. The verification code of the detection data is combined with the audit record information to obtain the audit combination array, and the SHA-256 algorithm is used to calculate the verification code of the query data.

7. The method for agricultural product testing and management according to claim 1, characterized in that, The verification of the sampler's identity information includes: extracting the sampler's identity token from the sampler's identity information, comparing the sampler's identity token with each preset token in the token library, and if there is a preset token in the token library that matches the sampler's identity token, the verification is successful; The verification of the sampler's identity information and the sampling data verification code includes: extracting the sampler's identity token from the sampler's identity information, comparing the sampler's identity token with each preset token in the token library, retrieving the associated encrypted sampling record information from the database according to the unique sample identifier, decrypting the encrypted sampling record information using the unique sample identifier to obtain the sampling record information, calculating the sampling data verification code using the sampling record information, comparing the sampling data verification code with the sampling data verification code, and if there is a preset token in the token library that is consistent with the sampler's identity token, and the sampling data verification code is consistent with the sampling data verification code, then the verification is successful. The verification of the inspector's identity information and the sample preparation data verification code includes: extracting the inspector's identity token from the inspector's identity information, comparing the inspector's identity token with each preset token in the token library, retrieving the associated encrypted sampling record information and encrypted sample preparation record information from the database based on the unique sample identifier, decrypting the encrypted sampling record information and encrypted sample preparation record information using the unique sample identifier to obtain the sampling record information and sample preparation record information, calculating the sampling data verification code using the sampling record information, calculating the sample preparation data verification code using the sample preparation record information and the sampling data verification code, comparing the sample preparation data verification code with the sample preparation data verification code, and if there is a preset token in the token library that is consistent with the inspector's identity token, and the sample preparation data verification code is consistent with the sample preparation data verification code, then the verification is successful; The verification of auditor identity information and test data verification code includes: extracting auditor identity token from auditor identity information, comparing the auditor identity token with each preset token in the token library, retrieving associated encrypted sampling record information, encrypted sample preparation record information, and encrypted test record information from the database based on the unique sample identifier, decrypting the encrypted sampling record information, encrypted sample preparation record information, and encrypted test record information using the unique sample identifier to obtain sampling record information, sample preparation record information, and test record information, calculating the sampling data verification code using the sampling record information, calculating the sample preparation data verification code using the sample preparation record information and the sampling data verification code, calculating the test data verification code using the test record information and the sample preparation data verification code, and comparing the test data verification code with the test data verification code. If a preset token consistent with the auditor identity token exists in the token library, and the test data verification code is consistent with the test data verification code, then the verification is successful.

8. An agricultural product testing and management system, characterized in that, It includes a data receiving unit, an information verification unit, a verification calculation unit, an information generation unit, a data sending unit, and a data storage unit, wherein: The data receiving unit is used to acquire the sampler's identity information and the sampling record information of the corresponding batch of agricultural products uploaded by the sampling end; to acquire the sampler's identity information, sample preparation record information, sampling data verification code and unique sample identification code uploaded by the sample preparation end after scanning the sampling label QR code; to acquire the tester's identity information, test record information, sample preparation data verification code and unique sample identification code uploaded by the testing end after scanning the sample preparation label QR code; and to acquire the reviewer's identity information, review record information, test data verification code and unique sample identification code uploaded by the review end after scanning the test label QR code. The information verification unit is used to verify the identity information of the sampler, the identity information of the sampler and the verification code of the sampling data, the identity information of the tester and the verification code of the sampler and the verification code of the test data; The verification calculation unit is used to calculate the sample data verification code using the sampling record information, to calculate the sample preparation data verification code using the sample preparation record information and the sample data verification code, to calculate the test data verification code using the test record information and the sample preparation data verification code, and to calculate the query data verification code using the audit record information and the test data verification code. The information generation unit is used to generate sampling label QR codes using sampling data verification codes and unique sample identification codes, to generate sample preparation label QR codes using sample preparation data verification codes and unique sample identification codes, to generate test label QR codes using test data verification codes and unique sample identification codes, and to generate test query QR codes for the corresponding batch of agricultural products using query data verification codes and unique sample identification codes. The data sending unit is used to send the sampling label QR code to the sampling end, the sample preparation label QR code to the sample preparation end, the test label QR code to the test end, and push the test query QR code of the corresponding batch of agricultural products to the user end; The data storage unit is used to encrypt sampling record information using a unique sample identifier to obtain encrypted sampling record information, associate the encrypted sampling record information with the unique sample identifier, and save it to the database; to encrypt sample preparation record information using the unique sample identifier to obtain encrypted sample preparation record information, save the encrypted sample preparation record information to the database and associate it with the unique sample identifier; to encrypt detection record information using the unique sample identifier to obtain encrypted detection record information, save the encrypted detection record information to the database and associate it with the unique sample identifier; and to encrypt audit record information using the unique sample identifier to obtain encrypted audit record information, save the encrypted audit record information to the database and associate it with the unique sample identifier.

9. An agricultural product testing and management system, characterized in that, include: Memory, used to store instructions; A processor is configured to read instructions stored in the memory and execute the agricultural product testing and management method according to any one of claims 1-7.

10. A computer program product, characterized in that, When the computer program product is run on a computer, it executes the agricultural product testing and management method according to any one of claims 1-7.