An offline authentication method based on anti-counterfeiting labels
By printing the first and second n-dimensional symbol patterns on the anti-counterfeiting label, storing the item feature information and comparing the hash value, the problem of offline authentication and anti-counterfeiting label diversion in the prior art is solved, and the reliability of offline authentication and anti-counterfeiting label is achieved.
Patent Information
- Application Number
- CN202210766058.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-01
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2042-07-01
AI Technical Summary
Existing QR code anti-counterfeiting methods require network support and cannot be implemented offline. In addition, the amount of image feature data in the existing technology is large and cannot effectively prevent the anti-counterfeiting label from being diverted or replaced.
An anti-counterfeiting label is used, with the first and second n-dimensional symbol patterns printed on the medium. The second data stores the characteristic information of the item. Offline authentication is achieved by comparing the second and third data, and the hash value of the first data is stored in the second n-dimensional symbol pattern to ensure a one-to-one correspondence.
It realizes automatic authentication in an offline environment, preventing anti-counterfeiting labels from being transferred or replaced, and has small data volume and high reliability, making it suitable for offline use.
Smart Images

Figure CN115062638B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to an off-line counterfeit identification method based on an anti-counterfeit label, and belongs to the field of two-dimensional code counterfeit identification. Background Art
[0002] A two-dimensional barcode (QR code for short) is a data symbol information carrier that uses a certain geometric shape and a black and white pattern distributed in a two-dimensional plane according to a certain pattern. Currently, there are several QR code anti-counterfeiting methods:
[0003] 1. Using a backend database to record QR code scan records, consumers can query the database to see if the code has been scanned before. This can help prevent counterfeiting to a certain extent. However, it requires network support and cannot be implemented in poor network conditions or when the network is offline.
[0004] 2. Pre-store QR code-related information in a backend database. The server extracts the relevant information of the QR code uploaded by the client and compares the extracted results with the data in the database. If they are inconsistent, the QR code is forged. However, this method still requires network support.
[0005] Therefore, an offline authentication method based on anti-counterfeiting labels is needed.
[0006] Patent publication number CN105493143B, "Identification Method, Identification System, Matching Device, and Program," discloses an image containing a QR code and a satin pattern. This solution stores the satin pattern features in the recognition device. However, network communication is required between the acquisition and recognition devices, making offline authentication impossible. Summary of the Invention
[0007] In order to overcome the problems existing in the prior art, the present invention designs an offline authentication method based on an anti-counterfeiting label, which stores second data through a second n-dimensional symbol pattern and then compares the second data with third data to achieve automatic offline authentication; wherein, since the medium is fixedly set on the article or article packaging, the second data represents its unique characteristic information, and the anti-counterfeiting label realizes a one-to-one correspondence with the article, effectively preventing the anti-counterfeiting label from being transferred to other articles.
[0008] In order to achieve the above object, the present invention adopts the following technical solutions:
[0009] An anti-counterfeiting label includes: a medium fixedly set on an object, the medium having a through hole and printed with a first n-dimensional symbol pattern and a second n-dimensional symbol pattern; the second n-dimensional symbol pattern is used to store second data, and the second data includes characteristic information of the object in the through hole.
[0010] Furthermore, the first n-dimensional symbol pattern stores first data, and the first data includes item information.
[0011] Furthermore, the second data also includes a hash value of the first data.
[0012] Furthermore, the method for acquiring the characteristic information of the object in the through hole is as follows:
[0013] Acquire a first image; identify a through-hole area in the first image; divide the through-hole area into grids, record position information and binarization information of i grids, and obtain second data.
[0014] Furthermore, the method for acquiring the characteristic information of the object in the through hole is as follows:
[0015] Acquire a first image; identify a through-hole area in the first image; record the coordinates of i pixels in the through-hole area whose grayscale difference with adjacent pixels is greater than a first threshold to obtain second data.
[0016] An off-line authentication method based on an anti-counterfeiting label comprises the following steps:
[0017] Acquire an image to be processed containing an anti-counterfeiting label; the anti-counterfeiting label has a through hole and is fixedly set on the article, and the anti-counterfeiting label has a first n-dimensional symbol pattern and a second n-dimensional symbol pattern
[0018] Reading a second n-dimensional symbol label in the image to be processed to obtain second data;
[0019] Extracting characteristic information of an object in the through-hole area of the image to be processed to obtain third data;
[0020] Compare the second data and the third data; and output an authentication result based on the comparison result.
[0021] Furthermore, the method further includes: reading a first n-dimensional symbol pattern in the image to be processed to obtain first data.
[0022] Furthermore, it also includes: calculating the hash value of the first data obtained by reading; the second data also includes the hash value of the first data; comparing the calculated hash value with the hash value in the second data, if the comparison result is inconsistent, outputting the authentication result as failed.
[0023] Furthermore, the steps of extracting characteristic information of the object in the through-hole area of the image to be processed to obtain the third data are as follows:
[0024] Identify a through-hole region in the image to be processed; divide the through-hole region into grids, record position information and binarization information of i grids, and obtain second data.
[0025] Furthermore, the steps of extracting characteristic information of the object in the through-hole area of the image to be processed to obtain the third data are as follows:
[0026] Identify a through-hole region in the image to be processed; record the coordinates of i pixels in the through-hole region whose grayscale difference with adjacent pixels is greater than a first threshold, and obtain third data.
[0027] Compared with the prior art, the present invention has the following characteristics and beneficial effects:
[0028] 1. The present invention achieves automatic offline authentication by storing second data in a second n-dimensional symbol pattern and then comparing the second data with third data. Since the medium is fixedly mounted on the article or article packaging, and the second data represents its unique characteristic information, the anti-counterfeiting label achieves a one-to-one correspondence with the article, effectively preventing the anti-counterfeiting label from being transferred to other articles.
[0029] 2. The feature information extracted by the present invention has a small amount of data and high reliability. The image features used in the prior art for authentication are multi-dimensional data with a large amount of data. However, the storage space of the QR code is limited, so it relies on server database storage and cannot be authenticated offline.
[0030] 3. The present invention stores the hash value of the first data in the second n-dimensional symbol pattern, thereby achieving a one-to-one correspondence between the first n-dimensional symbol pattern and the second n-dimensional symbol pattern, and effectively preventing the first n-dimensional symbol pattern from being replaced. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 It is a flow chart of the present invention;
[0032] Figure 2-5 This is a schematic diagram of the anti-counterfeiting label generation process of the present invention;
[0033] Figure 6 is a schematic diagram of the binarization result of the first image;
[0034] Figure 7 This is a schematic diagram of the grid segmentation result of the first image. DETAILED DESCRIPTION
[0035] The present invention will be described in more detail below with reference to the embodiments.
[0036] In one embodiment, the anti-counterfeiting label includes: a medium fixedly set on an article, the medium having a through hole, and the medium having a first n-dimensional symbol pattern and a second n-dimensional symbol pattern printed on the medium. The article is a commodity or commodity packaging. The first n-dimensional symbol pattern is a barcode, a QR code, a three-dimensional code or a dot matrix code, etc., in which first data is stored, and the first data is information such as a commodity link and commodity details; the second n-dimensional symbol pattern is a barcode, a QR code, a three-dimensional code or a dot matrix code, etc., in which second data is stored, and the second data includes a hash value of the first data and characteristic information of the commodity or commodity packaging in the medium through hole. In this embodiment, the first n-dimensional symbol pattern and the second n-dimensional symbol pattern are preferably three-dimensional codes. The method for generating the three-dimensional code can be referred to the following patents (CN106991462A "Three-dimensional code generation method", CN113435558A "A three-dimensional code encoding method, decoding method and anti-counterfeiting method containing hidden information", CN114154605A "A method and system for generating and identifying encrypted three-dimensional codes").
[0037] In one embodiment, generating an anti-counterfeiting label includes the following steps:
[0038] Obtain first data; convert the first data into binary stream data according to the encoding rule; arrange the code points according to the preset first code point arrangement rule, with data 0 in the binary stream data as white code points and data 1 as black code points, and generate the following Figure 3 The first code point matrix shown is the first n-dimensional symbol pattern. Positioning modules are printed at the corners of the first n-dimensional symbol pattern. The positioning modules include three positioning symbols and one correction symbol.
[0039] In this embodiment, the first code point arrangement rule is: arrange n1 columns continuously, with n2 code points arranged in each column from top to bottom; leave n3 columns blank; and continue to arrange n1 columns continuously, with n2 code points arranged in each column from top to bottom.
[0040] Print a first n-dimensional symbol pattern on a first medium. The first medium has n3 rows of blank areas in the middle of the first n-dimensional symbol pattern as through holes. The first medium is affixed to a product.
[0041] Obtain the second data; convert the second data into binary stream data according to the encoding rule; arrange the code points according to the preset second code point arrangement rule, with the data 0 in the binary stream data as the white code point and the data 1 as the black code point, and generate the following Figure 4 The second code point matrix shown is the second n-dimensional symbol pattern.
[0042] In this embodiment, the second code point arrangement rule is: arrange n1 rows continuously, with n2 code points arranged in each row from left to right; leave n3 rows blank; continue to arrange n1 rows continuously, with n2 code points arranged in each row from top to bottom.
[0043] The second n-dimensional symbol pattern is printed on the second medium. The blank area of the second medium in the middle of the second n-dimensional symbol pattern is a through hole. The second medium is superimposed and pasted on the first medium, and the through hole areas of the two overlap, so as to obtain the following Figure 5 Anti-counterfeiting label shown.
[0044] In one embodiment, the second data is obtained by photographing the first medium attached to the product to obtain a first image; identifying the through-hole area in the first image; performing block binarization processing on the first image to obtain a binary image, such as Figure 6 As shown; in the binary image, the through-hole area is divided into grids according to the size of the black code points of the first n-dimensional symbol pattern, as shown Figure 7 As shown in the figure, each grid is traversed, and the position information and binarization information of each grid i are recorded to obtain the second data. If the number of black pixels in a grid exceeds 1 / 2, the binarization information of the grid is considered to be 1. For example, 17171 indicates that the binarization information of the grid in row 17 and column 17 is 1.
[0045] In one embodiment, the method for obtaining the second data is as follows: photographing the first medium attached to the product to obtain a first image; identifying the through-hole area in the first image; grayscale processing the first image to obtain a grayscale image; in the grayscale image, traversing each pixel in the through-hole area, recording the coordinates of i pixels whose grayscale difference with the previous pixel is greater than a first threshold (the first threshold value in this embodiment is 80), to obtain the second data.
[0046] In one embodiment, the second data is image features such as color features (color histogram) and contour features.
[0047] In one embodiment, generating an anti-counterfeiting label includes the following steps:
[0048] Generate media with through holes; print or stick the media on product packaging.
[0049] Acquire first data; generate a first n-dimensional symbol pattern according to the first data; and print the first n-dimensional symbol pattern on a medium.
[0050] Acquire characteristic information of the object in the through-hole area of the medium to obtain second data; generate a second n-dimensional symbol pattern based on the second data; and print the second n-dimensional symbol pattern on the medium.
[0051] In one embodiment, Figure 5 The anti-counterfeiting label shown is authenticated by the following steps:
[0052] Obtaining an image to be processed containing an anti-counterfeiting label;
[0053] Identify the positioning module in the image to be processed;
[0054] According to the three positioning symbols and one correction symbol in the positioning module, the image to be processed is corrected in perspective;
[0055] Perform binarization on the corrected image to obtain the binarization result, such as Figure 6 As shown;
[0056] In the binarization result, a first code point matrix, i.e., a first n-dimensional symbol pattern, is obtained according to the first code point arrangement rule;
[0057] In the binarization result, a second code point matrix, i.e., a second n-dimensional symbol pattern, is obtained according to the second code point arrangement rule;
[0058] Recognizing a first n-dimensional symbol pattern in the image to be processed to obtain first data;
[0059] Reading a second n-dimensional symbol label in the image to be processed to obtain second data;
[0060] Extract the features of the through-hole area in the anti-counterfeiting label in the image to be processed to obtain the third data:
[0061] Identify a through-hole region in the image to be processed; divide the through-hole region into grids, record the positional information and binarized information of i grids, and obtain second data. For example, in the process of generating the anti-counterfeiting label, the data of the three grids at row 1, column 1, row 4, column 5, and row 17, column 17 are taken accordingly in this step. Specifically, the i grids to be selected can be determined based on the second data.
[0062] Compare the second data and the third data. If the number of grids with consistent binary information exceeds 80% of the total, the comparison results are considered consistent, and the hash value of the first data obtained by reading is further calculated; and the calculated hash value is compared with the hash value obtained by reading. If the comparison results are consistent, the authentication result is output as passed; otherwise, the authentication result is output as failed.
[0063] Obviously, the embodiments described are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
Claims
1. An anti-counterfeiting label, characterized in that: include: a medium fixedly disposed on the object, the medium having a through hole and printed with a first n-dimensional symbol pattern and a second n-dimensional symbol pattern; The second n-dimensional symbol pattern is used to store second data, the second data including characteristic information of the object in the through hole; The first n-dimensional symbol pattern stores first data, wherein the first data includes item information; The second data also includes a hash value of the first data.
2. The anti-counterfeiting label according to claim 1, characterized in that: The method for obtaining the characteristic information of the object in the through hole is as follows: Acquire a first image; identify a through-hole area in the first image; divide the through-hole area into grids, record position information and binarization information of i grids, and obtain second data.
3. The anti-counterfeiting label according to claim 1, characterized in that: The method for obtaining the characteristic information of the object in the through hole is as follows: Acquire a first image; identify a through-hole area in the first image; record position information of i pixels in the through-hole area whose grayscale difference with adjacent pixels is greater than a first threshold, and obtain second data.
4. An off-line authentication method based on anti-counterfeiting labels, characterized in that: The following steps are involved: Acquire an image to be processed including an anti-counterfeiting label; the anti-counterfeiting label has a through hole and is fixedly mounted on the article, and the anti-counterfeiting label has a first n-dimensional symbol pattern and a second n-dimensional symbol pattern; Reading a second n-dimensional symbol label in the image to be processed to obtain second data; Extracting characteristic information of an object in the through-hole area of the image to be processed to obtain third data; comparing the second data and the third data; According to the comparison results, output the authentication results; The method further includes: reading a first n-dimensional symbol pattern in the image to be processed to obtain first data; It also includes: calculating the hash value of the first data obtained by reading; the second data also includes the hash value of the first data; comparing the calculated hash value with the hash value of the first data in the second data, if the comparison result is inconsistent, outputting the authentication result as failed.
5. The offline authentication method based on anti-counterfeiting labels according to claim 4, characterized in that: The steps of extracting characteristic information of the object in the through-hole area of the image to be processed to obtain the third data are as follows: Identify a through-hole region in the image to be processed; divide the through-hole region into grids, record position information and binarization information of i grids, and obtain second data.
6. The offline authentication method based on anti-counterfeiting labels according to claim 4, characterized in that: The steps of extracting characteristic information of the object in the through-hole area of the image to be processed to obtain the third data are as follows: Identify a through-hole region in the image to be processed; record the coordinates of i pixels in the through-hole region whose grayscale difference with adjacent pixels is greater than a first threshold, and obtain third data.
Citation Information
Patent Citations
Identification methods, identification systems, matching devices and procedures
CN105493143B
Three-dimensional code generating method
CN106991462A
Coding method, decoding method and anti-counterfeiting method for three-dimensional code containing hidden information
CN113435558A
Encrypted three-dimensional code generation and identification method and system
CN114154605A
Anti-fake traceablility system and method based on label reading
CN106022805A