CN115204338B - Graphic code generation method and device, and graphic code verification method and device - Google Patents
Graphic code generation method and device, and graphic code verification method and device Download PDFInfo
- Publication number
- CN115204338B CN115204338B CN202210880319.2A CN202210880319A CN115204338B CN 115204338 B CN115204338 B CN 115204338B CN 202210880319 A CN202210880319 A CN 202210880319A CN 115204338 B CN115204338 B CN 115204338B
- Authority
- CN
- China
- Prior art keywords
- graphic code
- counterfeiting information
- information
- counterfeiting
- function
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 110
- 238000012795 verification Methods 0.000 title claims abstract description 40
- 230000006870 function Effects 0.000 claims description 149
- 230000008569 process Effects 0.000 claims description 29
- 230000001419 dependent effect Effects 0.000 claims description 4
- 238000012545 processing Methods 0.000 abstract description 8
- 241001391944 Commicarpus scandens Species 0.000 abstract description 4
- 238000010586 diagram Methods 0.000 description 14
- 238000004891 communication Methods 0.000 description 11
- 238000004364 calculation method Methods 0.000 description 6
- 238000005516 engineering process Methods 0.000 description 4
- 238000012937 correction Methods 0.000 description 3
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 230000008901 benefit Effects 0.000 description 2
- 238000004422 calculation algorithm Methods 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 238000013507 mapping Methods 0.000 description 2
- 230000007246 mechanism Effects 0.000 description 2
- 230000004044 response Effects 0.000 description 2
- 101100217298 Mus musculus Aspm gene Proteins 0.000 description 1
- 238000004590 computer program Methods 0.000 description 1
- 238000005314 correlation function Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000012549 training Methods 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06K—GRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
- G06K19/00—Record carriers for use with machines and with at least a part designed to carry digital markings
- G06K19/06—Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code
- G06K19/06009—Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking
- G06K19/06037—Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking multi-dimensional coding
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/64—Protecting data integrity, e.g. using checksums, certificates or signatures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06K—GRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
- G06K19/00—Record carriers for use with machines and with at least a part designed to carry digital markings
- G06K19/06—Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code
- G06K19/06009—Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking
- G06K19/06046—Constructional details
- G06K19/06056—Constructional details the marking comprising a further embedded marking, e.g. a 1D bar code with the black bars containing a smaller sized coding
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06K—GRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
- G06K7/00—Methods or arrangements for sensing record carriers, e.g. for reading patterns
- G06K7/10—Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
- G06K7/10544—Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation by scanning of the records by radiation in the optical part of the electromagnetic spectrum
- G06K7/10821—Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation by scanning of the records by radiation in the optical part of the electromagnetic spectrum further details of bar or optical code scanning devices
- G06K7/10861—Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation by scanning of the records by radiation in the optical part of the electromagnetic spectrum further details of bar or optical code scanning devices sensing of data fields affixed to objects or articles, e.g. coded labels
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06K—GRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
- G06K7/00—Methods or arrangements for sensing record carriers, e.g. for reading patterns
- G06K7/10—Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
- G06K7/14—Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
- G06K7/1404—Methods for optical code recognition
- G06K7/1408—Methods for optical code recognition the method being specifically adapted for the type of code
- G06K7/1417—2D bar codes
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Health & Medical Sciences (AREA)
- Electromagnetism (AREA)
- General Health & Medical Sciences (AREA)
- Toxicology (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Artificial Intelligence (AREA)
- Computer Security & Cryptography (AREA)
- Bioethics (AREA)
- Computer Hardware Design (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Editing Of Facsimile Originals (AREA)
Abstract
The disclosure discloses a graphic code generation method and device and a graphic code verification method and device, and relates to the field of data processing. The graphic code generation method comprises the following steps: determining at least two pieces of anti-counterfeiting information corresponding to the graphic code content data, wherein the at least two pieces of anti-counterfeiting information have an association relationship; and generating a graphic code corresponding to the graphic code content data based on the graphic code content data and at least two pieces of anti-counterfeiting information. That is, the graphic code generated by the present disclosure includes at least two anti-counterfeiting information, and the at least two anti-counterfeiting information has an association relationship therebetween. Therefore, if the graphic code generated by the present disclosure is to be attacked, the association relationship between at least two anti-counterfeiting information needs to be broken. However, the association relationship between at least two anti-counterfeiting information is not easy to obtain by observing the graphic code at the image level, so that the graphic code generated by the method is not easy to break, namely the security of the graphic code is improved by the method for generating the graphic code.
Description
Technical Field
The disclosure relates to the technical field of data processing, in particular to a graphic code generation method and device, a graphic code verification method and device and electronic equipment.
Background
With the rapid development of information technology and the popularization of graphic code technology, the application of graphic codes such as two-dimensional codes, bar codes and the like is becoming wider and wider. In the related art, a product manufacturer often attaches a graphic code to a produced product in order to identify the product as a regular product. In order to obtain illegal benefits, illegal manufacturers often forge the graphic code of a regular product and attach the forged graphic code to the forged product so that the forged product has a legal identity.
However, the present graphic code is very easy to forge and has poor security, so that it is clear that a scheme capable of improving the anti-counterfeiting performance of the graphic code is needed.
Disclosure of Invention
In view of the above, the present disclosure provides a method and apparatus for generating a graphic code, a method and apparatus for verifying a graphic code, and an electronic device, so as to solve the problems of easy counterfeiting and poor security of the graphic code.
In a first aspect, there is provided a graphic code generating method including: determining at least two pieces of anti-counterfeiting information corresponding to the graphic code content data, wherein the at least two pieces of anti-counterfeiting information have an association relationship; and generating a graphic code corresponding to the graphic code content data based on the graphic code content data and at least two pieces of anti-counterfeiting information.
In a second aspect, a graphic code verification method is provided, the graphic code verification method including: identifying the graphic code to be verified to obtain graphic code content data and identification information corresponding to at least two anti-counterfeiting information introduced in the generation process of the graphic code to be verified, wherein the at least two anti-counterfeiting information has an association relationship; based on the graphic code content data, predicting anti-counterfeiting information introduced in the generation process of the graphic code to be verified to obtain anti-counterfeiting prediction information; and verifying the graphic code to be verified based on the identification information and the anti-counterfeiting prediction information corresponding to the at least two anti-counterfeiting information respectively.
In a third aspect, a graphic code generating apparatus is provided, which includes a determining module and a generating module. The determining module is configured to determine at least two pieces of anti-counterfeiting information corresponding to the graphic code content data, wherein the at least two pieces of anti-counterfeiting information have an association relationship. The generation module is configured to generate a graphic code corresponding to the graphic code content data based on the graphic code content data and the at least two anti-counterfeiting information.
In a fourth aspect, a graphic code verification apparatus is provided, the graphic code verification apparatus including an identification module, a prediction module, and a verification module. The identification module is configured to identify the graphic code to be verified, so as to obtain graphic code content data and identification information corresponding to at least two pieces of anti-counterfeiting information introduced in the generation process of the graphic code to be verified, wherein the at least two pieces of anti-counterfeiting information have an association relationship. The prediction module is configured to predict anti-counterfeiting information introduced in the generation process of the graphic code to be verified based on the graphic code content data to obtain anti-counterfeiting prediction information. The verification module is configured to verify the graphic code to be verified based on the identification information and the anti-counterfeiting prediction information corresponding to the at least two anti-counterfeiting information respectively.
In a fifth aspect, a computer readable storage medium is provided, the storage medium storing instructions that, when executed, enable the method mentioned in the first and second aspects above to be carried out.
In a sixth aspect, there is provided a computer program product comprising instructions which, when executed, enable the method mentioned in the first and second aspects above to be carried out.
In a seventh aspect, there is provided an electronic device comprising a memory having executable code stored therein and a processor configured to execute the executable code to implement the methods mentioned in the first and second aspects above.
The graphic code generation method provided by the embodiment of the disclosure generates the graphic code corresponding to the graphic code content data based on the graphic code content data and at least two pieces of anti-counterfeiting information. That is, the graphic code generated by the embodiment of the disclosure includes at least two anti-counterfeiting information, and the at least two anti-counterfeiting information has an association relationship. Therefore, if the graphic code generated by the embodiment of the present disclosure is to be attacked, the association relationship between at least two pieces of anti-counterfeiting information needs to be broken. However, the association relationship between at least two anti-counterfeiting information cannot be obtained by observing the graphic code at the image level, so that the graphic code generated by the embodiment of the disclosure is not easy to break, i.e., the security of the generated graphic code is improved by the graphic code generation method.
Drawings
Fig. 1 is a schematic application scenario of a graphic code generating method according to an embodiment of the disclosure.
Fig. 2 is a schematic application scenario diagram of a graphic code verification method according to an embodiment of the disclosure.
Fig. 3 is a schematic application scenario diagram of a graphic code verification method according to another embodiment of the disclosure.
Fig. 4 is a flowchart illustrating a method for generating a graphic code according to an embodiment of the disclosure.
Fig. 5 is a flowchart illustrating a method for generating a graphic code according to another embodiment of the disclosure.
Fig. 6a is a schematic diagram of a graphic code without anti-counterfeit information according to an embodiment of the disclosure.
FIG. 6b is a schematic diagram of a graphic code with redundant bit information added according to one embodiment of the present disclosure.
FIG. 6c is a schematic diagram of a graphical code with added ink edge feature information according to one embodiment of the present disclosure.
Fig. 6d is a schematic diagram of a graphic code with watermark feature information added according to an embodiment of the present disclosure.
Fig. 7 is a flowchart illustrating a method for generating a graphic code according to another embodiment of the disclosure.
Fig. 8 is a flowchart illustrating a method for generating a graphic code according to another embodiment of the disclosure.
Fig. 9 is a flowchart illustrating a method for verifying a graphic code according to an embodiment of the disclosure.
Fig. 10 is a flowchart illustrating a method for verifying a graphic code according to another embodiment of the disclosure.
Fig. 11 is a flowchart illustrating a method for verifying a graphic code according to another embodiment of the disclosure.
Fig. 12 is a flowchart illustrating a method for verifying a graphic code according to another embodiment of the disclosure.
Fig. 13 is a schematic structural diagram of a graphic code generating device according to an embodiment of the disclosure.
Fig. 14 is a schematic structural diagram of a graphic code verification device according to an embodiment of the disclosure.
Fig. 15 is a schematic structural diagram of an electronic device according to an embodiment of the disclosure.
Detailed Description
The following description of the technical solutions in the embodiments of the present disclosure will be made clearly and completely with reference to the accompanying drawings in the embodiments of the present disclosure, and it is apparent that the described embodiments are only some embodiments of the present disclosure, not all embodiments.
With the rapid development of information technology and the popularization of graphic code technology, the application of graphic codes such as bar codes, two-dimensional codes and the like is becoming wider and wider. The bar code (also called one-dimensional bar code) is a graphic code in which a plurality of black bars with different widths are arranged according to a certain coding rule to express a set of information. The two-dimensional code (also called as a two-dimensional bar code) is a bar code which extends another dimension to have readability on the basis of the one-dimensional bar code, and a black-and-white rectangular pattern is used for representing a graphic code of binary data. The bar code and the two-dimensional code can acquire the information contained in the bar code and the two-dimensional code after being scanned by the equipment. The width of the bar code describes the data, while the bar code length does not. The length and the width of the two-dimensional code record data. The two-dimensional code has a 'positioning point' and a 'fault tolerance mechanism' which are not available in the one-dimensional bar code. The fault tolerance mechanism is that even if all the two-dimensional codes are not recognized or the two-dimensional codes are stained, the information on the two-dimensional codes can be correctly restored.
Illustratively, the quick response two-dimensional code (Quick Response Code, QRCode) is a two-dimensional code that is widely used at present. The QR Code has the advantages of large information capacity, high reliability, capability of representing various character information such as Chinese characters and images, strong confidentiality and anti-counterfeiting performance and the like of one-dimensional bar codes and other two-dimensional bar codes. For example, the graphic Code generated by the present disclosure may be a graphic Code generated by adding at least two anti-counterfeiting information with association relationship on the basis of QR Code.
The anti-counterfeiting purpose of the product can be realized by adding anti-counterfeiting information to the graphic code and attaching the graphic code added with the anti-counterfeiting information to the product. The graphic code generated by the embodiment of the disclosure comprises at least two anti-counterfeiting information, and the at least two anti-counterfeiting information has an association relationship. Therefore, if the graphic code generated by the embodiment of the present disclosure is to be attacked, the association relationship between at least two pieces of anti-counterfeiting information needs to be broken. However, the association relationship between at least two anti-counterfeiting information cannot be obtained by observing the graphic code at the image level, so that the graphic code generated by the embodiment of the disclosure is not easy to break, i.e., the security of the generated graphic code is improved by the graphic code generation method.
An example of an application scenario is described below in connection with fig. 1-3.
Fig. 1 is a schematic application scenario of a graphic code generating method according to an embodiment of the disclosure. As shown in fig. 1, the application scenario of the present embodiment is a product anti-counterfeiting scenario. Specifically, the product anti-counterfeiting scene mentioned in this embodiment includes a server 110 and a client 120 communicatively connected to the server 110. The client 120 is configured to send the graphic code content data to the server 110. The server 110 is configured to determine at least two pieces of anti-counterfeiting information corresponding to the graphic code content data, where the at least two pieces of anti-counterfeiting information have an association relationship; and generating a graphic code corresponding to the graphic code content data based on the graphic code content data and at least two pieces of anti-counterfeiting information.
In one embodiment, the server 110 may send the generated graphic code to the client 120 so that the client 120 outputs the graphic code, thereby allowing the user to attach the graphic code to the product to be anti-counterfeit.
By way of example, the client 120 may be a user terminal such as a user's cell phone, tablet computer, and desktop computer that has graphic code generating software installed. The client 120 may also be a user terminal such as a mobile phone, a tablet computer, and a desktop computer, which can log in to the graphic code generation platform webpage. That is, the user may provide the graphic code content data through the graphic code generation platform webpage using the client 120. The user may be a manufacturer of the product or a selling merchant of the product.
Fig. 2 is a schematic application scenario diagram of a graphic code verification method according to an embodiment of the disclosure. As shown in fig. 2, the application scenario of the present embodiment is a scenario of offline verification of a product. Specifically, the scenario of the offline verification product mentioned in this embodiment includes the client 210. The client 210 obtains the graphic code content data and the respective identification information of at least two anti-counterfeiting information introduced in the generation process of the graphic code by scanning the graphic code attached to the product to identify the graphic code, wherein the at least two anti-counterfeiting information has an association relationship. Then, the client 210 predicts the anti-counterfeiting information introduced in the generation process of the graphic code to be verified based on the graphic code content data to obtain anti-counterfeiting prediction information, and finally, the client 210 verifies the identified graphic code based on the identification information and the anti-counterfeiting prediction information of at least two anti-counterfeiting information respectively. For example, the client 210 may be a user terminal such as a mobile phone, a tablet computer, and a desktop computer installed with graphic code verification software. Wherein the user may be a buyer of the purchased product.
Fig. 3 is a schematic application scenario diagram of a graphic code verification method according to another embodiment of the disclosure. As shown in fig. 3, the application scenario of the present embodiment is a scenario of online verification of a product. Specifically, the scenario of online verification products mentioned in this embodiment includes a server 310 and a client 320 communicatively connected to the server 310. The client 320 is used to scan the graphic code attached to the product and transmit the graphic code to the server 310. The server 310 identifies the graphic code to be verified to obtain graphic code content data and respective identification information of at least two anti-counterfeiting information introduced in the generation process of the graphic code, wherein the at least two anti-counterfeiting information has an association relationship; based on the graphic code content data, predicting anti-counterfeiting information introduced in the generation process of the graphic code to be verified to obtain anti-counterfeiting prediction information; and verifying the identified graphic code based on the identification information and the anti-counterfeiting prediction information of each of the at least two anti-counterfeiting information. For example, the client 320 may be a user terminal such as a mobile phone, a tablet computer, and a desktop computer with a function of scanning a graphic code. Wherein the user may be a buyer of the purchased product.
The graphic code generation method is illustrated below in conjunction with fig. 4.
Fig. 4 is a flowchart illustrating a method for generating a graphic code according to an embodiment of the disclosure. Specifically, the present embodiment may be executed in a server. As shown in fig. 4, the graphic code generating method provided in this embodiment includes the following steps.
Step S410, at least two anti-counterfeiting information corresponding to the graphic code content data are determined.
The graphic code content data is content data for generating graphic codes. For example, the graphic code content data may be "12345678", and a graphic code may be generated using the graphic code content data "12345678", and the graphic code may be scanned to obtain graphic code content data "12345678".
Specifically, at least two pieces of anti-counterfeiting information have an association relationship, wherein the association relationship can be a mapping relationship. Illustratively, the at least two security information may include security information a and security information B, with a mapping relationship between the security information a and the security information B.
In some embodiments, determining at least two pieces of security information corresponding to the graphic code content data may be performed as: at least two anti-counterfeiting information corresponding to the graphic code content data are obtained. That is, at least two anti-counterfeiting information corresponding to the graphic code content data are directly acquired. This arrangement can simplify the calculation amount. In still other embodiments, determining at least two pieces of security information corresponding to the graphic code content data may be performed as: at least two anti-counterfeiting information corresponding to the graphic code content data are generated. That is, at least two pieces of anti-counterfeiting information corresponding to the graphic code content data are computationally generated. By this arrangement, it is possible to avoid a situation where the graphic code generation method cannot be executed due to the absence or inability to acquire the pre-generated security information.
Step S420, based on the graphic code content data and at least two anti-counterfeiting information, generating a graphic code corresponding to the graphic code content data.
Illustratively, the graphic code corresponding to the graphic code content data is generated based on the graphic code content data and the at least two anti-counterfeiting information, which may be that a part of the at least two anti-counterfeiting information (such as one of three anti-counterfeiting information) is generated based on the graphic code content data, and then generating the non-generated anti-counterfeiting information in the at least two anti-counterfeiting information by utilizing the generated anti-counterfeiting information and the association relation between the at least two anti-counterfeiting information, and finally generating the graphic code by utilizing all the generated anti-counterfeiting information and the graphic code content data.
Some of the above mentioned security information are of a type that is very easy to find by observing the graphic code itself (see the description of fig. 6a to 6d below). That is, by observing the graphic code, the type of the anti-counterfeiting information can be estimated roughly, and then the content data of the graphic code is extracted based on the determined type of the anti-counterfeiting information, so that the purpose of counterfeiting the graphic code is finally achieved. However, the graphic code generated by the embodiment of the disclosure includes at least two anti-counterfeiting information, and the at least two anti-counterfeiting information has an association relationship. Therefore, if the graphic code generated by the embodiment of the present disclosure is to be attacked, the association relationship between at least two pieces of anti-counterfeiting information needs to be broken. However, the association relationship between at least two anti-counterfeiting information cannot be obtained by observing the graphic code at the image level, so that the graphic code generated by the embodiment of the disclosure is not easy to break, i.e., the security of the generated graphic code is improved by the graphic code generation method.
In order to clarify a specific determination manner of at least two security information, an example is described below with reference to fig. 5.
Fig. 5 is a flowchart illustrating a method for generating a graphic code according to another embodiment of the disclosure. Specifically, in an embodiment of the present disclosure, the at least two pieces of security information mentioned in the above embodiment include a first security information and a second security information, and the first security information and the second security information have an association relationship therebetween. On this basis, as shown in fig. 5, in the embodiment of the present disclosure, the step of determining at least two pieces of anti-counterfeiting information corresponding to the graphic code content data includes the following steps.
Step S510, determining first anti-counterfeiting information corresponding to the graphic code content data.
In some embodiments, determining the first anti-counterfeiting information corresponding to the graphic code content data may be performed as: and acquiring first anti-counterfeiting information corresponding to the graphic code content data. That is, the first security information may be directly acquired. This arrangement can simplify the calculation amount. In still other embodiments, determining the first security information corresponding to the graphic code content data may be performed as: and generating first anti-counterfeiting information corresponding to the graphic code content data. That is, the first anti-counterfeiting information corresponding to the graphic code content data may be computationally generated. By the arrangement, the situation that the graphic code generation method cannot be executed due to the fact that the first anti-counterfeiting information corresponding to the pre-generated graphic code content data does not exist or cannot be acquired can be avoided.
Step S520, based on the first anti-counterfeiting information corresponding to the graphic code content data, generates second anti-counterfeiting information corresponding to the graphic code content data.
Specifically, since there is an association between the first anti-counterfeiting information and the second anti-counterfeiting information, generating the second anti-counterfeiting information corresponding to the graphic code content data based on the first anti-counterfeiting information corresponding to the graphic code content data may be performed as: and calculating and generating second anti-counterfeiting information corresponding to the graphic code content data according to the first anti-counterfeiting information corresponding to the graphic code content data and the association relation between the first anti-counterfeiting information and the second anti-counterfeiting information.
The graphic code generation method provided by the embodiment of the disclosure improves the counterfeiting difficulty of the graphic code and the anti-counterfeiting level of the graphic code by virtue of the correlation relation which is difficult to observe, and is simple and small in calculated amount.
In some embodiments, the first security information comprises overt security information that cannot be directly observed, and the second security information comprises overt security information that can be directly observed. Because the hidden anti-counterfeiting information which cannot be directly observed is less prone to losing in the process of counterfeiting (e.g. copying) the graphic code relative to the explicit anti-counterfeiting information which can be directly observed, the second anti-counterfeiting information which corresponds to the graphic code content data is generated based on the first anti-counterfeiting information which corresponds to the graphic code content data, so that in the subsequent graphic code verification process, accurate anti-counterfeiting prediction information is generated according to the first anti-counterfeiting information which cannot be easily lost, and whether the second anti-counterfeiting information extracted from the image layer is the counterfeiting information can be verified according to the accurate anti-counterfeiting prediction information.
In some embodiments, the first security information includes redundant bit information and/or ink edge feature information. The redundant bit information is anti-counterfeit information generated by using redundant bits of the graphic code corresponding to the graphic code content data. Taking redundant bit information of the two-dimensional code as an example, as shown in fig. 6a, the graphic code without anti-counterfeiting information is generated according to the content data of the graphic code. On the graphic code shown in fig. 6a, black and/or white rectangles of any data area are selected to be turned over, so that a new graphic code shown in fig. 6b is obtained, and the graphic code shown in fig. 6a or 6b is scanned to obtain graphic code content data. The information corresponding to the turned black and/or white rectangle is redundant bit information. The black and/or white rectangles may also be colored rectangles. In some embodiments, the number of black and white rectangles flipped is less than the corresponding number of error correction levels for the graphics code shown in fig. 6 a. The error correction level of the graphics code may characterize the number of redundant bits. For example, a graphic code contains P rectangles, and when Q rectangles are missing, the graphic code can still be correctly decoded, and the number of the graphic code corresponding to the error correction level is Q. The redundant bit information is implicit anti-counterfeiting information that cannot be directly observed. Specifically, if the graphic code added with the redundant bit information is to be observed, the graphic code content data of the graphic code added with the redundant bit information needs to be identified first, then the graphic code not added with the redundant bit information is generated by utilizing the graphic code content data, and then the graphic code not added with the redundant bit information and the graphic code added with the redundant bit information are compared to obtain the redundant bit information. Thus, the redundant bit information is implicit anti-counterfeiting information that cannot be directly observed. The ink edge feature information may be information of a relief feature included in a black (or color) pattern edge of the pattern code, as shown in fig. 6 c.
In some embodiments, the second security information includes watermark feature information. The watermark feature information is explicit anti-counterfeit information that can be directly observed. The watermark feature information may be information containing watermark features, such as the graphic code shown in fig. 6d, i.e. the graphic code shown in fig. 6d is a graphic code to which the watermark feature information has been added.
A specific implementation of generating the second security information is illustrated in the following with reference to fig. 7. Fig. 7 is a flowchart illustrating a method for generating a graphic code according to another embodiment of the disclosure. The embodiment shown in fig. 7 is extended from the embodiment shown in fig. 5, and differences between the embodiment shown in fig. 7 and the embodiment shown in fig. 5 are described with emphasis, and the details of the differences are not repeated.
As shown in fig. 7, in an embodiment of the present disclosure, the step of generating second security information corresponding to graphic code content data based on first security information corresponding to graphic code content data includes the following steps.
Step S710, determining an association function between the first anti-counterfeiting information and the second anti-counterfeiting information.
Specifically, the association relationship between the first anti-counterfeiting information and the second anti-counterfeiting information can be determined through an association relationship function. The first security information and the association function are known, or the second security information and the association function are known, and the first security information can be obtained.
Step S720, based on the first anti-counterfeiting information and the association function, generating second anti-counterfeiting information.
By determining the association function between the first anti-counterfeiting information and the second anti-counterfeiting information and generating the second anti-counterfeiting information based on the first anti-counterfeiting information and the association function, the attack difficulty of the subsequently generated graphic code can be improved by improving the complexity of the association function, so that the security of the subsequently generated graphic code is further improved.
In some embodiments, the associative function may be a one-way function. A one-way function is a function with unidirectional properties (also called irreversibility), i.e. for a one-way function y=f (x), y can be easily calculated if x is known, but x=f -1 (y) is difficult to calculate if y is known. Therefore, the association relation function is determined as the one-way function, and the second anti-counterfeiting information (i.e., y of the one-way function) can be easily calculated according to the first anti-counterfeiting information (i.e., x of the one-way function) in the process of generating the graphic code. However, in the graphic code verification process, it is difficult for an illegal person to calculate the first anti-counterfeiting information (i.e., x of the one-way function) according to the second anti-counterfeiting information (i.e., y of the one-way function), so that the security of the generated graphic code is further improved.
In some embodiments, the one-way function may be a one-way trapdoor function. It is understood that a one-way trapdoor function refers to a one-way function with trapdoors. The one-way trapdoor function contains two distinct features: one is unidirectional, and the other is trapdoor. The unidirectional property is the same as that of the unidirectional function described above, and will not be described again here. Trapdoor (also called back door) for a one-way trapdoor function y=f (x), where y is known at the same time, x=f -1 (y) can be easily calculated. Therefore, by further setting the one-way function as the one-way trapdoor function, the probability of decoding the graphic code can be further reduced, the complexity of the association relation function is further improved, and the security of the generated graphic code is further improved.
In some embodiments, the step of generating the second security information based on the first security information and the association function includes: and generating second anti-counterfeiting information serving as a dependent variable of the association function by using the association function by taking the first anti-counterfeiting information as the independent variable of the association function. Illustratively, the first anti-counterfeiting information is taken as a specific numerical value (for example, 0x4c2e1 c) of x in the association relation function y=f (x), so that the first anti-counterfeiting information can be assigned to x, and then the specific numerical value (for example, 0x44231c4 e) of y is calculated according to the association relation function y=f (x). And the specific value of y is the second anti-counterfeiting information. By defining the first anti-counterfeiting information as the independent variable of the association function and the second anti-counterfeiting information as the dependent variable of the association function, the second anti-counterfeiting information is conveniently generated according to the first anti-counterfeiting information and the association function, the calculation efficiency of the second anti-counterfeiting information is improved, and the calculation efficiency of the graphic code generation method is further improved.
A specific determination manner of the association relation function is illustrated in the following with reference to fig. 8. Fig. 8 is a flowchart illustrating a method for generating a graphic code according to another embodiment of the disclosure. The embodiment shown in fig. 8 is extended from the embodiment shown in fig. 7, and differences between the embodiment shown in fig. 8 and the embodiment shown in fig. 7 are described with emphasis, and the details of the differences are not repeated.
As shown in fig. 8, in an embodiment of the present disclosure, the step of determining an association function between the first security information and the second security information includes the following steps.
Step S810, determining a functional relation characterizing the association between the first anti-counterfeiting information and the second anti-counterfeiting information.
Specifically, the functional relation may be a preset relation, for example, y=ax 5+bx4+cx3+dx2 +ex+f. The functional relation may also be other relations, and the disclosure is not particularly limited.
In some embodiments, determining the functional relation characterizing the association of the first security information and the second security information may be performed as: and obtaining a functional relation representing the association relation of the first anti-counterfeiting information and the second anti-counterfeiting information. That is, the functional relation characterizing the association between the first security information and the second security information is directly obtained. This arrangement can simplify the calculation amount. In some other embodiments, determining the functional relation characterizing the association of the first security information and the second security information may be performed as: and generating a functional relation representing the association relation of the first anti-counterfeiting information and the second anti-counterfeiting information. That is, the functional relation characterizing the association between the first security information and the second security information is: and after the user balances the safety of the graphic code and the efficiency of generating the graphic code, generating the graphic code according to the selection of the user. The setting can satisfy user's actual demand.
For example, if the user's requirements for security of the graphic code are very high, the functional relation can be set relatively complex, thereby achieving the objective of improving security of the graphic code. If the user has higher requirements on the generation efficiency of the graphic code, the function relation can be set relatively simply, so that the generation efficiency of the graphic code is improved.
Step S820, hash (Hash) the graphic code content data to obtain the function parameters of the association function.
Specifically, hash is the transformation of an arbitrary length input into a fixed length output by a hashing algorithm. The Hash can be realized by MD5, SHA1, SHA256 and the like.
Illustratively, the graphic code content data is used as a hashed input, and the hashed output is used as a function parameter of the association function.
Step S830, determining the association relation function based on the function relation and the function parameter.
Illustratively, the functional relationship is: y=ax 5+bx4+cx3+dx2 +ex+f, the specific values of the function parameters are a, b, c, d, e and f, and the specific values of the function parameters are a, b, c, d, e and f are substituted into the functional relation, so that the association relation function can be obtained. For example, a=1, b=3, c=2, d= 6,e = 9,f =3, and substituting the above functional relation into the above functional relation function results in the following correlation function: y=x 5+3x4+2x3+6x2 +9x+3.
Hash has unidirectional properties. In other words, data of an arbitrary length (e.g., graphic code content data) is known, and unique fixed-length data (e.g., function parameters) is easily obtained by Hash. However, given fixed-length data (e.g., function parameters), it is difficult to obtain arbitrary-length data (e.g., graphic code content data) by the inverse operation of Hash. Therefore, the graphic code content data is hashed to obtain the function parameters of the association relation function, the association relation function can be easily obtained in the graphic code generation process, and the second anti-counterfeiting information is obtained through calculation according to the association relation function. However, in the graphic code verification process, illegal personnel cannot deduce the association relation function through Hash inverse operation, so that the security of the generated graphic code is further improved.
In some embodiments, the at least two security information may include a first security information, a second security information, and a third security information. The functional relation of the first, second and third anti-counterfeiting information may be y=ax 5+bx4+cz3+dx2 +ez+f. Illustratively, the first security information is taken as a specific numerical value (e.g., 0x4c2e1 c) of x in the association function y=f (x, z), the second security information is taken as a specific numerical value (e.g., 0x4c 0000) of z in the association function y=f (x, z), the first security information is assigned to x, the second security information is assigned to z, and then the specific numerical value (e.g., 0x 44231234) of y is calculated according to the association function y=f (x, z). And the specific value of y is the third anti-counterfeiting information. The at least two security information may include a greater number of security information, and so on.
The pattern verification method is illustrated in the following with reference to fig. 9.
Fig. 9 is a flowchart illustrating a method for verifying a graphic code according to an embodiment of the disclosure. As shown in fig. 9, the graphic code verification method provided by the embodiment of the disclosure includes the following steps.
Step S910, identifying the graphic code to be verified, and obtaining graphic code content data and identification information corresponding to at least two anti-counterfeiting information introduced in the generation process of the graphic code to be verified.
Specifically, there is an association between at least two pieces of security information. The graphic code to be verified can be a graphic code for anti-counterfeiting, which is attached to the product. Identifying the graphic code to be verified to obtain graphic code content data, which can be identified by scanning the graphic code to be verified. Identifying the graphic code to be verified to obtain the identification information corresponding to the at least two anti-counterfeiting information respectively, wherein the identification information is introduced in the generation process of the graphic code to be verified, and the identification information corresponding to the at least two anti-counterfeiting information respectively can be obtained by extracting the at least two anti-counterfeiting information in the graphic code to be verified.
For example, if the anti-counterfeiting information is watermark feature information, the watermark feature information may be obtained by extracting high-frequency information in the graphic code to be verified, or the watermark feature information of the graphic code to be verified may be extracted by using an anti-counterfeiting information extraction model obtained through training.
Step S920, based on the graphic code content data, predicting the anti-counterfeiting information introduced in the generation process of the graphic code to be verified, thereby obtaining anti-counterfeiting prediction information.
Specifically, based on the graphic code content data, the anti-counterfeiting information introduced in the generation process of the graphic code to be verified is predicted, and the anti-counterfeiting prediction information can be calculated according to the graphic code content data.
Step S930, verifying the graphic code to be verified based on the identification information and the anti-fake prediction information corresponding to the at least two anti-fake information.
Specifically, based on the identification information and the anti-counterfeiting prediction information corresponding to the at least two anti-counterfeiting information, the graphic code to be verified can be verified, wherein the identification information and the anti-counterfeiting prediction information corresponding to the at least two anti-counterfeiting information can be compared, if the comparison result is consistent, the graphic code to be verified can be true, and if the comparison result is inconsistent, the graphic code to be verified can be false.
The graphic code verification method of the embodiment of the disclosure identifies the graphic code to be verified, which contains at least two anti-fake information, and has an association relationship between the at least two anti-fake information, and verifies the identification information by generating anti-fake prediction information. Therefore, if the graphic code to be verified in the embodiment of the disclosure is to be attacked, the association relationship between at least two anti-counterfeiting information needs to be broken, so that the anti-counterfeiting prediction information and the identification information can be consistent when the graphic code is verified. However, the association relationship between at least two anti-counterfeiting information is not easily obtained by observing the graphic code at the image level, so that the identification information of the forged graphic code to be verified is difficult to be consistent with the anti-counterfeiting prediction information, that is, the security of the graphic code verification method in the embodiment of the disclosure is higher.
In some embodiments, the identification code to be verified is generated based on the graphical code generation method described above.
To further clarify the prediction method of the anti-counterfeit prediction information, an example will be described below with reference to fig. 10. Fig. 10 is a flowchart illustrating a method for verifying a graphic code according to another embodiment of the disclosure. The embodiment shown in fig. 10 is extended from the embodiment shown in fig. 9, and differences between the embodiment shown in fig. 10 and the embodiment shown in fig. 9 are described with emphasis, and the details of the differences are not repeated.
As shown in fig. 10, in the embodiment of the present disclosure, based on the content data of the graphic code, the step of predicting the anti-counterfeiting information introduced in the generation process of the graphic code to be verified to obtain anti-counterfeiting prediction information includes the following steps.
Step S1010, determining an association function between the first anti-counterfeiting information and the second anti-counterfeiting information.
Specifically, the association relationship between the first anti-counterfeiting information and the second anti-counterfeiting information can be determined through an association relationship function. The first security information and the association function are known, or the second security information and the association function are known, and the first security information can be obtained.
Specifically, the association relation function between the first anti-counterfeiting information and the second anti-counterfeiting information is the same as the association relation function between the first anti-counterfeiting information and the second anti-counterfeiting information used by the graphic code generator. In other words, the association function used by the graphic code verification method may be used by the graphic code generator to authorize the graphic code verifier.
Illustratively, the graphic code generator generates the graphic code using the association function. When the graphic code verifier needs to verify the graphic code, the verification software (including the association function) or the verification platform (including the association function) authorized by the graphic code generator can be used for scanning the graphic code to be verified.
Step S1020, generating anti-counterfeiting prediction information based on the association function and the identification information corresponding to the first anti-counterfeiting information.
Specifically, the anti-counterfeiting prediction information corresponds to the second anti-counterfeiting information.
By determining the association relation function between the first anti-counterfeiting information and the second anti-counterfeiting information and generating anti-counterfeiting prediction information based on the association relation function and the identification information corresponding to the first anti-counterfeiting information, the difficulty of generating the anti-counterfeiting prediction information can be increased by increasing the complexity of the association relation function, and therefore the accuracy of graphic code verification is further improved.
To further clarify the manner in which the associative function is determined, an example is illustrated below with reference to fig. 11. Fig. 11 is a flowchart illustrating a method for verifying a graphic code according to another embodiment of the disclosure. The embodiment shown in fig. 11 is extended from the embodiment shown in fig. 10, and differences between the embodiment shown in fig. 11 and the embodiment shown in fig. 10 are described with emphasis, and the details of the differences are not repeated.
As shown in fig. 11, in an embodiment of the present disclosure, the step of determining an association function between the first security information and the second security information includes the following steps.
Step S1110, obtaining a functional relation representing the association between the first anti-counterfeiting information and the second anti-counterfeiting information.
Step S1120, hash the graphic code content data to obtain the function parameters of the association function.
Step S1130, determining the association relation function based on the function relation and the function parameters.
The specific implementation manner of step S1110 to step S1130 refers to step S810 to step S830, and is not described herein.
To further clarify the specific manner of the graphic code verification method, an example is described below with reference to fig. 12. As shown in fig. 12, a specific method of the graphic code verification method may include the following steps.
Step S1210, identifying the graphic code to be verified, and obtaining graphic code content data and identification information corresponding to the first anti-counterfeiting information and the second anti-counterfeiting information introduced in the generation process of the graphic code to be verified.
Illustratively, the identified graphic code content data may be "12345678". The identification information corresponding to the first security information may be "0x4c2e1c". The identification information corresponding to the second anti-counterfeiting information may be "0x44231c4e".
Step S1220 obtains a functional relation representing the association between the first anti-counterfeiting information and the second anti-counterfeiting information.
Illustratively, the functional relation of the association relation may be y=ax 5+bx4+cx3+dx2 +ex+f.
In step S1230, the graphic code content data is hashed to obtain the function parameters of the association function.
For example, the function parameters of the association function may be a=1, b=3, c=2, d= 6,e = 9,f =3.
Step S1240, determining the association relationship function based on the function relationship and the function parameters.
Illustratively, the association relation function is determined based on the functional relation and the functional parameter, the functional parameter is substituted into the functional relation, and the obtained association relation function can be: y=x 5+3x4+2x3+6x2 +9x+3.
Step S1250, determining the anti-counterfeiting prediction information based on the identification information corresponding to the first anti-counterfeiting information and the association function.
For example, the identification information "0x4c2e1c" corresponding to the first anti-counterfeiting information is taken as a specific value of x in the association function of step S1240, so as to obtain anti-counterfeiting prediction information "0x44231c4e".
Step S1260, verifying the graphic code to be verified based on the anti-fake prediction information and the identification information corresponding to the second anti-fake information.
For example, based on the identification information corresponding to the anti-counterfeit prediction information and the second anti-counterfeit information, the graphic code to be verified is verified, and the identification information corresponding to the second anti-counterfeit information may be "0x44231c4e" and "0x44231c4e" of the anti-counterfeit prediction information, and it is seen that the identification information corresponding to the second anti-counterfeit information is identical to the anti-counterfeit prediction information, so that the verification result of the graphic code to be verified is true. In other words, the product to which the graphic code to be verified belongs is genuine goods.
Illustratively, if the identification information corresponding to the second anti-counterfeiting information identified in step S1210 is "0x44230000". By comparing the identification information corresponding to the second anti-counterfeiting information with the anti-counterfeiting prediction information 0x44230000, the identification information corresponding to the second anti-counterfeiting information is different from the anti-counterfeiting prediction information, so that the verification result of the graphic code to be verified is false. In other words, the product to which the graphic code to be verified belongs is a counterfeit.
Method embodiments of the present disclosure are described above in detail in connection with fig. 4-12, and apparatus embodiments of the present disclosure are described below in detail in connection with fig. 13 and 14. Furthermore, it should be understood that the description of the method embodiments corresponds to the description of the device embodiments, and that parts not described in detail can therefore be seen in the previous method embodiments.
Fig. 13 is a schematic structural diagram of a graphic code generating device according to an embodiment of the disclosure. As shown in fig. 13, a graphic code generating apparatus 1300 provided in an embodiment of the present disclosure includes: a determination module 1310 and a generation module 1320. Specifically, the determining module 1310 is configured to determine at least two pieces of anti-counterfeiting information corresponding to the graphic code content data, where the at least two pieces of anti-counterfeiting information have an association relationship. The generating module 1320 is configured to generate a graphic code corresponding to the graphic code content data based on the graphic code content data and at least two anti-counterfeiting information.
In some embodiments, the determining module 1310 is further configured to determine first anti-counterfeiting information corresponding to the graphic code content data; and generating second anti-counterfeiting information corresponding to the graphic code content data based on the first anti-counterfeiting information corresponding to the graphic code content data.
In some embodiments, the determining module 1310 is further configured to determine an association function between the first security information and the second security information; and generating second anti-counterfeiting information based on the first anti-counterfeiting information and the association relation function.
In some embodiments, the determining module 1310 is further configured to generate, using the association function, the second security information as an argument of the association function using the first security information as an argument of the association function.
In some embodiments, the determining module 1310 is further configured to determine a functional relation that characterizes an association of the first security information and the second security information; hashing the graphic code content data to obtain function parameters of the association relation function; and determining an association relation function based on the function relation and the function parameters.
Fig. 14 is a schematic structural diagram of a graphic code verification device according to an embodiment of the disclosure. As shown in fig. 14, a graphic code verification apparatus 1400 provided in an embodiment of the present disclosure includes: an identification module 1410, a prediction module 1420, and a verification module 1430. Specifically, the identifying module 1410 is configured to identify a graphic code to be verified, so as to obtain graphic code content data and identification information corresponding to at least two pieces of anti-counterfeiting information introduced in a process of generating the graphic code to be verified, where the at least two pieces of anti-counterfeiting information have an association relationship. The prediction module 1420 is configured to predict, based on the content data of the graphic code, the anti-counterfeit information introduced during the generation process of the graphic code to be verified, and obtain anti-counterfeit prediction information. The verification module 1430 is configured to verify the graphic code to be verified based on the identification information and the anti-counterfeit prediction information corresponding to the at least two anti-counterfeit information.
In some embodiments, the prediction module 1420 is further configured to determine an association function between the first security information and the second security information; and generating anti-fake prediction information based on the association relation function and the identification information corresponding to the first anti-fake information, wherein the anti-fake prediction information corresponds to the second anti-fake information.
In some embodiments, the prediction module 1420 is further configured to obtain a functional relation that characterizes an association between the first security information and the second security information; hashing the graphic code content data to obtain function parameters of the association relation function; and determining an association relation function based on the function relation and the function parameters.
Fig. 15 is a schematic structural diagram of an electronic device according to an embodiment of the disclosure. The electronic device 1500 (which may be a computer device) shown in fig. 15 includes a memory 1501, a processor 1502, a communication interface 1503, and a bus 1504. The memory 1501, the processor 1502 and the communication interface 1503 are connected to each other by a bus 1504.
The Memory 1501 may be a Read Only Memory (ROM), a static storage device, a dynamic storage device, or a random access Memory (Random Access Memory, RAM). The memory 1501 may store programs, and when the programs stored in the memory 1501 are executed by the processor 1502, the processor 1502 and the communication interface 1503 are used to perform the respective steps of the related methods of the embodiments of the present disclosure.
The processor 1502 may employ a general-purpose central processing unit (Central Processing Unit, CPU), microprocessor, application SPECIFIC INTEGRATED Circuit (ASIC), graphics processor (Graphics Processing Unit, GPU) or one or more integrated circuits for executing associated programs to perform the functions required by the elements in the associated apparatus of the disclosed embodiments.
The processor 1502 may also be an integrated circuit chip with signal processing capabilities. In implementation, various steps of the related methods of the present disclosure may be accomplished by integrated logic circuitry in hardware or instructions in software form in the processor 1502. The processor 1502 described above may also be a general purpose processor, a digital signal processor (DIGITAL SIGNAL Processing, DSP), an Application Specific Integrated Circuit (ASIC), a field programmable gate array (Field Programmable GATE ARRAY, FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component. The various methods, steps and logic blocks of the disclosure in the embodiments of the disclosure may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the embodiments of the present disclosure may be embodied directly in hardware, in a decoded processor, or in a combination of hardware and software modules in a decoded processor. The software modules may be located in a random access memory, flash memory, read only memory, programmable read only memory, or electrically erasable programmable memory, registers, etc. as well known in the art. The storage medium is located in the memory 1501, and the processor 1502 reads information in the memory 1501, and in combination with hardware thereof, performs functions necessary for execution of units included in the related apparatus of the disclosed embodiment, or performs related methods of the disclosed method embodiment.
The communication interface 1503 enables communication between the electronic device 1500 and other devices or communication networks using transceiving means such as, but not limited to, a transceiver. For example, the graphic code generation data may be acquired through the communication interface 1503.
Bus 1504 may include a path for transferring information among the various components of electronic device 1500 (e.g., memory 1501, processor 1502, communication interface 1503).
It should be noted that although the electronic device 1500 shown in fig. 15 illustrates only a memory, a processor, and a communication interface, those skilled in the art will appreciate that in a particular implementation, the electronic device 1500 also includes other components necessary to achieve proper operation. Also, as will be appreciated by those of skill in the art, the electronic device 1500 may also include hardware components that perform other additional functions, as desired. Furthermore, it will be appreciated by those skilled in the art that the electronic device 1500 may also include only the devices necessary to implement embodiments of the present disclosure, and not necessarily all of the devices shown in fig. 15.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present disclosure.
It will be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working process of the apparatus and modules described above may refer to the corresponding process in the foregoing method embodiment, which is not repeated herein.
In the several embodiments provided in the present disclosure, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other forms.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present disclosure may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present disclosure may be embodied in essence or a part contributing to the prior art or a part of the technical solution, or in the form of a software product stored in a storage medium, including several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in the embodiments of the present disclosure. And the aforementioned storage medium includes: various media capable of storing program codes, such as a U disk, a mobile hard disk, a read-only memory, a random access memory, a magnetic disk or an optical disk.
The foregoing is merely specific embodiments of the disclosure, but the protection scope of the disclosure is not limited thereto, and any person skilled in the art can easily think about changes or substitutions within the technical scope of the disclosure, and it is intended to cover the scope of the disclosure. Therefore, the protection scope of the present disclosure shall be subject to the protection scope of the claims.
Claims (9)
1. A method of generating a graphic code, comprising:
Determining at least two pieces of anti-counterfeiting information corresponding to graphic code content data, wherein the at least two pieces of anti-counterfeiting information have an association relationship, the at least two pieces of anti-counterfeiting information comprise first anti-counterfeiting information and second anti-counterfeiting information, the first anti-counterfeiting information comprises hidden anti-counterfeiting information which cannot be directly observed, the second anti-counterfeiting information comprises dominant anti-counterfeiting information which can be directly observed, and the hidden anti-counterfeiting information which cannot be directly observed comprises redundant bit information and/or ink edge characteristic information;
generating a graphic code corresponding to the graphic code content data based on the graphic code content data and the at least two anti-counterfeiting information;
wherein, the determining at least two anti-counterfeiting information corresponding to the graphic code content data comprises:
Determining first anti-counterfeiting information corresponding to the graphic code content data;
determining an association relation function between the first anti-counterfeiting information and the second anti-counterfeiting information;
generating the second anti-counterfeiting information serving as a dependent variable of the association function by using the association function by taking the first anti-counterfeiting information as the independent variable of the association function;
the determining the association relation function between the first anti-counterfeiting information and the second anti-counterfeiting information comprises the following steps:
Determining a functional relation representing the association relation between the first anti-counterfeiting information and the second anti-counterfeiting information;
hashing the graphic code content data to obtain function parameters of the association relation function;
and determining the association relation function based on the function relation and the function parameter.
2. The method of claim 1, the association function comprising a one-way function, wherein the one-way function comprises a one-way trapdoor function.
3. The method of claim 1, the explicit anti-counterfeiting information capable of being directly observed comprising watermark feature information.
4. A method of graphical code verification, comprising:
identifying a graphic code to be verified to obtain graphic code content data and identification information corresponding to at least two anti-counterfeiting information introduced in the generation process of the graphic code to be verified, wherein the at least two anti-counterfeiting information has an association relationship, the at least two anti-counterfeiting information comprises first anti-counterfeiting information and second anti-counterfeiting information, the first anti-counterfeiting information comprises hidden anti-counterfeiting information which cannot be directly observed, the second anti-counterfeiting information comprises dominant anti-counterfeiting information which can be directly observed, and the graphic code to be verified is generated based on the graphic code generation method of any one of claims 1 to 3;
Based on the graphic code content data, predicting anti-counterfeiting information introduced in the generation process of the graphic code to be verified to obtain anti-counterfeiting prediction information;
And verifying the graphic code to be verified based on the identification information and the anti-fake prediction information corresponding to the at least two anti-fake information.
5. The method of claim 4, wherein the second security information is derived based on the first security information,
The step of predicting the anti-counterfeiting information introduced in the generation process of the graphic code to be verified based on the graphic code content data to obtain anti-counterfeiting prediction information comprises the following steps:
determining an association relation function between the first anti-counterfeiting information and the second anti-counterfeiting information;
and generating the anti-fake prediction information based on the association relation function and the identification information corresponding to the first anti-fake information, wherein the anti-fake prediction information corresponds to the second anti-fake information.
6. The method of claim 5, the determining an association function between the first security information and the second security information comprising:
Acquiring a functional relation representing the association relation between the first anti-counterfeiting information and the second anti-counterfeiting information;
hashing the graphic code content data to obtain function parameters of the association relation function;
and determining the association relation function based on the function relation and the function parameter.
7. A graphic code generating apparatus comprising:
The determining module is configured to determine at least two pieces of anti-counterfeiting information corresponding to the graphic code content data, wherein the at least two pieces of anti-counterfeiting information have an association relationship, the at least two pieces of anti-counterfeiting information comprise first anti-counterfeiting information and second anti-counterfeiting information, the first anti-counterfeiting information comprises hidden anti-counterfeiting information which cannot be directly observed, the second anti-counterfeiting information comprises dominant anti-counterfeiting information which can be directly observed, and the hidden anti-counterfeiting information which cannot be directly observed comprises redundant bit information and/or ink edge characteristic information;
the generation module is configured to generate a graphic code corresponding to the graphic code content data based on the graphic code content data and the at least two anti-counterfeiting information;
wherein, the determining at least two anti-counterfeiting information corresponding to the graphic code content data comprises:
Determining first anti-counterfeiting information corresponding to the graphic code content data;
determining an association relation function between the first anti-counterfeiting information and the second anti-counterfeiting information;
generating the second anti-counterfeiting information serving as a dependent variable of the association function by using the association function by taking the first anti-counterfeiting information as the independent variable of the association function;
the determining the association relation function between the first anti-counterfeiting information and the second anti-counterfeiting information comprises the following steps:
Determining a functional relation representing the association relation between the first anti-counterfeiting information and the second anti-counterfeiting information;
hashing the graphic code content data to obtain function parameters of the association relation function;
and determining the association relation function based on the function relation and the function parameter.
8. A graphic code verification apparatus, comprising:
The identifying module is configured to identify a graphic code to be verified, so as to obtain graphic code content data and identifying information corresponding to at least two pieces of anti-counterfeiting information introduced in the process of generating the graphic code to be verified, wherein the at least two pieces of anti-counterfeiting information have an association relationship, the at least two pieces of anti-counterfeiting information comprise first anti-counterfeiting information and second anti-counterfeiting information, the first anti-counterfeiting information comprises hidden anti-counterfeiting information which cannot be directly observed, the second anti-counterfeiting information comprises dominant anti-counterfeiting information which can be directly observed, and the graphic code to be verified is generated based on the graphic code generating method of any one of claims 1 to 3;
The prediction module is configured to predict anti-counterfeiting information introduced in the generation process of the graphic code to be verified based on the graphic code content data to obtain anti-counterfeiting prediction information;
and the verification module is configured to verify the graphic code to be verified based on the identification information and the anti-fake prediction information corresponding to the at least two anti-fake information respectively.
9. An electronic device comprising a memory having executable code stored therein and a processor configured to execute the executable code to implement the method of any of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210880319.2A CN115204338B (en) | 2022-07-25 | 2022-07-25 | Graphic code generation method and device, and graphic code verification method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210880319.2A CN115204338B (en) | 2022-07-25 | 2022-07-25 | Graphic code generation method and device, and graphic code verification method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115204338A CN115204338A (en) | 2022-10-18 |
CN115204338B true CN115204338B (en) | 2024-08-06 |
Family
ID=83583356
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210880319.2A Active CN115204338B (en) | 2022-07-25 | 2022-07-25 | Graphic code generation method and device, and graphic code verification method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115204338B (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105389708A (en) * | 2015-11-05 | 2016-03-09 | 成都天星印务股份有限公司 | Anti-counterfeiting method based on combination of digital watermark and two-dimensional code and verification method thereof |
CN108229596A (en) * | 2016-12-09 | 2018-06-29 | 北京大码技术有限公司 | Combined two-dimension code, digital certificates carrier, generation, reading device and method |
Family Cites Families (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2014092831A (en) * | 2012-11-01 | 2014-05-19 | Dainippon Printing Co Ltd | Two-dimensional bar code display terminal, two-dimensional bar code display method, and program, and visitor certification system |
WO2015125025A2 (en) * | 2014-02-10 | 2015-08-27 | Geenee Ug | Systems and methods for image-feature-based recognition |
EP3242239A1 (en) * | 2016-05-02 | 2017-11-08 | Scantrust SA | Optimized authentication of graphic authentication code |
CN106330461B (en) * | 2016-08-30 | 2019-06-18 | 西安小光子网络科技有限公司 | A kind of optical label method for anti-counterfeit and system based on one-way hash function |
CN107194449B (en) * | 2017-06-19 | 2020-01-10 | 南京林业大学 | Printing anti-counterfeiting and information tracing method based on combination of digital watermark and two-dimensional code |
CN108960386A (en) * | 2018-06-29 | 2018-12-07 | 陈国清 | A kind of two dimensional code and its generation method and its identifying system for place of production retrospect |
CN109544189A (en) * | 2018-11-28 | 2019-03-29 | 杭州复杂美科技有限公司 | A kind of method for anti-counterfeit, equipment and storage medium |
CN113392664B (en) * | 2021-06-22 | 2023-04-18 | 杭州沃朴物联科技有限公司 | Anti-counterfeiting two-dimensional code generation method, anti-counterfeiting method and device |
-
2022
- 2022-07-25 CN CN202210880319.2A patent/CN115204338B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105389708A (en) * | 2015-11-05 | 2016-03-09 | 成都天星印务股份有限公司 | Anti-counterfeiting method based on combination of digital watermark and two-dimensional code and verification method thereof |
CN108229596A (en) * | 2016-12-09 | 2018-06-29 | 北京大码技术有限公司 | Combined two-dimension code, digital certificates carrier, generation, reading device and method |
Also Published As
Publication number | Publication date |
---|---|
CN115204338A (en) | 2022-10-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20200293772A1 (en) | Storing anonymized identifiers instead of personally identifiable information | |
US20180219681A1 (en) | Electronically signing and distributing identification data as a service that provides proof of identity, integrity, validity and origin of data for non-repudiation and id validation methods | |
CN105471575B (en) | Information encryption and decryption method and device | |
US11227037B2 (en) | Computer system, verification method of confidential information, and computer | |
CN110489466B (en) | Method and device for generating invitation code, terminal equipment and storage medium | |
CN116933222B (en) | Three-dimensional model copyright authentication method and system based on zero watermark | |
US20230025870A1 (en) | Password authentication apparatus, password authentication method, and computer readable medium | |
CN113988242A (en) | Multi-region-based anti-counterfeiting code generation and verification method, system, equipment and medium | |
Tzong-Chen et al. | Authenticating passwords over an insecure channel | |
JP6145792B2 (en) | Digital signature type two-dimensional code generation device and digital signature type two-dimensional code authentication device | |
CN115204338B (en) | Graphic code generation method and device, and graphic code verification method and device | |
CN117251839A (en) | Electronic fidelity method, system, computer and readable storage medium | |
CN116975923A (en) | Face information desensitization protection method, system and medium based on two-dimension code | |
CN115086008B (en) | Method and device for realizing password security protection, storage medium and electronic equipment | |
US20080049259A1 (en) | Image processing method carrying out verification of correctness of embedment data and identification of embedment data, data detection method, image processing apparatus, and recording medium recording computer program therefor | |
CN116192396A (en) | Signature rapid generation method and device, electronic equipment and computer storage medium | |
CN111694588B (en) | Engine upgrade detection method and device, computer equipment and readable storage medium | |
CN115293309B (en) | Graphic code verification method and device, graphic code registration method and device | |
CN113901502A (en) | Data processing method and device, electronic equipment and storage medium | |
CN118364517B (en) | Block chain-based sales contract certification method and system | |
JP6386181B2 (en) | Authenticity determination system and authentication method | |
CN118378240B (en) | Firmware secure start method and system | |
CN117411644B (en) | Digital signature verification method and device, electronic equipment and storage medium | |
JP7312130B2 (en) | Identity verification support device, identity verification support method, and identity verification support system | |
CN101772045B (en) | Method and device for detecting anti-cloning telecommunication intelligent card |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |