A method for tracing agricultural and livestock product information based on SM9 and blockchain

Through SM9 algorithm and blockchain technology, the problems of low efficiency and unreliable information of traditional agricultural and animal product traceability methods have been solved, and efficient and reliable traceability of agricultural and animal product information and dealer credit evaluation have been achieved, which has improved the transparency of the supply chain and trust.

CN118096182BActive Publication Date: 2024-11-05XI CANG WEI DUN SHU JU YOU XIAN GONG SI
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202311720737.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-13
Publication Date
2024-11-05
Estimated Expiration
2043-12-13

AI Technical Summary

Technical Problem

Traditional agricultural and livestock product traceability methods are inefficient and cannot guarantee the authenticity of information. They cannot clearly verify the operating rights and credit status of dealers, which affects the transparency and trust of the supply chain.

Method used

Using the SM9 algorithm and blockchain technology, agricultural and animal products information traceability method can ensure dealer identity authentication and credit evaluation to realize agricultural and animal products through certificate application and issuance, smart contract verification, digital signature and public key decryption and other steps. Efficient and reliable traceability of information.

Benefits of technology

It improves the transparency and traceability of the supply chain, ensures the non-debtability of dealer identity authentication and the accuracy of credit assessment, and enhances consumers and regulatory authorities' understanding of the quality and circulation of agricultural and livestock products.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118096182B_ABST
    Figure CN118096182B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of computer science, and more specifically to a method for tracing the information of agricultural and livestock products based on SM9 and blockchain. The main purpose is to solve the transparency and traceability problems of the supply chain. The main solution includes dealers submitting information to the agricultural and livestock product certificate issuance platform to apply for a certificate, which is obtained after verification by the platform. Subsequently, the dealer uploads the certificate, private key signature and agricultural and livestock product information to the blockchain through the upload interface. During the upload, the smart contract is verified based on credit, including the verification of certificates, signatures, business scope and production information, and the credit of the dealer is increased or decreased accordingly, and it is decided whether to store the information. Consumers or regulatory authorities can upload product names or scan QR codes or barcodes at the application layer, obtain traceability information through the traceability interface, and display the credit status of dealers in the supply chain.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer science, and more specifically to an agricultural and livestock product information traceability method based on SM9 and blockchain. Background Art

[0002] Consumers are increasingly concerned about the origins of the agricultural and livestock products they consume, including all stages of production, processing and distribution. Tracking and authenticating the food supply chain to understand the origin is essential to identifying and addressing counterfeit and substandard agricultural and livestock products in the food supply chain.

[0003] Traditional methods of tracing the origin of agricultural and livestock products are inefficient, and most of them do not adopt anti-tampering mechanisms, which cannot guarantee the authenticity and reliability of traceability information. The application of blockchain technology in tracing the supply chain of agricultural and livestock products provides significant advantages, mainly reflected in its ability to ensure that data cannot be tampered with and is highly secure, and to improve the transparency and traceability of the entire supply chain. Once the records of each link are uploaded to the chain, it is almost impossible to be changed, providing complete and reliable information for all participants. In addition, blockchain improves operational efficiency and reduces management and operating costs through automated processes, such as smart contracts. These features together improve the overall efficiency of the supply chain and increase consumer trust in the origin and quality of products.

[0004] However, using blockchain technology alone, consumers or agricultural and livestock product quality supervision departments cannot clearly know whether the dealer who uploaded the data to the blockchain has the agricultural and livestock product business rights recorded on the blockchain and the dealer's credit status. When a dealer uploads a certificate with authoritative certification, since the certificate contains the specific types of agricultural and livestock products that the dealer can operate and the corresponding unique identifier, it can clearly let consumers or relevant department personnel understand the types of agricultural and livestock products operated by the dealer. By executing a credit-based smart contract, dealers can perform credit assessments from the first time they upload data.

[0005] The SM9 algorithm is a cryptographic algorithm based on user identification issued by the State Cryptography Administration. In 2008, the identification cryptographic algorithm was officially awarded the commercial cryptographic algorithm model: SM9 (Commercial Cryptographic Algorithm No. 9) by the State Cryptography Administration, laying a solid foundation for the application of identification cryptographic technology in my country. Traditional PKI uses classic public key cryptographic algorithms such as RSA / ECDSA. Each user has a pair of keys, one of which is a public key that can be publicly released to others, and the other is a private key that is only kept by the user and cannot be made public. The public key is often a bunch of garbled characters. The public key generated based on SM9 can be one of the dealer company registration number, the company's tax identification number, and the company's official website address. It is strongly bound to the dealer's identity information, further strengthening the dealer's non-repudiation.

[0006] In the certificate application and issuance process of the agricultural and livestock product quality traceability system based on SM9 and blockchain, the generation of public and private key pairs is based on the SM9 cryptographic algorithm.

[0007] Out of consideration for the quality and safety of agricultural and livestock products, we proposed an agricultural and livestock product information traceability system based on SM9 and blockchain, aiming to efficiently obtain real information on the agricultural and livestock product supply chain based on blockchain technology; implement credit-based smart contracts to verify the legality of the dealer's agricultural and livestock product business scope and update their credit; achieve strong identity authentication of the block uploader and the certificate through the dealer's public key on the certificate; consumers and relevant department personnel can clearly understand the quality and circulation of agricultural and livestock products. Summary of the invention

[0008] The purpose of this invention is to effectively solve the quality and safety problems of agricultural and livestock products through blockchain technology and SM9 algorithm, improve the transparency and traceability of the supply chain, and also provide a new solution for dealer identity authentication and credit assessment.

[0009] In order to achieve the above purpose, the present invention adopts the following technical means:

[0010] The present invention provides an agricultural and livestock product information traceability method based on SM9 and blockchain, which specifically includes the following steps:

[0011] Step 1: The dealer submits information to apply for a certificate to the Agricultural and Livestock Product Certificate Issuing Platform. The Agricultural and Livestock Product Certificate Issuing Platform verifies the information submitted by the dealer and then issues the certificate;

[0012] Step 2: Upload information to the blockchain through the upload interface. The uploaded information includes the upload certificate, the signature of the private key generated based on the SM9 encryption algorithm, and information related to agricultural and livestock products;

[0013] Step 3: When the dealer uploads information, a credit-based smart contract is triggered to verify the certificate, the dealer’s digital signature, the business scope of agricultural and livestock products specified in the certificate, and the production information. The dealer’s credit is increased or decreased and the uploaded information is stored or not based on the verification results.

[0014] Step 4: Consumers or relevant agricultural and livestock product quality supervision departments upload the names of agricultural and livestock products or scan the QR codes or barcodes of agricultural and livestock products at the application layer, trace the information through the traceability interface, print the traceability results and display the credit information of dealers in the supply chain.

[0015] In the above technical solution, the process of step 1 certificate application is specifically as follows:

[0016] The agricultural and livestock product certificate issuance platform is responsible for verifying the dealer's business information and issuing certificates;

[0017] The certificate application created by the dealer to the agricultural and livestock product certificate issuance platform should include the agricultural and livestock product dealer company information, the scope of agricultural and livestock products operated, and the dealer's public key based on the SM9 algorithm;

[0018] The scope of agricultural and livestock products handled by the dealer includes information related to the specific agricultural and livestock products handled;

[0019] The public key generated based on SM9 should be a public key that strongly identifies the dealer's identity, including the company registration number, the company's tax identification number, and the company's official website address.

[0020] In the above technical solution, the certificate issued by the agricultural and livestock product certificate issuance platform includes:

[0021] After the agricultural and livestock product certificate issuance platform verifies the dealer’s identity, the certificate issued contains the specific names of all agricultural and livestock products handled by the dealer and the corresponding unique identifiers;

[0022] The unique identification ID assigned to the dealer by the agricultural and livestock product certificate issuance platform;

[0023] The issued certificate contains the dealer's company information and the SM9 public key uploaded by the dealer;

[0024] The issued certificate contains a digital signature signed by the Agricultural and Livestock Products Certificate Issuing Platform using a private key.

[0025] In the above technical solution, the agricultural and livestock product related information described in step 2 should include the following information: production information of agricultural and livestock products, and transaction information of agricultural and livestock products.

[0026] In the above technical solution, the production information of agricultural and livestock products uploaded by the dealer should include the following information:

[0027] Production location: exact geographical location, including province, city, district, county, township;

[0028] Production date and shelf life: specific production date and expiration date;

[0029] Production processes and technologies: agricultural techniques used, planting or breeding methods, pesticide use, types of machinery or tools used;

[0030] Quality of inputs: type, quantity and source of inputs such as seeds, feeds, fertilizers, and food additives;

[0031] Environmental information: climate conditions, soil type, water resources, etc. at the production site;

[0032] Processing methods and techniques: the processing techniques, equipment and processes used;

[0033] Safety and quality control measures: Quality testing, safety standards and control procedures implemented;

[0034] Packaging details: product packaging method, materials and labeling information.

[0035] In the above technical solution, the transaction information of agricultural and livestock products uploaded by the dealer should include:

[0036] Information about both parties to the transaction: the name, unique identifier and address of the buyer and seller;

[0037] Transaction date and time: the specific date and time when the transaction occurred;

[0038] Details of agricultural and livestock products: type, quantity, price and unique identification of agricultural and livestock products;

[0039] Transportation information: product transportation method, route, and arrival time;

[0040] Payment and settlement details: The payment method, payment terms and settlement details of the transaction.

[0041] In the above technical solution, in order to solve the problem of vague credit assessment of dealers and lack of direct and clear authoritative certification of the legal business rights of agricultural and livestock products in the blockchain, by executing a credit-based smart contract including certificate verification, the purpose of incentivizing dealers to upload honest information and making the legal business scope of agricultural and livestock products of dealers clear is achieved. The credit-based smart contract in step 3 is specifically as follows:

[0042] Step a: If the dealer uploads information to the blockchain for the first time, initialize the dealer's credit C k , k represents the unique identification ID assigned to the dealer by the agricultural and livestock product certificate issuance platform; otherwise, skip this step;

[0043] Step b: Use the SM9 public key published by the certificate issuing platform to verify the legitimacy of the certificate, and use the SM9 public key published by the certificate issuing platform to decrypt the certificate to obtain the plain text content of the certificate. If the certificate is decrypted correctly, then Cer k =1; otherwise, the smart contract execution fails and returns the dealer error information, including: "Certificate verification error, Cer k =-1, credit points decreased, C k =C k -1", where Cer k The credit score obtained by the dealer during the certificate verification during this round of upload;

[0044] Step c: Use the plain text content on the certificate obtained in step b to obtain the public key generated by the dealer based on SM9, decrypt the dealer's digital signature to obtain k'. The unique identifier id assigned to the dealer by the certificate issuing platform contained in the certificate is k. If the prefix of k is exactly the same as k, then DealerSig k =1; otherwise, the smart contract execution fails and returns the dealer error information, which includes: "Digital signature verification failed, DealerSig = -1, credit points reduced, C k =C k -1", where DealerSig k The credit score obtained by the dealer through digital signature verification during this round of uploading;

[0045] Verify the business scope of agricultural and livestock products specified in the certificate. The agricultural and livestock products included in the uploaded production information and transaction information of agricultural and livestock products are where a i is the unique ID of the corresponding agricultural and livestock products, m is the number of agricultural and livestock products contained in the production information and transaction information, Among them B k is the set of unique IDs of all agricultural and livestock products specified on the certificate, i is the unique identifier of the agricultural and livestock products specified on the certificate, and n is the total number of agricultural and livestock products specified on the certificate;

[0046]

[0047] The meaning of this formula is to determine whether all a i Included in B k In Sco k =1 indicates that the agricultural and livestock products included in the uploaded production information and transaction information are within the legal business scope of the dealer; otherwise, the smart contract execution fails and returns the dealer an error message: "The business scope verification of agricultural and livestock products failed. Sco k =-1, credit points decreased, C k =C k -1”, where Sco k The credit score obtained by the dealer during the verification of the business scope of agricultural and livestock products in this round of uploading;

[0048] The verification of production information includes: whether the agricultural and livestock products are within the shelf life, whether the pesticide use exceeds the standard, whether the planting and breeding environment is polluted, days = currentDay - productionDay, where currentDay is the current system time, productionDay is the production date, and days is the time since the production date. If days < shelfLife, then the agricultural and livestock products are within the shelf life, where shelfLife is the shelf life in the production information;

[0049] pes j represents the dosage of a specific pesticide, area i represents the application area of this pesticide, in square kilometers, T j represents the industry-recommended pesticide use threshold. If indicates that the pesticide use of the agricultural and livestock products meets the standard;

