CN115759161A - Two-dimensional code anti-counterfeiting method, two-dimensional code anti-counterfeiting code generation system and verification system - Google Patents

Two-dimensional code anti-counterfeiting method, two-dimensional code anti-counterfeiting code generation system and verification system Download PDF

Info

Publication number
CN115759161A
CN115759161A CN202211468187.9A CN202211468187A CN115759161A CN 115759161 A CN115759161 A CN 115759161A CN 202211468187 A CN202211468187 A CN 202211468187A CN 115759161 A CN115759161 A CN 115759161A
Authority
CN
China
Prior art keywords
code
public
coding
information
counterfeiting
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211468187.9A
Other languages
Chinese (zh)
Inventor
付强
周宇欢
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanjing Huanyin Anti Counterfeiting Technology Co ltd
Original Assignee
Nanjing Huanyin Anti Counterfeiting Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nanjing Huanyin Anti Counterfeiting Technology Co ltd filed Critical Nanjing Huanyin Anti Counterfeiting Technology Co ltd
Priority to CN202211468187.9A priority Critical patent/CN115759161A/en
Publication of CN115759161A publication Critical patent/CN115759161A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Editing Of Facsimile Originals (AREA)

Abstract

The invention provides a two-dimensional code anti-counterfeiting method, a two-dimensional code anti-counterfeiting code generation system and a verification system, and relates to the technical field of two-dimensional code anti-counterfeiting. The two-dimensional code is combined with the non-public code, the anti-counterfeiting capability of the non-public code is used for protecting the two-dimensional code, and the anti-counterfeiting capability of the two-dimensional code is improved. In addition, the invention optimizes the scheme of the non-public code, firstly utilizes the secret mark watermark to increase the copying difficulty of the non-public code, secondly utilizes the random number to generate the code position for coding based on the random position coding mode, so that the seed generated by the random number can be used to protect the code content even under the premise of the public coding mode, and the imitation difficulty is increased; and decoding according to the corresponding decoding parameters during decoding, calculating a decoding result and specific information of the two-dimensional code, and judging whether the decoding result and the specific information accord with an association relation or an association rule, so that the counterfeiting difficulty of the two-dimensional code is greatly increased.

Description

