A Hamming code-based black and white dot matrix information encoding and decoding method for the outer packaging of commodities

Through the black and white dot matrix information encoding and decoding method based on Haiming Code, a 13-bit binary sequence is generated and a 4 rows and 13-column dot matrix is generated, which solves the problem of inability to trace information and easy to destroy during the product flow process, realizes the uniqueness and anti-interference of product information, and improves circulation management efficiency.

CN117009402BActive Publication Date: 2025-07-18TONGJI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311127266.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-04
Publication Date
2025-07-18
Estimated Expiration
2043-09-04

AI Technical Summary

Technical Problem

The prior art cannot effectively trace commodity information during the process of commodity flow, and traditional anti-counterfeiting methods are easily forged and destroyed, resulting in economic losses to the manufacturer.

Method used

The black and white dot matrix information encoding and decoding method based on Haiming code is adopted. By generating a 13-bit binary sequence as the coding sequence, and combining a triple verification sequence to generate 4 rows and 13 columns of dot matrix, black and white dots are used to represent the coded information, so that the uniqueness and anti-interference of the information are achieved.

Benefits of technology

It realizes the uniqueness and anti-interference of product information, improves the traceability of product flow, reduces the phenomenon of cross-trade, and improves management efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117009402B_ABST
    Figure CN117009402B_ABST
Patent Text Reader

Abstract

The present invention provides a Hamming code-based black and white dot matrix information encoding and decoding method for the outer packaging of commodities, belonging to the technical field of commodity anti-counterfeiting and traceability. This method uses a discretized information encoding matrix as the unique identity information of each unit package. Through data processing such as parity check, encoding, discretization, and decoding of the matrix information, the information marked on the circulating commodities has the characteristics of uniqueness, anti-interference, large capacity, and traceability. Using the method of the present invention, on the one hand, it improves the traceability of commodities in circulation; on the other hand, it is conducive to matrix information decoding and improves the query efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of anti-counterfeiting traceability of commodity information, and particularly relates to a method for encoding and decoding black and white dot matrix information based on Hamming code for commodity outer packaging. Background Art

[0002] With the continuous development of the economy and the trend of marketization, the circulation of trade is becoming faster and more convenient. However, commodity production enterprises are faced with thorny problems. During the circulation of commodities, the non-uniqueness of the information marked on the produced commodities leads to the inability to trace the commodities during the circulation process. The imitation of commodities and the damage to the commodity markings by some distributors have caused huge economic losses to the production enterprises.

[0003] Therefore, how to prevent the phenomena of non-traceability and damage to the markings during the circulation of commodities, and solve problems such as the flow and cross-region sales of circulating commodities has become a problem widely concerned by scholars at home and abroad. At the same time, many methods to solve the above problems have been proposed, mainly including printing types such as laser anti-counterfeiting, label anti-counterfeiting, and ink anti-counterfeiting. These traditional anti-counterfeiting methods are easy to forge and be damaged artificially during the circulation of commodities, and cannot achieve effective anti-counterfeiting and anti-cross-region sales effects. Summary of the Invention

[0004] The purpose of the present invention is to provide a method for encoding and decoding black and white dot matrix information based on Hamming code for commodity outer packaging, which is characterized by including the following steps:

[0005] S1: Collect commodity information and convert it into a standard data format;

[0006] S2: Randomly generate a 9-bit binary sequence by a computer as a commodity feature code, and the commodity feature code is bound to the commodity information in the database;

[0007] S3: Generate a coding sequence based on the commodity feature code by using Hamming check code, and the coding sequence is a 13-bit binary sequence;

[0008] S4: Obtain the binary complement code of the coding sequence as the first parity check sequence; use the 9-bit binary sequence with zeros appended as the second parity check sequence; obtain the binary complement code of the second parity check sequence as the third parity check sequence; increase information redundancy through the first parity check sequence, the second parity check sequence, and the third parity check sequence to facilitate data restoration;

[0009] S5: Generate a dot matrix based on the coding sequence and the first parity check sequence, the second parity check sequence, and the third parity check sequence. In the dot matrix, when the code is 1, it is drawn as a black dot; when the code is 0, it is drawn as a white dot;

[0010] S6: By reading the drawing condition of the black and white dot matrix on the surface of the commodity, decoding and restoring the original sequence, and querying in the database to obtain the commodity information.

[0011] Further, in the above-mentioned S3, the generation of the encoding sequence is specifically as follows: Insert k Hamming check codes at fixed positions in the commodity feature code corresponding to the commodity information to generate the encoding sequence.

[0012] Further, in the above-mentioned S4, in the second-level check sequence, the number of zeros is the number of bits of the Hamming check code. That is, for a 9-bit binary sequence, the number of bits of the Hamming check code is 4.

[0013] Further, in the above-mentioned S5, the dot matrix is a 4-row and 13-column dot matrix, specifically: The dots in the first row of the dot matrix are the encoding sequence; the dots in the second row of the dot matrix are the first-level check sequence; the dots in the third row are the second-level check sequence; the dots in the fourth row are the third-level check sequence.

[0014] Further, the row spacing of the dot matrix is 2mm, and the column spacing is 1mm.

[0015] Further, the above-mentioned S6 is specifically as follows: When the encoding sequence is interfered, it is restored through the inverse processing process of encoding, the commodity feature code information corresponding to the encoding sequence is obtained, and it is compared through the database to obtain the finally corresponding commodity information.

[0016] Further, the encoding sequence, the first-level check sequence, the second-level check sequence, the third-level check sequence and the commodity information are all stored in the database and are mutually associated.

[0017] Compared with the prior art, the beneficial effects of the present invention are mainly reflected in: Through the method of the present invention, the flow direction of commodities marked with black and white dot matrix information can be effectively traced. For anti-counterfeiting commodities and commodities with damaged black and white dot matrix information, it has good information recovery characteristics; it can facilitate enterprises to manage the information flow of commodities, reduce commodity cross-flow, and improve efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 It is a schematic diagram of the dots in the first row of the dot matrix in the embodiment of the present invention.

[0019] Figure 2 It is a schematic diagram of the dots in the second row of the dot matrix in the embodiment of the present invention.

[0020] Figure 3 It is a schematic diagram of the dots in the third row of the dot matrix in the embodiment of the present invention.

[0021] Figure 4 It is a schematic diagram of the dots in the fourth row of the dot matrix in the embodiment of the present invention

[0022] Figure 5Schematic diagram of the overall dot matrix in the embodiment of the present invention. Detailed implementation manner

[0023] The following will describe in more detail a method for encoding and decoding black and white dot matrix information based on Hamming code for commodity outer packaging in conjunction with the schematic diagram, in which the preferred embodiments of the present invention are shown. It should be understood that those skilled in the art can modify the present invention described herein while still achieving the beneficial effects of the present invention. Therefore, the following description should be understood as broad guidance for those skilled in the art and not as a limitation on the present invention.

[0024] A method for encoding and decoding black and white dot matrix information based on Hamming code for commodity outer packaging includes the following steps:

[0025] Step 1: Commodity information collection

[0026] Collect commodity information and convert it into a standard data format.

[0027] Step 2: Generate the original sequence

[0028] Randomly generate a 9-bit binary sequence by a computer and associate it with the collected commodity information.

[0029] Step 3: Generate the encoded sequence

[0030] Use the Hamming check code to generate the encoded sequence, and the encoded sequence is a 13-bit binary sequence.

[0031] Step 4: Generate information redundancy

[0032] Take the binary one's complement of the encoded sequence as the first-level check sequence; append zeros after the 9-bit binary sequence as the second-level check sequence, and the number of zeros is the number of bits of the Hamming check code. The number of bits of the Hamming check code for the 9-bit binary sequence is 4; take the binary one's complement of the second-level check sequence as the third-level check sequence; use these three groups of check sequences to increase information redundancy for convenient data restoration.

[0033] Step 5: Generate the dot matrix

[0034] Generate a dot matrix of four rows and thirteen columns from the triple check codes of the encoded sequence. Each check code sequence is a row of the dot matrix, that is, the first row of dots is the encoded sequence, the second row of dots is the first-level check sequence, the third row of dots is the second-level check sequence, and the fourth row of dots is the third-level check sequence.

[0035] Draw dots every 1 mm in each row, with a 2-mm interval between rows of the dot matrix. Draw black dots for encoding 1 and white dots for encoding 0.

[0036] Step 6: Decode the dot matrix information

[0037] By reading the drawing situation of the black and white dot matrix on the surface of the commodity, decoding and restoring the original sequence, and querying the commodity information in the database.

[0038] The method provided by the present invention will be further described below through specific embodiments.

[0039] Embodiment

[0040] I. Encoding

[0041] Assume that the original sequence is 101101100, and Hamming check code is used for encoding. Let the number of data bits be m bits and the number of check bits be k bits, then m and k must satisfy the following relationship: m + k ≤ 2 k -1.

[0042] (1) Determine the number of check bits. The original sequence is 9 bits, that is, m = 9. From the formula m + k ≤ 2 k -1, it can be known that the minimum value of k is 4. Therefore, the number of data bits in the first-level check sequence is 9 + 4 = 13;

[0043] (2) Determine the positions of the Hamming check bits. The Hamming check bits are placed at the positions with index numbers of 2 n (n = 0, 1, 2,..., k - 1). In this example, k = 4, so the indexes of the check bits are the 1st, 2nd, 4th, and 8th bits;

[0044] (3) Fill in the data bits. Leave the 1st, 2nd, 4th, and 8th bits empty in Table 1, and fill the other positions with the original sequence;

[0045] Index number 1 2 3 4 5 6 7 8 9 10 11 12 13 H1 H2 1 H4 0 1 1 H8 0 1 1 0 0

[0046] Table 1

[0047] (4) List the binary conversion table, as shown in Table 2

[0048] Index number 8(23) 4(22) 2(21) 1(20) 3 0 0 1(H2) 1(H1) 5 0 1(H4) 0 1(H1) 6 0 1(H4) 1(H2) 0 7 0 1(H4) 1(H2) 1(H1) 9 1(H8) 0 0 1(H1) 10 1(H8) 0 1(H2) 0 11 1(H8) 0 1(H2) 1(H1) 12 1(H8) 1(H4) 0 0 13 1(H8 1(H4) 0 1(H1)

[0049] Table 2

[0050] In Table 2, starting from the second row, the first column of each row represents the index number, and the index number is all the bits except the Hamming check bits. The following four columns are the binary representations corresponding to this index number, and the number of bits depends on the number of Hamming check bits calculated in step (1). For example, the index number in the second row is 3, and the binary corresponding to decimal 3 is 11. Since the number of Hamming check bits is 4, it is represented by four 0011.

[0051] In the fifth column, code 1 represents that this index number can be checked by H1, and code 0 represents that this index number cannot be checked by H1; in the fourth column, code 1 represents that this index number can be checked by H2, and code 0 represents that this index number cannot be checked by H2; and so on for the other columns.

[0052] As can be seen from Table 2:

[0053] The check bit H1 is responsible for checking bits 3, 5, 7, 9, 11, and 13 (the part marked H1 in the above table in parentheses). The exclusive OR of the values in the corresponding positions is: 1⊕0⊕1⊕0⊕1⊕0 = 1. Since Hamming check performs even parity check, then H1 = 1;

[0054] The check bit H2 is responsible for checking bits 3, 6, 7, 10, and 11 (the part marked H2 in the above table in parentheses). The exclusive OR of the values in the corresponding positions is: 1⊕1⊕1⊕1⊕1 = 1, then H2 = 1;

[0055] The check bit H4 is responsible for checking bits 5, 6, 7, 12, and 13 (the part marked H4 in the above table in parentheses). The exclusive OR of the values in the corresponding positions is: 0⊕1⊕1⊕0⊕0 = 0, then H4 = 0;

[0056] The check bit H8 is responsible for checking bits 9, 10, 11, 12, and 13 (the part marked H8 in the above table in parentheses). The exclusive OR of the values in the corresponding positions is: 0⊕1⊕1⊕0⊕0 = 0, then H8 = 0.

[0057] (5) The encoded sequence is 1110011001100, where bits 1, 2, 4, and 8 are check codes, as

[0058] shown in Table 3;

[0059] Index number 1 2 3 4 5 6 7 8 9 10 11 12 13 1 1 1 0 0 1 1 0 0 1 1 0 0

[0060] Table 3

[0061] (6) The first - level check sequence is obtained by taking the inverse code of the encoded sequence: 0001100110011;

[0062] (7) Four 0s are appended after the 9 - bit binary sequence to obtain the second - level check sequence: 1011011000000;

[0063] (8) The third - level check sequence is obtained by taking the inverse code of the second - level check sequence: 0100100111111;

[0064] II. Drawing a black - and - white dot matrix diagram

[0065] As Figure 1 shown, the first row of dots is drawn according to the encoded sequence 1110011001100. There are a total of 13 dots, with a 1 - mm interval between each dot. Black dots represent code 1, and white dots represent code 0;

[0066] As Figure 2As shown, draw the second row of points according to the first parity check sequence 0001100110011, with a total of 13 points, each point spaced 1 mm apart. Black points represent code 1 and white points represent code 0;

[0067] As Figure 3 shown, draw the third row of points according to the second parity check sequence 1011011000000, with a total of 13 points, each point spaced 1 mm apart. Black points represent code 1 and white points represent code 0;

[0068] As Figure 4 shown, draw the fourth row of points according to the third parity check sequence 0100100111111, with a total of 13 points, each point spaced 1 mm apart. Black points represent code 1 and white points represent code 0;

[0069] As Figure 5 shown, the row spacing between each row of points is 2 mm. Arrange the 4 rows of points to obtain a black and white dot matrix diagram with 4 rows and 13 columns.

[0070] III. Decoding

[0071] Read the original information based on the black and white dot matrix information and the coding rules, and compare it with the database information to determine the commodity attributes.

[0072] The above is only the preferred embodiment of the present invention and does not impose any limitation on the present invention. Any person skilled in the art, within the scope of the technical solution of the present invention, makes any form of equivalent replacement or modification and other changes to the technical solution and technical content disclosed by the present invention, all of which belong to the content within the scope of the technical solution of the present invention and still fall within the protection scope of the present invention.

Claims

1. A method for encoding and decoding black and white dot matrix information based on Hamming code for the outer packaging of commodities, characterized in that, It includes the following steps: S1: Collect commodity information and convert it into a standard data format; S2: Randomly generate a 9-bit binary sequence by computer as the commodity feature code, and the commodity feature code is bound to the commodity information in the database; S3: Generate a coding sequence based on the commodity feature code using Hamming check codes, and the coding sequence is a 13-bit binary sequence; S4: Obtain the first parity check sequence by taking the binary complement of the coding sequence; obtain the second parity check sequence by appending zeros to the 9-bit binary sequence; obtain the third parity check sequence by taking the binary complement of the second parity check sequence; increase information redundancy through the first parity check sequence, the second parity check sequence, and the third parity check sequence to facilitate data restoration; S5: Generate a dot matrix based on the coding sequence and the first parity check sequence, the second parity check sequence, and the third parity check sequence. In the dot matrix, when the code is 1, it is drawn as a black dot; when the code is 0, it is drawn as a white dot; S6: Decode and restore the original sequence by reading the drawing situation of the black and white dot matrix on the commodity surface, and query the commodity information in the database.

2. The method for encoding and decoding black and white dot matrix information based on Hamming code for the outer packaging of goods according to claim 1, characterized in that, In S3, the generation of the coding sequence is specifically: insert k Hamming check codes at fixed positions in the commodity feature code corresponding to the commodity information to generate the coding sequence.

3. The method for encoding and decoding black and white dot matrix information based on Hamming code for commodity outer packaging according to claim 1, characterized in that, In S4, in the second parity check sequence, the number of zeros is the number of bits of the Hamming check code, that is, the number of bits of the Hamming check code of the 9-bit binary sequence is 4.

4. The Hamming code-based black and white dot matrix information encoding and decoding method for commodity outer packaging according to claim 1, characterized in that, In S5, the dot matrix is a 4-row and 13-column dot matrix, specifically: the dots in the first row of the dot matrix are the coding sequence; the dots in the second row of the dot matrix are the first parity check sequence; The third row of the dot matrix is the second parity check sequence; The fourth row of the dot matrix is the third parity check sequence.

5. The method for encoding and decoding black and white dot matrix information based on Hamming code for commodity outer packaging according to claim 4, wherein, The row spacing of the dot matrix is 2mm, and the column spacing is 1mm.

6. The method for encoding and decoding black and white dot matrix information based on Hamming code for the outer packaging of goods according to claim 1, characterized in that, S6 is specifically: when the coding sequence is interfered, restore it through the inverse processing process of the coding, obtain the commodity feature code information corresponding to the coding sequence, and compare it through the database to obtain the final corresponding commodity information.

7. The method for encoding and decoding black and white dot matrix information based on Hamming code for commodity outer packaging according to claim 1, characterized in that, The coding sequence, the first parity check sequence, the second parity check sequence, the third parity check sequence, and the commodity information are all stored in the database and are mutually associated.

Citation Information

Patent Citations

  • QR code security authentication method and system based on Hamming codes

    CN110097159A

  • Matrix type two-dimensional code, and encoding method and decoding method therefor

    WO2016119239A1