Information verification method for food safety traceability

By obtaining and analyzing food processing data and blockchain hash values ​​in the food safety traceability system, filtering out tampered data and verifying it, the problem that existing systems cannot accurately identify data tampering is solved, and the accuracy of information verification is improved.

CN120069905AActive Publication Date: 2025-05-30国品优选(北京)品牌管理有限公司
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510525321.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-25
Publication Date
2025-05-30
Estimated Expiration
2045-04-25

AI Technical Summary

Technical Problem

When checking data, the existing food safety traceability system cannot accurately identify whether some data tampering exists, resulting in inaccurate information verification results.

Method used

By obtaining the food processing data before and after food transportation and the hash value of each link blockchain, dividing hash groups and calculating the rate of submission and ratio, screening out the tampered data after food transportation, and verifying the food processing data.

Benefits of technology

It improves the accuracy of the verification results of food safety traceability information and can accurately identify whether food data has been tampered with.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120069905A_ABST
    Figure CN120069905A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of data analysis, in particular to a food safety traceability information verification method, which comprises the following steps of: according to a change rate difference condition between hash groups in adjacent link block chains, obtaining all changed hash groups of each link block chain; screening according to the intersection-to-union ratio of each change hash group of each link block chain and the difference between the hash change descending sequence and the maximum hash change sequence of each link block chain before and after food transportation, and obtaining tampered food data after food transportation; and verifying the food processing data after food transportation based on the tampered food data after food transportation. According to the invention, the accuracy of the information verification result of food safety traceability is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data analysis, and particularly relates to a method for information verification of food safety traceability. Background Art

[0002] The food safety traceability system uses automatic identification technology and IT technology to monitor and record information on food in key links such as planting, processing, packaging, inspection, transportation, etc., and presents it to consumers in real time. The data of each link will be uploaded to the blockchain in real time, and each node records this information to generate a "block", and links it with the previous block to form a chain, forming an immutable historical record; when performing data verification, each block is encrypted through a hash algorithm to ensure that the data in the blockchain cannot be changed. If the block data is tampered with, the hash value will change, resulting in the breakage of the chain, which can be immediately detected. However, with the development of computer technology, it is possible for tamperers to tamper with a part of the data, and then the hash value of the block remains unchanged, thus causing the inability to accurately identify whether it has been tampered with during information verification. Summary of the Invention

[0003] To solve the above problems, the present invention provides a method for information verification of food safety traceability, and the method includes: Obtain the food processing data before and after food transportation; the food processing data before and after food transportation includes all types of food data in the blockchain of several links; Obtain the hash value of each link blockchain; divide the hash value of each link blockchain into several hash groups; obtain the intersection-union ratio of each hash group according to the change situation of the hash value character type between the hash groups in adjacent link blockchains; obtain the change rate of each hash group according to the change situation of the elements at different positions of the hash values between the hash groups in adjacent link blockchains; obtain all the changed hash groups of each link blockchain according to the difference situation of the change rates between the hash groups in adjacent link blockchains; Obtain the descending hash change sequence and the maximum hash change sequence of each link blockchain before and after food transportation; perform screening according to the intersection-union ratio of each changed hash group of each link blockchain and the difference situation between the descending hash change sequence and the maximum hash change sequence of each link blockchain before and after food transportation to obtain the tampered food data after food transportation; Verify the food processing data after food transportation based on the tampered food data after food transportation.

[0004] Preferably, the specific method for obtaining the hash value of each link blockchain includes: Arrange all types of food data in the first-link blockchain in a fixed order by humans to obtain the food data string of the first-link blockchain. Input the food data string of the first-link blockchain into the MD5 method to obtain the hash value of the first-link blockchain. For any type of food data in the second-link blockchain, if the any type of food data is of the same type as any type of food data in the first-link blockchain, record the any type of food data as the same-attribute food data of the second-link blockchain; if the any type of food data is of a different type from all types of food data in the first-link blockchain, record the any type of food data as the new-attribute food data of the second-link blockchain. Input the string composed of all types of same-attribute food data in the second-link blockchain into the MD5 method to obtain the same-attribute hash value of the second-link blockchain. Input the string composed of all types of new-attribute food data in the second-link blockchain into the MD5 method to obtain the new-attribute hash value of the second-link blockchain. Place the new-attribute hash value after the same-attribute hash value to form a combined string, and input it into the MD5 method to obtain the hash value of the second-link blockchain. And so on, obtain the hash values of all link blockchains.