Two-dimensional code anti-counterfeiting method, two-dimensional code anti-counterfeiting code generation system and verification system
Technical Field
The invention relates to the technical field of two-dimensional code anti-counterfeiting, in particular to a two-dimensional code anti-counterfeiting method, a two-dimensional code anti-counterfeiting code generating system and a verification system.
Background
At present, the two-dimension code is comprehensively applied to anti-counterfeiting, anti-fleeing and tracing of commodities, from code assigning to detection, relevant software and hardware are mature, the support degree is very high, and the acceptance of people to the two-dimension code is also very high. However, because of this, it is very easy to copy the two-dimensional code of the famous brand enterprise, and the two-dimensional code needs to improve the anti-counterfeiting capability while providing convenience.
The existing two-dimension code anti-counterfeiting method is mainly based on one object code, and the authenticity of the two-dimension code is judged through the times of code scanning: if the code scanning is the first time, judging that the two-dimensional code is true; and if the code scanning is carried out for multiple times, the two-dimensional code is judged to be false. However, this anti-counterfeiting method has great limitations:
(1) The anti-counterfeiting detection can not be carried out before the commodities are sold. The two-dimensional code can only be detected once, so the anti-counterfeiting process is designed to be detected only by destroying the package, and the detection can only be carried out after the commodity is sold, otherwise, the sale of the commodity is influenced.
(2) The requirement of multiple true and false detections cannot be met. For example, when the goods are sent to other persons as gifts, the person who purchases the goods cannot usually detect the goods because the package of the goods needs to be damaged once the goods are detected, and the gift recipient can also display that the two-dimensional code is detected for multiple times when the gift recipient detects the goods again.
(3) The goods must be tested once. The anti-counterfeiting performance of the two-dimensional code is related to the detection rate of the commodity, if the detection rate is not high, a large amount of counterfeiting space is left, and under the actual condition, a consumer can confirm the authenticity of the commodity through other channels without detection operation, and also can randomly extract part of the commodity for detection when purchasing a plurality of commodities, so that the anti-counterfeiting performance of verifying the authenticity of the two-dimensional code based on times is influenced.
(4) The anti-counterfeiting method cannot be completed off-line because the verification and detection times must be connected with a server.
Disclosure of Invention
The invention aims to: the invention changes the two-dimension code anti-counterfeiting mode based on the verification times, but prevents the two-dimension code from being copied or imitated by adding the non-public coding mode and using the anti-counterfeiting capability of the non-public coding, and finally judges the authenticity of the two-dimension code by verifying the incidence relation between the non-public coding and the two-dimension code. Based on the method, the two-dimension code can be verified for any number of times, so that the commodity can be verified for many times before and after being sold; meanwhile, the overall anti-counterfeiting performance of the two-dimensional code is not verified or influenced; in addition, by setting a proper association rule, the authenticity of the two-dimensional code can be verified off line.
Based on the above, the invention provides a two-dimension code anti-counterfeiting method, and further provides a two-dimension code anti-counterfeiting code generation system and a verification system, so as to solve the above problems in the prior art.
In a first aspect, a two-dimensional code anti-counterfeiting method is provided, which comprises the following steps:
step 1, determining the position of the two-dimensional code public code, calibrating the area, and taking the area as a reference, and taking a blank area outside or inside the two-dimensional code as a coding area of the anti-counterfeiting code;
step 2, coding: based on the coding region, adding an anti-counterfeiting code consisting of non-public coding contents in a random position coding mode;
and step 3, decoding: extracting an anti-counterfeiting code based on a random position code based on the coding region;
and 4, verifying the matching relationship between the public code and the anti-counterfeiting code, and confirming the authenticity of the two-dimensional code, wherein if the public code and the anti-counterfeiting code are matched, the two-dimensional code is true, otherwise, the two-dimensional code is false.
In some realizations of the first aspect, the adding of the anti-counterfeiting code consisting of the non-public code content in the random position coding manner in the step 2 comprises:
step 2a, selecting n different coding regions corresponding to numbers 1 to n;
step 2b, generating a coding position number sequence consisting of 1 to n by using random number seeds; each digit in the digit sequence corresponds to a unique coding position; after the non-public coded content is converted into a 01 sequence, the non-public coded content is sequentially coded according to the positions marked by the coded position number sequence, wherein 0 is represented by a black square and 1 is represented by a white square;
and 2c, when all positions of a certain coding region are coded, neglecting the serial number of the coding position in the coding position digital sequence, moving down a serial number, and so on until all coding information is coded.
In some implementations of the first aspect, the decoding method in step 3 includes:
step 3a, taking the random seed during encoding as a key during decoding, and using the key as a random seed number to generate an encoding position number sequence consisting of n numbers, wherein each number represents an encoding position;
step 3b, sequentially reading the image gray scale at the position according to the position identified by the coded position digital sequence, and if the gray scale is smaller than a threshold value, extracting information to be 0; if the gray level is larger than the threshold value, extracting the information as 1;
and 3c, when all positions in a certain coding area are decoded, ignoring the coding position serial number in the coding position digital sequence, moving down one serial number, and so on until all decoding is finished.
In some implementations of the first aspect, the anti-counterfeiting code added in step 2 is in clear code.
In some implementations of the first aspect, the anti-counterfeit code added in step 2 is in the form of a secret code, and the anti-counterfeit code is added by using a secret mark watermark.
In some implementation manners of the first aspect, in a case where the anti-counterfeit code is added by using the watermark, image enhancement, four-corner positioning, image correction, and decoding operations are performed during decoding, so as to obtain the identifiable anti-counterfeit code.
In some realizations of the first aspect, the anti-counterfeiting code in step 4 implements a fixed scheme or a variable scheme:
when the fixed scheme is executed, the non-public coded information corresponding to all the two-dimensional codes is the same, the decoding information of the non-public coded information is compared with the information prestored in the server during verification, and if the decoding information is consistent with the information prestored in the server or the correlation is higher than a threshold value, the decoding information accords with the expectation;
when the variable scheme is executed, the non-public coded information corresponding to each public coded information is different, whether the non-public coded information is consistent with the public coded information is judged by verifying the association relation between the decoding information of the non-public coded information and the decoding information of the public coded information, and if the non-public coded information is consistent with the public coded information, the non-public coded information is consistent with the public coded information.
In some implementations of the first aspect, while the variable scheme is being executed, the authenticity of the two-dimensional code is verified by online verification and/or offline verification.
The process of online verification comprises the following steps: storing the incidence relation of the non-public coding information and the public coding information at a cloud end, respectively decoding the non-public coding information and the public coding information, uploading the decoding information of the non-public coding information and the decoding information of the public coding information to the cloud end, and then checking whether the incidence relation of the non-public coding information and the public coding information accords with expectation from a database: and if the two-dimensional code is in accordance with the expectation, performing subsequent decoding inquiry and other work, and otherwise prompting the user that the two-dimensional code is counterfeit.
The process of off-line verification comprises the following steps: after the non-public coding information and the public coding information are decoded respectively, whether the decoding information of the non-public coding information and the decoding information of the public coding information accord with a preset association rule or not is checked, if so, subsequent decoding inquiry and other work are carried out, and otherwise, a user is prompted that the two-dimensional code is counterfeit.
In a second aspect, a two-dimensional code anti-counterfeiting code generation system is provided, which comprises a calibration module and a coding module.
The calibration module is used for determining the position of the two-dimensional code public code, calibrating the area, and taking the area as a reference, and taking a blank area outside or inside the two-dimensional code as a coding area of the anti-counterfeiting code;
the coding module adds an anti-counterfeiting code consisting of non-public coding contents in a random position coding mode based on the coding region;
the encoding module is further configured to select n different encoding regions, corresponding to numbers 1 to n; generating a coded position number sequence consisting of 1 to n by using a random number seed; each number in the number sequence corresponds to a unique coding position; after the non-public coded content is converted into a 01 sequence, the non-public coded content is sequentially coded according to the positions marked by the coded position number sequence, wherein 0 is represented by a black square and 1 is represented by a white square; when all the positions of a certain coding region are coded, the serial number of the coding position in the coding position digital sequence is ignored, a serial number is shifted down, and the like is repeated until all the coded information is coded.
In a third aspect, a two-dimensional code anti-counterfeiting code verification system is provided, which comprises a decoding module and a verification module.
The decoding module extracts an anti-counterfeiting code based on random position coding based on the coding region;
the verification module is used for verifying the matching relationship between the public code and the anti-counterfeiting code and confirming the authenticity of the two-dimensional code, if the two codes are matched, the two-dimensional code is true, otherwise, the two-dimensional code is false;
the decoding module is further used for taking the random seed in the encoding process as a key in the decoding process, and generating an encoding position number sequence consisting of n numbers by taking the key as a random number seed, wherein each number represents an encoding position; sequentially reading the image gray scale at the position according to the position identified by the coded position digital sequence, and if the gray scale is less than a threshold value, extracting information to be 0; if the gray level is greater than the threshold value, extracting information as 1; when all the positions of a certain coding region are decoded, the sequence number of the coding position in the coding position digit sequence is ignored, and a sequence number is moved down, and so on until all the decoding is finished.
The anti-counterfeiting code executes a fixed scheme or a variable scheme:
when the fixed scheme is executed, the non-public coded information corresponding to all the two-dimensional codes is the same, the verification module compares the decoding information of the non-public coded information with the information prestored in the server during verification, and if the decoding information is consistent with the information prestored in the server or the correlation is higher than a threshold value, the decoding information accords with the expectation;
when the variable scheme is executed, the non-public coded information corresponding to each public coded information is different, whether the non-public coded information is consistent with the public coded information is judged by verifying the association relation between the decoding information of the non-public coded information and the decoding information of the public coded information, and if the non-public coded information is consistent with the public coded information, the non-public coded information is consistent with the public coded information;
verifying authenticity of the two-dimensional code through online verification and/or offline verification while the variable scheme is executed;
the process of online verification comprises the following steps: storing the incidence relation of the non-public coding information and the public coding information at a cloud end, respectively decoding the non-public coding information and the public coding information, uploading the decoding information of the non-public coding information and the decoding information of the public coding information to the cloud end, and checking whether the incidence relation of the non-public coding information and the public coding information accords with expectations from a database: if the two-dimensional code accords with the expectation, performing subsequent decoding inquiry and other work, otherwise prompting the user that the two-dimensional code is counterfeit;
the process of off-line verification comprises the following steps: after the non-public coding information and the public coding information are decoded respectively, whether the decoding information of the non-public coding information and the decoding information of the public coding information accord with a preset association rule or not is checked, if the decoding information of the non-public coding information and the decoding information of the public coding information accord with the preset association rule, subsequent decoding inquiry and other work are carried out, and if not, a user is prompted that the two-dimensional code is fake.
Has the advantages that: the invention provides a two-dimension code anti-counterfeiting method, a two-dimension code anti-counterfeiting code generating system and a verification system. In addition, the invention optimizes the scheme of the non-public code, firstly utilizes the secret mark watermark to increase the copying difficulty of the non-public code, secondly utilizes the random number to generate the code position for coding based on the random position coding mode, so that the seed generated by the random number can be used to protect the code content even under the premise of the public coding mode, and the imitation difficulty is increased; and decoding according to the corresponding decoding parameters during decoding, calculating a decoding result and specific information of the two-dimensional code, and judging whether the decoding result and the specific information accord with an association relation or an association rule, so that the counterfeiting difficulty of the two-dimensional code is greatly increased.
Drawings
Fig. 1 is a flow chart of a two-dimensional code anti-counterfeiting method.
FIG. 2 is a schematic diagram of generating a non-public code.
Fig. 3 is a diagram of the effect of the code outside the two-dimensional code after being displayed by a special device.
Fig. 4 is a schematic diagram of a two-dimensional code anti-counterfeiting code generation system.
Fig. 5 is a schematic diagram of a two-dimensional code anti-counterfeiting code verification system.
Fig. 6 is a diagram of the effect of the code inside the two-dimensional code after being displayed by a special device.
Detailed Description
In the following description, numerous specific details are set forth in order to provide a more thorough understanding of the present invention. It will be apparent, however, to one skilled in the art, that the present invention may be practiced without one or more of these specific details. In other instances, well-known features have not been described in order to avoid obscuring the invention.
The first embodiment is as follows:
the applicant researches and discovers that the two-dimension code is easy to counterfeit because the coding mode of the two-dimension code is public, and if the two-dimension code is combined with the non-public code, the anti-counterfeiting capability of the non-public code is used for protecting the two-dimension code, so that the anti-counterfeiting capability of the two-dimension code can be greatly improved.
Therefore, a non-public coding algorithm is designed around the two-dimensional code or inside the two-dimensional code, when the authenticity of the two-dimensional code needs to be verified, the contents of the two-dimensional code and the contents of the non-public code are respectively decoded, if the association between the contents of the two-dimensional code and the contents of the non-public code is in accordance with expectation, the two-dimensional code is real, otherwise, the two-dimensional code is fake.
Referring to fig. 1, the two-dimensional code anti-counterfeiting method comprises the following steps:
step 1, determining the position of the two-dimensional code public code, calibrating the area where the two-dimensional code public code is located, and taking the area as a reference, and taking a blank area outside or inside the two-dimensional code as an encoding area of the anti-counterfeiting code.
Step 2, coding: and based on the coding region, adding an anti-counterfeiting code consisting of non-public coding contents in a random position coding mode.
And step 3, decoding: and extracting the anti-counterfeiting code based on the random position code based on the coding region.
And 4, verifying the matching relationship between the public code and the anti-counterfeiting code, and confirming the authenticity of the two-dimensional code, wherein if the public code and the anti-counterfeiting code are matched, the two-dimensional code is true, otherwise, the two-dimensional code is false.
As shown in fig. 2, the two-dimensional code has coding information formed by a circle of black and white dots around the two-dimensional code, and we can design coding rules, and code with these black and white dots, for example, black stands for 0 and white stands for 1, to form a non-public code a. The encoding content of the two-dimensional code is B. And verifying the relationship between the A and the B to confirm the authenticity of the two-dimensional code.
Example two:
on the basis of the first embodiment, a secret watermark encoding algorithm (a secret watermark generation method is disclosed in patent application CN202010351020.9, a document anti-copy method and system based on secret watermark, and CN202010352108.2, a secret watermark extraction method and system based on mobile phone and image enhancement) may be adopted, a secret watermark is added around or inside a two-dimensional code, and an encoding rule based on secret watermark is designed, such as the simplest: and (3) representing 0 by using a dark color and 1 by using a light color, verifying whether decoding information accords with expectation or not by image enhancement, positioning four corners, correcting images and decoding during decoding, feeding the decoding information of the two-dimensional code back to a user if the decoding information accords with the expectation, and otherwise prompting the user that the two-dimensional code is possibly a counterfeit product.
Example three:
based on the watermark proposed in the second embodiment, the code a may be printed with invisible ink, and the appearance of the code a (see fig. 3) is shown under the irradiation of a specific light source, and then the code a is decoded by using specific software, and then the incidence relation between the code a and the two-dimensional code B is determined, thereby verifying the authenticity of the two-dimensional code.
The code A has two schemes of fixed and variable: according to the fixed scheme, the non-public coding information corresponding to all the two-dimensional codes is the same, the decoding information A is compared with the information prestored in the server during verification, and if the decoding information A is consistent with the information prestored in the server or the correlation is very high, the decoding information A is in line with the expectation; according to the variable scheme, the non-public coding information corresponding to each two-dimension code information B is different, whether the two-dimension code information B is consistent or not is judged by verifying the incidence relation between the decoding information A and the decoding information B, and the two-dimension code information B is consistent with the expected result.
Further, the variable scheme has a plurality of authenticity verification methods, and one verification method is (online verification): the incidence relation of the A and the B is stored in the cloud, the software respectively solves the non-public code A and the two-dimension code B, after the A and the B are uploaded to the cloud, whether the incidence relation of the A and the B is in accordance with the expectation or not is checked from the database, if the incidence relation is in accordance with the expectation, subsequent decoding inquiry and other work are carried out, otherwise, the user is prompted that the two-dimension code is fake.
Another association method (off-line verification) is: after the A and the B are decoded respectively, whether the code A and the code B accord with a preset association rule or not is checked, and the simplest condition is that whether the partial coding information of the A and the partial coding information of the B are consistent or not. Due to the fact that the non-public coding rule and the non-public association rule are designed, the difficulty of counterfeiting the two-dimensional code is greatly increased. Generally, when an offline verification scheme is adopted, in order to increase the counterfeiting difficulty of the two-dimensional code, a plain code fixed coding scheme is not adopted, but a secret mark watermark coding scheme and a variable coding scheme are adopted, or at least one of the coding schemes is adopted.
Example four:
at present, two-dimensional code counterfeiting mainly comprises two modes, namely copying and copying. The covert watermark and the invisible ink can prevent the code from being directly copied; and the non-public coding rule can prevent the code from being imitated, and the code cannot correspond to the two-dimensional code information because the coding rule is not known. The scheme can prevent most two-dimensional codes from being counterfeited.
The embodiment provides a scheme for optimizing non-public coding: firstly, identifying the two-dimensional code, and obtaining the coding and decoding parameters of the non-public codes from the head information of the two-dimensional code: and (3) decoding the information points of the periphery 01 according to the encoding and decoding parameters by using the seeds generated by the random numbers, and calculating the decoding result and the specific information at the tail part of the two-dimensional code to see whether the decoding result and the specific information accord with the association relationship or the association rule. Therefore, the method can not only disclose a non-public coding rule (a random coding method), but also utilize a secret random number to generate a seed to protect specific coding information.
A random encoding method: generating code numbers of 1-4 by using the random number seed, and sequentially operating as follows:
1. if the coding serial number is 1, coding is carried out on the two-dimensional code; if the coding serial number is 2, coding on the right side of the two-dimensional code; if the coding serial number is 3, coding is carried out below the two-dimensional code; if the code number is 4, the left side of the two-dimensional code is coded.
2. The encoded information is a sequence of 16 01, for example:
0 1 0 0 1 1 0 1 1 0 0 1 1 0 0 0。
3. assume that the code number is: 4 1 2 4 8230 \ 8230;. The preparation method is simple and easy to operate.
4. The first coding serial number is 4, the first coding information is 0, and the first coding position on the left side of the two-dimensional code is black;
the second code serial number is 1, the second code information is 1, and the first code position above the two-dimensional code is white;
the third code serial number is 2, the third code information is 0, and the first code position on the right of the two-dimensional code is black;
the fourth coding serial number is 4, the fourth coding information is 0, and the second coding position on the left side of the two-dimensional code is black;
the fifth coding serial number is 3, the fifth coding information is 1, and the first coding position below the two-dimensional code is white;
and so on. When all the positions of the two-dimensional code in a certain direction are coded, the coding serial number is ignored, and a serial number is shifted down until all the coded information is coded to all the coded positions.
5. The seed of random number generation is a key, decoding is carried out according to the key during decoding, but if the key is not known, the code A which accords with the rule cannot be generated, and the key cannot be traced back from a large amount of code information A.
6. The decoding process is just opposite, and 0,1 information is extracted from the coded positions in sequence according to the coded serial number to form coded information.
Example five:
in order to generate the anti-counterfeit codes provided in the first to fourth embodiments, this embodiment provides a two-dimensional code anti-counterfeit code generation system, see fig. 4. The system comprises a calibration module 51 and an encoding module 52.
The calibration module 51 is used for determining the position of the two-dimensional code public code, calibrating the area, and taking the area as a reference, and taking a blank area outside or inside the two-dimensional code as a coding area of the anti-counterfeiting code.
The encoding module 52 adds an anti-counterfeit code composed of non-public code content in a random position encoding manner based on the encoding region. The encoding module 52 generates an encoding position number sequence composed of four numbers, 1, 2, 3, and 4, by using a random number seed (in this process, refer to the fourth embodiment), each number represents an encoding position, and corresponds to the upper, right, lower, and left positions of the two-dimensional code, after converting the non-public encoding content into a 01 sequence, the non-public encoding content is encoded in sequence according to the positions identified by the encoding position number sequence, 0 is represented by a black square, and 1 is represented by a white square; adding 01 coded information to the upper position of the two-dimensional code from left to right in sequence; adding 01 coded information to the right position of the two-dimensional code from top to bottom in sequence; adding 01 coded information to the lower position of the two-dimensional code from right to left in sequence; adding 01 coded information to the left position of the two-dimensional code from bottom to top in sequence; when all the positions in a certain direction are coded, the sequence number of the coded position in the coded position digital sequence is ignored, and a sequence number is moved downwards, and so on until all the coded information is coded.
Example six:
in order to decode the anti-counterfeit code generated in the above embodiments, the present embodiment further provides a two-dimensional code anti-counterfeit code verification system, see fig. 5. The system comprises two components, a decoding module 53 and a verification module 54.
The decoding module 53 extracts the anti-counterfeit code based on the random position code based on the code region.
The verification module 54 is configured to verify a matching relationship between the public code and the anti-counterfeit code, and confirm authenticity of the two-dimensional code, if the two are matched, the two-dimensional code is true, otherwise the two-dimensional code is false. The decoding module 53 uses the random seed during encoding as a key during decoding, and uses the key as a random seed number to generate a coded position number sequence consisting of four numbers, namely 1, 2, 3 and 4, wherein each number represents a coded position and corresponds to four positions, namely an upper position, a right position, a lower position and a left position, of the two-dimensional code; sequentially reading the image gray scale at the position according to the position marked by the coding position digital sequence, and if the gray scale is less than a threshold value, extracting information to be 0; if the gray level is larger than the threshold value, extracting the information as 1; when all the positions in a certain direction are decoded, the sequence number of the coding position in the coding position digit sequence is ignored, and one sequence number is moved down, and so on until all the decoding is finished.
Example seven:
if the secret mark watermark coding algorithm is adopted, the secret mark watermark cannot be seen under natural conditions, so that the blank area in the two-dimensional code can be used as a coding area of the anti-counterfeiting code, for example, the blank area of three zigzag positioning points of the two-dimensional code is coded. As shown in fig. 6.
The encoding module 52 adds an anti-counterfeit code composed of non-public code content in a random position encoding manner based on the encoding region. The encoding module 52 generates an encoding position number sequence consisting of three numbers 1, 2, and 3 by using a random number seed, each number representing an encoding position, wherein: 1 corresponds to a locating point of the shape of the Chinese character hui at the lower left corner, 2 corresponds to a locating point of the shape of the Chinese character hui at the upper left corner, and 3 corresponds to a locating point of the shape of the Chinese character hui at the upper right corner. After converting the non-public coded content into a 01 sequence, the non-public coded content is sequentially coded according to the positions marked by the coded position number sequence, wherein 0 is represented by a dark gray square and 1 is represented by a light gray square. And each Chinese character hui-shaped positioning point takes the upper left corner as an initial position, and 01 coded information is sequentially added in the clockwise direction. When all the positions of a certain return-type positioning point are coded, the coded position serial number in the coded position digital sequence is ignored, a serial number is shifted down, and the like is carried out until all the coded information is coded.
In summary, the coding region of the invention can be selected to be the outer part or the inner part of the two-dimensional code; the coding form can adopt plain codes or secret code forms such as secret marks, invisible printing ink and the like; the coded content can adopt fixed content or variable content; the verification mode can adopt online verification or offline verification. Different choices can meet different production, application and verification requirements, and the application range of the technology is greatly expanded.
As noted above, while the present invention has been shown and described with reference to certain preferred embodiments, it is not to be construed as limited thereto. Various changes in form and detail may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (10)

1. A two-dimensional code anti-counterfeiting method is characterized by comprising the following steps:
step 1, determining the position of a two-dimensional code public code, calibrating the area where the two-dimensional code public code is located, and taking the area as a reference, and taking a blank area outside or inside the two-dimensional code as an anti-counterfeiting code area;
step 2, coding: based on the coding region, adding an anti-counterfeiting code consisting of non-public coding contents in a random position coding mode;
and step 3, decoding: extracting an anti-counterfeiting code based on random position codes based on the coding region;
and 4, verifying the matching relation between the public code and the anti-counterfeiting code, and confirming the authenticity of the two-dimensional code, wherein if the public code and the anti-counterfeiting code are matched, the two-dimensional code is true, and otherwise, the two-dimensional code is false.
2. The two-dimensional code anti-counterfeiting method according to claim 1, wherein the process of adding the anti-counterfeiting code consisting of the non-public code content in the step 2 in a random position coding mode comprises the following steps:
step 2a, selecting n different coding regions corresponding to numbers 1 to n;
step 2b, generating a coding position number sequence consisting of 1 to n by using a random number seed; each digit in the digit sequence corresponds to a unique coding position; after the non-public coded content is converted into a 01 sequence, the non-public coded content is sequentially coded according to the positions marked by the coded position number sequence, wherein 0 is represented by a black square and 1 is represented by a white square;
and 2c, when all positions of a certain coding region are coded, neglecting the serial number of the coding position in the coding position digital sequence, moving down a serial number, and so on until all coding information is coded.
3. The two-dimensional code anti-counterfeiting method according to claim 1, wherein the decoding method in the step 3 comprises the following steps:
step 3a, taking the random seed in the encoding process as a key in the decoding process, and using the key as a random seed number to generate an encoding position number sequence consisting of n numbers, wherein each number represents the encoding position;
step 3b, sequentially reading the image gray scale at the position according to the position identified by the coded position digital sequence, and if the gray scale is smaller than a threshold value, extracting information to be 0; if the gray level is greater than the threshold value, extracting information as 1;
and 3c, when all the positions of a certain coding area are decoded, neglecting the serial number of the coding position in the coding position digital sequence, moving down a serial number, and so on until all the decoding is finished.
4. The two-dimensional code anti-counterfeiting method according to claim 1, wherein the anti-counterfeiting code added in the step 2 is in a clear code form.
5. The two-dimensional code anti-counterfeiting method according to claim 1, wherein the anti-counterfeiting code added in the step 2 is in a form of a secret code, and the anti-counterfeiting code is added by using a secret mark watermark.
6. The two-dimensional code anti-counterfeiting method according to claim 5, wherein under the condition that the anti-counterfeiting code is added by the secret mark watermark, image enhancement, four-corner positioning, image correction and decoding operations are respectively executed during decoding to obtain the anti-counterfeiting code for identification.
7. The two-dimensional code anti-counterfeiting method according to claim 1, wherein the anti-counterfeiting code in step 4 implements a fixed scheme or a variable scheme:
when a fixed scheme is executed, the non-public coded information corresponding to all the two-dimensional codes is the same, the decoding information of the non-public coded information is compared with the information prestored in the server during verification, and if the decoding information is consistent with the information prestored in the server or the correlation is higher than a threshold value, the decoding information accords with the expectation;
when the variable scheme is executed, the non-public coding information corresponding to each public coding information is different, whether the decoding information of the non-public coding information is consistent with the decoding information of the public coding information or not is checked through verifying the incidence relation between the decoding information of the non-public coding information and the decoding information of the public coding information, and if the decoding information of the non-public coding information is consistent with the decoding information of the public coding information, the expectation is met.
8. The two-dimensional code anti-counterfeiting method according to claim 6, characterized in that the authenticity of the two-dimensional code is verified by on-line verification and/or off-line verification while the variable scheme is executed;
the process of online verification comprises the following steps: storing the incidence relation of the non-public coding information and the public coding information at a cloud end, respectively decoding the non-public coding information and the public coding information, uploading the decoding information of the non-public coding information and the decoding information of the public coding information to the cloud end, and checking whether the incidence relation of the non-public coding information and the public coding information accords with expectations from a database: if the two-dimensional code is in accordance with the expectation, performing subsequent decoding query work, otherwise prompting the user that the two-dimensional code is counterfeit;
the process of off-line verification comprises the following steps: and after the non-public coding information and the public coding information are decoded respectively, checking whether the decoding information of the non-public coding information and the decoding information of the public coding information accord with a preset association rule or not, if so, performing subsequent decoding inquiry work, and otherwise, prompting a user that the two-dimensional code is counterfeit.
9. A two-dimensional code anti-counterfeiting code generation system for generating the anti-counterfeiting code according to any one of claims 1 to 8; it is characterized by comprising:
the calibration module is used for determining the position of the two-dimensional code public code, calibrating the area where the two-dimensional code public code is located, and taking the area as a reference, wherein a blank area outside or inside the two-dimensional code is used as a coding area of the anti-counterfeiting code;
the encoding module is used for adding an anti-counterfeiting code consisting of non-public encoding contents in a random position encoding mode based on the encoding region;
the encoding module is further configured to select n different encoding regions, corresponding to numbers 1 to n; generating a coded position number sequence consisting of 1 to n by using a random number seed; each digit in the digit sequence corresponds to a unique coding position; after converting the non-public coded content into a 01 sequence, sequentially coding according to the positions marked by the coded position number sequence, wherein 0 is represented by a black square and 1 is represented by a white square; when all the positions of a certain coding region are coded, the serial number of the coding position in the coding position digital sequence is ignored, a serial number is shifted down, and the like is repeated until all the coded information is coded.
10. A two-dimensional code anti-counterfeiting code verification system for verifying the anti-counterfeiting code according to any one of claims 1 to 8; it is characterized by comprising:
the decoding module extracts an anti-counterfeiting code based on the random position code based on the coding region;
the verification module is used for verifying the matching relationship between the two-dimension code public code and the anti-counterfeiting code, confirming the authenticity of the two-dimension code, if the two-dimension code public code and the anti-counterfeiting code are matched, the two-dimension code is true, otherwise, the two-dimension code is false;
the decoding module is further used for taking the random seed in the encoding process as a key in the decoding process, and generating an encoding position number sequence consisting of n numbers by taking the key as a random number seed, wherein each number represents an encoding position; sequentially reading the image gray scale at the position according to the position identified by the coded position digital sequence, and if the gray scale is less than a threshold value, extracting information to be 0; if the gray level is greater than the threshold value, extracting information as 1; when all the positions of a certain coding region are decoded, the sequence number of the coding position in the coding position digit sequence is ignored, and a sequence number is moved down, and so on until all the decoding is finished.
CN202211468187.9A 2022-11-22 2022-11-22 Two-dimensional code anti-counterfeiting method, two-dimensional code anti-counterfeiting code generation system and verification system Pending CN115759161A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211468187.9A CN115759161A (en) 2022-11-22 2022-11-22 Two-dimensional code anti-counterfeiting method, two-dimensional code anti-counterfeiting code generation system and verification system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211468187.9A CN115759161A (en) 2022-11-22 2022-11-22 Two-dimensional code anti-counterfeiting method, two-dimensional code anti-counterfeiting code generation system and verification system

Publications (1)

Publication Number Publication Date
CN115759161A true CN115759161A (en) 2023-03-07

Family

ID=85335147

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211468187.9A Pending CN115759161A (en) 2022-11-22 2022-11-22 Two-dimensional code anti-counterfeiting method, two-dimensional code anti-counterfeiting code generation system and verification system

Country Status (1)

Country Link
CN (1) CN115759161A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117745299A (en) * 2023-10-31 2024-03-22 北京国立信科技术有限公司 Two-dimensional code-based anti-counterfeiting method and system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117745299A (en) * 2023-10-31 2024-03-22 北京国立信科技术有限公司 Two-dimensional code-based anti-counterfeiting method and system

Similar Documents

Publication Publication Date Title
CN108764420B (en) Two-dimensional code, coding and identifying method thereof and product with anti-counterfeiting function
Tkachenko et al. Two-level QR code for private message sharing and document authentication
US10373033B2 (en) Two dimensional barcode and method of authentication of such barcode
CN103761799B (en) A kind of bill anti-counterfeit method based on texture image feature and device
US9384390B2 (en) Sensing data from physical objects
CN113435556B (en) Code generation and decoding method and anti-counterfeiting method of dot matrix code
CN113313225B (en) Anti-counterfeiting method based on sparse dot matrix code
CN109190736B (en) Anti-counterfeiting two-dimensional code and generation method and generation application system thereof
EP3242239A1 (en) Optimized authentication of graphic authentication code
CN103577986A (en) Multi-level two-dimension code fake preventing method
CN102855578A (en) Anti-counterfeiting method and anti-counterfeiting mark
CN115293311B (en) Color watermark anti-counterfeiting method and device based on micro-point code
CN109816077A (en) A kind of hidden method of two-dimensional barcode information, device, electronic equipment and storage medium
CN109754037A (en) A kind of one yard of commodity counterfeit prevention of an object and traceability system based on digital watermarking two dimensional code
CN112749982A (en) Anti-counterfeiting system and method based on two-dimensional code
CN115329919B (en) Random additional point anti-counterfeiting method and device based on micro point code
CN115759161A (en) Two-dimensional code anti-counterfeiting method, two-dimensional code anti-counterfeiting code generation system and verification system
US8931697B2 (en) System for detecting reorigination of barcodes
CN116681098A (en) Method and system for generating anti-counterfeiting mark image based on two-dimensional code generation
US8893974B2 (en) Decoder for barcodes with anti-copy feature
CN112465093B (en) Double-layer two-dimensional code anti-counterfeiting generation method and verification method
AU2006252223B2 (en) Tamper Detection of Documents using Encoded Dots
CN115423063B (en) Anti-copying shading anti-counterfeiting method and device based on micro-point code
CN115601216A (en) Anti-counterfeiting tracing method and device based on structural deformation and image watermark
CN114997350A (en) Method and system for identifying authenticity of article

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination