CN112733987A - Two-dimensional code, identification method and identification device thereof, and electronic equipment - Google Patents

Two-dimensional code, identification method and identification device thereof, and electronic equipment Download PDF

Info

Publication number
CN112733987A
CN112733987A CN202110062301.7A CN202110062301A CN112733987A CN 112733987 A CN112733987 A CN 112733987A CN 202110062301 A CN202110062301 A CN 202110062301A CN 112733987 A CN112733987 A CN 112733987A
Authority
CN
China
Prior art keywords
dimensional code
layer
counterfeiting
image
information
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
CN202110062301.7A
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.)
Shenzhen Jinjia Hehe Technology Co ltd
Original Assignee
Shenzhen Jinjia Hehe Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Jinjia Hehe Technology Co ltd filed Critical Shenzhen Jinjia Hehe Technology Co ltd
Priority to CN202110062301.7A priority Critical patent/CN112733987A/en
Publication of CN112733987A publication Critical patent/CN112733987A/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
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K17/00Methods or arrangements for effecting co-operative working between equipments covered by two or more of main groups G06K1/00 - G06K15/00, e.g. automatic card files incorporating conveying and reading operations
    • G06K17/0022Methods or arrangements for effecting co-operative working between equipments covered by two or more of main groups G06K1/00 - G06K15/00, e.g. automatic card files incorporating conveying and reading operations arrangements or provisious for transferring data to distant stations, e.g. from a sensing device
    • G06K17/0025Methods or arrangements for effecting co-operative working between equipments covered by two or more of main groups G06K1/00 - G06K15/00, e.g. automatic card files incorporating conveying and reading operations arrangements or provisious for transferring data to distant stations, e.g. from a sensing device the arrangement consisting of a wireless interrogation device in combination with a device for optically marking the record carrier
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/018Certifying business or products
    • G06Q30/0185Product, service or business identity fraud

Abstract

Two-dimensional code, identification method and device thereof and electronic equipment. The application relates to a two-dimensional code, the two-dimensional code includes: the anti-counterfeiting graphic layer is printed on the surface of a printed material, the anti-counterfeiting graphic layer is a gray image with a preset gray scale range proportion, the two-dimensional code layer is printed above the anti-counterfeiting graphic layer, and the two-dimensional code layer and the color of the anti-counterfeiting graphic layer have a balance relation. Through above-mentioned two-dimensional code, can prevent that the personnel of making a fake from making a fake to the two-dimensional code through shoot the duplication etc..

Description

