An anti-interference square matrix bipartite graph coding method for commodity outer packaging
By generating an anti-interference matrix bipartite graph encoding and decoding method on product packaging, the problem of insufficient uniqueness and recoverability of product information codes during circulation is solved, realizing anti-counterfeiting traceability and effective information recovery of products.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TONGJI UNIV
- Filing Date
- 2023-08-28
- Publication Date
- 2026-07-31
AI Technical Summary
The existing product information codes have insufficient uniqueness and recoverability during circulation, causing economic losses to manufacturers when products are counterfeited or the labels are damaged.
An anti-interference matrix bipartite graph encoding and decoding method is adopted. By generating the original matrix and two anti-interference matrices, three sets of bipartite graphs are generated and sprayed on the product packaging. Information is stored using connecting lines to achieve anti-counterfeiting traceability and recovery after damage.
It improves the anti-interference and recoverability of product information codes, effectively traces the flow of goods, and restores the original data after the information is damaged.
Smart Images

Figure CN117057386B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the technical field of anti-counterfeiting and traceability of commodity information, and in particular to an anti-interference matrix bipartite graph encoding and decoding method for commodity outer packaging. Background Technology
[0002] With continuous economic development and marketization, trade is becoming increasingly fast and convenient. However, commodity manufacturers face a thorny problem: the non-uniqueness of product information labeling during the circulation process makes it impossible to trace goods. Counterfeiting and damage to product labels by some distributors cause significant economic losses to manufacturers. Currently, the mainstream product information code is the QR code. While it has advantages such as large information capacity and low production cost, its encoding method is relatively fixed, and its recoverability after damage is weak, making it unsuitable as a unique product information code. Therefore, improving the uniqueness and recoverability of product information codes is a crucial issue that deserves attention. Summary of the Invention
[0003] To address the shortcomings of existing technologies, the present invention aims to provide an anti-interference matrix bipartite graph encoding and decoding method for commodity outer packaging. This method can improve the anti-interference capability of commodity codes during circulation and effectively perform anti-counterfeiting traceability and information recovery after damage to commodities in circulation. To achieve the above-mentioned objectives and other advantages of the present invention, an anti-interference matrix bipartite graph encoding and decoding method for commodity outer packaging is provided, comprising:
[0004] S1. Collect product information through the system, convert it into standard binary data format, and save it to the system's database;
[0005] S2. The system generates binary logical information sequences at any time. These binary logical information sequences are associated with product information to form a corresponding relationship. The sequences are then saved in the system's database to generate the original matrix.
[0006] S3. Generate a second and a third square matrix from the original square matrix. The second square matrix is the first anti-interference square matrix, and the third square matrix is the second anti-interference square matrix.
[0007] S4. Generate three sets of bipartite graphs from the original square matrix, the first anti-interference square matrix, and the second anti-interference square matrix, and spray them onto the product packaging.
[0008] S5. Decode the information.
[0009] Preferably, in step S2, the 4*4 bit binary logic information randomly generated by the computer is grouped into groups of four and stored in each row of the square matrix in order to generate the original square matrix.
[0010] Preferably, in step S3, the first anti-interference matrix is generated by XORing the original matrix with its transpose matrix. It is a symmetrical matrix with all elements on its diagonal being 0. The corresponding bipartite graph features are that the graph does not contain horizontal lines and the graph is horizontally flipped symmetrically.
[0011] Preferably, in step S3, the second anti-interference matrix is generated by flipping the original matrix along its secondary diagonal, i.e., b ij =a (4-j)(4-i) , where b ij Let a represent the element in the i-th row and j-th column of the anti-interference matrix. (4-j)(4-i) The element in the (4-j)th row and (4-i)th column of the original square matrix has the characteristic that the corresponding bipartite graph can be rotated 180 degrees around the center of the graph to restore it to the original bipartite graph.
[0012] Preferably, in step S4, the product packaging includes three sets of bipartite graphs from left to right, storing information about the original square matrix, the first anti-interference square matrix, and the second anti-interference square matrix respectively. The bipartite graph is generated by dividing a rectangle from top to bottom into four equal parts, representing the first to fourth rows of the square matrix, and this graphic is defined as a row rectangle. On the right side of the row rectangle, another rectangle of the same size is divided from top to bottom into four equal parts, representing the first to fourth columns of the square matrix, and this graphic is defined as a column rectangle. Connecting lines are used to selectively connect the left and right areas. Whether or not they are connected corresponds one-to-one with the information at the corresponding position in the square matrix, with 1 corresponding to connection and 0 corresponding to no connection.
[0013] Preferably, in step S5, if the original bipartite image information is complete, the system directly reads the first bipartite image from left to right. The reading steps are as follows: the left row rectangle is divided into four blocks from top to bottom, and the connecting lines added to each block store the information of the corresponding row of the original matrix; the right column rectangle is divided into four blocks, and the connecting lines added to each block store the information of the corresponding column of the original matrix; the other end of the connecting lines added to the first block of the left rectangle is read one by one to obtain the column coordinate information of the element 1 in the first row of the original matrix; using the same method, all blocks of the left rectangle are read in sequence to obtain the complete data of the original matrix.
[0014] Preferably, in step S5, if the original bipartite image information is incomplete and the original bipartite image can retain part of the lines, the line segments can be extended to recover the original connecting lines and obtain the complete data of the original matrix.
[0015] Preferably, if the tilt line information of the original bipartite graph is completely lost in step S5, the damaged original bipartite graph can be horizontally flipped around the right rectangle. The resulting new bipartite graph corresponds to the transpose of the original square matrix. The information at the original missing lines in the new bipartite graph is XORed with the corresponding information in the first anti-interference bipartite graph to obtain the information of the damaged original bipartite graph. That is, the complete data of the original square matrix is restored by XORing the information that is not lost in the symmetrical position of the original square matrix about the main diagonal with the information at the corresponding position of the first anti-interference bipartite graph.
[0016] Preferably, if the original bipartite image loses a pair of horizontally flipped symmetrical line information in step S5, according to the method of obtaining the second anti-interference matrix, the second anti-interference bipartite image is obtained by rotating the original bipartite image 180 degrees around the center of the image. The original bipartite image information can be obtained by rotating the second anti-interference bipartite image 180 degrees around the center of the image, and the complete data of the original matrix can be obtained.
[0017] Compared with existing technologies, the advantages of this invention are: it effectively traces the flow of goods annotated with bipartite graphs, and it has a strong ability to recover information for anti-counterfeiting products and products with damaged information markings. Since product information is contained in the connecting lines, as long as a single line is not completely damaged, it can be restored by extending the line segments. The original graphic is particularly resistant to vertical damage. If the original graphic lines are completely damaged, information recovery can still be achieved by selecting either a first or second anti-interference bipartite graph based on whether the damage is oblique or horizontal, combined with the original graphic. Attached Figure Description
[0018] Figure 1 The bipartite graph corresponding to the 4*4 unit square matrix in the anti-interference square matrix bipartite graph encoding and decoding method for commodity outer packaging according to the present invention;
[0019] Figure 2 A bipartite graph generated from three sets of information square matrices printed on the outer packaging of a product, as an example of the anti-interference matrix bipartite graph encoding and decoding method for product outer packaging according to the present invention;
[0020] Figure 3 An example of the anti-interference matrix bipartite graph encoding and decoding method for commodity outer packaging according to the present invention is a bipartite graph with lost original information slanted lines printed on the commodity outer packaging;
[0021] Figure 4 An example of the anti-interference matrix bipartite graph encoding and decoding method for commodity packaging according to the present invention: original bipartite graph horizontal flip (left) and anti-interference bipartite graph... Figure 1 (right);
[0022] Figure 5An example of the anti-interference matrix bipartite graph encoding and decoding method for commodity outer packaging according to the present invention is a bipartite graph printed on the commodity outer packaging, showing a pair of horizontally flipped symmetrical positions where lines are lost.
[0023] Figure 6 An example of the anti-interference matrix bipartite graph encoding and decoding method for commodity outer packaging according to the present invention: the original bipartite graph (left) and the anti-interference bipartite graph. Figure 2 The image is rotated 180 degrees around the center (right). Detailed Implementation
[0024] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0025] Reference Figure 1-6 An anti-interference matrix bipartite graph encoding and decoding method for commodity outer packaging includes the following steps: S1, collecting commodity information through the system, converting it into a standard binary data format, and saving it to the system's database;
[0026] S2. The system generates binary logical information sequences at any time. These binary logical information sequences are associated with the product information to form a corresponding relationship. The sequences are then saved in the system's database to generate the original matrix.
[0027] S3. Generate a second and a third square matrix from the original square matrix. The second square matrix is the first anti-interference square matrix, and the third square matrix is the second anti-interference square matrix.
[0028] S4. Generate three sets of bipartite graphs from the original square matrix, the first anti-interference square matrix, and the second anti-interference square matrix, and spray them onto the product packaging.
[0029] S5. Decode the information.
[0030] Example 1
[0031] 1) Product Information Collection
[0032] The system collects product information through its data acquisition device, converts it into a standard binary data format, saves it to the system's database, and provides it to step 2);
[0033] 2) Generate the original square matrix
[0034] The system computer randomly generates a 4*4 bit binary logical information sequence. In this example, we assume that the sequence is 1111_0110_1101_0101. It is associated with the product information collected in step 1 to form a one-to-one correspondence and is saved to the system's database. The 4*4 bit binary logical information is divided into groups of 4 and stored in each row of the square matrix in the order of the groups to generate the original square matrix, which is provided to step 3.
[0035] 3) Generate an anti-interference matrix
[0036] Perform a bitwise XOR operation on the initial information matrix in the database from step 2 and its transpose matrix to form the second matrix, which is the first anti-interference matrix. Then, flip the original matrix along the secondary diagonal to obtain the third matrix, which is the second anti-interference matrix.
[0037] The initial array and the two anti-interference arrays are shown in the table below. They are saved to the system's database and provided to step 4).
[0038] 0 1 1 0 1 1 0 1 0 1 0 1
[0039] Original square matrix
[0040] 1 0 0 1 0 0 0 1 1 1 1 0
[0041] First Anti-interference Array
[0042]
[0043]
[0044] Second Anti-interference Array
[0045] 4) Generate a bipartite graph
[0046] Based on the initial square matrix and two anti-interference square matrices, three sets of bipartite graphs are generated. The generation rules are as follows: Divide a rectangle into four equal parts from top to bottom, representing rows 1 to 4 of the square matrix; this shape is defined as a row rectangle. To the right of the row rectangle, divide another rectangle of the same size into four equal parts from top to bottom, representing columns 1 to 4 of the square matrix; this shape is defined as a column rectangle. Selectively connect the left and right regions with connecting lines. Whether a connection is made corresponds one-to-one with the information at the corresponding position in the square matrix: 1 corresponds to connection, 0 corresponds to no connection. Using this method, three sets of bipartite graphs containing information from the original square matrix, the first anti-interference square matrix, and the second anti-interference square matrix are generated.
[0047] The generated bipartite graph is saved to the system's database and sprayed onto the product packaging. It contains three sets of bipartite graphs, from left to right, storing information about the original matrix, the first anti-interference matrix, and the second anti-interference matrix, respectively.
[0048] 5) Information Decoding
[0049] If the original bipartite image information is complete, the system directly reads the first bipartite image from left to right. The decoding rules during reading are as follows: the left row rectangle is divided into four blocks from top to bottom, and the added connecting lines in each block store the information of the corresponding row in the original matrix; the right column rectangle is divided into four blocks, and the added connecting lines in each block store the information of the corresponding column in the original matrix. The other end of the added connecting lines in the first block of the left rectangle is read one by one to obtain the column coordinate information of the element with a value of 1 in the first row of the original matrix. Using the same method, all blocks of the left rectangle are read in sequence to obtain the complete data of the original matrix.
[0050] If the original bipartite graph image information is incomplete, or if the original bipartite graph can retain part of the lines, the line segments can be extended to recover the original connecting lines and obtain the complete data of the original matrix.
[0051] If the tilted line information of the original bipartite graph is completely lost, the damaged original bipartite graph can be horizontally flipped around the right rectangle. The resulting new bipartite graph corresponds to the transpose of the original square matrix. The information at the original missing lines in the new bipartite graph is XORed with the corresponding information in the first anti-interference bipartite graph to decrypt and obtain the damaged information of the original bipartite graph. That is, the complete data of the original square matrix is restored by XORing the information that is not lost in the symmetrical position of the original square matrix about the main diagonal with the information at the corresponding position of the first anti-interference square matrix. Figure 4 As shown, the thick black lines in the diagram indicate where line information is lost. The lost line information in the original bipartite graph is left 1 -> right 2, corresponding to the information in the 1st row and 2nd column of the original square matrix. The original bipartite graph is horizontally flipped around the right rectangle to obtain a new bipartite graph. The new bipartite graph stores the information after the transpose of the original square matrix. Its left 1 -> right 2 has no connecting line, which is represented as 0. In the first anti-interference bipartite graph, left 1 -> right 2 has a connecting line, which is represented as 1. XOR decoding of 0 and 1 yields the lost original bipartite graph information left 1 -> right 2 as 1, that is, the original square matrix 1st row and 2nd column is 1.
[0052] If the original bipartite graph loses information about a pair of horizontally flipped symmetrical lines, according to the method of obtaining the second anti-interference matrix, the second anti-interference bipartite graph is obtained by rotating the original bipartite graph 180 degrees around the center of the graph. The original bipartite graph information can be obtained by rotating the second anti-interference bipartite graph 180 degrees around the center of the graph, thus obtaining the complete data of the original matrix. For example... Figure 6 The thick black lines in the image represent areas where line information is lost, and this is an anti-interference binary search. Figure 3 Rotate 180 degrees around the center of the figure to obtain the information of the missing part of the original square matrix, and obtain the original data of the original square matrix.
[0053] The number of devices and processing scale described herein are for the purpose of simplifying the description of the invention, and applications, modifications and variations thereof will be apparent to those skilled in the art.
[0054] Although embodiments of the present invention have been disclosed above, they are not limited to the applications listed in the specification and embodiments. They can be applied to various fields suitable for the present invention. For those skilled in the art, other modifications can be easily made. Therefore, without departing from the general concept defined by the claims and their equivalents, the present invention is not limited to the specific details and illustrations shown and described herein.
Claims
1. A method for encoding and decoding an anti-interference matrix bipartite graph for commodity outer packaging, characterized in that, Includes the following steps: S1. Collect product information through the system, convert it into standard binary data format, and save it to the system's database; S2. The system generates binary logical information sequences at any time. These binary logical information sequences are associated with product information to form a one-to-one correspondence. The sequences are then saved in the system's database to generate the original matrix. S3. Generate a second and a third square matrix from the original square matrix. The second square matrix is the first anti-interference square matrix, and the third square matrix is the second anti-interference square matrix. In step S3, the first anti-interference square matrix is generated by XORing the original square matrix with its transpose. It is a symmetrical square matrix with all elements on its diagonal being 0. The corresponding bipartite graph characteristic is that this graph does not contain horizontal connecting lines and the graph is symmetrical when horizontally flipped. In step S3, the second anti-interference square matrix is generated by flipping the original square matrix along its secondary diagonal. ,in This represents the element in the i-th row and j-th column of the anti-interference matrix. The element in the (4-j)th row and (4-i)th column of the original square matrix has the characteristic that the bipartite graph can be rotated 180 degrees around the center of the graph to restore the original bipartite graph. S4. Generate three sets of bipartite graphs from the original square matrix, the first anti-interference square matrix, and the second anti-interference square matrix, and spray them onto the product packaging. In step S4, the product packaging includes three sets of bipartite graphs from left to right, storing information about the original square matrix, the first anti-interference square matrix, and the second anti-interference square matrix respectively. The bipartite graph is generated by dividing a rectangle into four equal parts from top to bottom, representing the first to fourth rows of the square matrix. This graphic is defined as a row rectangle. On the right side of the row rectangle, divide another rectangle of the same size into four equal parts from top to bottom, representing the first to fourth columns of the square matrix. This graphic is defined as a column rectangle. Use connecting lines to selectively connect the left and right areas. Whether or not to connect corresponds one-to-one with the information at the corresponding position in the square matrix. 1 corresponds to connection, and 0 corresponds to no connection. S5. Decode the information.
2. The anti-interference matrix bipartite graph encoding and decoding method for commodity outer packaging as described in claim 1, characterized in that, In step S2, the 4*4 bit binary logic information randomly generated by the computer is grouped into groups of four and stored in each row of the square matrix in order to generate the original square matrix.
3. The anti-interference matrix bipartite graph encoding and decoding method for commodity outer packaging as described in claim 1, characterized in that, In step S5, if the original bipartite image information is complete, the system directly reads the first bipartite image from left to right. The reading steps are as follows: the left row rectangle is divided into four blocks from top to bottom, and the connecting lines added to each block store the information of the corresponding row of the original matrix; the right column rectangle is divided into four blocks, and the connecting lines added to each block store the information of the corresponding column of the original matrix; the other end of the connecting lines added to the first block of the left rectangle is read one by one to obtain the column coordinate information of the element 1 in the first row of the original matrix; using the same method, all blocks of the left rectangle are read in sequence to obtain the complete data of the original matrix.
4. The anti-interference matrix bipartite graph encoding and decoding method for commodity outer packaging as described in claim 3, characterized in that, If the original bipartite image information is incomplete in step S5, and the original bipartite image can retain part of the lines, the line segments can be extended to recover the original connecting lines and obtain the complete data of the original matrix.
5. The anti-interference matrix bipartite graph encoding and decoding method for commodity outer packaging as described in claim 4, characterized in that, If the tilted line information of the original bipartite graph is completely lost in step S5, the damaged original bipartite graph can be horizontally flipped around the right rectangle. The resulting new bipartite graph is the transpose of the original square matrix. The information at the original missing lines in the new bipartite graph is XORed with the corresponding information in the first anti-interference bipartite graph to decrypt and obtain the damaged information of the original bipartite graph. That is, the complete data of the original square matrix is restored by XORing the information that is not lost in the symmetrical position of the original square matrix about the main diagonal with the information at the corresponding position of the first anti-interference bipartite graph.
6. The anti-interference matrix bipartite graph encoding and decoding method for commodity outer packaging as described in claim 5, characterized in that, If the original bipartite image loses a pair of horizontally flipped symmetrical line information in step S5, according to the method of obtaining the second anti-interference matrix, the second anti-interference bipartite image is obtained by rotating the original bipartite image 180 degrees around the center of the image. The original bipartite image information can be obtained by rotating the second anti-interference bipartite image 180 degrees around the center of the image, and the complete data of the original matrix can be obtained.