Code generation, decoding and Anti-counterfeiting method for dot matrix code
By generating randomly distributed dot matrix codes and using server verification, the problem of easy counterfeiting of QR codes is solved, achieving the concealment and anti-counterfeiting effect of dot matrix codes, which is suitable for anti-counterfeiting labels for products.
Patent Information
- Application Number
- PCT/CN2025/097049
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-05-29
- Filing Date
- 2025-05-26
- Publication Date
- 2025-12-04
AI Technical Summary
Existing QR codes are easily generated by open-source algorithms and their location-detection graphics are easily recognized, making it easy to counterfeit product anti-counterfeiting labels and rendering them ineffective in preventing counterfeiting.
A randomly distributed dot matrix code is generated, including random positioning points and data storage area. The code is then verified for legitimacy by a server. Anti-counterfeiting information is printed on carbonless packaging and identified using carbon printing and infrared devices.
It improves the concealment of dot matrix codes, prevents the positioning points from being identified and damaged, protects the anti-counterfeiting information in the data storage area, and achieves effective anti-counterfeiting labeling for goods.
Smart Images

Figure CN2025097049_04122025_PF_FP_ABST
Abstract
Description
Dot code generation, decoding and anti-counterfeiting method TECHNICAL FIELD
[0001] The present application belongs to the technical field of dot code anti-counterfeiting, and particularly relates to a dot code generation, decoding and anti-counterfeiting method. BACKGROUND
[0002] With the popularity of terminal electronic devices, two-dimensional codes are widely used as a common label. Two-dimensional codes have the advantages of high information density and high readability, and are often used as a kind of anti-counterfeiting mark of goods.
[0003] However, some characteristics of the existing two-dimensional code make it unsuitable for use as an anti-counterfeiting mark of goods. Specifically, the reasons include the following points: 1) the open source algorithm of the two-dimensional code, which allows counterfeiters to directly generate two-dimensional codes using the open source algorithm; 2) the position detection pattern in the two-dimensional code is easy to be recognized by the human eye, and the two-dimensional code edge is provided with a blank area, so that counterfeiters can directly determine the position and range of the anti-counterfeiting mark, and can copy the two-dimensional code by printing and other methods.
[0004] In summary, there is a need for a new dot code suitable for use as an anti-counterfeiting mark of goods to overcome the above-mentioned shortcomings. SUMMARY
[0005] In view of the defects in the prior art, the purpose of the present application is to provide a dot code generation, decoding and anti-counterfeiting method.
[0006] In a first aspect, the present application provides a dot code generation, decoding and anti-counterfeiting method, comprising:
[0007] generating a dot code;
[0008] printing the generated dot code according to a predetermined anti-counterfeiting method;
[0009] identifying the dot code on the printed matter and mapping it to the corresponding numerical value, and then converting it to decoding data;
[0010] performing legality verification on the decoding data by a server.
[0011] In a second aspect, the present application further provides an anti-counterfeiting mark comprising a dot code.
[0012] The dot code is identified and mapped to the corresponding numerical value to convert it to decoding data.
[0013] The decoding data is used for legality verification by a server.
[0014] Optionally, the method for generating, decoding and anti-counterfeiting of the dot matrix code according to the first aspect, or the anti-counterfeiting mark according to the second aspect, the dot matrix code comprises: positioning points and data storage areas; wherein the positioning points are used to indicate the starting positions of the data storage areas, and the data storage areas are used to store anti-counterfeiting information.
[0015] The positions of the positioning points are randomly distributed, and the positioning points comprise a specified shape formed by three or more points. For example, the specified shape formed by three points is a positioning point in the form of 110, 010. For another example, the specified shape formed by three points is a positioning point in the form of 0110, 0100. For example, the specified shape formed by four points is a positioning point in the form of 0100, 0111. For example, the specified shape formed by five points is a positioning point in the form of 0101, 0111.
[0016] It should be noted that the number of the positioning points is not limited, and the length of the binary string is not limited.
[0017] In a preferred embodiment, at least two digits 1 in a 2-row matrix formed by two binary strings are located in the same column. Correspondingly, if 1 in the binary string represents a black dot in the dot matrix, and 0 in the binary string represents a white dot in the dot matrix, at least two black dots are located in the same column in the dot matrix. Such a setting can effectively prevent misreading of the positioning points and improve the recognition accuracy of the positioning points.
[0018] Optionally, the method for generating, decoding and anti-counterfeiting of the dot matrix code according to the first aspect, or the anti-counterfeiting mark according to the second aspect, the points in the positioning points are located in multiple rows; and there are row gaps between at least two of the multiple rows.
[0019] The multiple rows are different odd rows or different even rows.
[0020] Optionally, the method for generating, decoding and anti-counterfeiting of the dot matrix code according to the first aspect, or the anti-counterfeiting mark according to the second aspect, the dot matrix code comprises multiple positioning points, and the positioning points are randomly distributed as a whole. Preferably, the positioning points are uniformly distributed, such as spiral distribution.
[0021] Optionally, the method for generating, decoding and anti-counterfeiting of the dot matrix code according to the first aspect, or the anti-counterfeiting mark according to the second aspect, in the data storage area, data is converted into a binary form for encoding and storage, wherein: the value 1 is represented by a black dot in the dot matrix code, the value 0 is represented by a white dot in the dot matrix code, and the dots in the dot matrix code maintain a fixed interval in the horizontal direction and the vertical direction.
[0022] The effective data is uniformly and repeatedly present in the data storage area, wherein the effective data refers to data containing anti-counterfeiting information.
[0023] The dot code is printed on the carbon-free package by carbon printing.
[0024] Optionally, the dot code generation, decoding and anti-counterfeiting method according to the first aspect, or the anti-counterfeiting mark according to the second aspect, the dot code on the printed matter is identified and mapped to a corresponding numerical value, comprising:
[0025] The dot code image collected by the camera is subjected to grayscale processing to obtain a grayscale image;
[0026] The grayscale image is subjected to contour detection to obtain contour information of each code point in the image;
[0027] According to the contour information, the position of each code point is determined;
[0028] Each code point is mapped to binary data;
[0029] The conversion into decoding data comprises:
[0030] The positioning point is searched for;
[0031] Starting from the starting position determined by the positioning point, the data is read in the encoding order for decoding.
[0032] In a third aspect, the present application further provides an article, wherein the article or the package of the article has the anti-counterfeiting mark according to any one of the first aspect or the second aspect.
[0033] In a fourth aspect, the present application further provides a computer readable storage medium storing a computer program, wherein the computer program is executed by a processor to implement the steps of the dot code generation, decoding and anti-counterfeiting method according to any one of the first aspect or the second aspect.
[0034] In a fifth aspect, the present application further provides an electronic device, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the computer program is executed by the processor to implement the steps of the dot code generation, decoding and anti-counterfeiting method according to any one of the first aspect or the second aspect.
[0035] Compared with the prior art, the present application has the following beneficial effects:
[0036] The dot matrix code generation, decoding and anti-counterfeiting method provided by the application comprises the following steps: generating a dot matrix code; printing the generated dot matrix code according to a preset anti-counterfeiting mode; identifying the dot matrix code on the printed matter, mapping the dot matrix code into corresponding numerical values, and converting the numerical values into decoding data; and performing legality verification on the decoding data through a server. Thus, the positions of the positioning points in the dot matrix code can be randomized, the positions of the positioning points in the dot matrix code are more concealed, the positioning points are not easy to be identified, the anti-counterfeiting information of the data storage area is effectively protected, and the dot matrix code can be widely used as an anti-counterfeiting label of a product. BRIEF DESCRIPTION OF DRAWINGS
[0037] Other features, objects and advantages of the application will become more apparent from the following detailed description of non-limiting embodiments with reference to the attached drawings:
[0038] Fig. 1 is a flowchart of a dot matrix code generation, decoding and anti-counterfeiting method provided by an embodiment of the application;
[0039] Fig. 2 is a schematic diagram of a dot matrix code provided by an embodiment of the application;
[0040] Fig. 3 is a schematic diagram of a dot matrix code provided by an embodiment of the application;
[0041] Fig. 4 is a schematic diagram of the principle of decoding of a dot matrix code provided by an embodiment of the application;
[0042] Fig. 5 is a schematic diagram of the structure of an electronic device provided by an embodiment of the application. DETAILED DESCRIPTION
[0043] The application will be described in detail below with reference to specific embodiments. The following embodiments will help those skilled in the art to further understand the application, but do not limit the application in any form. It should be noted that those skilled in the art can make several changes and improvements without departing from the concept of the application. These all belong to the protection scope of the application.
[0044] At present, most dot matrix code encoding is positioned by positioning points in fixed positions. This mode is easy to find the positioning points by people, so that the positioning points in the dot matrix code are destroyed, resulting in that the correct information cannot be identified.
[0045] In view of the problems in the prior art, the application provides a dot matrix code generation, decoding and anti-counterfeiting method, which aims to solve the problems that the dot matrix code is easy to be positioned and destroyed, and improve the concealment of the dot matrix code so that it can be used as an anti-counterfeiting label of a product.
[0046] Fig. 1 is a flowchart of a dot matrix code generation, decoding and anti-counterfeiting method provided by an embodiment of the application, as shown in Fig. 1, the method in the embodiment can comprise:
[0047] Step S101, generating dot matrix code.
[0048] In an example embodiment, the dot matrix code comprises: a locating point and a data storage area; wherein the locating point is used to indicate the starting position of the data storage area, and the data storage area is used to store anti-counterfeiting information.
[0049] In an example embodiment, the position of the locating point can be randomly distributed, and the locating point comprises a specified shape composed of three or more points, thereby improving the difficulty of identifying the locating point by the human eye.
[0050] In an example embodiment, the specified shape is composed of three points, for example, the locating point is 110, 010, or 011, 010, or 0110, 0100. The specified shape is composed of four points, for example, the locating point is 0100, 0111. The specified shape is composed of five points, for example, the locating point is 0101, 0111.
[0051] It should be noted that the number of locating points is not limited, and the length of the binary string is not limited.
[0052] In a preferred embodiment, at least two digits 1 in a 2-row matrix composed of two binary strings are located in the same column. Correspondingly, if 1 in the binary string represents a black dot in the dot matrix, and 0 in the binary string represents a white dot in the dot matrix, it is equivalent to setting at least two black dots in the same column in the dot matrix. Such a setting mode can effectively prevent misreading of the locating point and improve the identification accuracy of the locating point.
[0053] In an example embodiment, the points in the locating point are located in multiple rows, and there are staggered rows between at least two of the multiple rows. The multiple rows are different odd rows or are located in different even rows. Data can be stored in multiple groups to improve redundancy, so that even if part of the data is damaged, the correct reading of the data can still be ensured.
[0054] In an example embodiment, the row data is grouped in pairs, and each group contains a locating point.
[0055] It should be noted that in the present embodiment, the multiple consecutive rows refer to multiple rows arranged from top to bottom, for example, the first row, the second row, and the third row are consecutive rows, the second row and the third row are consecutive rows, and so on. In the present embodiment, the staggered rows refer to the interval of one N+1 row between the Nth row and the N+2th row. Similarly, in addition to an interval of one row, an interval of more than one row can also be provided, for example, an interval of two rows, an interval of four rows, and further preferably an interval of any odd number of rows, for example, an interval of three rows, an interval of five rows, and the like.
[0056] The points in the positioning points are located in multiple rows, for example, in the 3rd row, the 4th row, and the 6th row, for example, in the 3rd row, the 4th row, and the 5th row, for example, in the 3rd row, the 5th row, and the 7th row.
[0057] For example, the positioning points in the embodiment can include a specified shape composed of at least three black points, which can identify the direction from left to right. FIG. 2 is a schematic diagram of dot matrix code provided by the embodiment, and FIG. 3 is a schematic diagram of dot matrix code provided by the embodiment. As shown in FIG. 2, the positioning points include three points, the 2nd row and the 4th row in the even rows form a T shape (see the boxed black points), and the 18th row and the 20th row form a T shape; the 5th row and the 7th row in the odd rows form a T shape, and the 17th row and the 19th row form a T shape. As shown in FIG. 3, the positioning points include three points, the 2nd row and the 4th row in the even rows form a shape similar to the number 7 (see the boxed black points), and the 18th row and the 20th row form a shape similar to the number 7; the 5th row and the 7th row in the odd rows form a shape similar to the number 7, and the 17th row and the 19th row form a shape similar to the number 7.
[0058] It should be noted that the embodiment does not limit the number of specific points that constitute the positioning points, and the shapes formed by the points.
[0059] In an optional embodiment, the points in the positioning points are located in different odd rows or different even rows. Specifically, the odd rows or the even rows as a whole can be offset by half the interval to identify the time zone.
[0060] In the embodiment, the data is formed by the rows as a whole, so that the dot matrix code has no regularity in vision and is more concealed, and is not easy to be imitated and damaged.
[0061] In another optional embodiment, the dot matrix code includes multiple positioning points, and the positioning points are alternately distributed in the left and right regions as a whole. Such a setting mode belongs to a redundant design. If the left region is polluted, the positioning points can still be identified from the right region, so that the identification rate of the effective data can be improved.
[0062] For example, in the data storage region, the data is converted into a binary form for encoding and storage, in which: the value 1 is represented by a black point in the dot matrix code, the value 0 is represented by a white point in the dot matrix code, and the points in the dot matrix code maintain a fixed interval in the horizontal direction and the vertical direction.
[0063] In yet another optional embodiment, the effective data appears uniformly and multiple times in the data storage region, wherein the effective data refers to data containing anti-fake information.
[0064] In step S102, the generated dot matrix code is printed according to a preset anti-counterfeiting manner.
[0065] In this embodiment, the dot matrix code can be printed on the carbon-free package by carbon printing, which is not easy to be recognized by naked eyes and is not easy to be copied. Then, the dot matrix code is scanned by a special infrared device to read the data.
[0066] In step S103, after the dot matrix code on the printed matter is recognized and mapped into corresponding numerical values, the dot matrix code is converted into decoding data.
[0067] In this embodiment, the dot matrix code image collected by the camera can be subjected to grayscale processing to obtain a grayscale image. Then, the grayscale image is subjected to contour detection to obtain contour information of each code point in the image. According to the contour information, the position of each code point is determined. Finally, each code point is mapped into binary data according to the position.
[0068] For example, FIG. 4 is a schematic diagram of the principle of decoding the dot matrix code according to an embodiment of the present application. As shown in FIG. 4, the dot matrix code image is scanned by a device including a camera, and then the scanned image is subjected to perspective correction processing to obtain the dot matrix code. The contour of each code point in the dot matrix code is obtained, and is further mapped into numerical values. Finally, the decoding data is obtained.
[0069] In step S104, the decoding data is subjected to legality verification by a server.
[0070] In this embodiment, the decoded data is sent to the server for verification of legality.
[0071] Specifically, the server pre-stores the to-be-encoded data, and the anti-counterfeiting information in the to-be-encoded data is associated with the product identification information. The server queries the anti-counterfeiting information according to the received product identification information, and compares the received anti-counterfeiting information with the locally stored anti-counterfeiting information. If the comparison result is consistent, the dot matrix code is considered to be a genuine product. Otherwise, the dot matrix code is considered to be a counterfeit product.
[0072] In this embodiment, the dot matrix code is generated, the generated dot matrix code is printed according to a preset anti-counterfeiting manner, the dot matrix code on the printed matter is recognized and mapped into corresponding numerical values, and the dot matrix code is converted into decoding data. The decoding data is subjected to legality verification by a server. Thus, the positions of the positioning points in the dot matrix code are not fixed and accumulated, and the randomness is high, so that the dot matrix code is not easy to be recognized by artificial recognition, and the threshold for imitation is indirectly improved. When the positions of the positioning points cannot be accurately recognized, the region for storing data is effectively protected, so that the dot matrix code can be widely used as a product anti-counterfeiting label.
[0073] The present application also provides an anti-counterfeiting label, which comprises a dot matrix code. The dot matrix code is recognized and mapped into corresponding numerical values to be converted into decoding data. The decoding data is subjected to legality verification by a server.
[0074] It should be noted that the anti-counterfeiting mark in the embodiment can be generated by the method shown in Figure 1. The dot matrix code of the anti-counterfeiting mark includes: a positioning point and a data storage area; wherein the positioning point is used to indicate the starting position of the data storage area, and the data storage area is used to store anti-counterfeiting information; the position of the positioning point is randomly distributed, and the positioning point includes a specified shape composed of at least three black points.
[0075] For example, the points in the positioning point are located in multiple rows; there are staggered rows between at least two of the multiple rows; the multiple rows are different odd rows, or are located in different even rows.
[0076] It should be noted that the multiple consecutive rows in the embodiment refer to multiple rows arranged from top to bottom, for example, the second row, the third row, and the fourth row are consecutive rows, the second row and the third row are consecutive rows, and the like. In the embodiment, the staggered rows refer to the interval of one N+1 row between the Nth row and the N+2th row. Similarly, in addition to one row, more than one row can be staggered, for example, two rows, four rows, and further preferably more than one odd row, for example, three rows, five rows, and the like.
[0077] In the embodiment, the dot matrix code includes multiple positioning points, and the positioning points are alternately distributed in a spiral shape as a whole. In the data storage area, the data is converted into a binary form for encoding and storage, wherein: the value 1 is represented by a black point in the dot matrix code, and the value 0 is represented by a white point in the dot matrix code, and the points in the dot matrix code maintain a fixed interval in the horizontal and vertical directions; the effective data uniformly and multiple times appears in the data storage area, wherein the effective data refers to data containing anti-counterfeiting information; and the dot matrix code is printed on a carbon-free package by carbon printing.
[0078] Further, the dot matrix code image captured by the camera can be processed by grayscale processing to obtain a grayscale image; the grayscale image is subjected to contour detection to obtain contour information of each code point in the image; the positions of the code points are determined according to the contour information; the positions of the code points are mapped into binary data; then, the positioning points are searched for; starting from the starting position determined by the positioning points, the data is read in the order of encoding.
[0079] The anti-counterfeiting mark in the embodiment can randomize the positions of the positioning points in the dot matrix code, so that the positions of the positioning points in the dot matrix code are more concealed, the positioning points are not easily identified, the anti-counterfeiting information of the data storage area is effectively protected, and the dot matrix code can be widely used as a product anti-counterfeiting label.
[0080] The application also provides an article, wherein the article or the packaging of the article has the anti-counterfeiting mark described above. For example, the article is a toy.
[0081] The application further provides a dot-matrix code generation, decoding and anti-counterfeiting system, i.e., an electronic device, which can be realized by executing the flow steps of the dot-matrix code generation, decoding and anti-counterfeiting method, i.e., the dot-matrix code generation, decoding and anti-counterfeiting method can be understood as a preferred embodiment of the dot-matrix code generation, decoding and anti-counterfeiting system by those skilled in the art.
[0082] FIG. 5 is a structural schematic diagram of an electronic device provided by an embodiment of the application, as shown in FIG. 5, which comprises at least one processor 501; and a memory 502 in communication connection with the at least one processor 501; wherein the memory 502 stores instructions executable by the at least one processor 501, and the instructions are executed by the at least one processor 501 to enable the at least one processor 501 to execute the dot-matrix code generation, decoding and anti-counterfeiting method described above.
[0083] The memory 502 and the processor 501 are connected in a bus mode, the bus can comprise any number of interconnected buses and bridges, and the bus connects various circuits of the one or more processors 501 and the memory 502 together. The bus can also connect various other circuits such as peripheral devices, voltage regulators and power management circuits together, which are well known in the art, and thus, further description is not given herein. The bus interface provides an interface between the bus and the transceiver. The transceiver can be one element or multiple elements such as multiple receivers and transmitters, which provide units for communicating with various other devices on the transmission medium. The data processed by the processor 501 is transmitted on the wireless medium through the antenna, and further, the antenna also receives data and transmits the data to the processor 501.
[0084] The processor 501 is responsible for managing the bus and general processing, and can also provide various functions including timing, peripheral interface,
[0085] voltage regulation, power management and other control functions. And the memory 502 can be used to store data used by the processor 501 in performing operations.
[0086] The application further provides a computer readable storage medium storing a computer program, wherein the computer program is executed by a processor to implement the dot-matrix code generation, decoding and anti-counterfeiting method described above.
[0087] That is, those skilled in the art can understand that all or part of the steps in the methods of the above-mentioned embodiments can be completed by programs instructing relevant hardware, the programs are stored in a storage medium, and the programs include a plurality of instructions for causing an apparatus (which can be a single-chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps of the methods described in various embodiments of the present application. The foregoing storage medium includes a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.
[0088] Those skilled in the art can understand that the above-mentioned embodiments are specific embodiments for implementing the present application, and in actual applications, various changes can be made in form and details without departing from the spirit and scope of the present application.
[0089] The specific embodiments of the present application are described above. It needs to be understood that the present application is not limited to the specific embodiments described above, and those skilled in the art can make various changes or modifications within the scope of the claims, which does not affect the essential content of the present application. In the case of no conflict, the embodiments of the present application and the features in the embodiments can be combined with each other at will.
Claims
1. A method for generating, decoding and anti-counterfeiting of dot-matrix code, characterized in that, The method comprises: generating dot matrix code; printing the generated dot matrix code according to a preset anti-counterfeiting manner; identifying the dot matrix code on the printed matter, mapping the dot matrix code into corresponding numerical values, and converting the numerical values into decoding data; performing legality verification on the decoding data by a server.
2. A security marking, characterized in that The method comprises dot matrix code. The dot matrix code is identified and mapped into corresponding numerical values, and the numerical values are converted into decoding data. The decoding data is used for legality verification by a server.
3. The method for generating, decoding and anti-counterfeiting of dot-matrix code according to claim 1 or the anti-counterfeiting mark according to claim 2, characterized in that, The dot matrix code comprises positioning points and data storage areas; the positioning points are used to indicate the starting positions of the data storage areas, and the data storage areas are used to store anti-counterfeiting information. The positions of the positioning points are randomly distributed, and the positioning points comprise a specified shape formed by three or more points.
4. The method for generating, decoding and anti-counterfeiting of dot-matrix code or anti-counterfeiting mark according to claim 3, characterized in that, The points in the positioning points are located in multiple rows. There are row gaps between at least two of the multiple rows. The multiple rows are different odd rows or different even rows.
5. The method for generating, decoding and anti-counterfeiting of dot-matrix code or anti-counterfeiting mark according to claim 3, characterized in that, The dot matrix code comprises multiple positioning points, and the positioning points are randomly distributed as a whole.
6. The method for generating, decoding and anti-counterfeiting of dot-matrix code according to claim 3, characterized in that, In the data storage areas, data is converted into a binary form for encoding and storage; numerical value 1 is represented by black points in the dot matrix code, numerical value 0 is represented by white points in the dot matrix code, and the points in the dot matrix code maintain fixed intervals in the horizontal direction and the vertical direction. Effective data uniformly and repeatedly appears in the data storage areas; the effective data refers to data containing anti-counterfeiting information. The dot matrix code is printed on carbon-free packaging by carbon printing.
7. The dot code generation, decoding and anti-counterfeiting method or anti-counterfeiting mark according to any one of claims 1-6, characterized in that, Identifying the dot matrix code on the printed matter and mapping the dot matrix code into corresponding numerical values comprises: performing grayscale processing on a dot matrix code image collected by a camera to obtain a grayscale image; performing contour detection on the grayscale image to obtain contour information of each code point in the image; determining the positions of the code points according to the contour information; mapping the code points into binary data; The conversion into decoding data comprises: finding a positioning point; starting from the starting position determined by the positioning point, reading data in the encoding order, and performing decoding.
8. An article, characterized by, The anti-counterfeiting mark of any one of claims 1 to 7 is on the article or the packaging of the article.
9. A computer readable storage medium storing a computer program, characterized in that, The computer program is executed by a processor to implement the steps of the dot matrix code generation, decoding, and anti-counterfeiting method of any one of claims 1 to 7.
10. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The computer program is executed by a processor to implement the steps of the dot matrix code generation, decoding, and anti-counterfeiting method of any one of claims 1 to 7.
Citation Information
Patent Citations
Anti-counterfeiting method based on sparse dot matrix codes
CN113313225A
Code generating method of dot matrix code, decoding method of dot matrix code and anti-counterfeiting method
CN113435556A
Code generating, decoding and anti-counterfeiting method of dot matrix code
CN118569289A
Dot matrix anti-counterfeiting mark
CN209401226U