Two-dimensional code, identification method and identification device thereof, and electronic equipment
Technical Field
The present application relates to the field of computer technologies, and in particular, to a two-dimensional code, a method and an apparatus for identifying the two-dimensional code, and an electronic device.
Background
With the development of computer technology, the two-dimensional code technology is widely applied to industries of product one-object one-code identification, payment business, logistics, automatic identification and the like as a new technology for data storage and information transfer.
However, the two-dimensional code is in a form of a two-dimensional image, and is easily copied and faked in the application process, so that a user can identify a fake product as a true product in the subsequent identification process, thereby causing misunderstanding.
Disclosure of Invention
In view of the above, it is desirable to provide a two-dimensional code, a method for identifying the two-dimensional code, an identifying device, an electronic device, and a storage medium, which can prevent the two-dimensional code from being falsified.
A two-dimensional code, comprising: the anti-counterfeiting graphic layer is printed on the surface of a printed material, the anti-counterfeiting graphic layer is a gray image with a preset gray scale range proportion, the two-dimensional code layer is printed above the anti-counterfeiting graphic layer, and the two-dimensional code layer and the color of the anti-counterfeiting graphic layer have a balance relation.
In one embodiment, the anti-counterfeiting layer is a gray scale image generated by an anti-counterfeiting encryption algorithm.
In one embodiment, the gray scale range of the gray scale image is greater than or equal to 8 percent and less than or equal to 20 percent.
In one embodiment, the color of the two-dimensional code layer is blue.
A two-dimensional code identification method comprises the following steps:
acquiring a two-dimensional code;
carrying out image layering processing on the two-dimensional code to obtain a two-dimensional code layer and an anti-counterfeiting layer of the two-dimensional code;
and identifying the anti-counterfeiting layer, and identifying the two-dimensional code layer when the anti-counterfeiting layer is determined to be true.
In one embodiment, the step of performing image layering processing on the two-dimensional code to obtain a two-dimensional code layer and an anti-counterfeiting layer of the two-dimensional code includes:
performing geometric characteristic analysis on an image formed by the two-dimensional code layer and the anti-counterfeiting layer under light to obtain geometric characteristic information of the two-dimensional code layer and the anti-counterfeiting layer;
and obtaining the two-dimensional code layer and the anti-counterfeiting layer of the two-dimensional code based on the geometric characteristic information of the two-dimensional code layer and the anti-counterfeiting layer.
In one embodiment, the step of determining that the security layer is authentic includes:
and verifying the anti-counterfeiting layer based on a preset anti-counterfeiting decryption algorithm, and determining that the anti-counterfeiting layer is true when the anti-counterfeiting layer is decrypted.
In one embodiment, the step of identifying the two-dimensional code layer and ending the identification process of the two-dimensional code includes:
comparing the characteristic information of the two-dimensional code layer with the pre-stored characteristic information;
if the two-dimension code layer is consistent with the two-dimension code layer, judging that the two-dimension code layer is true, identifying the information of the two-dimension code layer after the verification is passed, and finishing the identification process of the two-dimension code;
if not, outputting prompt information and ending the identification process of the two-dimensional code.
An apparatus for recognizing a two-dimensional code, the apparatus comprising:
the two-dimensional code acquisition module is used for acquiring a two-dimensional code;
the two-dimensional code layering processing module is used for carrying out image layering processing on the two-dimensional code to obtain a two-dimensional code layer and an anti-counterfeiting layer of the two-dimensional code;
and the two-dimension code identification module is used for identifying the anti-counterfeiting layer, identifying the two-dimension code layer when the anti-counterfeiting layer is determined to be true, and finishing the identification process of the two-dimension code.
An electronic device comprising a memory storing a computer program and a processor implementing the steps of the method described above when the processor executes the computer program.
A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the above-mentioned method.
The two-dimensional code comprises: the anti-counterfeiting graphic layer is printed on the surface of a printed material, the anti-counterfeiting graphic layer is a gray image with a preset gray scale range proportion, the two-dimensional code layer is printed above the anti-counterfeiting graphic layer, and the two-dimensional code layer and the color of the anti-counterfeiting graphic layer have a balance relation. The anti-counterfeiting layer with a color balance relation and a preset range proportion is printed above the two-dimensional code layer of the two-dimensional code, so that the two-dimensional code which is difficult to copy and counterfeit is produced.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments or the conventional technologies of the present application, the drawings used in the descriptions of the embodiments or the conventional technologies will be briefly introduced below, it is obvious that the drawings in the following descriptions are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a two-dimensional schematic of a two-dimensional code in one embodiment;
FIG. 2 is a diagram of a two-dimensional code according to one embodiment;
FIG. 3 is a schematic flow chart illustrating a two-dimensional code recognition method according to an embodiment;
fig. 4 is a schematic flowchart of a two-dimensional code recognition method in another embodiment;
FIG. 5 is a block diagram showing the structure of a two-dimensional code recognition apparatus according to an embodiment;
FIG. 6 is a diagram illustrating an internal structure of an electronic device in one embodiment.
Detailed Description
To facilitate an understanding of the present application, the present application will now be described more fully with reference to the accompanying drawings. Embodiments of the present application are set forth in the accompanying drawings. This application may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein in the description of the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application.
Spatial relational terms, such as "under," "below," "under," "over," and the like may be used herein to describe one element or feature's relationship to another element or feature as illustrated in the figures. It will be understood that the spatially relative terms are intended to encompass different orientations of the device in use or operation in addition to the orientation depicted in the figures. For example, if the device in the figures is turned over, elements or features described as "below" or "beneath" other elements or features would then be oriented "above" the other elements or features. Thus, the exemplary terms "under" and "under" can encompass both an orientation of above and below. In addition, the device may also include additional orientations (e.g., rotated 90 degrees or other orientations) and the spatial descriptors used herein interpreted accordingly.
In one embodiment, as shown in fig. 1, there is provided a two-dimensional code, including: the anti-counterfeiting image layer 102 is printed on the surface of a printed material, the anti-counterfeiting image layer 102 is a gray image with a preset gray scale range proportion, the two-dimensional code layer 104 is printed above the anti-counterfeiting image layer, and the two-dimensional code layer and the color of the anti-counterfeiting image layer have a balance relation.
The two-dimensional code comprises an anti-counterfeiting layer 102 and a two-dimensional code layer 104, the anti-counterfeiting layer 102 can be printed on the surface of a printing stock, the two-dimensional code layer 104 is printed above the anti-counterfeiting layer, the anti-counterfeiting layer 102 can select a gray image with a preset gray scale range proportion, and a color balance relationship exists between the two-dimensional code layer 104 and the anti-counterfeiting layer 102. For example, the gray scale range of the gray scale image may be selected to be greater than or equal to 8 percent and less than or equal to 20 percent, and the color of the two-dimensional code layer 104 is selected to be blue, so that the color balance between the two-dimensional code layer 104 and the anti-counterfeiting layer 102 is achieved.
In one embodiment, as shown in fig. 2, the three-dimensional structure diagram of the two-dimensional code in fig. 1 is obtained when the two-dimensional code is printed, the anti-counterfeiting layer and the two-dimensional code layer in fig. 2 are both printed on a printing material, wherein the anti-counterfeiting layer is printed on the surface of the printing material, the two-dimensional code layer is printed above the anti-counterfeiting layer, and the anti-counterfeiting layer and the two-dimensional code layer are obtained through a recognizer in an illuminated environment.
In one embodiment, the anti-counterfeiting layer is a gray image generated by an encryption algorithm, where the encryption algorithm may be an image processing algorithm, for example, if the anti-counterfeiting layer needs to carry related information of a product, the anti-counterfeiting layer may be generated by embedding the related information of the product on the gray image by using a digital watermarking algorithm, where the digital watermarking algorithm is a technique of embedding identification information into a carrier without affecting the use of the carrier. In the embodiment of the application, the grayscale image can be used as a carrier, and the related information of the product can be used as identification information. Specifically, the digital watermarking algorithm may be a digital watermarking scheme based on least significant bits, that is, the related information of the product is embedded into the least significant bits of the numbers in the gray-scale image, the related information of the product is converted into a binary bit stream, a key is generated according to the length of the binary bit stream, the key can be used as a mapping of the pixel position of the gray-scale image, each bit in the binary bit stream is sequentially replaced by a corresponding pixel in the original gray-scale image according to the key, the last bit of each pixel point in the binary form is extracted based on the replaced corresponding pixel in the original gray-scale image, each extracted bit is recombined into the related information of the product, and a final anti-counterfeiting image layer is generated. Based on the grayscale image embedded with the product identification information, the grayscale range of the grayscale image may be adjusted, for example, the range of the grayscale image is adjusted to be equal to or greater than 8 percent and equal to or less than 20 percent.
The two-dimensional code layer is a pattern for recording data symbol information, which is distributed on a plane (two-dimensional direction) according to a certain rule by using a certain specific geometric figure, and for example, the two-dimensional code layer can represent literal numerical information by using a plurality of geometric figures corresponding to a binary system by using the concepts of "0" and "1" bit streams forming the internal logic basis of a computer in terms of code encoding. The two-dimensional code layer can carry payment information, product information and the like. When the two-dimensional code is manufactured, the anti-counterfeiting layer is printed below the two-dimensional code layer, the copying difficulty of the two-dimensional code can be improved, when a two-dimensional code fake worker uses a scanner or a camera to photograph and copy the two-dimensional code, the two-dimensional code graph can be directly copied generally, the anti-counterfeiting layer serves as a gray level image generated through an encryption algorithm, and the fake worker can easily lose details in the copying process, so that the copying difficulty is increased.
In one embodiment, as shown in fig. 3, a two-dimensional code identification method is provided, which is described by taking an example that the method is applied to a terminal, and includes the following steps:
and step 302, acquiring a two-dimensional code.
The traditional two-dimensional code is a graph which is distributed on a plane (two-dimensional direction) according to a certain rule by using a certain specific geometric figure and records data symbol information, and the two-dimensional code uses the concepts of '0' and '1' bit streams which form the internal logic basis of a computer in code compilation and uses a plurality of geometric shapes corresponding to binary systems to represent literal numerical information. The two-dimensional code can carry payment information, product information and the like. For example, the user may enter the payment interface of the corresponding merchant by scanning the two-dimensional code, or enter a questionnaire survey page of a school by scanning the two-dimensional code, and complete a questionnaire survey process by filling in related information. In the embodiment of the application, the two-dimensional code comprises a two-dimensional code layer and an anti-counterfeiting layer, and the two-dimensional code is manufactured by printing the two-dimensional code layer on the anti-counterfeiting layer, wherein the two-dimensional code layer can carry related information such as payment information, product information and the like, the anti-counterfeiting layer is a gray image generated by an encryption algorithm, the two-dimensional code layer and the anti-counterfeiting layer are overlapped to generate a final two-dimensional code, and a color balance relationship exists between the two-dimensional code layer and the anti-counterfeiting layer. For example, the gray scale range of the gray scale image may be selected to be greater than or equal to 8 percent and less than or equal to 20 percent, and the color of the two-dimensional code layer is selected to be blue, so that the color balance between the two-dimensional code layer and the anti-counterfeiting layer is achieved.
Wherein, the two-dimensional code can be acquired by an image input device or a photoelectric scanning device, etc. to realize the relevant processing of information. Specifically, the device for acquiring the two-dimensional code may be any electronic device capable of performing photographing and scanning, such as a mobile phone and a tablet.
And 304, performing image layering processing on the two-dimensional code to obtain a two-dimensional code layer and an anti-counterfeiting layer of the two-dimensional code.
The two-dimensional code is divided into a two-dimensional code layer and an anti-counterfeiting layer, wherein the two-dimensional code layer is a pattern which is distributed on a plane (two-dimensional direction) according to a certain rule and used for recording data symbol information, for example, the concept of '0' and '1' bit stream which forms the internal logic basis of a computer can be utilized in code coding of the two-dimensional code layer, and a plurality of geometric shapes corresponding to binary systems are used for representing character numerical value information. The two-dimensional code layer can carry payment information, product information and the like.
The anti-counterfeiting layer is a gray image generated based on an encryption algorithm, and for example, related information of a product can be embedded into the gray image through the encryption algorithm to generate the anti-counterfeiting layer. When the two-dimensional code is printed, the two-dimensional code layer is printed above the anti-counterfeiting layer, after the two-dimensional code is obtained, image layering processing needs to be carried out on the two-dimensional code firstly, the two-dimensional code layer and the anti-counterfeiting layer are obtained, and then a subsequent analysis process is unfolded.
In one embodiment, the anti-counterfeiting layer is a gray image generated by an encryption algorithm, where the encryption algorithm may be an image processing algorithm, for example, if the anti-counterfeiting layer needs to carry related information of a product, the anti-counterfeiting layer may be generated by embedding the related information of the product on the gray image by using a digital watermarking algorithm, where the digital watermarking algorithm is a technique of embedding identification information into a carrier without affecting the use of the carrier. In the embodiment of the application, the grayscale image can be used as a carrier, and the related information of the product can be used as identification information. Specifically, the digital watermarking algorithm may be a digital watermarking scheme based on least significant bits, that is, the related information of the product is embedded into the least significant bits of the numbers in the gray-scale image, the related information of the product is converted into a binary bit stream, a key is generated according to the length of the binary bit stream, the key can be used as a mapping of the pixel position of the gray-scale image, each bit in the binary bit stream is sequentially replaced by a corresponding pixel in the original gray-scale image according to the key, the last bit of each pixel point in the binary form is extracted based on the replaced corresponding pixel in the original gray-scale image, each extracted bit is recombined into the related information of the product, and a final anti-counterfeiting image layer is generated.
And 306, identifying the anti-counterfeiting layer, and identifying the two-dimensional code layer when the anti-counterfeiting layer is determined to be true.
After the two-dimensional code layer and the anti-counterfeiting layer of the two-dimensional code are obtained by performing image layering processing on the two-dimensional code, the anti-counterfeiting layer can be recognized firstly and then the two-dimensional code layer can be recognized through a recognition algorithm preset in the electronic equipment. Specifically, on the basis that the anti-counterfeiting layer is true, the two-dimensional code layer is identified. If the anti-counterfeiting layer is false, the two-dimensional code can be directly judged to be false, and the next two-dimensional code layer identification process is not needed.
In one embodiment, after a mobile phone is used as an electronic device to obtain a two-dimensional code, image layering processing is performed on the two-dimensional code to obtain a two-dimensional code layer and an anti-counterfeiting layer of the two-dimensional code, based on a preset identification algorithm, the anti-counterfeiting layer is firstly identified, when the anti-counterfeiting layer is determined to be true, the two-dimensional code layer is identified, if the anti-counterfeiting layer is false, the two-dimensional code can be directly judged to be false, and the next two-dimensional code layer identification process is not needed.
In the two-dimensional code identification method, the two-dimensional code is obtained, and image layering processing is carried out on the two-dimensional code to obtain a two-dimensional code layer and an anti-counterfeiting layer of the two-dimensional code; and identifying the anti-counterfeiting layer, and identifying the two-dimensional code layer when the anti-counterfeiting layer is determined to be true. Therefore, by adding the anti-counterfeiting layer, the safety degree of the two-dimensional code can be increased when the two-dimensional code is identified.
In one embodiment, the step of performing image layering processing on the two-dimensional code to obtain a two-dimensional code layer and an anti-counterfeiting layer of the two-dimensional code includes:
performing geometric characteristic analysis on an image formed by the two-dimensional code layer and the anti-counterfeiting layer under light to obtain geometric characteristic information of the two-dimensional code layer and the anti-counterfeiting layer;
and obtaining the two-dimensional code layer and the anti-counterfeiting layer of the two-dimensional code based on the geometric characteristic information of the two-dimensional code layer and the anti-counterfeiting layer.
After the two-dimensional code is obtained, the two-dimensional code layer and the anti-counterfeiting layer of the two-dimensional code are obtained by layering the two-dimensional code. Specifically, the electronic device acquires the two-dimensional code in the illumination environment, and when performing image layering processing on the two-dimensional code layer and the anti-counterfeiting layer of the two-dimensional code, geometric characteristic information analysis can be performed according to the imaging of the two-dimensional code layer and the anti-counterfeiting layer of the two-dimensional code based on the principle that the imaging of the two-dimensional code layer and the anti-counterfeiting layer in the illumination environment is different, specifically, after the imaging of the two-dimensional code layer and the anti-counterfeiting layer is acquired by the electronic device, the imaging of the two-dimensional code layer and the anti-counterfeiting layer is respectively converted into analog image (continuous image) signals, and then the analog images are converted into digital images by an analog converter, whether the identification device is accurately focused during photographing is determined based on digital image development analysis, such as contrast analysis, sharpness analysis and the like, geometric characteristic analysis is performed under the condition that the focusing is good, specifically, the geometric characteristics of the digital images of the two-dimensional code, such as the measurement of the dimensions and orientation of a digital image, which is a basic unit of pixels, the geometrical features of which are described by rectangular coordinates in units of pixels. For example, the center position of the image, the line direction of the line, the distance between the point and the point, and the like can be acquired respectively to distinguish different images. And (4) obtaining the two-dimensional code layer and the anti-counterfeiting layer of the two-dimensional code based on the calibration of the geometric characteristics. The two-dimensional code layer and the anti-counterfeiting layer of the two-dimensional code can be obtained through image layering, and the step of separately identifying the two-dimensional code layer and the anti-counterfeiting layer by subsequent electronic equipment is conveniently unfolded.
In one embodiment, the step of determining that the security layer is authentic includes: and verifying the anti-counterfeiting layer based on a preset anti-counterfeiting decryption algorithm, and determining that the anti-counterfeiting layer is true when the anti-counterfeiting layer is decrypted.
The anti-counterfeiting layer can be decrypted through a preset anti-counterfeiting decryption algorithm, so that the anti-counterfeiting layer is verified, and when the anti-counterfeiting layer is decrypted, the anti-counterfeiting layer is determined to be true. Specifically, for different anti-counterfeiting encryption algorithms, corresponding anti-counterfeiting decryption algorithms are different. For example, when the anti-counterfeiting encryption algorithm for generating the anti-counterfeiting layer is a digital encryption scheme based on the least significant bit, and the product information is embedded into the gray-scale image to generate the anti-counterfeiting layer, the corresponding anti-counterfeiting decryption algorithm can generate a decryption key based on the width and height of the replaced original gray-scale image, so that the original product information can be restored. When the anti-counterfeiting layer is decrypted through a decryption algorithm, the anti-counterfeiting layer is represented as true, and the two-dimensional code layer can be identified. Therefore, the anti-counterfeiting layer is identified before the two-dimensional code layer is identified, so that the safety of the information related to the two-dimensional code can be further guaranteed after the user acquires the two-dimensional code.
In one embodiment, the step of identifying the two-dimensional code layer and ending the identification process of the two-dimensional code includes:
comparing the characteristic information of the two-dimensional code layer with the pre-stored characteristic information, if the characteristic information of the two-dimensional code layer is consistent with the pre-stored characteristic information, judging that the two-dimensional code layer is true, identifying the information of the two-dimensional code layer after the verification is passed, and finishing the identification process of the two-dimensional code;
if not, outputting prompt information and ending the identification process of the two-dimensional code.
In the case that the anti-counterfeiting layer is determined to be authentic, the identification process of the two-dimensional code layer is started, for example, the feature information of the two-dimensional code layer may be compared with feature information pre-stored in the electronic device, for example, the feature information may be an appearance feature of the two-dimensional code layer, for example, the appearance feature of the two-dimensional code layer may be a size, a shape, and the like of the two-dimensional code layer, and may also be a position where a geometric point in the two-dimensional code layer is located.
In one embodiment, the position of the geometric point in the two-dimensional code layer of the two-dimensional code can be matched with a two-dimensional code layer which is stored in the electronic device in advance and verified to be true, if the geometric points of the two-dimensional code layer are consistent with the positions of the geometric points of the two-dimensional code layer stored in the electronic device in advance, the two-dimensional code layer can be judged to be true, and after verification is passed, a user can recognize information of the two-dimensional code layer, for example, the information carried in the two-dimensional code layer may be payment information, or the information may enter a corresponding website, so that link information of user information is perfected. And if the position of the geometric point in the two-dimensional code layer cannot be completely matched with the position of the geometric point of the two-dimensional code layer stored in the electronic equipment in advance, judging that the two-dimensional code is false, and ending the identification process of the two-dimensional code. After the two-dimensional code is judged to be false, prompt information can be output to remind a user, for example, the prompt information can be used for outputting an alarm signal for the electronic equipment, and the user can take corresponding measures based on the alarm signal output by the electronic equipment.
In one embodiment, as shown in fig. 4, a flowchart of two-dimensional code recognition in a specific embodiment is shown.
First, the two-dimensional code may be acquired by using an electronic device, which may be a terminal, such as a mobile phone, a tablet, and the like. The obtained two-dimensional code can be a two-dimensional code applied to the payment field, and can also be a two-dimensional code carrying product information and the like.
For example, a mobile phone is used as a terminal to acquire a two-dimensional code applied to the payment field. After the two-dimensional code is obtained, image layering processing can be performed on the obtained two-dimensional code to obtain a two-dimensional code layer and an anti-counterfeiting layer of the two-dimensional code. The method for performing image layering processing on the two-dimensional code may be that the electronic device obtains the two-dimensional code in a light source environment, and performs analysis on geometric characteristic information of the image based on a preset algorithm based on the image of the two-dimensional code layer and the anti-counterfeiting layer under light, where the geometric characteristic information may be, for example, the size, the shape, and the like of the two-dimensional code layer.
After the two-dimensional code layer and the anti-counterfeiting layer of the two-dimensional code are obtained, the anti-counterfeiting layer can be firstly identified and then the two-dimensional code layer can be identified based on a preset algorithm at a mobile phone terminal, wherein when the anti-counterfeiting layer is identified, the anti-counterfeiting layer can be decrypted through the preset anti-counterfeiting decryption algorithm, and corresponding decryption algorithms are different according to different image encryption algorithms. For example, when the product information is embedded into the grayscale image by using a digital encryption scheme based on least significant bits, the corresponding decryption algorithm may generate decryption keys for the width and height of the watermark picture corresponding to the product information, and restore the original product information. When the anti-counterfeiting layer is decrypted through a decryption algorithm, the anti-counterfeiting layer is represented as true, and the two-dimensional code layer can be identified. And if the anti-counterfeiting layer cannot be decrypted, directly finishing the identification process of the two-dimensional code.
When the anti-counterfeiting image layer is determined to be true, entering an identification process of the two-dimensional code layer, wherein the positions of the geometric points in the two-dimensional code layer of the two-dimensional code can be matched with the two-dimensional code layer which is pre-stored in the electronic equipment and verified to be true, if the geometric points of the two-dimensional code layer are consistent with the positions of the geometric points of the two-dimensional code layer which is pre-stored in the electronic equipment, the two-dimensional code layer can be judged to be true, and after verification is passed, a user can identify information of the two-dimensional code layer, for example, the information carried in the two-dimensional code layer can be payment information or can enter a corresponding website to perfect link information of user information. And if the position of the geometric point in the two-dimensional code layer cannot be completely matched with the position of the geometric point of the two-dimensional code layer stored in the electronic equipment in advance, judging that the two-dimensional code is false, and ending the identification process of the two-dimensional code. After the two-dimensional code is judged to be false, prompt information can be output to remind a user, for example, the prompt information can be used for outputting an alarm signal for the electronic equipment, and the user can take corresponding measures based on the alarm signal output by the electronic equipment.
It should be understood that although the various steps in the flow charts of fig. 3-4 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 3-4 may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed in turn or alternately with other steps or at least some of the other steps.
In one embodiment, as shown in fig. 5, there is provided a two-dimensional code recognition apparatus including: two-dimensional code obtains module, two-dimensional code layering processing module and two-dimensional code layering processing module, wherein:
and a two-dimension code identification module 502, configured to obtain a two-dimension code.
And the two-dimension code layering processing module 504 is configured to perform image layering processing on the two-dimension code to obtain a two-dimension code layer and an anti-counterfeiting layer of the two-dimension code.
And the two-dimension code identification module 506 is configured to identify the two-dimension code layer and end the identification process of the two-dimension code when the anti-counterfeiting layer is determined to be authentic.
In one embodiment, the two-dimensional code layering processing module is configured to perform geometric feature analysis on an image formed by the two-dimensional code layer and the anti-counterfeiting layer under light to obtain geometric feature information of the two-dimensional code layer and the anti-counterfeiting layer; and obtaining the two-dimensional code layer and the anti-counterfeiting layer of the two-dimensional code based on the geometric characteristic information of the two-dimensional code layer and the anti-counterfeiting layer.
In one embodiment, the two-dimensional code identification module is configured to verify the anti-counterfeiting layer based on a preset anti-counterfeiting decryption algorithm, and determine that the anti-counterfeiting layer is authentic when the anti-counterfeiting layer is decrypted.
In one embodiment, the two-dimensional code recognition module is configured to compare feature information of the two-dimensional code layer with pre-stored feature information; if the two-dimension code layer is consistent with the two-dimension code layer, judging that the two-dimension code layer is true, identifying the information of the two-dimension code layer after the verification is passed, and finishing the identification process of the two-dimension code; if not, outputting prompt information and ending the identification process of the two-dimensional code.
For specific limitations of the two-dimensional code recognition device, reference may be made to the above limitations of the two-dimensional code recognition method, which are not described herein again. All or part of the modules in the two-dimensional code recognition device can be realized by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent of a processor in the electronic device, or can be stored in a memory in the electronic device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, an electronic device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 6. The electronic device comprises a processor, a memory, a communication interface, a display screen and an input device which are connected through a system bus. Wherein the processor of the electronic device is configured to provide computing and control capabilities. The memory of the electronic equipment comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The communication interface of the electronic device is used for carrying out wired or wireless communication with an external terminal, and the wireless communication can be realized through WIFI, an operator network, NFC (near field communication) or other technologies. The computer program is executed by a processor to implement a two-dimensional code recognition method. The display screen of the electronic equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the electronic equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the configuration shown in fig. 6 is a block diagram of only a portion of the configuration associated with the present application, and does not constitute a limitation on the electronic device to which the present application is applied, and a particular electronic device may include more or less components than those shown in the drawings, or may combine certain components, or have a different arrangement of components.
In one embodiment, an electronic device is provided, which includes a memory and a processor, wherein the memory stores a computer program, and the processor implements a two-dimensional code recognition method when executing the computer program.
In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements a two-dimensional code recognition method.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A two-dimensional code, comprising: the anti-counterfeiting graphic layer is printed on the surface of a printed material, the anti-counterfeiting graphic layer is a gray image with a preset gray scale range proportion, the two-dimensional code layer is printed above the anti-counterfeiting graphic layer, and the two-dimensional code layer and the color of the anti-counterfeiting graphic layer have a balance relation.
2. The two-dimensional code according to claim 1, wherein the anti-counterfeiting layer is a gray scale image generated by an anti-counterfeiting encryption algorithm.
3. The two-dimensional code according to claim 1, wherein the grayscale range of the grayscale image is 8 percent or more and 20 percent or less.
4. The two-dimensional code according to claim 1, wherein the color of the two-dimensional code layer is blue.
5. A two-dimensional code recognition method is characterized by comprising the following steps:
acquiring a two-dimensional code;
carrying out image layering processing on the two-dimensional code to obtain a two-dimensional code layer and an anti-counterfeiting layer of the two-dimensional code;
and identifying the anti-counterfeiting layer, and identifying the two-dimensional code layer when the anti-counterfeiting layer is determined to be true.
6. The method according to claim 5, wherein the step of performing image layering processing on the two-dimensional code to obtain a two-dimensional code layer and an anti-counterfeiting layer of the two-dimensional code comprises:
performing geometric characteristic analysis on an image formed by the two-dimensional code layer and the anti-counterfeiting layer under light to obtain geometric characteristic information of the two-dimensional code layer and the anti-counterfeiting layer;
and obtaining the two-dimensional code layer and the anti-counterfeiting layer of the two-dimensional code based on the geometric characteristic information of the two-dimensional code layer and the anti-counterfeiting layer.
7. The method of claim 5, wherein the step of determining that the security layer is authentic comprises:
and verifying the anti-counterfeiting layer based on a preset anti-counterfeiting decryption algorithm, and determining that the anti-counterfeiting layer is true when the anti-counterfeiting layer is decrypted.
8. The method of claim 5, wherein the step of identifying the two-dimensional code layer and ending the two-dimensional code identification process comprises:
comparing the characteristic information of the two-dimensional code layer with the pre-stored characteristic information;
if the two-dimension code layer is consistent with the two-dimension code layer, judging that the two-dimension code layer is true, identifying the information of the two-dimension code layer after the verification is passed, and finishing the identification process of the two-dimension code;
if not, outputting prompt information and ending the identification process of the two-dimensional code.
9. An apparatus for recognizing a two-dimensional code, the apparatus comprising:
the two-dimensional code acquisition module is used for acquiring a two-dimensional code;
the two-dimensional code layering processing module is used for carrying out image layering processing on the two-dimensional code to obtain a two-dimensional code layer and an anti-counterfeiting layer of the two-dimensional code;
and the two-dimension code identification module is used for identifying the anti-counterfeiting layer, identifying the two-dimension code layer when the anti-counterfeiting layer is determined to be true, and finishing the identification process of the two-dimension code.
10. An electronic device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor realizes the steps of the method of any of claims 5 to 8 when executing the computer program.
CN202110062301.7A 2021-01-18 2021-01-18 Two-dimensional code, identification method and identification device thereof, and electronic equipment Pending CN112733987A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110062301.7A CN112733987A (en) 2021-01-18 2021-01-18 Two-dimensional code, identification method and identification device thereof, and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110062301.7A CN112733987A (en) 2021-01-18 2021-01-18 Two-dimensional code, identification method and identification device thereof, and electronic equipment

Publications (1)

Publication Number Publication Date
CN112733987A true CN112733987A (en) 2021-04-30

Family

ID=75591970

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110062301.7A Pending CN112733987A (en) 2021-01-18 2021-01-18 Two-dimensional code, identification method and identification device thereof, and electronic equipment

Country Status (1)

Country Link
CN (1) CN112733987A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015062424A1 (en) * 2013-10-28 2015-05-07 汝思信息技术(上海)有限公司 Method and system for using feature images to achieve printing stock anti-fake
CN106611205A (en) * 2015-10-23 2017-05-03 西安新桂系信息技术有限公司 Multi-layer overprinted two-dimensional code anti-counterfeit label with gradually changed colors
CN108647659A (en) * 2018-05-16 2018-10-12 臧戈平 A method of hidden image in decryption printed matter is analyzed based on digital video image
CN112163871A (en) * 2020-10-12 2021-01-01 深圳劲嘉盒知科技有限公司 Product verification method and device, computer equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015062424A1 (en) * 2013-10-28 2015-05-07 汝思信息技术(上海)有限公司 Method and system for using feature images to achieve printing stock anti-fake
CN106611205A (en) * 2015-10-23 2017-05-03 西安新桂系信息技术有限公司 Multi-layer overprinted two-dimensional code anti-counterfeit label with gradually changed colors
CN108647659A (en) * 2018-05-16 2018-10-12 臧戈平 A method of hidden image in decryption printed matter is analyzed based on digital video image
CN112163871A (en) * 2020-10-12 2021-01-01 深圳劲嘉盒知科技有限公司 Product verification method and device, computer equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
APPLE公司: "示例:在Motion中颜色平衡两个层", <<网页>>, 31 December 2019 (2019-12-31), pages 1 - 2 *
王俊杰: "《数字水印与信息安全技术研究》", pages: 133 - 135 *

