CN115204338A - 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 PDF

Info

Publication number
CN115204338A
CN115204338A CN202210880319.2A CN202210880319A CN115204338A CN 115204338 A CN115204338 A CN 115204338A CN 202210880319 A CN202210880319 A CN 202210880319A CN 115204338 A CN115204338 A CN 115204338A
Authority
CN
China
Prior art keywords
graphic code
information
counterfeiting information
counterfeiting
content data
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
CN202210880319.2A
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.)
Ant Blockchain Technology Shanghai Co Ltd
Original Assignee
Ant Blockchain Technology Shanghai 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 Ant Blockchain Technology Shanghai Co Ltd filed Critical Ant Blockchain Technology Shanghai Co Ltd
Priority to CN202210880319.2A priority Critical patent/CN115204338A/en
Publication of CN115204338A publication Critical patent/CN115204338A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K19/00Record carriers for use with machines and with at least a part designed to carry digital markings
    • G06K19/06Record 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/06009Record 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/06037Record 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K19/00Record carriers for use with machines and with at least a part designed to carry digital markings
    • G06K19/06Record 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/06009Record 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/06046Constructional details
    • G06K19/06056Constructional details the marking comprising a further embedded marking, e.g. a 1D bar code with the black bars containing a smaller sized coding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/10544Methods 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/10821Methods 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/10861Methods 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods 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/1404Methods for optical code recognition
    • G06K7/1408Methods for optical code recognition the method being specifically adapted for the type of code
    • G06K7/14172D bar codes

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 anti-counterfeiting information corresponding to the graphic code content data, wherein the at least two 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 the at least two anti-counterfeiting information. That is, the generated graphic code of the present disclosure includes at least two pieces of anti-counterfeit information, and there is an association relationship between the at least two pieces of anti-counterfeit information. Therefore, if the graphic code generated by the present disclosure is 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 on the image layer, so that the graphic code generated by the method is not easy to break, namely the method for generating the graphic code improves the safety of the graphic code.

Description