[0050] The evaluation recommendations for the planting and breeding environment are divided into excellent, good, average, poor, and extremely poor, which are set to 5, 4, 3, 2, and 1 respectively. If the environmental evaluation is at or above average, that is, the environmental score e ≥ 3, the verification of the planting and breeding environment passes.

[0051] If all verifications pass, then the verification of the production information passes, P k = 1, where P k is the score obtained from the verification of the production information; otherwise, the smart contract execution fails and returns the dealer error message: "The verification of the production information fails, P k = -1, the credit points are reduced, C k = C k - 1";

[0052] After the verification of the certificate, the identity verification of the dealer's digital signature, the verification of the scope of business of the agricultural and livestock products stipulated in the certificate, and the verification of the production information are completed, update the dealer's credit:

[0053] C k = C k +(Cer k ∩DealerSig k ∩Sco k ∩P k )

[0054] The information uploaded by the dealer passes, and the smart contract based on credit is executed.

[0055] In the above technical solution, consumers or relevant agricultural and livestock product quality supervision departments use the system for traceability. Specifically:

[0056] Consumers or relevant agricultural and livestock product quality supervision departments upload the names of agricultural and livestock products at the application layer or scan the QR code or barcode of agricultural and livestock products. The traceability interface locates the block corresponding to the agricultural and livestock products, and traces back to the previous block through the hash pointer of the current block until the source of the agricultural and livestock product supply chain. By printing the dealer information, dealer credit, production information, and transaction information on the agricultural and livestock product supply chain, consumers or relevant agricultural and livestock product quality supervision departments can evaluate the food quality based on the traceability information results on the supply chain and the dealer's credit points through the above information.

[0057] The beneficial effects of the present invention are as follows:

[0058] 1. This agricultural and livestock product information traceability system introduces certificates and digital signatures based on the SM9 cryptographic algorithm, which further strengthens the identity authentication of dealers in the supply chain during the information upload process, ensuring the dealer's non-repudiation. At the same time, the business scope of agricultural and livestock products specified in the certificate also provides a basis for consumers and relevant agricultural and livestock product quality supervision departments to confirm the legality of their agricultural and livestock product operations;

[0059] 2. The use of blockchain technology for agricultural and livestock product quality traceability ensures data tamper-proof and integrity, thereby ensuring the authenticity and reliability of traceability;

[0060] 3. When dealers upload information to the blockchain, a credit-based smart contract is triggered. The dealers’ credit points are increased or decreased through verification results, which encourages dealers to upload honest and credible information. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] Figure 1 It is a flow chart of the agricultural and livestock product information traceability system based on SM9 and blockchain of the present invention;

[0062] Figure 2 This is a schematic diagram of the agricultural and livestock product information traceability system architecture based on SM9 and blockchain in the present invention;

[0063] Figure 3 This is a certificate application flow chart based on the SM9 cryptographic algorithm;

[0064] Figure 4 It is the execution flow chart of a credit-based smart contract;

[0065] Figure 5 This is a flowchart for the use of the agricultural and livestock product information traceability system based on SM9 and blockchain. DETAILED DESCRIPTION

[0066] In order to make the objectives, technical solutions and advantages of the present invention more clear, the present invention is further described below in conjunction with the accompanying drawings and implementation examples.

[0067] Example 1

[0068] This example provides a flow chart of the agricultural and livestock product quality traceability system based on SM9 and blockchain. Figure 1 As shown, the specific steps include:

[0069] Step 101: The dealer submits company information, a public key generated based on the SM9 encryption algorithm, and the agricultural and livestock product business scope, and applies for a certificate from the agricultural and livestock product certificate issuance platform. After the agricultural and livestock product certificate issuance platform verifies the relevant information submitted by the dealer, it issues a certificate to the dealer.

[0070] Step 102: The dealer uploads the certificate, the digital signature of the private key generated based on the SM9 encryption algorithm, the agricultural and livestock product production information, and the transaction information to the blockchain through the upload interface of the application layer of the traceability system.

[0071] Step 103: During the process of uploading information, the credit-based smart contract is executed. The contract needs to verify the certificate, the digital signature of the dealer, the business scope of agricultural and livestock products specified in the certificate, and the production information. If all the verifications are passed, the contract is successfully executed, the dealer's credit points are increased, and the data is written to a new block; if the verification fails, the dealer's credit points are reduced, and the dealer's error information is returned.