Similar Documents

Publication Publication Date Title
US11238556B2 (en) Embedding signals in a raster image processor
US11188997B2 (en) Detecting conflicts between multiple different signals within imagery
USRE44982E1 (en) Mixed code, and method and apparatus for generating the same
US11023708B2 (en) Within document face verification
CN108345880A (en) Invoice recognition methods, device, computer equipment and storage medium
KR102235215B1 (en) Augmenting barcodes with secondary encoding for anti-counterfeiting
CN110766594B (en) Information hiding method and device, detection method and device and anti-counterfeiting tracing method
JPH06343128A (en) Processing method and system for digitized image mark
KR20130032309A (en) Hidden image signaling
US10657636B1 (en) Methods and systems to ensure correct printing plate usage for encoded signals
US10460161B1 (en) Methods and systems for ensuring correct printing plate usage and signal tolerances
WO2003103217A1 (en) Biometric authentication system
CN111931783A (en) Training sample generation method, machine-readable code identification method and device
KR20180103835A (en) A method for authenticating and / or verifying the integrity of a subject
JP2021529336A (en) 2D barcode generation method, authentication method, server, and 2D barcode
CN112733987A (en) Two-dimensional code, identification method and identification device thereof, and electronic equipment
CN109906458B (en) Method and system for generating surface feature codes
CN109657487A (en) Image processing method, image authentication method and its device
CN114330621A (en) Two-dimensional code anti-counterfeiting method and device based on identification information and storage medium
CN113177517A (en) Method for unlocking anti-counterfeiting hidden image in printed matter based on intelligent mobile equipment
JP4958868B2 (en) Document feature extraction apparatus and method
CN113516131A (en) Image processing method, device, equipment and storage medium
US11816756B1 (en) Anti-leak digital document marking system and method using distributed ledger
US20220366158A1 (en) Information code, information code generation device, information code readout device, program, and information code utilization system
US11207909B2 (en) Method for detecting the physical characteristics of a physical credential in 3D space for ID authenticity

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20210430

RJ01 Rejection of invention patent application after publication