[0005] Preferably, the method of dividing the hash value of each link blockchain into several hash groups includes the following specific method: For the same-attribute hash value of the nth link blockchain, divide it into 32 hash groups according to four elements in a 128-bit hash value as a group; for the hash value of the

[0006] nth link blockchain, divide it into 32 hash groups according to four elements in the hash value as a group.

[0006] Preferably, the method of obtaining the intersection-union ratio of each hash group according to the change situation of the hash value character types between adjacent link blockchains includes the following specific method: For the nth link blockchain, record the number of all hash value character types in the mth hash group of the same-attribute hash value as the first quantity; record the number of all the same hash value character types in the nth link blockchain and the mth hash group of the hash value of the n + 1th link blockchain as the second quantity; take the ratio of the second quantity to the first quantity as the nth link blockchain and the n + 1th link blockchain and the mth hash group of the hash value of the nth link blockchain and the The intersection-over-union ratio of a hash group.

[0007] Preferably, the method for obtaining the change rate of each hash group according to the change of elements at different positions of the hash values between hash groups in adjacent blockchain links includes the following specific method: If the th hash group in the same-attribute hash values of the th blockchain link and the th hash group in the hash values of the th blockchain link have the same element at any position, record the element at the any position as the same element; and record the ratio of the number of same elements between the th hash group in the same-attribute hash values of the th blockchain link and the th hash group in the hash values of the th blockchain link to 4 as the change rate of the th hash group in the same-attribute hash values of the th blockchain link.

[0008] Preferably, the method for obtaining all changed hash groups of each blockchain link according to the difference in change rates between hash groups in adjacent blockchain links includes the following specific method: Preset a change parameter threshold . If the change rate of the th hash group in the same-attribute hash values of the th blockchain link is greater than the average value of the change rates of all hash groups in the same-attribute hash values of the th blockchain link; and the absolute value of the difference between the change rate of the th hash group in the same-attribute hash values of the th blockchain link and the change rate of the th hash group in the hash values of the th blockchain link is greater than or equal to the change parameter threshold , record the th hash group in the same-attribute hash values of the th blockchain link as a changed hash group.

[0009] Preferably, the method for obtaining the descending sequence of hash changes and the maximum hash change sequence of each blockchain link before and after food transportation includes the following specific method: For the th blockchain link before food transportation, record the sequence formed by sorting all the changed hash groups of the th blockchain link in descending order of change rate as the Descending sequence of hash changes in each link of the blockchain; the change hash group with the largest change rate among all change hash groups of the blockchain in the th link is denoted as the target hash group of the blockchain in the th link; the sequence composed of the target hash groups of all links of the blockchain before food transportation is denoted as the maximum hash change sequence before food transportation; For the blockchain of the th link after food transportation, the sequence formed by sorting all change hash groups of the blockchain of the th link in descending order of change rate is denoted as the descending sequence of hash changes of the blockchain of the th link after food transportation; the change hash group with the largest change rate among all change hash groups of the blockchain of the th link is denoted as the target hash group of the blockchain of the th link; the sequence composed of the target hash groups of all links of the blockchain after food transportation is denoted as the maximum hash change sequence after food transportation.

[0010] Preferably, the method for screening according to the intersection ratio of each change hash group of each link of the blockchain and the difference between the descending sequence of hash changes and the maximum hash change sequence of each link of the blockchain before and after food transportation to obtain the tampered food data after food transportation includes the following specific methods: Preset an intersection ratio parameter and a number parameter . If the intersection ratio of the th change hash group of the blockchain of the th link is less than or equal to the intersection ratio parameter , the th change hash group of the blockchain of the th link is denoted as the tampered point; Obtain the tampered link blockchain according to the difference between the descending sequences of hash changes of each link of the blockchain before and after food transportation; Obtain the tampered data according to the difference between the maximum hash change sequences before and after food transportation; Take the tampered point, the tampered link blockchain and the tampered data as the tampered food data after food transportation.

[0011] Preferably, the method for obtaining the tampered link blockchain according to the difference between the descending sequences of hash changes of each link of the blockchain before and after food transportation includes the following specific methods: If the intersection ratio of all change hash groups of the blockchain of the th link after food transportation is greater than the intersection ratio parameter , the descending sequence of the hash changes of the blockchain in the th link before food transportation is compared with the descending sequence of the hash changes of the blockchain in the th link after food transportation to obtain the number of element swaps. If the number of element swaps is less than the number parameter , the blockchain in the th link after food transportation is recorded as the same-link blockchain; if the number of element swaps is greater than or equal to the number parameter , the blockchain in the th link is recorded as the non-same-link blockchain after food transportation; if the ratio between the number of same-link blockchains after food transportation and the number of all blockchains after food transportation is less than the intersection-union ratio parameter , all non-same-link blockchains after food transportation are recorded as tampered blockchains.

[0012] Preferably, the method for obtaining the tampered data according to the difference between the maximum hash change sequences before and after food transportation includes the following specific steps: If the ratio between the number of same-link blockchains after food transportation and the number of all blockchains after food transportation is greater than or equal to the intersection-union ratio parameter , the maximum hash change sequence before food transportation is compared with the maximum hash change sequence after food transportation using the permutation cycle algorithm to obtain the maximum number of element swaps; if the maximum number of element swaps is greater than or equal to the number parameter , the food processing data after food transportation is recorded as tampered data.

[0013] The beneficial effects of the technical solution of the present invention are as follows: According to the difference in the change rate between hash groups in adjacent link blockchains, all changed hash groups of each link blockchain are obtained; according to the intersection-union ratio of each changed hash group of each link blockchain, and the difference between the descending sequence of hash changes and the maximum hash change sequence of each link blockchain before and after food transportation, the tampered food data after food transportation is obtained; the food processing data after food transportation is verified based on the tampered food data after food transportation; thereby identifying whether the food data in each link blockchain is tampered. By dividing the information in different link blockchains into two parts: same-attribute food data and newly added attribute food data, and then comparing the hash value changes of each part with the previous link, the tampered food data after food transportation is obtained, thus improving the accuracy of the information verification result of food safety traceability. Description of the Drawings

[0014] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the accompanying drawings required for the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0015] Figure 1 It is a flowchart of the steps of an information verification method for food safety traceability according to the present invention; Figure 2 It is a flowchart of the characteristic relationship of an information verification method for food safety traceability according to the present invention. Detailed implementation manners

[0016] In order to further elaborate on the technical means and effects adopted by the present invention to achieve the intended invention purpose, the following, in combination with the accompanying drawings and preferred embodiments, details the specific implementation manners, structures, characteristics and effects of an information verification method for food safety traceability according to the present invention. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. In addition, the specific features, structures or characteristics in one or more embodiments can be combined in any suitable form.

[0017] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which the present invention belongs.

[0018] The following specifically describes the specific solution of an information verification method for food safety traceability provided by the present invention in conjunction with the accompanying drawings.

[0019] Please refer to Figure 1 , which shows a flowchart of the steps of an information verification method for food safety traceability provided by an embodiment of the present invention. The method includes the following steps: Step S001: Obtain the food processing data before and after food transportation; the food processing data before and after food transportation includes all types of food data in the blockchain of several links.

[0020] Specifically, first, it is necessary to collect the food processing data before and after food transportation. The specific process is as follows: Before food transportation, collect the production batch number in the production link blockchain, the processing date in the processing link blockchain, the ingredients and raw material sources of the food in the storage link blockchain, the environmental temperature and humidity in the transportation link blockchain, and the seller and end user in the sales link blockchain as the food processing data before food transportation; Collect the production batch number in the production link blockchain after food transportation, the processing date in the processing link blockchain, the ingredients and raw material sources of food in the warehousing link blockchain, the ambient temperature and humidity in the transportation link blockchain, and the seller and end user in the sales link blockchain as the food processing data after food transportation.

[0021] Thus, the food processing data before and after food transportation are obtained by the above method.

[0022] Step S002: Obtain the hash value of each link blockchain; divide the hash value of each link blockchain into several hash groups; obtain the intersection-union ratio of each hash group according to the change of the hash value character type between the hash groups in adjacent link blockchains; obtain the change rate of each hash group according to the change of elements at different positions of the hash value between the hash groups in adjacent link blockchains; obtain all the changed hash groups of each link blockchain according to the difference of the change rate between the hash groups in adjacent link blockchains.

[0023] It should be noted that the existing process for users to perform integrity verification through QR codes, barcodes, etc. on food packaging is as follows: Each block is encrypted through a hash algorithm to ensure that the data in the blockchain cannot be changed. If the block data is tampered with, the hash value will change, resulting in the chain breaking and being immediately detected. However, with the development of computer hardware and software technologies, there is a probability that a tamperer can tamper with some data, but the hash value of the block remains unchanged. Therefore, in this embodiment, by combining the data changes of food in different link blockchains, the verification link blockchain is added to ensure that the tampered data can be accurately identified.

[0024] Preferably, in some implementation manners of the embodiment of the present invention, the specific method for obtaining the hash value of each link blockchain is as follows: Arrange all types of food data in the first link blockchain in a fixed order by humans to obtain the food data string of the first link blockchain, and input the food data string of the first link blockchain into the MD5 method to obtain the hash value of the first link blockchain; For any type of food data in the blockchain of the second link, if the any type of food data is of the same type as any type of food data in the blockchain of the first link, the any type of food data is recorded as the food data with the same attribute in the blockchain of the second link; if the any type of food data is of different types from all types of food data in the blockchain of the first link, the any type of food data is recorded as the food data with a new attribute in the blockchain of the second link; the string formed by all types of food data with the same attribute in the blockchain of the second link is input into the MD5 method to obtain the hash value with the same attribute in the blockchain of the second link; the string formed by all types of food data with new attributes in the blockchain of the second link is input into the MD5 method to obtain the hash value with a new attribute in the blockchain of the second link; the hash value with a new attribute is placed after the hash value with the same attribute to form a combined string, and the combined string is input into the MD5 method to obtain the hash value of the blockchain of the second link; By analogy, the hash values of the blockchains of all links are obtained.

[0025] Among them, the MD5 method is a prior art, and no further elaboration is made here in this embodiment.

[0026] It should be noted that in the process of obtaining the hash value of each link blockchain above, data that can be verified and has higher security is further obtained, avoiding being cracked by attackers; in this embodiment, the data is further verified through the relationship between the change hash group of the food data with the same attribute and the degree of change of the change hash group. Even if an attacker can make the hash values of a certain link blockchain the same, the hash values during transportation are different, that is, it is very difficult to ensure that the hash value of each food data with the same attribute is the same as the hash value of the previous link blockchain.

[0027] Preferably, in some implementation manners of the embodiment of the present invention, since the hash values obtained by the MD5 method are all 128-bit, the 128-bit hash values are usually represented by 32-bit hexadecimal numbers; in hexadecimal representation, each digit can be a number from 0 to 9 or a letter from A to F, and there are 16 possible characters in total. Therefore, the 128-bit hash value can be represented by 32 hexadecimal characters, and each character has 16 possibilities; then the specific method of dividing the hash value of each link blockchain into several hash groups is as follows: The hash value with the same attribute of the th link blockchain is divided into 32 hash groups according to four elements in the 128-bit hash value as a group; the hash value of the th link blockchain is divided into 32 hash groups according to four elements in the hash value as a group; Preferably, in some implementation manners of the embodiments of the present invention, the specific method for obtaining the intersection-over-union ratio of each hash group according to the change situation of the hash value character types between the hash groups in the adjacent link blockchains is as follows: The number of all hash value character types in the th hash group in the same-attribute hash values of the th link blockchain and the th hash group in the hash values of the th link blockchain is recorded as the first quantity; the number of all the same hash value character types in the th hash group in the same-attribute hash values of the th link blockchain and the th hash group in the hash values of the th link blockchain is recorded as the second quantity; the ratio of the second quantity to the first quantity is used as the intersection-over-union ratio of the th hash group in the same-attribute hash values of the th link blockchain; Preferably, in some implementation manners of the embodiments of the present invention, the specific method for obtaining the change rate of each hash group according to the change situation of the elements at different positions of the hash values between the hash groups in the adjacent link blockchains is as follows: If any one of the elements at any position between the th hash group in the same-attribute hash values of the th link blockchain and the th hash group in the hash values of the th link blockchain is the same element, the said any one of the elements is recorded as the same element; the ratio of the number of the same elements between the th hash group in the same-attribute hash values of the th link blockchain and the th hash group in the hash values of the th link blockchain to 4 is used as the change rate of the th hash group in the same-attribute hash values of the th link blockchain; Preferably, in some implementation manners of the embodiments of the present invention, in order to ensure the disorderliness of the changed hash groups, it is very difficult for an attacker to simulate this disorderliness when not stealing the complete real data, and even if stealing the real data, it is very difficult to find forged data that can make the data at the disordered positions obtained from the original data the same; then the specific method for obtaining all the changed hash groups of each link blockchain according to the change rate difference situation between the hash groups in the adjacent link blockchains is as follows: Preset a change parameter threshold , where in this embodiment, For the sake of description, this embodiment is not specifically limited, where It depends on the specific implementation situation; If the change rate of the th hash group in the same - attribute hash values of the blockchain in the th link is greater than the average value of the change rates of all hash groups in the same - attribute hash values of the blockchain in the th link; and the absolute value of the difference between the change rate of the th hash group and the change rate of the th hash group in the same - attribute hash values of the blockchain in the th link and the change rate of the th hash group in the hash values of the blockchain in the th link is greater than or equal to the change parameter threshold , then the th hash group in the same - attribute hash values of the blockchain in the th link is recorded as the changed hash group;

