A method for generating and verifying anti-counterfeiting marks

By generating and encrypting dynamic attribute parameters during the product production process, a complex anti-counterfeiting logic is formed, which solves the problem of insufficient number of traditional anti-counterfeiting codes and easy forgery, and realizes the generation of high-capacity, difficult-to-crack anti-counterfeiting labels.

CN120218959BActive Publication Date: 2025-09-23SHAANXI LIBANG SOFTWARE CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510688111.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-27
Publication Date
2025-09-23
Estimated Expiration
2045-05-27

AI Technical Summary

Technical Problem

Traditional anti-counterfeiting code generation methods make it difficult to generate a sufficient number of anti-counterfeiting codes in a short period of time. In addition, the anti-counterfeiting codes lack complexity and diversity and are easily forged, which puts the products at risk of counterfeiting.

Method used

Based on the dynamic attribute parameters in the product production process, a plaintext identifier containing the first identification segment and the second identification segment is generated, and encryption conversion is performed separately. The final anti-counterfeiting mark is generated using a multi-base mapping table and independent padding rules. Complex anti-counterfeiting logic is formed through logical integration and base conversion.

Benefits of technology

The generated anti-counterfeiting mark is difficult to crack, has a large capacity, and is suitable for a large number of commodities. It has achieved 10 million anti-counterfeiting codes per year, with a total capacity of 700 million, and has achieved "one item, one code" without duplication, meeting the needs of large-scale commodity circulation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120218959B_ABST
    Figure CN120218959B_ABST
Patent Text Reader

Abstract

This invention discloses a method for generating and verifying an anti-counterfeiting mark. Its core is to enhance anti-counterfeiting effectiveness by combining multi-dimensional dynamic parameter fusion with an encryption mechanism. The method comprises: a) generating a plaintext identifier containing a first identification segment and a second identification segment based on dynamic attribute parameters during the product production process; b) performing encryption conversion on the first and second identification segments to generate first and second encrypted segments, respectively, wherein the second encrypted segment is length-adjusted using independent padding rules; and c) combining the first and second encrypted segments according to a predefined combination strategy to generate a final anti-counterfeiting mark.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of product anti-counterfeiting, and in particular to a method for generating and verifying an anti-counterfeiting mark. Background Art

[0002] With the continuous expansion of the commodity market and the growing consumer demand for product authenticity verification, the demand for security codes is rapidly increasing. However, traditional security code generation methods, such as inkjet printing, are limited by their technical characteristics and production efficiency, making it difficult to generate a sufficient number of security codes in a short period of time to meet the needs of large-scale commodity distribution. This not only leads to a shortage of security codes but also puts some products at risk of counterfeiting due to the lack of effective anti-counterfeiting markings.

[0003] Furthermore, traditional methods for generating security codes also have significant shortcomings in terms of security. Security codes generated using simple technologies like inkjet printing often lack sufficient complexity and diversity, making them easily copied and counterfeited through technical means, causing significant distress and losses to consumers and businesses.

[0004] Therefore, it is necessary to provide a method for generating and verifying an anti-counterfeiting mark to solve the problems mentioned in the above background technology. Summary of the Invention

[0005] To achieve the above objectives, the present invention provides the following technical solution: a method for generating and verifying an anti-counterfeiting mark, comprising:

[0006] a) generating a plaintext identifier comprising a first identification segment and a second identification segment based on dynamic attribute parameters during the product production process;

[0007] b) performing encryption conversion on the first identification segment and the second identification segment respectively to generate a first encrypted segment and a second encrypted segment, wherein the second encrypted segment is length-adapted using an independent padding rule;

[0008] c) generating a final anti-counterfeiting mark by combining the first encrypted segment and the second encrypted segment according to a predefined combination strategy.

[0009] Preferably, the dynamic attribute parameter includes a first sub-parameter associated with a time dimension and a second sub-parameter associated with a production process dimension.

[0010] Preferably, the first sub-parameter is generated by extracting a hash feature of a production timestamp, and the second sub-parameter is generated by associating logic between a production serial number and a workstation identifier.

[0011] Preferably, the encryption conversion includes performing asymmetric algorithm processing on the first identification segment and the second identification segment using mutually independent multi-ary mapping tables.

[0012] Preferably, the character set of the multi-base mapping table is user-defined, and the mapping table corresponding to the first identification segment and the second identification segment has a set base number.

[0013] Preferably, the independent filling rules include:

[0014] i) The predefined placeholder character set has no intersection with the character set of the encryption map;

[0015] ii) Dynamically select the insertion position and number of padding characters based on the length defect value of the second encrypted segment.

[0016] Preferably, the version identifier of the placeholder character set forms a binding relationship with the predefined combination strategy.

[0017] Preferably, the predefined combination strategy includes performing character-level cross-reorganization or segment sequence permutation on the first encrypted segment and the second encrypted segment.

[0018] Preferably, the method further includes an anti-counterfeiting mark verification step:

[0019] d) parsing the anti-counterfeiting mark and separating the first encrypted segment and the second encrypted segment;

[0020] e) restoring the first identification segment and the second identification segment based on the inverse mapping rule and the placeholder character set;

[0021] f) Verify the temporal and spatial uniqueness and logical consistency of the restored plaintext identifier.

[0022] Preferably, the step e) comprises:

[0023] i) performing a padding character stripping operation on the second encrypted segment;

[0024] ii) Convert the remaining characters to their original numerical format by performing a multi-ary inverse mapping.

[0025] Preferably, the encryption conversion process uses a dynamically generated encryption key, which is associated with a production batch or a time period.

[0026] Preferably, the generation of the first identification segment includes truncation and modulo operation of the image feature hash value, and outputting a feature code of a fixed length.

[0027] Preferably, the generation of the second identification segment includes composite encoding of the work station identification, the quality inspection identification and the random factor to form a traceable production process identification.

[0028] Preferably, the lengths of the first encrypted segment and the second encrypted segment are respectively constrained to be predefined fixed values.

[0029] Preferably, when the length of the first encrypted segment after the encryption conversion is insufficient, a leading character padding operation is performed to meet the length constraint.

[0030] Compared with the prior art, the present invention provides a method for generating and verifying an anti-counterfeiting mark, which has the following beneficial effects:

[0031] In the present invention, the encryption mapping table used in the generation algorithm is defined by the user, and the padding rules are set, the dynamic feature parameter part of product production and the preset identification part related to the production process are split, and two completely different anti-counterfeiting logics are set. Through multiple anti-counterfeiting encryption means such as logic integration, base conversion and padding, the anti-counterfeiting result combination rules are made complex and difficult to crack. It is applicable before January 2100, and the operation algorithm is a mathematical algorithm. The anti-counterfeiting code capacity can generate 10 million per year, and the total capacity reaches 700 million, which can meet the generation needs of a large number of anti-counterfeiting codes, and can achieve 100% non-repetition of anti-counterfeiting codes without the help of a database, facilitating the realization of "one item, one code". BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 The figure is a flowchart of the anti-counterfeiting mark generation method. DETAILED DESCRIPTION

[0033] See also Figure 1 The present invention provides a method for generating and verifying an anti-counterfeiting mark, comprising the following steps:

[0034] a) Generate a plaintext identifier comprising a first identification segment and a second identification segment based on dynamic attribute parameters during the product production process, wherein the first identification segment is four characters long, and the second identification segment is six or seven characters long; the dynamic attribute parameters include a first sub-parameter associated with the time dimension and a second sub-parameter associated with the production process dimension; the first sub-parameter is generated by extracting a hash feature of the production timestamp, and the second sub-parameter is generated using the association logic between the production serial number and the workstation identifier.

[0035] Furthermore, generating the first identification segment includes truncating and performing a modulo operation on the image feature hash value to output a fixed-length feature code. Specifically, a local hash value of a set area can be extracted from the product image features, and a hash value of a preset length can be truncated and performed a modulo operation to output a fixed-length character as the feature code of the first identification segment.

[0036] Furthermore, the generation of the second identification segment includes compound encoding the workstation identification, the quality inspection identification, and the random factor to form a traceable production process identification. Specifically, the workstation identification is the workstation number, and the quality inspection identification is the inspector ID.

[0037] b) performing encryption conversion on the first identification segment and the second identification segment respectively to generate a first encrypted segment and a second encrypted segment, wherein the second encrypted segment is length-adapted using an independent padding rule;

[0038] Furthermore, the encryption conversion includes performing asymmetric algorithm processing on the first identification segment and the second identification segment using a mutually independent multi-base mapping table. The character set of the multi-base mapping table is customized by the user, and the mapping table corresponding to the first identification segment and the second identification segment has a set base.

[0039] Furthermore, the independent filling rules include:

[0040] i) The predefined placeholder character set has no intersection with the character set of the encryption map;

[0041] ii) Dynamically select the insertion position and number of padding characters based on the length defect value of the second encrypted segment.

[0042] The lengths of the first and second encrypted segments are each constrained to a predefined fixed value. The encryption conversion process utilizes a dynamically generated encryption key associated with a production batch or time period. If the length of the first encrypted segment after encryption conversion is insufficient, a leading character padding operation is performed to satisfy the length constraint.

[0043] In this implementation, the production timestamp is used as the first sub-parameter to generate the first identification segment (fixed length of 4 digits, for example). For example, when March 2019 is converted to the first identification segment, it is written as 1903. The single production serial number parameter is used as the second sub-parameter to generate the second identification segment (set length of 7 digits, for example). The numbering format is: prefix 0 + serial number. If the serial number is less than 7 digits, it is padded with zeros on the left to 7 digits. For example, 0000001, 0000022, 0000333, etc., represent products with production serial numbers 1, 22, and 333, respectively.

[0044] Specifically, the first identification segment is encrypted using base 62, and the second identification segment is encrypted using base 57. A first encryption mapping table, a second encryption mapping table, and a padding cipher table (not less than 5 digits) are respectively set. The first encryption mapping table and the second encryption mapping table both include uppercase letters, lowercase letters, and Arabic numerals. Specific examples are as follows:

[0045] The first encrypted mapping table (base 62):

[0046] 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.

[0047] The second encrypted mapping table (57 hexadecimal):

[0048] 0abc1ABCDEFGdefg2HIJKLMNhij3OPQRSTklm4nop5qru6vwx7yzUVWXYZ.

[0049] Complementary cipher table: 89stZ.

[0050] In this embodiment, the initial anti-counterfeiting mark generation date is set to December 2018. Taking the product plaintext identifier 19030000001 (the product production date is March 2019, the serial number is 1, and the serial number length is set to 7 digits) as an example, the product with the product plaintext identifier 19030000001 is encrypted for anti-counterfeiting according to the above encryption mapping table;

[0051] The encryption process of the plaintext identifier 19030000001 includes: encrypting the first identification segment and the second identification segment. The encryption of the first identification segment specifically includes:

[0052] ① Extract the time parameter 1903 and the serial number parameter 0000001 respectively,

[0053] ②Take the last two digits of the extracted product serial number parameter 0000001, divide it by three, take the remainder and add 1 to get D1, which is equal to 2;

[0054] ③ Calculate the month difference D2 between the time parameter 1903 and the time when the initial anti-counterfeiting mark was generated. The calculation shows that D2 is 3. If D2 is less than three digits, zeros are added to the left, that is, D2 is equal to 003;

[0055] ④ Combine D1 and D2 in sequence to form the first sub-parameter.

[0056] From the above content, it can be seen that the first sub-parameter is 2003. The first sub-parameter is converted into sixty-binary according to the above first encryption mapping table (base 62), and the first encrypted segment is equal to z8.

[0057] The encryption of the second identification segment specifically includes:

[0058] Extract the serial number parameter 0000001 and convert it into base 57 according to the second encryption mapping table to obtain the second encrypted segment a. Since the second encrypted segment does not meet the predefined fixed value length, the padding operation is performed according to the padding rules, specifically including:

[0059] ① Extract the last two digits of the serial number parameter 0000001, round it down, divide it by three, and take the remainder. The result is B1, which is equal to 1.

[0060] ② Calculate the length B2 that needs to be padded based on the set second encryption segment length and the actual calculated second encryption segment length. From the above content, we can see that the set length is 4 and the actual length is 1. Therefore, we know that B2 is equal to 3;

[0061] ③ Take the B2 characters after the B1 position in the padding cipher table and output the padding string B3. According to the padding cipher table, the padding string B3 is 9st;

[0062] ④ Combine the padding string B3 and the actual second encrypted segment in sequence to obtain the second encrypted segment 9sta of the product.

[0063] c) The first encrypted segment and the second encrypted segment are combined according to a predefined strategy to generate a final anti-counterfeiting mark, that is, the anti-counterfeiting mark of the product with the plaintext identifier of 19030000001 is z89sta.

[0064] Furthermore, the predefined combination strategy includes character-level cross-reorganization or segment order permutation of the first encryption segment and the second encryption segment, and the anti-counterfeiting mark z89sta is a sorting combination in which the first encryption segment is in front and the second encryption segment is in the back.

[0065] Furthermore, the version identifier of the placeholder character set forms a binding relationship with the predefined combination strategy.

[0066] It needs to be explained that the present invention allows the user to define the encryption mapping table used in the generation algorithm, and sets up a padding password table, splits the dynamic feature parameter part of product production and the preset identification part related to the production process, and sets up two completely different anti-counterfeiting logics. Through multiple anti-counterfeiting encryption means such as logic integration, base conversion and padding, the combination rules of the anti-counterfeiting results are made complex and difficult to crack. It is applicable before January 2100, and the operation algorithm is a mathematical algorithm. The anti-counterfeiting identification capacity can generate 10 million anti-counterfeiting identifications per year, and the total capacity reaches 700 million, which can meet the generation needs of a large number of anti-counterfeiting identifications, and can achieve 100% non-repetition of anti-counterfeiting identifications without the help of a database, facilitating the realization of "one item, one code".

[0067] Furthermore, it also includes the anti-counterfeiting mark verification step:

[0068] d) parsing the anti-counterfeiting mark and separating the first encrypted segment and the second encrypted segment;

[0069] e) restoring the first identification segment and the second identification segment based on the inverse mapping rule and the placeholder character set;

[0070] The step e) comprises:

[0071] i) performing a padding character stripping operation on the second encrypted segment;

[0072] ii) Convert the remaining characters to their original numerical format by performing a multi-ary inverse mapping.

[0073] f) Verify the temporal and spatial uniqueness and logical consistency of the restored plaintext identifier.

[0074] In this embodiment, taking the anti-counterfeiting mark z89sta as an example, reverse calculation verification is performed on the anti-counterfeiting mark.

[0075] Specifically, ① the first encrypted segment and the second encrypted segment of the anti-counterfeiting mark z89sta are split according to the predefined combination strategy to obtain the first encrypted segment and the second encrypted segment before combination. It can be seen that the first encrypted segment is z8 and the second encrypted segment is 9sta;

[0076] ② Convert the first encrypted segment z8 into decimal, take the last three digits as an integer, and obtain the month difference between the product time parameter and the initial anti-counterfeiting mark generation date, which is 3;

[0077] ③ Based on the set initial anti-counterfeiting mark generation date, calculate the first identification segment of the product. Based on the above initial anti-counterfeiting mark generation date, the calculated product production date is March 2019, written as 1903;

[0078] ④ Strip off the padding characters representing the padding code C in the second encrypted segment and convert the remaining characters into decimal to obtain the actual calculated second encrypted segment of the product;

[0079] According to the cipher table: 89stZ, remove 9st from the second encrypted segment of the product, leaving a. Convert a from heptadecimal to decimal to obtain the product's second identification segment (production serial number) equal to 0000001.

[0080] ⑤ Combine the first identification segment and the second identification segment to obtain the product plaintext identifier, that is, the product plaintext identifier of the anti-counterfeiting mark z89sta is 19030000001.

[0081] Among them, when the second identification segment of the product is less than the set length, zeros are added on the left to ensure that the length of the product's plaintext identifier is consistent, which is convenient for identification and circulation.

[0082] It should be noted that the present invention only uses a simplified scenario in which a single production timestamp and a single serial number are used as the first and second identification segments to encrypt and decrypt the anti-counterfeiting mark. However, when a single production timestamp is integrated with an intercepted image feature value (such as a fixed-length feature code consisting of a production timestamp + an intercepted image feature value), or a single serial number is integrated with digital elements such as a workstation identifier, a quality inspection identifier, and a random factor (such as a fixed-length feature code consisting of a workstation identifier + a quality inspection identifier + a random factor + a serial number), the anti-counterfeiting mark generation method is also applicable. Among them, the introduction of the image feature value, the workstation identifier, the quality inspection identifier, and the random factor only increases the complexity of encryption and decryption. When the encryption and decryption method adopts the above-mentioned encryption and decryption process, it is also applicable to extract the corresponding character segment according to the above-mentioned algorithm for calculation.

[0083] The above is only a preferred specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any technician familiar with this technical field, within the technical scope disclosed by the present invention, who makes equivalent replacements or changes based on the technical solutions and inventive concepts of the present invention, should be covered by the scope of protection of the present invention.

Claims

1. A method for generating and verifying an anti-counterfeiting mark, characterized in that: The following steps are involved: a) generating a plaintext identifier comprising a first identification segment and a second identification segment based on dynamic attribute parameters during the product production process; b) performing encryption conversion on the first identification segment and the second identification segment respectively to generate a first encrypted segment and a second encrypted segment, wherein the second encrypted segment is length-adapted using an independent padding rule; c) generating a final anti-counterfeiting mark by combining the first encrypted segment and the second encrypted segment according to a predefined combination strategy; The dynamic attribute parameter includes a first sub-parameter associated with the time dimension and a second sub-parameter associated with the production process dimension; The encryption conversion includes performing asymmetric algorithm processing on the first identification segment and the second identification segment using mutually independent multi-base mapping tables; The independent filling rules include: i) a predefined placeholder character set, whose character elements have no intersection with the character set of the multi-base mapping table; ii) dynamically selecting the insertion position and number of padding characters based on the length defect value of the second encrypted segment; The version identifier of the placeholder character set forms a binding relationship with the predefined combination strategy.

2. The method according to claim 1, characterized in that The first sub-parameter is generated by extracting the hash feature of the production timestamp, and the second sub-parameter is generated by the association logic between the production serial number and the work station identifier.

3. The method according to claim 1, characterized in that The character set of the multi-base mapping table is configured by a user, and the multi-base mapping table corresponding to the first identification segment and the second identification segment has a set base number.

4. The method according to claim 1, wherein The predefined combination strategy includes performing character-level cross-reorganization or segment sequence permutation on the first encrypted segment and the second encrypted segment.

5. The method according to claim 1, wherein It also includes anti-counterfeiting mark verification steps: d) parsing the anti-counterfeiting mark and separating the first encrypted segment and the second encrypted segment; e) restoring the first identification segment and the second identification segment based on the inverse mapping rule and the placeholder character set; f) Verify the temporal and spatial uniqueness and logical consistency of the restored plaintext identifier.

6. The method according to claim 5, characterized in that The step e) comprises: i) performing a padding character stripping operation on the second encrypted segment; ii) Convert the remaining characters to their original numerical format by performing a multi-ary inverse mapping.

7. The method according to claim 1, characterized in that The encryption conversion process uses a dynamically generated encryption key that is associated with a production batch or time period.

8. The method according to claim 2, characterized in that The generation of the first identification segment includes intercepting and performing a modulo operation on the image feature hash value, and outputting a feature code of a fixed length.

9. The method according to claim 2, characterized in that The generation of the second identification segment includes compound encoding the work station identification, the quality inspection identification and the random factor to form a traceable production process identification.

10. The method according to claim 1, characterized in that The lengths of the first encrypted segment and the second encrypted segment are respectively constrained to be predefined fixed values.

11. The method according to claim 10, characterized in that When the length of the first encrypted segment after the encryption conversion is insufficient, a leading character padding operation is performed to meet the length constraint.

Citation Information

Patent Citations

  • Product anti-counterfeiting method based on digital signature and public key system and verifying method

    CN102004986A

  • Chip serial number encoding method and system, storage medium and terminal

    CN109714163A

  • Authorization code generation method and device, equipment and readable storage medium

    CN117609964A