Graphic code generation method and device and graphic code verification method and device
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, graphic codes such as two-dimensional codes and bar codes are more and more widely applied. 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 interests, illegal manufacturers often forge the graphic codes of regular products and attach the forged graphic codes to the forged products so that the forged products have legal identities.
However, the existing graphic code is easily forged and has poor security performance, so that a scheme for improving the anti-counterfeiting performance of the graphic code is urgently needed.
Disclosure of Invention
In view of this, the present disclosure provides a graphic code generation method and apparatus, a graphic code verification method and apparatus, and an electronic device, so as to solve the problems that a graphic code is easily forged and has poor security performance.
In a first aspect, a method for generating a graphic code is provided, where the method includes: 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 the at least two anti-counterfeiting information.
In a second aspect, a graphic code verification method is provided, where the graphic code verification method includes: 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 have an association relationship; predicting 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 verifying the graphic code to be verified based on the identification information and the anti-counterfeiting prediction information which correspond to the at least two pieces of anti-counterfeiting information respectively.
In a third aspect, a graphic code generation apparatus is provided, which includes a determination module and a generation module. The determining module is configured to determine at least two anti-counterfeiting information corresponding to the graphic code content data, wherein the at least two anti-counterfeiting information have an association relationship. The generating 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, which includes an identification module, a prediction module, and a verification module. The identification module is configured to identify 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 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 pieces of anti-counterfeiting information.
In a fifth aspect, a computer-readable storage medium is provided, which stores instructions that, when executed, are capable of implementing the methods of the first and second aspects.
A sixth aspect provides a computer program product comprising instructions that, when executed, enable the method of the first and second aspects mentioned above.
In a seventh aspect, an electronic device is provided, which includes a memory and a processor, where the memory stores executable code, and the processor is configured to execute the executable code to implement the method of the first and second aspects.
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 to say, the graphic code generated by the embodiment of the present disclosure includes at least two pieces of anti-counterfeit information, and there is an association relationship between the at least two pieces of anti-counterfeit information. Therefore, if the generated graphic code is 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 pieces of anti-counterfeiting information cannot be obtained by observing the graphic code on the image layer, so that the graphic code generated by the embodiment of the disclosure is not easy to be broken, namely, the safety of the generated graphic code is improved by the method for generating the graphic code.
Drawings
Fig. 1 is a schematic view of an application scenario of a graphic code generation method according to an embodiment of the present disclosure.
Fig. 2 is a schematic view of an application scenario of the graphic code verification method according to an embodiment of the present disclosure.
Fig. 3 is a schematic view of an application scenario of a graphic code verification method according to another embodiment of the present disclosure.
Fig. 4 is a schematic flow chart diagram illustrating a method for generating a graphic code according to an embodiment of the present disclosure.
Fig. 5 is a schematic flow chart diagram illustrating a method for generating a graphic code according to another embodiment of the present disclosure.
Fig. 6a is a schematic view 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 an embodiment of the disclosure.
Fig. 6c is a schematic diagram illustrating a graphic code added with ink edge characteristic information according to an embodiment of the present disclosure.
Fig. 6d is a schematic diagram of a graphic code added with watermark feature information according to an embodiment of the present disclosure.
Fig. 7 is a schematic flow chart diagram illustrating a method for generating a graphic code according to another embodiment of the present disclosure.
Fig. 8 is a schematic flow chart diagram illustrating a method for generating a graphic code according to another embodiment of the present disclosure.
Fig. 9 is a schematic flow chart of a graphic code verification method according to an embodiment of the present disclosure.
Fig. 10 is a schematic flow chart of a graphic code verification method according to another embodiment of the present disclosure.
Fig. 11 is a schematic flow chart of a graphic code verification method according to another embodiment of the present disclosure.
Fig. 12 is a schematic flow chart of a graphic code verification method according to another embodiment of the present disclosure.
Fig. 13 is a schematic structural diagram of a graphic code generation apparatus according to an embodiment of the disclosure.
Fig. 14 is a schematic structural diagram of a graphic code verification apparatus according to an embodiment of the present disclosure.
Fig. 15 is a schematic structural diagram of an electronic device according to an embodiment of the disclosure.
Detailed Description
The technical solutions in the embodiments of the present disclosure will be described clearly and completely with reference to the drawings in the embodiments of the present disclosure, and it is obvious that the described embodiments are only some embodiments of the present disclosure, rather than all embodiments.
With the rapid development of information technology and the popularization of graphic code technology, graphic codes such as bar codes and two-dimensional codes are more and more widely applied. 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 group of information. The two-dimensional code (also called as a two-dimensional bar code) is a bar code which is extended from one dimension to another dimension and has readability, 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 information contained therein after being scanned by the device. The width of the bar code carries data, while the length of the bar code carries no data. The length and width of the two-dimensional code are recorded with data. The two-dimensional code has a positioning point and a fault-tolerant mechanism which are not available in the one-dimensional bar code. The fault-tolerant mechanism is that the information on the two-dimensional code can be correctly restored even if all the two-dimensional codes are not identified or the two-dimensional code is polluted.
Illustratively, a Quick Response Code (QRCode) is a two-dimensional Code 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, images and the like, strong confidentiality and anti-counterfeiting performance and the like of a one-dimensional bar Code and other two-dimensional bar codes. Illustratively, the generated graphic Code may be generated after adding at least two anti-counterfeiting information with an association relationship on the basis of the QR Code.
The anti-counterfeiting information is added to the graphic code, and the graphic code added with the anti-counterfeiting information is attached to a product, so that the purpose of product anti-counterfeiting can be realized by the graphic code. The generated graphic code comprises at least two pieces of anti-counterfeiting information, and the at least two pieces of anti-counterfeiting information have an association relationship. Therefore, if the generated graphic code is 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 pieces of anti-counterfeiting information cannot be obtained by observing the graphic code on the image layer, so that the generated graphic code is not easy to be broken, i.e. the method for generating the graphic code improves the safety of the generated graphic code.
The following description of the application scenarios is made with reference to fig. 1 to 3.
Fig. 1 is a schematic view of an application scenario of a graphic code generation method according to an embodiment of the present disclosure. As shown in fig. 1, the application scenario of the present embodiment is a product anti-counterfeit 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 used for sending the graphic code content data to the server 110. The server 110 is configured to determine at least two anti-counterfeit information corresponding to the graphic code content data, where at least two anti-counterfeit information have an association relationship therebetween; and 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.
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 counterfeit-protected.
The client 120 may be a user terminal, such as a mobile phone, a tablet computer, and a desktop computer, which is installed with the graphic code generation software. The client 120 may also be a user terminal such as a mobile phone, a tablet computer, or a desktop computer, which is capable of logging in the graphic code generation platform web page. That is, the user may provide the graphic code content data through the graphic code generation platform web page using the client 120. Wherein the user may be a manufacturer of the product or a vendor of the product.
Fig. 2 is a schematic view of an application scenario of the graphic code verification method according to an embodiment of the present disclosure. As shown in fig. 2, an application scenario of the present embodiment is an offline verification scenario of a product. Specifically, the scenario of offline verification of a product referred to in this embodiment includes the client 210. The client 210 identifies the graphic code by scanning the graphic code attached to the product, to obtain the content data of the graphic code and the identification information of at least two pieces of anti-counterfeiting information introduced in the generation process of the graphic code, wherein the at least two pieces of anti-counterfeiting information have 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 recognized graphic code based on the respective identification information and anti-counterfeiting prediction information of at least two pieces of anti-counterfeiting information. The client 210 may be a user terminal of a user, such as a mobile phone, a tablet computer, and a desktop computer, which are installed with a graphic code verification software. Wherein the user may be a buyer purchasing a product.
Fig. 3 is a schematic view of an application scenario of a graphic code verification method according to another embodiment of the present disclosure. As shown in fig. 3, an application scenario of the present embodiment is a scenario of online verification of a product. Specifically, the scenario of online verification of a product according to the present 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 send the graphic code to the server 310. The server 310 identifies the graphic code to be verified to obtain content data of the graphic code and identification information of at least two pieces of anti-counterfeiting information introduced in the generation process of the graphic code, wherein the at least two pieces of anti-counterfeiting information have an association relationship; predicting 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 verifying the identified graphic code based on the respective identification information and anti-counterfeiting prediction information of the at least two pieces of anti-counterfeiting information. The client 320 may be a user terminal of a mobile phone, a tablet computer, a desktop computer, etc. with a function of scanning a graphic code. Wherein the user may be a buyer purchasing a product.
The graphic code generation method is illustrated below with reference to fig. 4.
Fig. 4 is a schematic flowchart illustrating a graphic code generation method according to an embodiment of the disclosure. In particular, the present embodiment may be executed in a server. As shown in fig. 4, the graphic code generation 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 a graphic code. For example, the content data of the graphic code may be "12345678", and the content data of the graphic code "12345678" may be used to generate a graphic code, and the graphic code may be scanned to obtain the content data of the graphic code "12345678".
Specifically, at least two pieces of anti-counterfeiting information have an association relationship therebetween, where the association relationship may be a mapping relationship. Illustratively, the at least two pieces of anti-counterfeiting information can comprise anti-counterfeiting information A and anti-counterfeiting information B, and the anti-counterfeiting information A and the anti-counterfeiting information B have a mapping relation.
In some embodiments, determining the at least two pieces of anti-counterfeiting information corresponding to the graphic code content data may be performed as: and acquiring at least two pieces of anti-counterfeiting information corresponding to the graphic code content data. That is to say, at least two anti-counterfeiting information corresponding to the graphic code content data are directly obtained. With this arrangement, the amount of calculation can be simplified. In some other embodiments, determining at least two anti-counterfeiting information corresponding to the graphical code content data may be performed as: and generating at least two pieces of anti-counterfeiting information corresponding to the graphic code content data. That is to say, at least two anti-counterfeiting information corresponding to the graphic code content data are generated by calculation. By the arrangement, the situation that the graphic code generation method cannot be executed due to the fact that the pre-generated anti-counterfeiting information does not exist or cannot be acquired can be avoided.
And step S420, 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.
For example, the graphic code corresponding to the graphic code content data is generated based on the graphic code content data and the at least two pieces of anti-counterfeit information, and may be generated by first generating a part of anti-counterfeit information (for example, one piece of anti-counterfeit information out of three pieces of anti-counterfeit information) out of the at least two pieces of anti-counterfeit information based on the graphic code content data, then generating the non-generated piece of anti-counterfeit information out of the at least two pieces of anti-counterfeit information by using the generated anti-counterfeit information and the association relationship between the at least two pieces of anti-counterfeit information, and finally generating the graphic code by using all the generated anti-counterfeit information and the graphic code content data.
Some of the above-mentioned anti-counterfeiting information are easily found by observing the graphic code itself (see the following description of fig. 6a to 6 d). That is, the type of the anti-counterfeiting information can be roughly estimated by observing the graphic code, 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 realized. However, the generated graphic code of the embodiment of the present disclosure includes at least two pieces of anti-counterfeit information, and there is an association relationship between the at least two pieces of anti-counterfeit information. Therefore, if the generated graphic code is 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 pieces of anti-counterfeiting information cannot be obtained by observing the graphic code on the image layer, so that the generated graphic code is not easy to be broken, i.e. the method for generating the graphic code improves the safety of the generated graphic code.
In order to clarify the specific determination manner of at least two anti-counterfeiting information, the following example is provided with reference to fig. 5.
Fig. 5 is a schematic flow chart diagram illustrating a method for generating a graphic code according to another embodiment of the present disclosure. Specifically, in the embodiment of the present disclosure, the at least two pieces of anti-counterfeiting information mentioned in the above embodiment include first anti-counterfeiting information and second anti-counterfeiting information, and the first anti-counterfeiting information and the second anti-counterfeiting 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-counterfeit information corresponding to the graphic code content data.
In some embodiments, determining the first anti-counterfeiting information corresponding to the graphical code content data may be performed by: and acquiring first anti-counterfeiting information corresponding to the graphic code content data. That is, the first anti-counterfeiting information may be directly acquired. With this arrangement, the amount of calculation can be simplified. In some other embodiments, determining the first anti-counterfeit information corresponding to the graphical code content data may be performed by: and generating first anti-counterfeiting information corresponding to the graphic code content data. That is, the first anti-counterfeit information corresponding to the graphic code content data may be generated by calculation. 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.
And step S520, 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.
Specifically, since the first anti-counterfeit information and the second anti-counterfeit information have an association relationship, generating the second anti-counterfeit information corresponding to the graphic code content data based on the first anti-counterfeit information corresponding to the graphic code content data may be performed as: and calculating to generate 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, the incidence 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 grade of the graphic code by means of the incidence relation which is difficult to observe, and is simple and small in calculation amount.
In some embodiments, the first security information comprises covert security information that is not directly observable and the second security information comprises overt security information that is directly observable. Because the recessive anti-counterfeiting information which can not be directly observed is less prone to loss relative to the explicit anti-counterfeiting information which can be directly observed in the process of counterfeiting (for example, copying) the graphic code, the second anti-counterfeiting information corresponding to the graphic code content data is generated based on the first anti-counterfeiting information corresponding to the graphic code content data, so that in the subsequent graphic code verification process, accurate anti-counterfeiting prediction information can be generated according to the first anti-counterfeiting information which is not prone to loss, 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 anti-counterfeiting information includes redundant bit information and/or ink edge feature information. The redundant bit information is anti-counterfeiting information generated by utilizing redundant bits of the graphic code corresponding to the graphic code content data. Taking the redundant bit information of the two-dimensional code as an example, as shown in fig. 6a, the graphic code is generated according to the content data of the graphic code without the anti-counterfeit information. On the graphic code shown in fig. 6a, black and/or white rectangles of any data area are selected to be turned over, so as to obtain a new graphic code as shown in fig. 6b, and the graphic code shown in fig. 6a or 6b can be scanned to obtain the content data of the graphic code. The information corresponding to the flipped black and/or white rectangles is the redundant bit information. The black and/or white rectangles may also be colored rectangles. In some embodiments, the number of black and white rectangles that are flipped is less than the number corresponding to the error correction level of the graphical code shown in fig. 6 a. The error correction level of the graphic code may characterize the number of redundant bits. For example, a graphic code includes P rectangles, and when Q rectangles are missing, the graphic code can still be decoded correctly, and the number of error correction levels of the graphic code is Q. The redundant bit information is implicit anti-counterfeiting information which cannot be directly observed. Specifically, if the graphic code added with the redundant bit information needs to be observed, the graphic code content data of the graphic code added with the redundant bit information needs to be identified, then the graphic code without the redundant bit information is generated by utilizing the graphic code content data, and then the graphic code without the redundant bit information is compared with the graphic code added with the redundant bit information to obtain the redundant bit information. Therefore, the redundant bit information is implicit anti-counterfeiting information which cannot be directly observed. The ink edge feature information may be information of a concave-convex feature included in a black (or color) graphic edge of the graphic code, as shown in fig. 6 c.
In some embodiments, the second security information comprises watermark characterizing information. The watermark characteristic information is explicit anti-counterfeiting information which can be directly observed. The watermark characteristic information may be information containing watermark characteristics, such as a graphic code shown in fig. 6d, and contain watermark characteristics, that is, the graphic code shown in fig. 6d is a graphic code added with watermark characteristic information.
The following describes a specific implementation manner of generating the second anti-counterfeit information with reference to fig. 7. Fig. 7 is a schematic flowchart illustrating a graphic code generation method according to another embodiment of the disclosure. The embodiment shown in fig. 7 is extended based on the embodiment shown in fig. 5, and the differences between the embodiment shown in fig. 7 and the embodiment shown in fig. 5 will be emphasized below, and the descriptions of the same parts will not be repeated.
As shown in fig. 7, in the embodiment of the present disclosure, the step of generating the second anti-counterfeit information corresponding to the graphic code content data based on the first anti-counterfeit information corresponding to the graphic code content data includes the following steps.
Step S710, determining an association function between the first anti-counterfeit information and the second anti-counterfeit information.
Specifically, it may be determined that the first anti-counterfeiting information and the second anti-counterfeiting information have an association relationship through an association relationship function. For example, the second anti-counterfeiting information may be obtained by knowing the first anti-counterfeiting information and the association relation function, or the first anti-counterfeiting information may be obtained by knowing the second anti-counterfeiting information and the association relation function.
Step S720, second anti-counterfeiting information is generated based on the first anti-counterfeiting information and the incidence relation function.
The incidence relation function between the first anti-counterfeiting information and the second anti-counterfeiting information is determined, the second anti-counterfeiting information is generated based on the first anti-counterfeiting information and the incidence relation function, the attack difficulty of the subsequently generated graphic code can be improved by improving the complexity of the incidence relation function, and the safety of the subsequently generated graphic code is further improved.
In some embodiments, the incidence function may be a one-way function. One-wayThe function is a function with one-way (also called irreversibility), i.e. for a one-way function y = f (x), y can be easily calculated if x is known, but it is difficult to calculate x = f given y -1 (y) of (a). Therefore, the incidence relation function is determined as a 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 generation process of the graphic code. However, in the verification process of the graphic code, 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 the presence of trapdoors. The unidirectionality is the same as that of the unidirectional function described above, and will not be described herein again. Trapdoors (also called back doors) have a one-way trapdoor function y = f (x), and in the case of a known trapdoor, if y is known at the same time, x = f can be easily calculated -1 (y) is carried out. Therefore, the unidirectional function is further set as the unidirectional trapdoor function, so that the probability of the graphic code being cracked can be further reduced, the complexity of the association relation function is further improved, and the safety of the generated graphic code is further improved.
In some embodiments, the step of generating the second anti-counterfeiting information based on the first anti-counterfeiting information and the association relation function comprises: and generating second anti-counterfeiting information which is a dependent variable of the incidence relation function by using the incidence relation function by taking the first anti-counterfeiting information as an independent variable of the incidence relation function. Illustratively, the first anti-counterfeiting information is taken as a specific value of x (e.g., 0x4c2e1 c) in the association function y = f (x), so that the first anti-counterfeiting information can be assigned to x, and then the specific value of y (e.g., 0x44231c4 e) is calculated according to the association function y = f (x). The specific value of y is the second anti-counterfeiting information. By determining that the first anti-counterfeiting information is an independent variable of the association relation function and the second anti-counterfeiting information is a dependent variable of the association relation function, the second anti-counterfeiting information is generated conveniently according to the first anti-counterfeiting information and the association relation 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.
The following illustrates a specific determination manner of the association function with reference to fig. 8. Fig. 8 is a schematic flow chart diagram illustrating a method for generating a graphic code according to another embodiment of the present disclosure. The embodiment shown in fig. 8 is extended based on the embodiment shown in fig. 7, and the differences between the embodiment shown in fig. 8 and the embodiment shown in fig. 7 will be emphasized below, and the descriptions of the same parts will not be repeated.
As shown in fig. 8, in the embodiment of the present disclosure, the step of determining the association function between the first anti-counterfeiting information and the second anti-counterfeiting information includes the following steps.
Step S810, determining a functional relation representing the incidence relation 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 +bx 4 +cx 3 +dx 2 + ex + f. The functional relation may also be other relations, and the disclosure is not particularly limited.
In some embodiments, determining the functional relationship characterizing the association of the first anti-counterfeiting information and the second anti-counterfeiting information may be performed as: and acquiring a function relation representing the incidence relation between the first anti-counterfeiting information and the second anti-counterfeiting information. That is, the functional relation representing the association relationship between the first anti-counterfeit information and the second anti-counterfeit information is directly obtained. With this arrangement, the amount of calculation can be simplified. In still other embodiments, determining the functional relationship characterizing the association of the first security information and the second security information may be performed as: and generating a functional relation representing the incidence relation between the first anti-counterfeiting information and the second anti-counterfeiting information. That is, the functional relation representing the association relationship between the first anti-counterfeiting information and the second anti-counterfeiting information is: the user balances the safety of the graphic code and the efficiency of generating the graphic code and then generates the graphic code according to the selection of the user. So set up, can satisfy user's actual demand.
Illustratively, if the user has a very high requirement on the security of the graphic code, the functional relation may be set to be relatively complex, so as to achieve the purpose of improving the 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.
In step S820, hash (Hash) is performed on the graphic code content data to obtain a function parameter of the association function.
Specifically, the hashing is to convert an input of an arbitrary length into an output of a fixed length by a hashing algorithm. The Hash can be realized by methods such as MD5, SHA1, SHA256 and SHA 256.
Illustratively, the graphical code content data is taken as the input to the hashing, and the output of the hashing is taken as the function parameter of the correlation function.
Step S830, based on the function relation and the function parameter, determining an association relation function.
Illustratively, the functional relationship is: y = ax 5 +bx 4 +cx 3 +dx 2 And the function parameter is the specific numerical value of a, b, c, d, e and f, and the specific numerical value of the function parameter a, b, c, d, e and f is substituted into the function relation formula to obtain the association relation function. For example, a =1,b =3,c =2,d =6,e =9,f =3, and the correlation function obtained by substituting the above functional relation equation is: y = x 5 +3x 4 +2x 3 +6x 2 +9x+3。
Hash has unidirectionality. In other words, given that data of an arbitrary length (for example, graphic code content data) is obtained, unique data of a fixed length (for example, function parameters) can be easily obtained by hashing. However, given fixed-length data (e.g., function parameters), it is difficult to obtain data of an arbitrary length (e.g., graphic code content data) by inverse operation of Hash. Therefore, the Hash processing is carried out on the graphic code content data to obtain the function parameters of the incidence relation function, the incidence relation function can be easily obtained in the graphic code generating process, and the second anti-counterfeiting information is obtained through calculation according to the incidence relation function. However, in the verification process of the graphic code, an illegal person cannot deduce the association relation function through Hash inverse operation, and the safety of the generated graphic code is further improved.
In some embodiments, the at least two pieces of anti-counterfeiting information may include first anti-counterfeiting information, second anti-counterfeiting information, and third anti-counterfeiting information. The functional relation of the first anti-counterfeiting information, the second anti-counterfeiting information and the third anti-counterfeiting information may be y = ax 5 +bx 4 +cz 3 +dx 2 + ez + f. Illustratively, the first anti-counterfeiting information is taken as a specific value of x (e.g., 0x4c2e1 c) in the association function y = f (x, z), the second anti-counterfeiting information is taken as a specific value of z (e.g., 0x4c 0000) in the association function y = f (x, z), the first anti-counterfeiting information is thereby assigned to x, the second anti-counterfeiting information is assigned to z, and then the specific value of y (e.g., 0x 44231234) is calculated according to the association function y = f (x, z). And the specific value of y is the third anti-fake information. The at least two pieces of anti-counterfeiting information can comprise a larger number of pieces of anti-counterfeiting information, and the like.
The graphic code verification method is illustrated in conjunction with fig. 9.
Fig. 9 is a schematic flow chart of a graphic code verification method according to an embodiment of the present disclosure. As shown in fig. 9, the graphic code verification method provided by the embodiment of the present disclosure includes the following steps.
Step S910, identifying the graphic code to be verified, and obtaining the content data of the graphic code 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.
Specifically, at least two anti-counterfeiting information have an association relationship. The graphic code to be verified can be a graphic code which is attached to a product and used for preventing counterfeiting. And identifying the graphic code to be verified to obtain the graphic code content data, wherein the graphic code content data can be identified by scanning the graphic code to be verified. Identifying the graphic code to be verified to obtain identification information corresponding to the at least two pieces of anti-counterfeiting information introduced in the generation process of the graphic code to be verified, or extracting the at least two pieces of anti-counterfeiting information in the graphic code to be verified to obtain the identification information corresponding to the at least two pieces of anti-counterfeiting information.
Illustratively, if the anti-counterfeiting information is watermark characteristic information, the watermark characteristic information can be obtained by extracting high-frequency information in the graphic code to be verified, and the watermark characteristic information of the graphic code to be verified can also be extracted by utilizing an anti-counterfeiting information extraction model obtained by training.
Step S920, based on the content data of the graphic code, predicting the anti-counterfeiting information introduced in the generation process of the graphic code to be verified to obtain anti-counterfeiting prediction information.
Specifically, the anti-counterfeiting information introduced in the generation process of the graphic code to be verified is predicted based on the graphic code content data, and the anti-counterfeiting prediction information can be obtained by calculation according to the graphic code content data.
In step S930, the graphic code to be verified is verified based on the identification information and the anti-counterfeit prediction information corresponding to the at least two pieces of anti-counterfeit information, respectively.
Specifically, the graphic code to be verified is verified based on the identification information and the anti-counterfeiting prediction information corresponding to the at least two pieces of anti-counterfeiting information, the identification information and the anti-counterfeiting prediction information corresponding to the at least two pieces of anti-counterfeiting information may be compared, if the comparison result is consistent, the graphic code to be verified may be verified to be true, and if the comparison result is inconsistent, the graphic code to be verified may be verified to 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 pieces of anti-counterfeiting information, wherein the at least two pieces of anti-counterfeiting information have an incidence relation, and verifies the identification information by generating anti-counterfeiting prediction information. Therefore, if the graphic code to be verified in the embodiment of the present disclosure is attacked, the association relationship between at least two pieces of anti-counterfeiting information needs to be broken, so that the anti-counterfeiting prediction information and the identification information are 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 on the image layer, so that the identification information of the counterfeit graphic code to be verified is hardly consistent with the anti-counterfeiting prediction information, i.e., the graphic code verification method of the embodiment of the disclosure has higher security.
In some embodiments, the identification code to be verified is generated based on the graph code generation method described above.
To further clarify the prediction method of the anti-counterfeit prediction information, the following description is given with reference to fig. 10. Fig. 10 is a schematic flow chart of a graphic code verification method according to another embodiment of the present disclosure. The embodiment shown in fig. 10 is extended based on the embodiment shown in fig. 9, and the differences between the embodiment shown in fig. 10 and the embodiment shown in fig. 9 will be emphasized below, and the descriptions of the same parts will not be repeated.
As shown in fig. 10, in the embodiment of the present disclosure, the step of predicting the anti-counterfeit information introduced in the generation process of the to-be-verified graphic code based on the content data of the graphic code to obtain the anti-counterfeit prediction information includes the following steps.
Step S1010, determining an incidence relation function between the first anti-counterfeiting information and the second anti-counterfeiting information.
Specifically, it may be determined that the first anti-counterfeiting information and the second anti-counterfeiting information have an association relationship through an association relationship function. For example, the second anti-counterfeiting information may be obtained by knowing the first anti-counterfeiting information and the association relation function, or the first anti-counterfeiting information may be obtained by knowing the second anti-counterfeiting information and the association relation function.
Specifically, the association relationship function between the first anti-counterfeiting information and the second anti-counterfeiting information is the same as the association relationship 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 a graphic code generator authorized by a graphic code verifier.
Illustratively, the graphical code generator generates the graphical code using the incidence relation function. When the graphic code verifier needs to verify the graphic code, the graphic code to be verified can be scanned by using verification software (containing the association function) or a verification platform (containing the association function) authorized by the graphic code generator.
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.
The incidence relation function between the first anti-counterfeiting information and the second anti-counterfeiting information is determined, the anti-counterfeiting prediction information is generated based on the incidence relation function and the identification information corresponding to the first anti-counterfeiting information, the difficulty of generating the anti-counterfeiting prediction information can be improved by improving the complexity of the incidence relation function, and the accuracy of graphic code verification is further improved.
To further clarify the determination of the association function, the following description is made with reference to fig. 11. Fig. 11 is a schematic flow chart of a graphic code verification method according to another embodiment of the present disclosure. The embodiment shown in fig. 11 is extended based on the embodiment shown in fig. 10, and the differences between the embodiment shown in fig. 11 and the embodiment shown in fig. 10 will be emphasized below, and the descriptions of the same parts will not be repeated.
As shown in fig. 11, in the embodiment of the present disclosure, the step of determining the association function between the first anti-counterfeiting information and the second anti-counterfeiting information includes the following steps.
Step S1110, a functional relation representing the association relationship between the first anti-counterfeit information and the second anti-counterfeit information is obtained.
In step S1120, the graphic code content data is hashed to obtain a function parameter of the association function.
Step S1130, an association function is determined based on the function relation and the function parameter.
For specific implementation of steps S1110 to S1130, refer to steps S810 to S830, which are not described herein again.
To further clarify the specific manner of the graphic code verification method, the following description is made 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 to obtain the content data of the graphic code 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 content data of the graphic code may be "12345678". The identification information corresponding to the first forgery prevention information may be "0x4c2e1c". The identification information corresponding to the second anti-counterfeiting information may be "0x44231c4e".
Step S1220 is to obtain a function relation representing the association relationship between the first anti-counterfeit information and the second anti-counterfeit information.
For example, the functional relation of the association relationship may be y = ax 5 +bx 4 +cx 3 +dx 2 +ex+f。
Step S1230, hash the graphic code content data to obtain a function parameter of the association function.
Exemplarily, the function parameter of the associative relation function may be a =1,b =3,c =2,d =6,e =9,f =3.
Step S1240, based on the function relation and the function parameter, determining the association relation function.
For example, based on the function relation and the function parameter, the association relation function is determined, which may be substituting the function parameter into the function relation, and the obtained association relation function may be: y = x 5 +3x 4 +2x 3 +6x 2 +9x+3。
Step S1250 is to determine the anti-counterfeit prediction information based on the identification information and the association function corresponding to the first anti-counterfeit information.
For example, the identification information "0x4c2e1c" corresponding to the first anti-counterfeit information is used as the specific value of x in the association function in step S1240, so as to obtain the anti-counterfeit prediction information "0x44231c4e".
And step S1260, verifying the graphic code to be verified based on the anti-counterfeiting prediction information and the identification information corresponding to the second anti-counterfeiting information.
Illustratively, the graphic code to be verified is verified based on the anti-counterfeiting prediction information and the identification information corresponding to the second anti-counterfeiting information, which may be obtained by comparing that the identification information corresponding to the second anti-counterfeiting information may be "0x44231c4e" and the anti-counterfeiting prediction information "0x44231c4e", and it is seen that the identification information corresponding to the second anti-counterfeiting information is the same as the anti-counterfeiting prediction information, and therefore, 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 a genuine product.
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, which may be "0x44230000" and the anti-counterfeiting prediction information "0x44231c4e", it can be known that the identification information corresponding to the second anti-counterfeiting information is different from the anti-counterfeiting prediction information, and therefore, 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 in detail above in conjunction with fig. 4-12, and apparatus embodiments of the present disclosure are described in detail below in conjunction with fig. 13 and 14. Furthermore, it is to be understood that the description of the method embodiments corresponds to the description of the apparatus embodiments, and therefore reference may be made to the preceding method embodiments for parts which are not described in detail.
Fig. 13 is a schematic structural diagram of a graphic code generation apparatus according to an embodiment of the present disclosure. As shown in fig. 13, a graphic code generation apparatus 1300 provided in the 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 at least two pieces of anti-counterfeiting information have an association relationship therebetween. 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 the at least two pieces of anti-counterfeit information.
In some embodiments, the determining module 1310 is further configured to determine first anti-counterfeit 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 anti-counterfeiting information and the second anti-counterfeiting 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 the second anti-counterfeiting information as a dependent variable of the association function by using the association function with the first anti-counterfeiting information as an independent variable of the association function.
In some embodiments, the determining module 1310 is further configured to determine a functional relation representing an association relationship between the first anti-counterfeiting information and the second anti-counterfeiting information; carrying out Hash on the graphic code content data to obtain a function parameter of an association relation function; and determining the incidence relation function based on the function relation and the function parameter.
Fig. 14 is a schematic structural diagram of a graphic code verification apparatus according to an embodiment of the disclosure. As shown in fig. 14, the graphic code verification apparatus 1400 provided by the 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 to-be-verified graphic code, to obtain content data of the graphic code, and identification information corresponding to at least two pieces of anti-counterfeiting information introduced in a generating process of the to-be-verified graphic code, where at least two pieces of anti-counterfeiting information have an association relationship therebetween. The prediction module 1420 is configured to predict the anti-counterfeit information introduced in the generation process of the graphic code to be verified based on the graphic code content data, so as to 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 pieces of anti-counterfeit information, respectively.
In some embodiments, the prediction module 1420 is further configured to determine an association function between the first anti-counterfeiting information and the second anti-counterfeiting information; and generating anti-counterfeiting prediction information based on the incidence relation function and the identification information corresponding to the first anti-counterfeiting information, wherein the anti-counterfeiting prediction information corresponds to the second anti-counterfeiting information.
In some embodiments, the prediction module 1420 is further configured to obtain a functional relation representing an association relationship between the first anti-counterfeit information and the second anti-counterfeit information; carrying out Hash processing on the graphic code content data to obtain a function parameter of an association relation function; and determining an association relation function based on the function relation and the function parameter.
Fig. 15 is a schematic structural diagram of an electronic device according to an embodiment of the disclosure. An electronic device 1500 (which may be a computer device) shown in fig. 15 includes 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 communicatively connected to each other via a bus 1504.
The Memory 1501 may be a Read Only Memory (ROM), a static Memory device, a dynamic Memory device, or a Random Access Memory (RAM). The memory 1501 may store programs, and the processor 1502 and the communication interface 1503 are used to perform the steps of the related methods of the embodiments of the present disclosure when the programs stored in the memory 1501 are executed by the processor 1502.
The processor 1502 may be a general-purpose Central Processing Unit (CPU), a microprocessor, an Application Specific Integrated Circuit (ASIC), a Graphics Processing Unit (GPU) or one or more Integrated circuits, and is configured to execute related programs to implement the functions of the units of the related devices of the embodiments of the present disclosure.
The processor 1502 may also be an integrated circuit chip having signal processing capabilities. In implementation, various steps of the related methods of the present disclosure may be performed by instructions in the form of hardware, integrated logic circuits, or software in the processor 1502. The processor 1502 may also be a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components. The various methods, steps, and logic blocks disclosed in the embodiments of the present 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 the method disclosed in connection with the embodiments of the present disclosure may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is 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 required to be performed by units included in the related apparatus of the disclosed embodiment, or performs related methods of the disclosed method embodiment.
Communication interface 1503 uses a transceiver device such as, but not limited to, a transceiver to enable communication between electronic device 1500 and other devices or communication networks. For example, the graphic code generation data may be acquired through the communication interface 1503.
Bus 1504 may include a path that transfers information between 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 shows only a memory, a processor, and a communication interface, in a specific implementation, those skilled in the art will understand that the electronic device 1500 also includes other components necessary for normal operation. Also, those skilled in the art will appreciate that the electronic device 1500 may also include hardware components that implement other additional functions, according to particular needs. Further, those skilled in the art will appreciate that the electronic device 1500 may also include only those elements necessary to implement the embodiments of the disclosure, and need not include all of the elements 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 implementation. 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 can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described apparatuses and modules may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
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 above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed 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 can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present disclosure may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into 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 solutions of the present disclosure, which are essential or part of the technical solutions contributing to the prior art, may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the methods described in the embodiments of the present disclosure. And the aforementioned storage medium includes: u disk, removable hard disk, read only memory, random access memory, magnetic or optical disk, etc. for storing program codes.
The above description is only for the specific embodiments of the present disclosure, but the scope of the present disclosure is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present disclosure, and all the changes or substitutions should be covered within the scope of the present disclosure. Therefore, the protection scope of the present disclosure should be subject to the protection scope of the claims.