[0072] Step 104: The consumer or the relevant agricultural and livestock product quality supervision department calls the traceability interface by inputting the name of the agricultural and livestock product in the application layer or scanning the QR code or barcode through a mobile device, traces the information on the corresponding supply chain through the traceability interface, prints the traceability results and displays the credit information of the distributors in the supply chain.

[0073] Example 2

[0074] This example provides a schematic diagram of the agricultural and livestock product information traceability system architecture based on SM9 and blockchain. Figure 2 As shown, the details are as follows:

[0075] Step 201: In order to ensure the legitimacy of the certificate, the government or relevant departments should provide an agricultural and livestock product certificate issuance platform to be responsible for verifying the dealer's business information and issuing certificates.

[0076] Step 202: The system is mainly divided into four layers, namely, storage layer, service layer, interface layer and application layer.

[0077] Step 203: The storage layer includes the CouchDB database, operating system, smart contract and corresponding hardware storage resources attached to the blockchain. According to performance and cost, choose on demand: mechanical hard disk (HDD), solid state drive (SSD), hybrid hard disk (SSHDD), enterprise-level hard disk; Linux is the preferred operating system for many blockchain platforms, with the advantages of open source, stability, security and service orientation; the credit-based smart contract deployed on it implements source code or executable files; CouchDB is selected as the blockchain database. The design concept of CouchDB emphasizes distribution, fault tolerance, simplicity and flexibility, and has great advantages in processing large amounts of heterogeneous data, high availability and horizontal expansion capabilities.

[0078] Step 204: The service layer includes identity authentication based on SM9 encryption algorithm certificates, credit-based smart contracts, and traceability services for agricultural and livestock products;

[0079] Step 205: The interface layer includes an upload interface and a traceability interface. The dealer uploads the agricultural and livestock product related information through the upload interface. The consumer or the relevant agricultural and livestock product quality supervision department calls the traceability interface. The traceability interface calls the traceability service of the service layer and prints the traceability result.

[0080] Step 206: The application layer provides business functions corresponding to different users of the platform, including: uploading of agricultural and livestock product information, certificates, and digital signatures by dealers, and tracing of agricultural and livestock product information by consumers or relevant agricultural and livestock product quality supervision departments.

[0081] Example 3

[0082] like Figure 3 As shown, this embodiment provides a certificate application flow chart based on the SM9 cryptographic algorithm as follows, including:

[0083] Step 301: The dealer selects one of the company registration number, the company's tax identification number, and the company's official website address as its public key, generates a private key based on the SM9 encryption algorithm in a local computer environment, and obtains a public-private key pair based on the SM9 encryption algorithm;

[0084] Step 302: The dealer creates a certificate application to the agricultural and livestock product certificate issuance platform, which includes the agricultural and livestock product dealer company information, the scope of agricultural and livestock product business, and the public key information generated based on SM9;

[0085] Step 303: The agricultural and livestock product certificate issuance platform verifies the identity and information of the certificate requester through online and offline methods, and issues a certificate to the agricultural and livestock product distributor after confirming the authenticity of the identity and information;

[0086] Step 304: The dealer uses the public key decryption certificate published by the agricultural and livestock product certificate issuance platform to obtain the certificate information using the decryption algorithm in the SM9 encryption algorithm. The certificate includes:

[0087] The unique identifier assigned to the dealer by the certificate issuing platform;

[0088] Distributor's company information;

[0089] The specific names of all agricultural and livestock products handled by the dealer and their corresponding unique identifiers;

[0090] The public key generated based on the SM9 encryption algorithm uploaded by the dealer;

[0091] Example 4

[0092] like Figure 4 As shown, the execution flow chart of the credit-based smart contract provided by this embodiment is as follows, specifically:

[0093] Step 401: C k Indicates the dealer's credit, which can be accumulated. C k The higher the value, the better the credit. k represents the unique ID assigned to the dealer by the agricultural and livestock product certificate issuance platform. If the dealer uploads information to the blockchain for the first time, the dealer’s credit C is initialized. k ; Otherwise, skip this step;

[0094] Step 402: Cer k Indicates the credit score obtained by the dealer during the certificate verification in this round of upload. Use the public key based on the SM9 encryption algorithm published by the certificate issuance platform to decrypt the certificate to obtain the certificate information. If the certificate is decrypted correctly, then Cer k =1; otherwise, the smart contract execution fails and returns the dealer error information, including: "Certificate verification error, Cer k =-1, credit points decreased, C k =C k -1".

[0095] Step 403: DealerSig k Indicates the credit score obtained by the dealer in the digital signature verification process during this round of uploading. Use the dealer's public key on the decryption certificate obtained in the previous step to decrypt the dealer's digital signature to get k. The unique identifier id assigned to the dealer by the agricultural and livestock product certificate issuance platform contained in the certificate is k. If the prefix of k is exactly the same as k, then DealerSi g k =1; otherwise, the smart contract execution fails and returns the dealer error information, including: "Digital signature verification failed, DealerSig = -1, credit points reduced, C k =C k -1".

[0096] Step 404: Sco k Represents the credit score obtained from the verification of the business scope of agricultural and livestock products during the current round of upload by the dealer. Represents the agricultural and livestock products included in the production and transaction information uploaded by the dealer, where a i Is the unique identification id of the corresponding agricultural and livestock product, and m is the quantity of agricultural and livestock products included in the production information and transaction information. Among them, B k Is the set of all unique identifications of agricultural and livestock products specified in the certificate, b i Is the unique identification id of the agricultural and livestock product specified in the certificate, and n is the total quantity of agricultural and livestock products specified in the certificate.. Sco k The specific calculation process of Sco is as follows:

[0097]

[0098] The meaning of the above公示 is to determine whether all a i Are included in B k . Sco k = 1 indicates that the agricultural and livestock products included in the uploaded production and transaction information are within the legal business scope of the dealer; otherwise, the smart contract execution fails, and the dealer error message is returned: "The verification of the business scope of agricultural and livestock products fails, Sco k = -1, the credit points are reduced, C k = C k - 1".

[0099] Step 405: P k Represents the score obtained from the verification of production information. The verification of production information includes: verification of the shelf life of agricultural and livestock products, verification of the reasonable use of pesticides, and verification of the planting and breeding environment conditions.

[0100] For the verification of the shelf life of agricultural and livestock products, days = currentDay - productionDay, where currentDay is the current system time, productionDay is the production date, and days is the time since the production date. If days < shelfLife, the agricultural and livestock products are within the shelf life, where shelfLife is the shelf life in the production information;

[0101] For the verification of the reasonable use of pesticides, pes i Represents the dosage of a specific pesticide, area i Represents the area of use of this pesticide, in square kilometers, T i Represents the pesticide use threshold recommended by the industry. If Indicates that the pesticide use of agricultural and livestock products meets the standard;

[0102] For the verification of planting and breeding environment conditions, the planting and breeding environment assessment is recommended to be divided into excellent, good, general, poor, and extremely poor, with corresponding settings of 5, 4, 3, 2, and 1. If the environment assessment is general or above, that is, the environment score e≥3, the planting and breeding environment verification passes.

[0103] If all verifications are passed, the verification of production information is passed, P k =1; otherwise, the smart contract execution fails and returns the dealer an error message: "Production information verification failed, P k =-1, credit points decreased, C k =C k -1”;

[0104] Step 406: After the verification of the certificate, the identity verification of the dealer's digital signature, the verification of the agricultural and livestock product business scope specified in the certificate, and the verification of the production information are completed, the dealer's credit is updated:

[0105] C k =C k +(Cer k ∩DealerSig k ∩Sco k ∩P k )

[0106] The information uploaded by the dealer is processed through credit-based smart contract.

[0107] Example 5

[0108] like Figure 5 As shown, the flowchart of the agricultural and livestock product information traceability system based on SM9 and blockchain in this embodiment is as follows:

[0109] Step 501: Consumers or relevant agricultural and livestock product quality supervision departments use scanning devices including but not limited to smart phones, tablet computers, and RFID scanning terminals to scan agricultural and livestock product QR codes or bar codes, or input agricultural and livestock product names in the system application layer.

[0110] Step 502: Call the traceability interface, which locates the block corresponding to the agricultural and livestock products, and traces back to the previous block through the hash pointer of the current block until the source of the agricultural and livestock products supply chain.

[0111] Step 503: Print the dealer information, dealer credit points, agricultural and livestock product production information and transaction information in the agricultural and livestock product supply chain.

[0112] Step 504: Consumers or relevant agricultural and livestock product quality supervision departments can use the above information to evaluate food quality based on the traceability information results on the supply chain and the credit points of the distributors. The higher the credit points of the distributors, the higher the public trust.

[0113] The above description is only 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 and improvements made by any technician familiar with the field within the spirit and principle of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for tracing agricultural and livestock product information based on SM9 and blockchain, characterized in that: The specific steps include: Step 1: The dealer submits information to apply for a certificate to the Agricultural and Livestock Product Certificate Issuing Platform. The Agricultural and Livestock Product Certificate Issuing Platform verifies the information submitted by the dealer and then issues the certificate; Step 2: Upload information to the blockchain through the upload interface. The uploaded information includes the upload certificate, the signature of the private key generated based on the SM9 encryption algorithm, and information related to agricultural and livestock products; Step 3: When the dealer uploads information, a credit-based smart contract is triggered to verify the certificate, the dealer’s digital signature, the business scope of agricultural and livestock products specified in the certificate, and the production information. The dealer’s credit is increased or decreased and the uploaded information is stored or not based on the verification results. Step 4: Consumers or relevant agricultural and livestock product quality supervision departments upload the names of agricultural and livestock products or scan the QR codes or barcodes of agricultural and livestock products on the application layer, trace the information through the traceability interface, print the traceability results and display the credit information of the distributors in the supply chain; Step 1: The certificate application process is as follows: The agricultural and livestock product certificate issuance platform is responsible for verifying the dealer's business information and issuing certificates; The certificate application created by the dealer to the agricultural and livestock product certificate issuance platform should include the agricultural and livestock product dealer company information, the scope of agricultural and livestock products operated, and the dealer's public key based on the SM9 algorithm; The scope of agricultural and livestock products handled by the dealer includes information related to the specific agricultural and livestock products handled; The public key generated based on SM9 should be a public key that strongly identifies the dealer's identity, including the company registration number, the company's tax identification number, and the company's official website address; The certificates issued by the Agricultural and Livestock Products Certificate Issuance Platform include: After the agricultural and livestock product certificate issuance platform verifies the dealer’s identity, the certificate issued contains the specific names of all agricultural and livestock products handled by the dealer and the corresponding unique identifiers; The unique identification ID assigned to the dealer by the agricultural and livestock product certificate issuance platform; The issued certificate contains the dealer's company information and the SM9 public key uploaded by the dealer; The issued certificate contains a digital signature signed by the Agricultural and Livestock Product Certificate Issuing Platform using a private key; The credit-based smart contract in step 3 is as follows: Step a: If the dealer uploads information to the blockchain for the first time, initialize the dealer’s credit , k represents the unique identification ID assigned to the dealer by the agricultural and livestock product certificate issuance platform; otherwise, skip this step; Step b: Use the SM9 public key published by the certificate issuing platform to verify the legitimacy of the certificate, and use the SM9 public key published by the certificate issuing platform to decrypt the certificate to obtain the plain text content of the certificate. If the certificate is decrypted correctly, then ; Otherwise, the smart contract execution fails and returns the dealer error information, including: "Certificate verification error, , credit points reduced, ",in The credit score obtained by the dealer during the certificate verification during this round of upload; Step c: Use the plain text content on the certificate obtained in step b to obtain the public key generated by the dealer based on SM9, and decrypt the dealer's digital signature to obtain The unique ID assigned by the certificate issuing platform to the dealer is ,like The prefix of Exactly the same, then Otherwise, the smart contract execution fails and returns the dealer error information, which includes: "Digital signature verification failed, , credit points reduced, ",in The credit score obtained by the dealer through digital signature verification during this round of uploading; Verify the business scope of agricultural and livestock products specified in the certificate. The agricultural and livestock products included in the uploaded production information and transaction information of agricultural and livestock products are ,in is the unique ID of the corresponding agricultural and livestock products. is the quantity of agricultural and livestock products included in production information and transaction information. ,in It is a collection of unique IDs of all agricultural and livestock products specified on the certificate. It is the unique ID of agricultural and livestock products specified on the certificate. It is the total quantity of agricultural and livestock products specified on the certificate; , The meaning of this formula is to determine whether all Included in middle, Indicates that the agricultural and livestock products contained in the uploaded production information and transaction information are within the legal business scope of the dealer; otherwise, the smart contract execution fails and returns the dealer an error message: "Verification of the business scope of agricultural and livestock products failed. , credit points reduced, ",in The credit score obtained by the dealer during the verification of the business scope of agricultural and livestock products in this round of uploading; The verification of production information includes: whether agricultural and livestock products are within the shelf life, whether the use of pesticides exceeds the standard, whether the planting and breeding environment is polluted, ,in is the current system time, is the production date, is the time from the production date, if , then the agricultural and livestock products are within the shelf life, among which The shelf life in the production information; Represents the amount of a specific pesticide used. Represents the area where the pesticide is used, in square kilometers. Represents the pesticide use threshold recommended by the industry if =1, indicating that the use of pesticides in agricultural and livestock products meets the standards; The recommended evaluation of the planting and breeding environment is divided into excellent, good, general, poor, and extremely poor, which are set to 5, 4, 3, 2, and 1 respectively. If the environmental evaluation is general or above, the environmental score is , the planting and breeding environment verification has been passed, If all verifications are passed, the verification of production information is passed. ,in The score obtained by production information verification; otherwise, the smart contract execution fails and returns the dealer an error message: "Production information verification failed, , credit points reduced, ”; After the verification of the certificate, the identity verification of the dealer's digital signature, the verification of the agricultural and livestock product business scope specified in the certificate, and the verification of production information are completed, the dealer's credit is updated: The information uploaded by the dealer is processed through credit-based smart contract.

