Extension code based on QR code, anti-counterfeiting method, system, equipment and medium
By setting feature points and extending the information storage area along the outer edge of the QR code, and using the RS error correction algorithm for encryption processing, the problem of easy counterfeiting of QR codes is solved, achieving a high level of security and reliability in anti-counterfeiting.
Patent Information
- Application Number
- CN202310642964.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-01
- Publication Date
- 2026-02-27
AI Technical Summary
Existing QR codes are easily counterfeited and lack security and reliability, making it difficult to effectively prevent the mass counterfeiting of goods.
Feature point patterns and extended information storage areas are set in the outer edge area of the QR code. The extended information is encrypted and converted into a two-dimensional dot matrix by the RS error correction algorithm, and then drawn on the preset medium together with the QR code image. The recognition end achieves dual verification through feature point detection and decryption.
It improves the anti-counterfeiting reliability of QR codes, effectively prevents product counterfeiting, increases information redundancy and security, and provides a high level of anti-counterfeiting protection.
Smart Images

Figure CN121581089A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of information processing, in particular to an extended code and anti-counterfeiting method, system, computer device and storage medium based on QR code. BACKGROUND
[0002] With the continuous development of commodity retail industry, commodity anti-counterfeiting becomes more and more important. As a low-cost commodity anti-counterfeiting technology, one product one code label anti-counterfeiting technology has been widely used in various industries; among them, QR (Quick Response) code (a square, in three of the four corners, a smaller square positioning pattern is printed) as the most commonly used two-dimensional code at present, is widely used in the field of commodity anti-counterfeiting. However, due to the open source characteristics of its generation mechanism, QR code is easy to be imitated and counterfeited; therefore, a more secure and reliable anti-counterfeiting method is urgently needed. SUMMARY
[0003] In order to overcome the shortcomings of the prior art, the embodiments of the present application provide an extended code and anti-counterfeiting method based on QR code, computer device and storage medium.
[0004] An extended code based on QR code, comprising a two-dimensional code image, the two-dimensional code image comprising a QR code image, a feature point pattern and an extended information storage area are arranged in the outer edge area of the QR code image;
[0005] Wherein, the QR code image stores target information; the feature point pattern is used to identify whether the extended information storage area includes extended information; the extended information includes check information corresponding to the target information.
[0006] An anti-counterfeiting method of an extended code based on QR code, comprising an extended code generation method, the extended code generation method is used to generate the extended code based on QR code as described above; and comprising:
[0007] Generating a QR code image containing target information;
[0008] Setting a feature point pattern and an extended information storage area in the outer edge area of the QR code image, wherein the feature point pattern is used to identify whether the extended information storage area includes extended information; the extended information includes check information corresponding to the target information;
[0009] The extended information is encrypted and then converted into a two-dimensional dot matrix by RS error correction algorithm;
[0010] The QR image, the feature point pattern and the extended information storage area are drawn together on a preset medium to obtain an extended code based on QR code.
[0011] The application discloses an extended code anti-fake system based on a QR code, which comprises an extended code generating end and an extended code identifying end.
[0012] A QR code generating module is arranged for generating a QR code image containing target information.
[0013] A characteristic point pattern and extended information generating module is arranged for setting a characteristic point pattern and an extended information storage area in a peripheral area of the QR code image, wherein the characteristic point pattern is used for identifying whether the extended information storage area contains extended information; and the extended information comprises check information corresponding to the target information.
[0014] A dot array converting module is arranged for converting the extended information into a two-dimensional dot array after encryption and RS error correction.
[0015] A drawing module is arranged for drawing the QR code image, the characteristic point pattern and the extended information storage area onto a preset medium to obtain an extended code based on the QR code.
[0016] The extended code identifying end comprises:
[0017] A QR code information extracting module is arranged for extracting a QR code image contained in the extended code based on the QR code on the preset medium, decoding the QR code image and obtaining target information to be verified.
[0018] A characteristic point pattern detecting module is arranged for detecting a characteristic point pattern in a peripheral area of the QR code image according to size information of the QR code image and a preset position of the characteristic point pattern.
[0019] An extended information positioning module is arranged for positioning a position of the extended information storage area according to a pointing direction of the characteristic point pattern if the characteristic point pattern is detected.
[0020] A decryption module is arranged for decrypting information parsed in the extended information storage area to obtain check information to be verified.
[0021] A check module is arranged for comparing the target information to be verified and the check information to be verified with target information and check information generated in the extended code generating method respectively to obtain a check result.
[0022] A computer device comprises a memory, a processor, a computer program stored in the memory and executable on the processor, and the processor executes the computer program to realize steps of an extended code generating method in the extended code anti-fake method based on the QR code; or a handheld device end executes the computer program to realize steps of an extended code identifying method in the extended code anti-fake method based on the QR code.
[0023] A computer readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the extended code generation method in the above-mentioned QR code-based extended code anti-counterfeiting method; or, the computer program, when executed by a processor, implements the steps of the extended code identification method in the above-mentioned QR code-based extended code anti-counterfeiting method.
[0024] The above-mentioned QR code-based extended code and anti-counterfeiting method, system, computer device and storage medium effectively prevent the forgery of the two-dimensional code by setting the feature points and the extended information storage area in the outer edge area of the QR code. The extended information is encrypted and encoded by a specific algorithm and drawn to the specified area, and at the same time, the repeated or cross-repeated processing is performed to increase the redundancy of the information. At the identification end, the extended information is decoded by performing the inverse operation, and together with the anti-counterfeiting code value information stored in the two-dimensional code, the double check is realized, and the reliability of the anti-counterfeiting is improved. The present scheme is not only simple and easy to implement, but also has high security and reliability, and can effectively prevent the batch counterfeiting of goods, and provides better protection for enterprises. BRIEF DESCRIPTION OF DRAWINGS
[0025] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the description of the embodiments of the present application. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0026] Figure 1 is a flowchart of the extended code generation method in an embodiment of the present application;
[0027] Figure 2 is a flowchart of the extended code identification method in an embodiment of the present application;
[0028] Figure 3 is a whole flowchart of the QR code-based extended code anti-counterfeiting system in an embodiment of the present application. DETAILED DESCRIPTION
[0029] The technical solutions in the embodiments of the present application will be described clearly and completely in the following with reference to the drawings of the embodiments of the present application. Obviously, the described embodiments are only some embodiments of the present application, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.
[0030] In an embodiment, a QR code-based extended code is provided, including a two-dimensional code image, the two-dimensional code image including a QR code image, a feature point pattern and an extended information storage area being arranged in a peripheral area of the QR code image; wherein the QR code image stores target information; the feature point pattern is used to identify whether the extended information storage area includes extended information; the extended information includes check information corresponding to the target information.
[0031] Specifically, the feature point pattern includes an ant trail, or a square, or an L line, but is not limited thereto. The peripheral area of the QR code image includes, but is not limited to, a preset dot matrix range in any one of the upper, lower, left, right, upper left, lower left, upper right, and lower right directions of the QR code image.
[0032] In an application scenario, the target information includes a one-to-one corresponding anti-counterfeit code value of a commodity, and the check information includes an extended check code corresponding to the anti-counterfeit code value, that is, the QR code-based extended code can realize one-to-one correspondence, and has the effect of preventing batch counterfeiting of anti-counterfeit code values.
[0033] Further, the extended information is drawn after the check information is encrypted, converted into a two-dimensional dot matrix through an RS error correction algorithm and binaryzation processing. The RS algorithm, i.e., Reed-Solomon code, or simply RS code, is based on the mathematical theory of finite fields, and encodes and decodes data as polynomials. Specifically, a data block of length n is first set, which is regarded as a polynomial of degree n-1, and each data block is encoded as a coefficient polynomial. Then, a higher degree polynomial is constructed from the coefficients, which is the check sum of the original data and is called the check polynomial. When sending data, the original data and the check polynomial are sent together; at the receiving end, the check polynomial is calculated according to the received polynomial, and if the calculated check polynomial is inconsistent with the received check polynomial, it means that the data has an error. By using inverse operations and error locating algorithms, the position of the error in the data can be found, and the error can be repaired through the error correction algorithm.
[0034] In an embodiment, as shown in FIG. 1, a QR code-based extended code anti-counterfeiting method is provided, including an extended code generation method and an extended code identification method, which are respectively used to generate the QR code-based extended code and identify the QR code-based extended code. Figure 2
[0035] The extended code generation method includes the following steps:
[0036] S1: generating a QR code image containing target information.
[0037] The target information is a one-to-one corresponding anti-counterfeit code of the commodity; and the QR code image can be generated by using the existing technology. Specifically, according to the anti-counterfeit code value of the product uniqueness of the identification label and the QR code generation mechanism, a common QR two-dimensional code image is generated.
[0038] S2: setting a feature point pattern and an extended information storage area in the outer edge area of the QR code image, wherein the feature point pattern is used to identify whether the extended information storage area includes the extended information; and the extended information includes check information corresponding to the target information.
[0039] The feature point pattern is used to identify whether the extended information is different from the common two-dimensional code, and specifically includes but is not limited to an ant line, or a square box, or an L line.
[0040] The outer edge area of the QR code image includes a preset dot matrix range in any one direction of the upper, lower, left, right, upper left, lower left, upper right, and lower right of the QR code image; for example, a 20*10 dot matrix range on the left side of the QR code image.
[0041] The check information, i.e., the extended check code, corresponds to the anti-counterfeit code value and is used to check the anti-counterfeit code value.
[0042] S3: after the extended information is encrypted, it is converted into a two-dimensional dot matrix through an RS error correction algorithm.
[0043] The encryption of the extended information can be performed by using various encryption algorithms, which are not limited herein.
[0044] The RS error correction algorithm is a coding algorithm based on a finite field, and the core idea is to convert data into a polynomial and express the coefficients of the polynomial as elements in the finite field GF(2^m). GF(2^m) is a finite field containing 2^m elements, and m represents the order of the finite field. In the RS error correction algorithm, the data is divided into k data blocks, a polynomial operation is performed on each data block to obtain a polynomial, and the coefficients of the polynomial are expressed as elements in the GF(2^m) field. The obtained k polynomials are combined into an (n-k) order polynomial, and the coefficients of the polynomial are expressed as elements in the GF(2^m) field. The polynomial is subjected to division operation to obtain the remainder. The coefficients of the remainder are the error correction code. The encrypted data and the error correction code are combined into a long sequence, and finally the long sequence is converted into a binary matrix. The extended code generation system software is used to draw the binary matrix into the pre-designed extended information storage area.
[0045] S4: drawing the QR image together with the feature point pattern and the extended information storage area onto a preset medium to obtain an extended code based on the QR code.
[0046] The preset medium includes, but is not limited to, a paper label. Specifically, a common QR two-dimensional code is drawn on the paper label medium together with an extended information storage area, that is, the generation of the extended code is completed.
[0047] As shown in Figure 3 The extended code identification method is used for reverse identification of the extended code on the preset medium, and includes the following steps:
[0048] S5: The QR code image contained in the QR code-based extended code on the preset medium is acquired, and the QR code image is decoded to obtain target information to be verified.
[0049] Specifically, the identification software on the handheld device can identify and verify the extended code. First, the extended code is positioned by using the positioning corner points of the QR code and a preset offset, and the dot matrix width and single-point size information of the QR code are obtained.
[0050] S6: The outer edge region of the QR image is detected according to the size information of the QR image and the preset position of the feature point pattern.
[0051] Specifically, according to the dot matrix width and single-point size information of the QR image, it is determined whether the feature point drawing region contains the feature point information such as the ant line, the square frame or the L line according to the extended code feature point generation rule.
[0052] S7: If the feature point pattern is detected, the position of the extended information storage area is located according to the direction of the feature point pattern.
[0053] Specifically, if the feature point pattern is detected, the dot matrix width and single-point size information of the QR image are also used to locate and read the data in the extended information storage area.
[0054] S8: The information parsed in the extended information storage area is decrypted to obtain verification information to be verified.
[0055] S9: The target information to be verified and the verification information to be verified are compared with the target information and the verification information generated in the extended code generation method, respectively, to obtain a verification result.
[0056] Specifically, for steps 8 and 9, the extended information storage area dot matrix data read is converted to obtain a long sequence combined by the encrypted data and the error correction code, the encrypted data is corrected and verified by using the RS error correction code, the corrected data is obtained, and finally the corrected data is decoded to obtain the original verification code value according to the inverse operation of the encrypted original data.
[0057] Wherein, the encrypted data is checked by using RS error correction code, and the converted encrypted data block is converted into a polynomial again, and then a remainder operation is used to detect whether there is an error. If the remainder is 0, it means that the received data has no error; otherwise, there is an error, and the Berlekamp-Massey algorithm is used to realize RS error correction code error correction. The Berlekamp-Massey algorithm realizes RS error correction code error correction, that is, a minimum error polynomial is derived by inputting the received polynomial coefficients, so as to find the error position and correct the error, and finally, the polynomial coefficients after error correction are used as input, and the Forney algorithm is used to calculate the final decoding result.
[0058] It should be noted that the Forney algorithm uses the special structure of the RS code, that is, the RS code can be regarded as a combination of an evaluator and a polynomial differentiator. Specifically, the algorithm first finds the error position through the differentiator, then calculates the error value by using the evaluator, and finally replaces the corrected value with the original code word through the exclusive or operation.
[0059] In an embodiment, a QR code-based extended code anti-counterfeiting system is provided, and a working process thereof is as shown in Figure 3 The extended code anti-counterfeiting system includes an extended code generation end and an extended code identification end, wherein the extended code generation end includes:
[0060] A QR code generation module is configured to generate a QR code image containing target information;
[0061] A feature point pattern and extended information generation module is configured to set a feature point pattern and an extended information storage area in a peripheral area of the QR code image, wherein the feature point pattern is used to identify whether the extended information storage area includes extended information; and the extended information includes check information corresponding to the target information.
[0062] A dot matrix conversion module is configured to convert the extended information into a two-dimensional dot matrix after encryption and by using RS error correction algorithm;
[0063] A drawing module is configured to draw the QR image, the feature point pattern and the extended information storage area together on a preset medium to obtain a QR code-based extended code.
[0064] The extended code identification end includes:
[0065] A QR code information extraction module is configured to obtain a QR code image contained in the QR code-based extended code on the preset medium, and decode the QR code image to obtain target information to be verified;
[0066] A feature point pattern detection module is configured to perform feature point pattern detection on a peripheral area of the QR image according to size information of the QR image and a preset position of the feature point pattern;
[0067] The expansion information positioning module is configured to, if the feature point pattern is detected, locate to a position where the expansion information storage area is located according to a pointing direction of the feature point pattern.
[0068] The decryption module is configured to decrypt the information parsed in the expansion information storage area to obtain the verification information to be verified.
[0069] The verification module is configured to compare the target information to be verified and the verification information to be verified with the target information and the verification information generated in the expansion code generation method respectively to obtain a verification result.
[0070] The working mode of the QR code-based expansion code anti-counterfeiting system corresponds to the above-mentioned QR code-based expansion code anti-counterfeiting method, and thus will not be described here again to avoid repetition.
[0071] In an embodiment, a computer device is provided, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, and the processor implements the steps of the QR code-based expansion code anti-counterfeiting method in the above-mentioned embodiments when executing the computer program, and thus will not be described here again to avoid repetition.
[0072] In an embodiment, a computer readable storage medium is provided, which stores a computer program, and the computer program is executable on a processor to implement the QR code-based expansion code anti-counterfeiting method in the above-mentioned method embodiments, and thus will not be described here again to avoid repetition.
[0073] The above-mentioned embodiments are only used to illustrate the technical solutions of the present application, rather than limit them; although the present application has been described in detail with reference to the above-mentioned embodiments, those skilled in the art should understand that the technical solutions recorded in the above-mentioned embodiments can still be modified, or some technical features can be replaced equivalently; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.
Claims
1. An extended code based on QR codes, characterized in that, It includes a QR code image, wherein a feature point pattern and an extended information storage area are provided in the outer edge area of the QR code image; The QR code image stores target information; the feature point pattern is used to identify whether the extended information storage area includes extended information; the extended information includes verification information corresponding to the target information.
2. The QR code-based extended code as described in claim 1, characterized in that, The feature point pattern includes ant lines, squares, or L-shaped lines.
3. The QR code-based extended code as described in claim 1, characterized in that, The outer edge region of the QR code image includes a preset dot matrix range in any one of the following directions: top, bottom, left, right, upper left, lower left, upper right, and lower right.
4. The QR code-based extended code as described in any one of claims 1 to 3, characterized in that, The target information includes an anti-counterfeiting code value that corresponds one-to-one with the product, and the verification information includes an extended verification code that corresponds to the anti-counterfeiting code value.
5. A QR code-based extended code anti-counterfeiting method, characterized in that, The method includes an extended code generation method for generating a QR code-based extended code as described in any one of claims 1 to 4; and includes: Generate a QR code image containing target information; A feature point pattern and an extended information storage area are set on the outer edge of the QR code image, wherein the feature point pattern is used to identify whether the extended information storage area includes extended information; the extended information includes verification information corresponding to the target information; The extended information is encrypted and then converted into a two-dimensional dot matrix using algorithms such as RS error correction. The QR image, along with the feature point pattern and extended information storage area, is drawn onto a preset medium to obtain an extended code based on the QR code.
6. The QR code-based extended code anti-counterfeiting method as described in claim 5, characterized in that, The outer edge region of the QR code image includes a preset dot matrix range in any one of the following directions: top, bottom, left, right, upper left, lower left, upper right, and lower right. The feature point pattern includes ants, squares, or L-shaped lines.
7. The QR code-based extended code anti-counterfeiting method as described in claim 5, characterized in that, It also includes an extension code recognition method, which is used to reverse-engineer the extension code on the preset medium, and includes: The QR code image contained in the QR code-based extended code on the preset medium is obtained, and the QR code image is decoded to obtain the target information to be verified. Based on the size information of the QR image and the preset position of the feature point pattern, feature point pattern detection is performed on the outer edge region of the QR image; If a feature point pattern is detected, the location of the extended information storage area is determined based on the direction of the feature point pattern. The information parsed from the extended information storage area is decrypted to obtain the verification information to be verified; The target information and verification information to be verified are compared with the target information and verification information generated in the extended code generation method to obtain the verification result.
8. A QR code-based extended code anti-counterfeiting system, characterized in that, It includes an extended code generation end and an extended code recognition end, wherein the extended code generation end includes: The QR code generation module is used to generate QR code images containing target information; A feature point pattern and extended information generation module is used to set a feature point pattern and extended information storage area in the outer edge region of the QR code image, wherein the feature point pattern is used to identify whether the extended information storage area includes extended information; the extended information includes verification information corresponding to the target information; The dot matrix conversion module is used to convert the encrypted extended information into a two-dimensional dot matrix using algorithms such as RS error correction. A drawing module is used to draw the QR image together with the feature point pattern and the extended information storage area onto a preset medium to obtain an extended code based on the QR code; The extended code recognition terminal includes: The QR code information extraction module is used to obtain the QR code image contained in the QR code-based extended code on the preset medium, and decode the QR code image to obtain the target information to be verified. The feature point pattern detection module is used to detect feature point patterns in the outer edge region of the QR image based on the size information of the QR image and the preset position of the feature point pattern. An extended information positioning module is used to locate the extended information storage area based on the direction of the feature point pattern if a feature point pattern is detected. The decryption module is used to decrypt the information parsed from the extended information storage area to obtain the verification information to be verified. The verification module is used to compare the target information to be verified and the verification information to be verified with the target information and verification information generated in the extension code generation method, respectively, and obtain the verification result.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the step of the extended code generation method in the extended code anti-counterfeiting method based on QR codes as described in claims 5 to 6; or, when the processor executes the computer program, it implements the step of the extended code recognition method in the extended code anti-counterfeiting method based on QR codes as described in claim 7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the extended code generation method in the QR code-based extended code anti-counterfeiting method as described in claim 5 or 6; or, when the handheld device executes the computer program, it implements the steps of the extended code recognition method in the QR code-based extended code anti-counterfeiting method as described in claim 7.