Claims (14)

1. A method for generating a graphic code 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 the at least two anti-counterfeiting information.
2. The method according to claim 1, wherein the at least two anti-counterfeit information includes a first anti-counterfeit information and a second anti-counterfeit information, and the determining at least two anti-counterfeit information corresponding to the graphic code content data includes:
determining 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.
3. The method according to claim 2, wherein the generating of 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 comprises:
determining an incidence relation 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 incidence relation function.
4. The method of claim 3, the generating the second anti-counterfeiting information based on the first anti-counterfeiting information and the association relationship function, comprising:
and generating the second anti-counterfeiting information serving as a dependent variable of the incidence relation function by using the incidence relation function with the first anti-counterfeiting information serving as an independent variable of the incidence relation function.
5. The method of claim 3 or 4, the determining the correlation function between the first anti-counterfeiting information and the second anti-counterfeiting information, comprising:
determining a functional relation representing the incidence relation between the first anti-counterfeiting information and the second anti-counterfeiting information;
hashing the graphic code content data to obtain a function parameter of the incidence relation function;
and determining the incidence relation function based on the function relation and the function parameter.
6. The method of claim 3 or 4, the correlation function comprising a one-way function, wherein the one-way function comprises a one-way trapdoor function.
7. The method according to any one of claims 2 to 4, wherein the first anti-counterfeiting information comprises invisible anti-counterfeiting information which cannot be directly observed, and the invisible anti-counterfeiting information which cannot be directly observed comprises redundant bit information and/or ink edge characteristic information; and/or the presence of a gas in the gas,
the second anti-counterfeiting information comprises dominant anti-counterfeiting information which can be directly observed, and the dominant anti-counterfeiting information which can be directly observed comprises watermark characteristic information.
8. A graphic code verification method comprises the following steps:
identifying a graphic code to be verified 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;
predicting 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 verifying the graphic code to be verified based on the identification information and the anti-counterfeiting prediction information corresponding to the at least two pieces of anti-counterfeiting information respectively.
9. The method of claim 8, wherein the at least two anti-counterfeiting information comprises a first anti-counterfeiting information and a second anti-counterfeiting information, and the second anti-counterfeiting information is obtained based on the first anti-counterfeiting information,
the predicting 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 incidence relation function between the first anti-counterfeiting information and the second anti-counterfeiting information;
and generating the anti-counterfeiting prediction information based on the incidence relation function and the identification information corresponding to the first anti-counterfeiting information, wherein the anti-counterfeiting prediction information corresponds to the second anti-counterfeiting information.
10. The method of claim 9, the determining the correlation function between the first anti-counterfeiting information and the second anti-counterfeiting information, comprising:
acquiring a function relation representing the incidence relation between the first anti-counterfeiting information and the second anti-counterfeiting information;
hashing the graphic code content data to obtain a function parameter of the incidence relation function;
and determining the incidence relation function based on the function relation and the function parameter.
11. The method according to any one of claims 8 to 10, wherein the identification code to be verified is generated based on the graphic code generation method according to any one of claims 1 to 7.
12. A graphic code generation apparatus comprising:
the determining module is configured to determine at least two anti-counterfeiting information corresponding to the graphic code content data, wherein the at least two anti-counterfeiting information have an association relationship;
and the generating module is configured to generate the graphic code corresponding to the graphic code content data based on the graphic code content data and the at least two anti-counterfeiting information.
13. A graphic code authentication device, comprising:
the identification module is configured to identify 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 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;
and 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 pieces of anti-counterfeiting information.
14. 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 11.
CN202210880319.2A 2022-07-25 2022-07-25 Graphic code generation method and device and graphic code verification method and device Pending CN115204338A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210880319.2A CN115204338A (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 CN115204338A (en) 2022-07-25 2022-07-25 Graphic code generation method and device and graphic code verification method and device

Publications (1)

Publication Number Publication Date
CN115204338A true CN115204338A (en) 2022-10-18

Family

ID=83583356

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210880319.2A Pending CN115204338A (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) CN115204338A (en)

Citations (5)

* Cited by examiner, † Cited by third party
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
CN107194449A (en) * 2017-06-19 2017-09-22 南京林业大学 The antiforge and information source tracing method combined based on digital watermarking and Quick Response Code
CN108229596A (en) * 2016-12-09 2018-06-29 北京大码技术有限公司 Combined two-dimension code, digital certificates carrier, generation, reading device and method
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

Patent Citations (5)

* Cited by examiner, † Cited by third party
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
CN107194449A (en) * 2017-06-19 2017-09-22 南京林业大学 The antiforge and information source tracing method combined based on digital watermarking and Quick Response 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

Similar Documents

Publication Publication Date Title
Swaminathan et al. Robust and secure image hashing
Hakak et al. Approaches for preserving content integrity of sensitive online Arabic content: A survey and research challenges
CN105471575B (en) Information encryption and decryption method and device
KR101934444B1 (en) A Managing Method Of The Integrity Data of Documents Or Securities
CN110351089B (en) Data signature authentication method and device
Sajjad et al. Robust image hashing based efficient authentication for smart industrial environment
Weng et al. A secure perceptual hash algorithm for image content authentication
Hsu et al. Enhancing the robustness of image watermarking against cropping attacks with dual watermarks
WO2005062910A2 (en) Method and system for controlling encoded image production using image signatures
KR101925463B1 (en) Method of record and validation of image hash value and apparatus using the same
CN112003888A (en) Block chain-based certificate management method, device, equipment and readable medium
Raj et al. Blockwise fragile watermarking schemes for tamper localization in digital images
CN112434319A (en) Data encryption method and device for electronic file
CN114880687A (en) Document security protection method and device, electronic equipment and storage medium
Al-Zahrani et al. Secure real-time artificial intelligence system against malicious QR code links
CN110990814A (en) Trusted digital identity authentication method, system, equipment and medium
Alkhowaiter et al. Evaluating perceptual hashing algorithms in detecting image manipulation over social media platforms
Devadiga et al. E-banking security using cryptography, steganography and data mining
JP6145792B2 (en) Digital signature type two-dimensional code generation device and digital signature type two-dimensional code authentication device
Nyeem et al. Counterfeiting attacks on block-wise dependent fragile watermarking schemes
US20200057871A1 (en) Apparatuses and methods for signing a legal document
WO2009005259A2 (en) Puzzle typed keycode with image, and security system and method using it
CN115204338A (en) Graphic code generation method and device and graphic code verification method and device
Lou et al. Digital signature-based image authentication
JP7143626B2 (en) Placement device, verification device, control method, data generation method and data structure

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