2. According to claim 1, a method for tracing the source of agricultural and livestock product information based on SM9 and blockchain, characterized in that: The agricultural and livestock product related information described in step 2 should include the following information: agricultural and livestock product production information, agricultural and livestock product transaction information.

3. According to claim 2, a method for tracing agricultural and livestock product information based on SM9 and blockchain, characterized in that: The production information of agricultural and livestock products uploaded by the distributors shall include the following information: Production location: exact geographical location, including province, city, district, county, township; Production date and shelf life: specific production date and expiration date; Production processes and technologies: agricultural techniques used, planting or breeding methods, pesticide use, types of machinery or tools used; Quality of inputs: type, quantity and source of inputs such as seeds, feeds, fertilizers, and food additives; Environmental information: climate conditions, soil type, water resources, etc. at the production site; Processing methods and techniques: the processing techniques, equipment and processes used; Safety and quality control measures: Quality testing, safety standards and control procedures implemented; Packaging details: product packaging method, materials and labeling information.

4. According to claim 3, a method for tracing agricultural and livestock product information based on SM9 and blockchain is characterized in that: The transaction information of agricultural and livestock products uploaded by the dealers shall include: Information about both parties to the transaction: the name, unique identifier and address of the buyer and seller; Transaction date and time: the specific date and time when the transaction occurred; Details of agricultural and livestock products: type, quantity, price and unique identification of agricultural and livestock products; Transportation information: product transportation method, route, and arrival time; Payment and settlement details: The payment method, payment terms and settlement details of the transaction.

5. According to claim 1, a method for tracing agricultural and livestock product information based on SM9 and blockchain, characterized in that: Consumers or relevant agricultural and livestock product quality supervision departments use the system for traceability, specifically: Consumers or relevant agricultural and livestock product quality supervision departments upload the names of agricultural and livestock products at the application layer or scan the QR code or barcode of agricultural and livestock products. The traceability interface locates the block corresponding to the agricultural and livestock products, and traces back to the previous block through the hash pointer of the current block until the source of the agricultural and livestock product supply chain. By printing the dealer information, dealer credit, production information, and transaction information on the agricultural and livestock product supply chain, consumers or relevant agricultural and livestock product quality supervision departments use the above information to evaluate food quality based on the traceability information results on the supply chain and the dealer's credit points.

Citation Information

Patent Citations

  • Method for terminal to apply for certificate

    CN101188616A

  • Grain security source-tracing and motivating method and system based on block chain

    CN108694584A

  • Agricultural product traceability system based on block chain

    CN110163628A

  • Traceability code generation method and device based on block chain

    CN112508587A

  • Block chain-based power grid identity authentication method and device, medium and equipment

    CN112839041A