[0028] Step S003: Obtain the descending - order sequence of hash changes and the maximum hash - change sequence for each link of the blockchain before and after food transportation; screen according to the intersection - union ratio of each changed hash group of each link of the blockchain and the difference between the descending - order sequence of hash changes and the maximum hash - change sequence for each link of the blockchain before and after food transportation, and obtain the tampered food data after food transportation.

[0029] Preferably, in some implementation manners of the embodiments of the present invention, the specific method for obtaining the descending - order sequence of hash changes and the maximum hash - change sequence for each link of the blockchain before and after food transportation is as follows: For the th link of the blockchain before food transportation, the sequence formed by sorting all the changed hash groups of the th link of the blockchain from largest to smallest according to the change rate is recorded as the descending - order sequence of hash changes of the th link of the blockchain before food transportation; the changed hash group with the largest change rate among all the changed hash groups of the th link of the blockchain is recorded as the target hash group of the th link of the blockchain; the sequence formed by the target hash groups of all the links of the blockchain before food transportation is recorded as the maximum hash - change sequence before food transportation; Similarly, obtain the descending - order sequence of hash changes and the maximum hash - change sequence for each link of the blockchain after food transportation.

[0030] Preferably, in some implementation manners of the embodiments of the present invention, according to the intersection ratio of each change hash group of the blockchain in each link, and the difference between the descending sequence of hash changes of the blockchain in each link before and after food transportation and the maximum hash change sequence, the specific method for obtaining the tampered food data after food transportation is as follows: Preset an intersection ratio parameter and a number parameter , where in this embodiment, and are taken as examples for description, and this embodiment does not make specific limitations, where and are determined according to the specific implementation situation; If the intersection ratio of the th change hash group of the blockchain in the th link after food transportation is less than or equal to the intersection ratio parameter , record the th change hash group of the blockchain in the th link after food transportation as the tampered point; If the intersection ratio of all change hash groups of the blockchain in the th link after food transportation is greater than the intersection ratio parameter , then use the permutation cycle algorithm to compare the descending sequence of hash changes of the blockchain in the th link before food transportation with the descending sequence of hash changes of the blockchain in the th link after food transportation to obtain the number of element exchanges. If the number of element exchanges is less than the number parameter , record the blockchain in the th link after food transportation as the same-link blockchain; if the number of element exchanges is greater than or equal to the number parameter , record the th link blockchain as the non-same-link blockchain after food transportation; if the ratio between the number of same-link blockchains after food transportation and the number of all blockchains after food transportation is less than the intersection ratio parameter , record all non-same-link blockchains after food transportation as tampered link blockchains; If the ratio between the number of same-link blockchains after food transportation and the number of all blockchains after food transportation is greater than or equal to the intersection ratio parameter , then use the permutation cycle algorithm to compare the maximum hash change sequence before food transportation with the maximum hash change sequence after food transportation to obtain the maximum number of element exchanges; if the maximum number of element exchanges is greater than or equal to the number parameter , record the food processing data after food transportation as tampered data; The tampered positions, the blockchain of the tampered links, and the tampered data are all regarded as the tampered food data after food transportation.

[0031] Thus, the tampered food data after food transportation is obtained through the above method.

[0032] Step S004: Verify the food processing data after food transportation based on the tampered food data after food transportation.

[0033] Preferably, in some implementation manners of the embodiments of the present invention, the specific method for verifying the food processing data after food transportation based on the tampered food data after food transportation is as follows: Mark the tampered positions, the blockchain of the tampered links, and the tampered data in the food processing data after transportation, and immediately isolate the relevant data. Find the front and back links of the data chain through the traceability system to determine the source and scope of the tampering. Tracking can be carried out through information such as timestamps, IP addresses, and operators; the system should send an alarm to relevant personnel to notify the occurrence of the data tampering event, and finally restore the correct tampered data through the backup system.

[0034] Please refer to Figure 2 , which shows a characteristic relationship flowchart of an information verification method for food safety traceability; Thus, this embodiment is completed.

[0035] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A food safety traceability information verification method, characterized in that: The method comprises the following steps: Obtaining food processing data before and after food transportation; the food processing data before and after food transportation includes all types of food data in several links of blockchain; Obtain the hash value of each link blockchain; divide the hash value of each link blockchain into several hash groups; obtain the intersection and union ratio of each hash group according to the change of the character type of the hash value between the hash groups in the adjacent link blockchains; obtain the change rate of each hash group according to the change of the elements at different positions of the hash value between the hash groups in the adjacent link blockchains; obtain all the changed hash groups of each link blockchain according to the difference in the change rate between the hash groups in the adjacent link blockchains; Obtain the hash change descending sequence and the maximum hash change sequence of each link of the blockchain before and after food transportation; screen according to the intersection-and-union ratio of each change hash group of each link of the blockchain, and the difference between the hash change descending sequence and the maximum hash change sequence of each link of the blockchain before and after food transportation, and obtain the tampered food data after food transportation; The food processing data after food transportation is verified based on the tampered food data after food transportation.

2. According to claim 1, a food safety traceability information verification method is characterized in that: The specific method of obtaining the hash value of each link of the blockchain includes: All types of food data in the first link blockchain are rehearsed in a fixed order to obtain the food data string of the first link blockchain, and the food data string of the first link blockchain is input into the MD5 method to obtain the hash value of the first link blockchain; for any type of food data in the second link blockchain, if the food data of any type is the same type as the food data of any type in the first link blockchain, the food data of any type is recorded as the food data of the same attribute in the second link blockchain; if the food data of any type is different from all types of food data in the first link blockchain, the food data of any type is recorded as the food data of the newly added attribute in the second link blockchain; the string composed of all types of food data of the same attribute in the second link blockchain is input into the MD5 method to obtain the hash value of the same attribute in the second link blockchain; the string composed of all types of food data of the newly added attribute in the second link blockchain is input into the MD5 method to obtain the new attribute hash value of the second link blockchain; the new attribute hash value is placed after the same attribute hash value to form a joint string, and input into the MD5 method to obtain the hash value of the second link blockchain; And so on, the hash value of the blockchain of all links is obtained.

3. According to claim 2, a food safety traceability information verification method is characterized in that: The specific method of dividing the hash value of each link blockchain into several hash groups includes: The first The hash values ​​of the blockchains with the same attributes in each link are divided into 32 hash groups according to the four elements in the 128-bit hash value. The hash value of each link of the blockchain is divided into 32 hash groups according to the four elements in the hash value.

4. According to claim 2, a food safety traceability information verification method is characterized in that: The method of obtaining the intersection-and-union ratio of each hash group according to the change of the character types of the hash values ​​between the hash groups in the adjacent link blockchains includes: The first The hash value of the same attribute in the blockchain of the link The hash group and The hash value of the blockchain in the first link The number of all hash value character types in the hash group is recorded as the first number; the The hash value of the same attribute in the blockchain of the link The hash group and The hash value of the blockchain in the first link The number of all the same hash value character types in the hash group is recorded as the second number; the ratio of the second number to the first number is recorded as the first The hash value of the same attribute in the blockchain of the link The intersection-union ratio of hash groups.

5. According to claim 2, a food safety traceability information verification method is characterized in that: The specific method of obtaining the change rate of each hash group according to the change of elements at different positions of the hash values ​​between hash groups in the adjacent link blockchains includes: Jordi The hash value of the same attribute in the blockchain of the link The hash group and The hash value of the blockchain in the first link If the elements at any position between the hash groups are the same element, the elements at any position are recorded as the same element; The hash value of the same attribute in the blockchain of the link The hash group and The hash value of the blockchain in the first link The ratio of the number of identical elements between the hash groups to 4 is recorded as The hash value of the same attribute in the blockchain of the link The rate of change of each hash group.

6. According to claim 2, a food safety traceability information verification method is characterized in that: The specific method of obtaining all the changed hash groups of each link blockchain according to the difference in the change rate between the hash groups in the adjacent link blockchains is as follows: Preset a change parameter threshold , The hash value of the same attribute in the blockchain of each link The change rate of the hash group is greater than The average of the change rates of all hash groups in the same attribute hash value of the blockchain in the first link; and The hash value of the same attribute in the blockchain of each link The rate of change of the hash group is The hash value of the blockchain in the first link The absolute value of the difference between the change rates of the hash groups is greater than or equal to the change parameter threshold , will The hash value of the same attribute in the blockchain of each link The hash groups are recorded as changed hash groups.

7. According to claim 1, a food safety traceability information verification method is characterized in that: The specific method of obtaining the descending sequence of hash changes and the maximum hash change sequence of the blockchain in each link before and after food transportation includes: Before food transportation The blockchain will The sequence of all the changed hash groups of the blockchain in each link is sorted from large to small according to the change rate, and recorded as the first The hash changes of the blockchain in each link are in descending order; The change hash group with the largest change rate among all the change hash groups of the blockchain in the link is recorded as The target hash group of the blockchain of each link before the food is transported; the sequence composed of the target hash groups of the blockchain of all links before the food is transported is recorded as the maximum hash change sequence before the food is transported; For food transportation The blockchain will The sequence of all the changed hash groups of the blockchain in each link is sorted from large to small according to the change rate, and recorded as the first The hash changes of the blockchain in each link are in descending order; The change hash group with the largest change rate among all the change hash groups of the blockchain in the link is recorded as The target hash group of the blockchain of each link after the food is transported; the sequence composed of the target hash groups of the blockchain of all links after the food is transported is recorded as the maximum hash change sequence after the food is transported.

8. According to claim 1, a food safety traceability information verification method is characterized in that: The method of screening based on the intersection-and-union ratio of each change hash group of each link of the blockchain and the difference between the hash change descending sequence and the maximum hash change sequence of each link of the blockchain before and after food transportation to obtain the tampered food data after food transportation includes the following specific methods: Preset an IoU parameter and the number of parameters , The first link of blockchain The IoU ratio of the changed hash groups is less than or equal to the IoU parameter , will The first link of blockchain The changed hash groups are recorded as tampered points; According to the difference between the hash change descending sequence of each link of the blockchain before and after the food transportation, the blockchain of the tampered link is obtained; Obtain tampered data based on the difference between the maximum hash change sequence before and after food transportation; The tampered points, tampered link blockchain and tampered data will all be regarded as tampered food data after food transportation.

9. The information verification method for food safety traceability according to claim 8, characterized in that: The specific method of obtaining the tampered link blockchain according to the difference between the hash change descending sequence of each link blockchain before and after food transportation is as follows: If the food is transported The intersection-and-combination ratio of all the hash groups of the blockchain in each link is greater than the intersection-and-combination ratio parameter , then the permutation ring algorithm is used to calculate the first The hash change sequence of the blockchain in each link is in descending order and the first The hash changes of the blockchain in each link are compared in descending order to obtain the number of element swaps. If the number of element swaps is less than the number parameter , the first The blockchains of different links are recorded as the same blockchain; If the number of element swaps is greater than or equal to the number parameter , will The link blockchain is recorded as the non-identical link blockchain after food transportation; if the ratio between the number of identical link blockchains after food transportation and the number of link blockchains after all food transportation is less than the intersection ratio parameter , all non-identical link blockchains after food transportation are recorded as tampered link blockchains.

10. The information verification method for food safety traceability according to claim 8, characterized in that: The specific method of obtaining the tampered data according to the difference between the maximum hash change sequence before and after the food is transported is as follows: If the ratio between the number of blockchains in the same link after food transportation and the number of blockchains in all links after food transportation is greater than or equal to the intersection ratio parameter , then use the permutation ring algorithm to compare the maximum hash change sequence before food transportation with the maximum hash change sequence after food transportation to obtain the maximum number of element swaps; if the maximum number of element swaps is greater than or equal to the number parameter , and the food processing data after food transportation is recorded as tampered data.

Citation Information

Patent Citations

  • Fresh agricultural product tracing method and device based on block chain

    CN114037456A

  • Data integrity verification method and system based on block chain technology

    CN115618428A

  • Block chain digital evidence storage method and system

    CN117033382A

  • Data verification method and device applied to block chain traceability

    CN117272405A

  • Data management method, apparatus and system based on blockchain

    WO2022022457A1