CN116993373B - Infant food information safety traceability management system - Google Patents

Infant food information safety traceability management system Download PDF

Info

Publication number
CN116993373B
CN116993373B CN202311254196.2A CN202311254196A CN116993373B CN 116993373 B CN116993373 B CN 116993373B CN 202311254196 A CN202311254196 A CN 202311254196A CN 116993373 B CN116993373 B CN 116993373B
Authority
CN
China
Prior art keywords
attribute
information
difference
analyzed
original
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202311254196.2A
Other languages
Chinese (zh)
Other versions
CN116993373A (en
Inventor
张君
姜守磊
徐名
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Qingdao Jun Sheng Food Ltd By Share Ltd
Original Assignee
Qingdao Jun Sheng Food Ltd By Share Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Qingdao Jun Sheng Food Ltd By Share Ltd filed Critical Qingdao Jun Sheng Food Ltd By Share Ltd
Priority to CN202311254196.2A priority Critical patent/CN116993373B/en
Publication of CN116993373A publication Critical patent/CN116993373A/en
Application granted granted Critical
Publication of CN116993373B publication Critical patent/CN116993373B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/018Certifying business or products
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Abstract

The invention relates to the technical field of data management, and provides an infant food information safety traceability management system, which comprises: acquiring infant food information safety information from a management system, preprocessing the infant food information safety information, and acquiring original safety information and a unique identification code; acquiring an attribute difference coefficient corresponding to the analyzed attribute; acquiring the grade number of the attribute difference coefficient, constructing a difference tree, and acquiring the number of bytes extracted from each layer in the difference tree; acquiring extraction data, acquiring an original key matrix, and acquiring ciphertext and a subkey corresponding to the original security information according to the original key matrix; and according to the subkey, the ciphertext and the unique identification code, realizing the safety tracing of the food information. The invention solves the problem of insufficient safety of safety encryption information caused by over high similarity of life cycle information of infant foods in the same batch.

Description

Infant food information safety traceability management system
Technical Field
The invention relates to the technical field of data management, in particular to an infant food information safety traceability management system.
Background
Infant food is a food specifically designed and manufactured to meet the nutritional needs and developments of infants from 0 to 3 years old. The infant food information contains sensitive and private information of various categories such as substances, ingredients and proportions for producing infant foods, production companies, production addresses, purchasing personnel and the like, so that the safety encryption of the life cycle information of the infant food is an important step for guaranteeing the safety of related information. Meanwhile, safety encryption of life cycle information of infant food can help to carry out safety tracing on infant food, food quality of the infant is comprehensively guaranteed, and when the infant food has problems, various related responsibilities such as problem recovery, recall management and market supervision can be completed in time. Therefore, the safe encryption of the life cycle information of the infant food is a key ring in the industry chain of the infant food.
The AES-128 encryption algorithm can be used for encrypting the life cycle information of the infant food, and the key generator is used for acquiring the initial key, so that the security of the key is improved, however, the data similarity is extremely high in the life cycle information of the infant food in the same batch, so that the security of the conventional encryption algorithm is insufficient.
Disclosure of Invention
The invention provides an infant food information safety traceability management system, which aims to solve the problem of insufficient safety encryption information safety caused by too high similarity of life cycle information of infant foods in the same batch, and adopts the following technical scheme:
the embodiment of the invention provides an infant food information safety traceability management system, which comprises the following modules:
and a data acquisition module: the method comprises the steps of obtaining infant food information safety information from a management system, preprocessing the infant food information safety information, and obtaining original safety information corresponding to each infant food and a unique identification code of each infant food;
attribute variability coefficient module: according to the original safety information corresponding to all infant foods in the same batch, obtaining difference factors corresponding to each attribute of every two adjacent infant foods, obtaining information distance between information of each attribute corresponding to every two infant foods, and obtaining attribute difference coefficients corresponding to the analyzed attributes according to the difference factors of the analyzed attributes corresponding to different infant foods and the information distance between the information of the analyzed attributes;
byte number module: acquiring the grade number of the attribute difference coefficient, constructing a difference tree according to the attribute difference coefficient corresponding to each attribute in the original safety information and the grade number of the attribute difference coefficient, acquiring the number of bytes extracted in each layer in the difference tree, updating the numerical value of the number of bytes extracted in the first layer, and acquiring the number of bytes extracted in each layer in the updated difference tree;
ciphertext acquisition module: acquiring extraction data according to the number of bytes extracted by each layer in the updated difference tree, acquiring an original key corresponding to each position of a matrix according to the extraction data, further acquiring an original key matrix, and acquiring ciphertext and a subkey corresponding to original safety information according to the original key matrix;
food information safety traceability module: judging whether the original safety information corresponding to the infant food is tampered maliciously or not according to the subkey, the ciphertext corresponding to the original safety information and the unique identification code of the infant food, and further realizing the safety tracing of the food information.
Further, the method for obtaining the difference factor corresponding to each attribute of each two adjacent infant foods according to the original safety information corresponding to all infant foods in the same batch comprises the following steps:
taking each attribute in the original safety information as an attribute to be analyzed;
taking every two adjacent infant foods in all infant foods in the same batch as one type of infant foods to be analyzed and two types of infant foods to be analyzed respectively;
the information of the attribute to be analyzed in the original safety information corresponding to the infant food to be analyzed in the same batch is recorded as one type of information, and the information of the attribute to be analyzed in the original safety information corresponding to the infant food to be analyzed in the same batch is recorded as two types of information;
the maximum value of the lengths of the first information and the second information is marked as a third length, and the length of the maximum common character string of the first information and the second information is marked as a fourth length;
and recording the difference value of the third length and the fourth length as a difference factor of the attribute to be analyzed in the primary safety information corresponding to the infant food to be analyzed and the infant food to be analyzed.
Further, the method for obtaining the information distance between the information of each attribute corresponding to every two infant foods comprises the following steps:
and recording the distance between the information of the to-be-analyzed attribute corresponding to the to-be-analyzed infant food and the to-be-analyzed infant food as the information distance.
Further, the method for obtaining the attribute difference coefficient corresponding to the analyzed attribute according to the difference factor of the analyzed attribute corresponding to different infant foods and the information distance between the information of the analyzed attribute comprises the following steps:
the product of the information distance and the difference factor of the attribute to be analyzed in the original safety information corresponding to the infant food to be analyzed and the infant food to be analyzed is recorded as a first product of the attribute to be analyzed in the original safety information corresponding to the infant food to be analyzed and the infant food to be analyzed;
marking the sum of first products of the to-be-analyzed attributes in the original safety information corresponding to every two adjacent infant foods in the original safety information as a first sum value;
the difference between the number of infant foods contained in all infant foods in the same batch and the number one is recorded as a first difference;
and marking the ratio of the first sum value to the first difference value as an attribute difference coefficient corresponding to the attribute to be analyzed in the original safety information.
Further, the method for obtaining the grade number of the attribute difference coefficient and constructing the difference tree according to the attribute difference coefficient corresponding to each attribute in the original safety information and the grade number of the attribute difference coefficient comprises the following steps:
dividing the same value of the attribute difference coefficient into a grade, numbering the grade corresponding to each attribute difference coefficient from the beginning of the number according to the value of the attribute difference coefficient from large to small, and marking the number as the grade number of the attribute difference coefficient;
constructing a difference tree according to the attribute difference coefficient corresponding to each attribute in the original safety information and the grade number of the attribute difference coefficient;
the root node of the difference tree stores attribute difference coefficients with the grade number of first, the number of the root nodes of the difference tree is equal to the number of the attribute difference coefficients with the grade number of first, and the nodes of each layer of the difference tree store attribute difference coefficients with the same grade number, wherein the layer of the attribute difference coefficients in the difference tree is the same as the grade number of the attribute difference coefficients;
when the number of the attribute difference coefficients stored in the nodes exceeds the first branch threshold, all the overflowed attribute difference coefficients are added to the same node.
Further, the method for obtaining the number of bytes extracted from each layer in the difference tree, updating the value of the number of bytes extracted from the first layer, and obtaining the number of bytes extracted from each layer in the updated difference tree comprises the following steps:
each layer in the difference tree is respectively marked as a layer to be analyzed;
the sum of the difference value of the number of layers contained in the difference tree and the layer to be analyzed and the number one is recorded as a second sum value;
recording the accumulated sum of the number of layers contained in the difference tree as a first accumulated sum;
the ratio of the second sum value to the first accumulated sum is recorded as a first ratio;
the value of the product of the first ratio and the first extraction quantity threshold value, which is subjected to the value of a first value function, is recorded as the quantity of bytes extracted by a layer to be analyzed in the difference tree;
the difference value of the sum of the first extraction quantity threshold and the quantity of the bytes extracted in each layer in the difference tree is recorded as an extraction difference value, and the value of the quantity of the bytes extracted in the first layer is updated by using the sum of the quantity of the bytes extracted in the first layer and the extraction difference value;
and acquiring the number of bytes extracted by each layer in the updated difference tree.
Further, the method for obtaining the extracted data according to the number of the extracted bytes of each layer in the updated difference tree comprises the following steps:
and according to the number of the extracted bytes of each layer in the updated difference tree, carrying out average extraction on the information corresponding to the attribute difference coefficient stored in each layer in the difference tree, extracting a third preset threshold value for each time, and sequencing the extracted bytes according to the grade number corresponding to the attribute difference coefficient to obtain extraction data.
Further, the method for obtaining the original key matrix according to the original key corresponding to each position of the extraction data comprises the following steps:
dividing the extracted data into two groups, marking one group positioned at the front position of the extracted data as first extracted data, and marking one group positioned at the rear position of the extracted data as second extracted data;
the sum of the number of continuous digital zeros appearing in the first extraction data and the number of continuous digital ones is recorded as a first length, and the sum of the number of continuous digital zeros appearing in the second extraction data and the number of continuous digital ones is recorded as a second length;
uniformly filling the numbers contained in the first extracted data into a first key matrix according to the sequence from top to bottom and from left to right, and uniformly filling the numbers contained in the second extracted data into a second key matrix according to the sequence from top to bottom and from left to right;
acquiring an original key of each position in the matrix;
and converting the original key corresponding to each position of the matrix into hexadecimal numbers, filling the hexadecimal numbers into the matrix position corresponding to the original key, and obtaining the original key matrix.
Further, the acquiring an original key of each position in the matrix specifically comprises the following steps:
in the method, in the process of the invention,representation matrix +.>Line->An original key for the column position; />Representing an exclusive or operation; />Representing a first length; />Representing a second length; />Representing a first valued function acting as a rounding value in brackets; />A symbol is moved to the right in a representation loop, and overflowed data is supplemented to the front of the data; />Representing a cyclic shift to the left, i.e., supplementing the overflowed data to the back of the data; />Representing the +.f in the first key matrix>Line->Data of column positions; />Representing the +.>Line->Data of column positions.
Further, the method for judging whether the original safety information corresponding to the infant food is maliciously tampered according to the subkey, the ciphertext corresponding to the original safety information and the unique identification code of the infant food, and further realizing the safety tracing of the food information comprises the following steps:
decrypting the ciphertext corresponding to the original security information through the subkey to obtain a unique identification code of decrypted data;
when the unique identification codes of the decrypted data and the unique identification codes of the infant food are all the same, the original safety information corresponding to the encrypted infant food is considered not to be tampered maliciously, otherwise, the original safety information corresponding to the infant food is considered to be tampered maliciously;
when original safety information corresponding to infant food is tampered maliciously, a specific link from production to sales is obtained according to different positions of the decrypted unique identification code of the data and the unique identification code of the infant food, and safety tracing of food information of the infant food is achieved.
The beneficial effects of the invention are as follows:
the invention provides an infant food information safety traceability management system, which constructs a unique identification code of food information through hash operation and byte replacement. Firstly, acquiring attribute difference coefficients through the attribute information of infant foods, wherein the attribute difference coefficients can effectively identify the difference of the same attribute information of different foods because a large number of similarities appear in the same attribute information of different foods; secondly, constructing a difference tree through attribute difference coefficients, effectively dividing different attribute grades, determining the number of bytes extracted by each attribute through analyzing the difference tree, and enabling the extracted information to be larger in difference as the grade is higher; then, the extracted bytes are divided into two groups, an original key matrix is obtained, and the original key matrix is established through the inconsistency of attribute information among foods, so that the safety of encryption information can be effectively improved; finally, taking the original key matrix as an initial key of an AES-128 encryption algorithm, acquiring ciphertext and a subkey corresponding to the original safety information by using the AES-128 encryption algorithm, judging whether the original safety information corresponding to the infant food is maliciously tampered or not according to the subkey, the ciphertext corresponding to the original safety information and the unique identification code of the infant food, further realizing the safety tracing of the food information, and solving the problem of insufficient safety encryption information safety caused by overhigh similarity of life cycle information of the infant food in the same batch.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions of the prior art, the drawings which are used in the description of the embodiments or the prior art will be briefly described, it being obvious that the drawings in the description below are only some embodiments of the invention, and that other drawings can be obtained according to these drawings without inventive faculty for a person skilled in the art.
Fig. 1 is a schematic flow chart of an infant food information security traceability management system according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of infant food attribute information;
FIG. 3 is a schematic diagram of a difference tree;
fig. 4 is a schematic diagram of an original key matrix acquisition process.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Referring to fig. 1, a flowchart of an infant food information security traceability management system according to an embodiment of the present invention is shown, where the system includes: the system comprises a data acquisition module, an attribute difference coefficient module, a byte number module, a ciphertext acquisition module and a food information security tracing module.
The data acquisition module acquires infant food information safety information from the management system and performs preprocessing, and acquires original safety information corresponding to each infant food and a unique identification code of each infant food.
The infant food information is required to pass through four links including a raw material purchasing link, a production processing and packaging link, a transportation and storage link and a sales link from production to sales, and each link can acquire binary data corresponding to a plurality of attributes and upload all the data to an infant food information safety traceability management system. Wherein the attributes include purchasing personnel, purchasing companies, etc., as shown in fig. 2.
The method comprises the steps of extracting binary data of four links corresponding to each infant food from an infant food information safety tracing management system, and sequencing the binary data according to the time sequence of uploading the binary data to the infant food information safety tracing management system to obtain original safety information corresponding to each infant food.
The link identification codes of four links corresponding to each infant food are extracted from the infant food information safety traceability management system, the extracted link identification codes of four links are sequentially arranged according to the sequence of the four links, and the unique identification codes corresponding to the infant food are obtained. The link identification codes of four links in the infant food information safety traceability management system are binary data.
Slicing unique identification codes corresponding to infant food, and dividing the unique identification codes into lengthsOf (2), wherein->The empirical value is 4 bits for the first preset threshold. Slice data is taken to be +.>Storing a hash table in the form of a linked list, wherein +.>For a second preset threshold, the empirical value is 8; the use of hash tables to store slice data is known in the art and will not be described in detail.
Hash table sharingAnd establishing the following extraction rules of tangential data at each position: extracting first slice data from hash table 0, second slice data from hash table 1, and third slice data from hash table 2 until +.>Slice data. The rule of extracting the tangent data can be set according to the needs of the implementer. Draw +.>The slice data are sequentially connected end to end according to the extraction sequence, and the unique identification code of the infant food is obtained.
So far, the original safety information corresponding to each infant food and the unique identification code of each infant food are obtained.
The attribute difference coefficient module is used for acquiring difference factors corresponding to each attribute of every two adjacent infant foods according to the original safety information corresponding to all infant foods in the same batch, acquiring information distance between the information of each attribute corresponding to every two infant foods, and acquiring attribute difference coefficients corresponding to the analyzed attribute according to the difference factors of the analyzed attribute corresponding to different infant foods and the information distance between the information of the analyzed attribute.
Infant food produced in the same batch has larger consistency in infant food information acquired in the raw material purchasing link, the production processing and packaging link, the transportation and storage link and the sales link, so that the same kind of attribute information has larger similarity in original safety information corresponding to the infant food produced in the same batch. When the similarity of the data is extremely high, the safety of the encrypted data can be reduced, and in order to ensure the safety of the encrypted infant food information, firstly, the difference between the data corresponding to the same type attribute of the original safety information corresponding to all infant foods in the same batch is evaluated.
And acquiring attribute difference coefficients corresponding to each attribute according to the original safety information corresponding to all infant foods in the same batch.
In the method, in the process of the invention,indicate->Parts and->The first part of the original safety information corresponding to infant food>A difference factor of individual attributes, wherein +.>,/>The total number of different attributes contained in the original security information;represents the>The first part of the original safety information corresponding to infant food>Information of the individual attributes, wherein,,/>indicating the number of infant food products contained in all infant food products of the same batch;represents the>The first part of the original safety information corresponding to infant food>Information of the individual attributes;a maximum value representing the length of two pieces of information in brackets; />The length of the largest common string of two messages in brackets is indicated.
When the original safety information corresponding to the two infant foods is consistent, the length of the maximum common character string of the information with the same attribute is longer, and the difference factor of the attribute corresponding to the two infant foods is smaller. The greater the similarity of the information of the attribute corresponding to the two infant foods.
The total number of different attributes contained in the original security information is obtained. And recording the Levenshtein distance between the information of each attribute corresponding to every two adjacent infant foods as the information distance of each attribute corresponding to every two adjacent infant foods, wherein the acquisition of the Levenshtein distance is a known technology and is not repeated. When the similarity of the two original security information is larger, the information distance between the two original security information is smaller.
And acquiring attribute difference coefficients corresponding to the analyzed attributes according to the difference factors of the analyzed attributes corresponding to different infant foods and the information distance between the information of the analyzed attributes.
In the method, in the process of the invention,representing the +.>Attribute difference coefficients corresponding to the respective attributes; />Indicating the number of infant food products contained in all infant food products of the same batch; />Indicate->Parts and->The first part of the original safety information corresponding to infant food>A difference factor for each attribute; />Represents the>The first part of the original safety information corresponding to infant food>Information of individual attributes, wherein->;/>Representing the same batch of the firstThe first part of the original safety information corresponding to infant food>Information of the individual attributes; />Representing the Levenshtein distance between the two information in brackets.
When the difference factor of the analyzed attribute in the original safety information corresponding to every two infant foods in the same batch is smaller and the information distance between the analyzed attribute information is smaller, the attribute difference coefficient corresponding to the analyzed attribute in the original safety information is smaller, namely the similarity of the analyzed attribute information in the original safety information is larger.
So far, the attribute difference coefficient corresponding to each attribute in the original safety information is obtained.
The byte number module is used for acquiring the grade number of the attribute difference coefficient, constructing a difference tree according to the attribute difference coefficient corresponding to each attribute in the original safety information and the grade number of the attribute difference coefficient, acquiring the number of the bytes extracted in each layer in the difference tree, updating the numerical value of the number of the bytes extracted in the first layer, and acquiring the number of the bytes extracted in each layer in the updated difference tree.
The values of the attribute difference coefficients are equally divided into one grade, the grade corresponding to each attribute difference coefficient is numbered from the number 1 according to the value of the attribute difference coefficient from large to small, and the number is recorded as the grade number of the attribute difference coefficient.
As shown in fig. 3, a difference tree is constructed according to the attribute difference coefficient corresponding to each attribute in the original security information and the class number of the attribute difference coefficient.
The root node of the difference tree stores attribute difference coefficients with the class number of 1, the number of the root nodes of the difference tree is equal to the number of the attribute difference coefficients with the class number of 1, and the nodes of each layer of the difference tree store attribute difference coefficients with the same class number, and the layer where the attribute difference coefficients are located in the difference tree is the same as the class number of the attribute difference coefficients. When the number of the attribute difference coefficients stored in the nodes exceeds the first branch threshold, all the overflowed attribute difference coefficients are added to the same node. The node position added by the overflowed attribute difference coefficient is the leftmost node of the difference tree; the empirical value of the first branch threshold is 2.
When the node is closer to the root node, the attribute difference coefficient stored by the node is larger, the attribute information difference corresponding to the attribute difference coefficient is larger, and in order to improve the security of compressed information, the selected information amount should be larger when encryption is performed.
And obtaining the total number of different grade numbers, namely the number of layers contained in the difference tree.
The number of bytes extracted per layer in the difference tree is obtained.
In the method, in the process of the invention,representing +.>The number of bytes extracted by the layer, wherein +.>;/>Representing the number of layers that the difference tree contains; />Representing a first extraction number threshold, an empirical value of 64; />A first valued function is represented, acting as a rounded value in brackets.
In the process of acquiring the number of bytes extracted in each layer in the difference tree, the calculation result is rounded, so that the sum of the number of bytes extracted in each layer in the acquired difference tree is smaller than a first extraction number threshold. Counting the sum of the number of the bytes extracted in each layer in the difference tree, recording the difference value between the threshold value of the first extraction number and the sum of the number of the bytes extracted in each layer in the difference tree as an extraction difference value, and updating the numerical value of the number of the bytes extracted in the first layer by using the sum of the number of the bytes extracted in the first layer and the extraction difference value.
So far, the number of bytes extracted by each layer in the updated difference tree is obtained.
The ciphertext acquisition module acquires extraction data according to the number of bytes extracted by each layer in the updated difference tree, acquires an original key corresponding to each position of the matrix according to the extraction data, further acquires an original key matrix, and acquires ciphertext and a subkey corresponding to the original security information according to the original key matrix.
And according to the number of the extracted bytes of each layer in the updated difference tree, carrying out average extraction on the information corresponding to the attribute difference coefficient stored in each layer in the difference tree, extracting a third preset threshold value for each time, and sequencing the extracted bytes according to the grade number corresponding to the attribute difference coefficient to obtain extraction data. Wherein the third preset threshold has an empirical value of 8.
The extraction data are divided into two groups, one group positioned at the front position of the extraction data is marked as first extraction data, and the other group positioned at the rear position of the extraction data is marked as second extraction data.
The sum of the number of consecutive digital 0 s and the number of consecutive digital 1 s of the first decimated data is noted as a first length, and the sum of the number of consecutive digital 0 s and the number of consecutive digital 1 s of the second decimated data is noted as a second length.
And uniformly filling the numbers contained in the first extracted data into the first key matrix according to the sequence from top to bottom and from left to right. The first key matrix has an empirical size of 4*4, and each position in the first key matrix contains 8 adjacent digits in the first extracted data according to the third preset threshold and the empirical value of the first extraction quantity threshold.
And uniformly filling the numbers contained in the second extracted data into the second key matrix according to the sequence from top to bottom and from left to right. The empirical size of the second key matrix is 4*4, and each position in the second key matrix contains 8 adjacent digits in the second extracted data according to the third preset threshold value and the empirical value of the first extracted quantity threshold value.
The original key for each position of the matrix is obtained.
In the method, in the process of the invention,representation matrix +.>Line->An original key for the column position; />Representing an exclusive or operation; />Representing a first length; />Representing a second length; />Representing a first valued function acting as a rounding value in brackets; />A symbol is moved to the right in a representation loop, and overflowed data is supplemented to the front of the data; />Representing a cyclic shift to the left, i.e., supplementing the overflowed data to the back of the data; />Representing the +.f in the first key matrix>Line->Data of column positions; />Representing the +.>Line->Data of column positions.
And converting the original key corresponding to each position of the matrix into a 16-system number, filling the 16-system number into the matrix position corresponding to the original key, and obtaining the original key matrix.
The process of obtaining the original key matrix from the first key matrix and the second key matrix is shown in fig. 4.
And taking the original key matrix as an initial key of the AES-128 encryption algorithm, and acquiring ciphertext and a subkey corresponding to the original security information by using the AES-128 encryption algorithm.
So far, ciphertext and subkey corresponding to the original security information are obtained.
And the food information safety tracing module judges whether the original safety information corresponding to the infant food is tampered maliciously according to the subkey, the ciphertext corresponding to the original safety information and the unique identification code of the infant food, thereby realizing the safety tracing of the food information.
Decrypting the ciphertext corresponding to the original security information through the subkey to obtain the unique identification code of the decrypted data.
When the unique identification code of the decrypted data and the unique identification code of the infant food are all the same, the original safety information corresponding to the encrypted infant food is considered not to be tampered maliciously, otherwise, the original safety information corresponding to the infant food is considered to be tampered maliciously.
When original safety information corresponding to infant food is tampered maliciously, different positions appear according to the corresponding unique identification codes, specific links from production to sales corresponding to the different positions are obtained, and safety tracing of the food information of the infant food is achieved. The specific links from production to sales comprise a raw material purchasing link, a production processing and packaging link, a transportation and storage link and a sales link.
The above description is only of the preferred embodiments of the present invention and is not intended to limit the invention, but any modifications, equivalent substitutions, improvements, etc. within the principles of the present invention should be included in the scope of the present invention.

Claims (2)

1. The infant food information safety traceability management system is characterized by comprising the following modules:
and a data acquisition module: the method comprises the steps of obtaining infant food information safety information from a management system, preprocessing the infant food information safety information, and obtaining original safety information corresponding to each infant food and a unique identification code of each infant food;
attribute variability coefficient module: according to the original safety information corresponding to all infant foods in the same batch, obtaining difference factors corresponding to each attribute of every two adjacent infant foods, obtaining information distance between information of each attribute corresponding to every two infant foods, and obtaining attribute difference coefficients corresponding to the analyzed attributes according to the difference factors of the analyzed attributes corresponding to different infant foods and the information distance between the information of the analyzed attributes;
byte number module: acquiring the grade number of the attribute difference coefficient, constructing a difference tree according to the attribute difference coefficient corresponding to each attribute in the original safety information and the grade number of the attribute difference coefficient, acquiring the number of bytes extracted in each layer in the difference tree, updating the numerical value of the number of bytes extracted in the first layer, and acquiring the number of bytes extracted in each layer in the updated difference tree;
ciphertext acquisition module: acquiring extraction data according to the number of bytes extracted by each layer in the updated difference tree, acquiring an original key corresponding to each position of a matrix according to the extraction data, further acquiring an original key matrix, and acquiring ciphertext and a subkey corresponding to original safety information according to the original key matrix;
food information safety traceability module: judging whether the original safety information corresponding to the infant food is maliciously tampered or not according to the subkey, the ciphertext corresponding to the original safety information and the unique identification code of the infant food, so that the safety tracing of the food information is realized;
the method for acquiring the difference factors corresponding to each attribute of every two adjacent infant foods according to the original safety information corresponding to all infant foods in the same batch comprises the following steps: taking each attribute in the original safety information as an attribute to be analyzed; taking every two adjacent infant foods in all infant foods in the same batch as one type of infant foods to be analyzed and two types of infant foods to be analyzed respectively; the information of the attribute to be analyzed in the original safety information corresponding to the infant food to be analyzed in the same batch is recorded as one type of information, and the information of the attribute to be analyzed in the original safety information corresponding to the infant food to be analyzed in the same batch is recorded as two types of information; the maximum value of the lengths of the first information and the second information is marked as a third length, and the length of the maximum common character string of the first information and the second information is marked as a fourth length; recording the difference value of the third length and the fourth length as a difference factor of the attribute to be analyzed in the primary safety information corresponding to the infant food to be analyzed and the infant food to be analyzed;
the method for acquiring the information distance between the information of each attribute corresponding to every two infant foods comprises the following steps: the distance between the infant food to be analyzed and the information of the attribute to be analyzed corresponding to the infant food to be analyzed is recorded as the information distance;
the method for acquiring the attribute difference coefficient corresponding to the analyzed attribute according to the difference factor of the analyzed attribute corresponding to different infant foods and the information distance between the information of the analyzed attribute comprises the following steps: the product of the information distance and the difference factor of the attribute to be analyzed in the original safety information corresponding to the infant food to be analyzed and the infant food to be analyzed is recorded as a first product of the attribute to be analyzed in the original safety information corresponding to the infant food to be analyzed and the infant food to be analyzed; marking the sum of first products of the to-be-analyzed attributes in the original safety information corresponding to every two adjacent infant foods in the original safety information as a first sum value; the difference between the number of infant foods contained in all infant foods in the same batch and the number one is recorded as a first difference; the ratio of the first sum value to the first difference value is recorded as an attribute difference coefficient corresponding to the attribute to be analyzed in the original safety information;
the method for obtaining the grade number of the attribute difference coefficient and constructing the difference tree according to the attribute difference coefficient corresponding to each attribute in the original safety information and the grade number of the attribute difference coefficient comprises the following steps: dividing the same value of the attribute difference coefficient into a grade, numbering the grade corresponding to each attribute difference coefficient from the beginning of the number according to the value of the attribute difference coefficient from large to small, and marking the number as the grade number of the attribute difference coefficient; constructing a difference tree according to the attribute difference coefficient corresponding to each attribute in the original safety information and the grade number of the attribute difference coefficient; the root node of the difference tree stores attribute difference coefficients with the grade number of first, the number of the root nodes of the difference tree is equal to the number of the attribute difference coefficients with the grade number of first, and the nodes of each layer of the difference tree store attribute difference coefficients with the same grade number, wherein the layer of the attribute difference coefficients in the difference tree is the same as the grade number of the attribute difference coefficients; setting a first branch threshold when the nodes of each layer store attribute difference coefficients, and adding all overflowed attribute difference coefficients to the same node when the number of the node store attribute difference coefficients exceeds the first branch threshold;
the method for acquiring the byte number extracted by each layer in the difference tree updates the value of the byte number extracted by the first layer, and the method for acquiring the byte number extracted by each layer in the updated difference tree comprises the following steps: each layer in the difference tree is respectively marked as a layer to be analyzed; the sum of the difference value of the number of layers contained in the difference tree and the layer to be analyzed and the number one is recorded as a second sum value; recording the accumulated sum of the number of layers contained in the difference tree as a first accumulated sum; the ratio of the second sum value to the first accumulated sum is recorded as a first ratio; the value of the product of the first ratio and the first extraction quantity threshold value, which is subjected to the value of a first value function, is recorded as the quantity of bytes extracted by a layer to be analyzed in the difference tree; the difference value of the sum of the first extraction quantity threshold and the quantity of the bytes extracted in each layer in the difference tree is recorded as an extraction difference value, and the value of the quantity of the bytes extracted in the first layer is updated by using the sum of the quantity of the bytes extracted in the first layer and the extraction difference value; acquiring the number of bytes extracted by each layer in the updated difference tree;
the method for acquiring the extracted data according to the number of the extracted bytes of each layer in the updated difference tree comprises the following steps: according to the number of the extracted bytes of each layer in the updated difference tree, carrying out average extraction on the information corresponding to the attribute difference coefficient stored in each layer in the difference tree, extracting a third preset threshold value for each time, and sequencing the extracted bytes according to the grade number corresponding to the attribute difference coefficient to obtain extraction data;
the method for acquiring the original key corresponding to each position of the matrix according to the extracted data and further acquiring the original key matrix comprises the following steps: dividing the extracted data into two groups, marking one group positioned at the front position of the extracted data as first extracted data, and marking one group positioned at the rear position of the extracted data as second extracted data; the sum of the number of continuous digital zeros appearing in the first extraction data and the number of continuous digital ones is recorded as a first length, and the sum of the number of continuous digital zeros appearing in the second extraction data and the number of continuous digital ones is recorded as a second length; uniformly filling the numbers contained in the first extracted data into a first key matrix according to the sequence from top to bottom and from left to right, and uniformly filling the numbers contained in the second extracted data into a second key matrix according to the sequence from top to bottom and from left to right; acquiring an original key of each position in the matrix; converting an original key corresponding to each position of the matrix into hexadecimal numbers, filling the hexadecimal numbers into the matrix positions corresponding to the original keys, and obtaining an original key matrix;
the original secret key of each position in the acquisition matrix is acquired by the following specific acquisition formula:
in the method, in the process of the invention,representation matrix +.>Line->An original key for the column position; />Representing an exclusive or operation; />Representing a first length; />Representing a second length; />Representing a first valued function acting as a rounding value in brackets;a symbol is moved to the right in a representation loop, and overflowed data is supplemented to the front of the data; />Representing a cyclic shift to the left, i.e., supplementing the overflowed data to the back of the data; />Representing the +.f in the first key matrix>Line->Data of column positions; />Representing the +.>Line->Data of column positions.
2. The infant food information security tracing management system of claim 1, wherein the method for judging whether the original security information corresponding to the infant food is tampered maliciously according to the subkey, the ciphertext corresponding to the original security information and the unique identification code of the infant food, and further realizing the security tracing of the food information is as follows:
decrypting the ciphertext corresponding to the original security information through the subkey to obtain a unique identification code of decrypted data;
when the unique identification codes of the decrypted data and the unique identification codes of the infant food are all the same, the original safety information corresponding to the encrypted infant food is considered not to be tampered maliciously, otherwise, the original safety information corresponding to the infant food is considered to be tampered maliciously;
when original safety information corresponding to infant food is tampered maliciously, a specific link from production to sales is obtained according to different positions of the decrypted unique identification code of the data and the unique identification code of the infant food, and safety tracing of food information of the infant food is achieved.
CN202311254196.2A 2023-09-27 2023-09-27 Infant food information safety traceability management system Active CN116993373B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311254196.2A CN116993373B (en) 2023-09-27 2023-09-27 Infant food information safety traceability management system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311254196.2A CN116993373B (en) 2023-09-27 2023-09-27 Infant food information safety traceability management system

Publications (2)

Publication Number Publication Date
CN116993373A CN116993373A (en) 2023-11-03
CN116993373B true CN116993373B (en) 2023-12-22

Family

ID=88530589

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311254196.2A Active CN116993373B (en) 2023-09-27 2023-09-27 Infant food information safety traceability management system

Country Status (1)

Country Link
CN (1) CN116993373B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005267153A (en) * 2004-03-18 2005-09-29 Hiroshi Sato Traceability system device and means, traceability information referencing confirming device, and traceability information
CN108320162A (en) * 2017-01-16 2018-07-24 南京橙红科技股份有限公司 A kind of food security quality tracing application data analysis system
CN108876415A (en) * 2018-07-05 2018-11-23 江苏农牧科技职业学院 A kind of agricultural input product traceability system and method
WO2019062530A1 (en) * 2017-09-30 2019-04-04 浙江鑫泊物流科技有限公司 Commodity tracing and anti-counterfeiting method and device
CN110809058A (en) * 2019-11-13 2020-02-18 北京物资学院 Block chain traceability system and method based on feature code identification and verification technology
CN111062731A (en) * 2019-12-20 2020-04-24 江苏荣泽信息科技股份有限公司 Block chain-based food safety tracing system and method
CN115809884A (en) * 2022-11-24 2023-03-17 河南省食品检验研究院 Information tracing system for special food supervision
CN116188041A (en) * 2023-03-29 2023-05-30 中国工商银行股份有限公司 Food information tracing method, device and system based on block chain

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018183768A1 (en) * 2017-03-29 2018-10-04 Innit International S.C.A. Trusted food traceability system and method and sensor network
CN110807641A (en) * 2018-08-01 2020-02-18 隽名有限公司 Pet food traceability system

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005267153A (en) * 2004-03-18 2005-09-29 Hiroshi Sato Traceability system device and means, traceability information referencing confirming device, and traceability information
CN108320162A (en) * 2017-01-16 2018-07-24 南京橙红科技股份有限公司 A kind of food security quality tracing application data analysis system
WO2019062530A1 (en) * 2017-09-30 2019-04-04 浙江鑫泊物流科技有限公司 Commodity tracing and anti-counterfeiting method and device
CN108876415A (en) * 2018-07-05 2018-11-23 江苏农牧科技职业学院 A kind of agricultural input product traceability system and method
CN110809058A (en) * 2019-11-13 2020-02-18 北京物资学院 Block chain traceability system and method based on feature code identification and verification technology
CN111062731A (en) * 2019-12-20 2020-04-24 江苏荣泽信息科技股份有限公司 Block chain-based food safety tracing system and method
CN115809884A (en) * 2022-11-24 2023-03-17 河南省食品检验研究院 Information tracing system for special food supervision
CN116188041A (en) * 2023-03-29 2023-05-30 中国工商银行股份有限公司 Food information tracing method, device and system based on block chain

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于区块链的药品溯源系统分析与设计;张兰 等;中国数字医学;第15卷(第09期);第38-40页 *

Also Published As

Publication number Publication date
CN116993373A (en) 2023-11-03

Similar Documents

Publication Publication Date Title
CN109472338B (en) Batch generation method of commodity anti-counterfeiting two-dimensional codes
CN110603595B (en) Methods and systems for reconstructing genomic reference sequences from compressed genomic sequence reads
CN112884104B (en) Commodity anti-counterfeiting two-dimensional code generation method based on chaotic encryption
CN104680220B (en) A kind of commodity counterfeit prevention code Mass production method
CN102968725A (en) Method for tracing anti-fake markings for agricultural product
CN107425956B (en) A kind of character type commodity counterfeit prevention code generating method
CN104751342A (en) Commodity information coding and decoding method for tracking commodities
CN116993373B (en) Infant food information safety traceability management system
CN116527233B (en) Energy monitoring data management system based on cloud computing
CN116032474A (en) Safety protection system based on big data computer network
CN111062456A (en) Two-dimensional code encryption algorithm
CN107565975A (en) The method of FASTQ formatted file Lossless Compressions
Ebrahimi-Fard et al. On an extension of Knuth’s rotation correspondence to reduced planar trees
CN113255860B (en) Commodity anti-counterfeiting two-dimensional code generation method based on layered encryption
Srilakshmi et al. Text embedding using image steganography in spatial domain
KR101501507B1 (en) Method of generating compression barcode of binary data, method of recovering binary data and the apparatus thereof
CN116071164B (en) Digital asset tracing method based on blockchain management
CN109919277B (en) Enciphered colour triangular code coding and decoding method for commodity external package
CN108021814A (en) A kind of image encryption method of the bionical cellular automata based on balance rule
CN101930458B (en) Short message matching method based on characteristic value
CN109005025B (en) Convolution compression method for hash function
CN113947096A (en) Commodity anti-counterfeiting code identification method based on picture-to-character string decryption
CN108156136B (en) Secret-pattern carrier-free test question disguising method for indirect transmission and random codebook
CN104899520A (en) Masking and reverse masking methods of 15-digit identity card number
CN117291750B (en) Block chain-based veterinary waste traceability management method and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant