CN108416405B - Two-dimensional code verification method and system - Google Patents

Two-dimensional code verification method and system Download PDF

Info

Publication number
CN108416405B
CN108416405B CN201810198980.9A CN201810198980A CN108416405B CN 108416405 B CN108416405 B CN 108416405B CN 201810198980 A CN201810198980 A CN 201810198980A CN 108416405 B CN108416405 B CN 108416405B
Authority
CN
China
Prior art keywords
counterfeiting
dimensional code
color
counterfeiting information
server
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810198980.9A
Other languages
Chinese (zh)
Other versions
CN108416405A (en
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.)
Beijing Knownsec Information Technology Co Ltd
Original Assignee
Beijing Knownsec Information 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 Beijing Knownsec Information Technology Co Ltd filed Critical Beijing Knownsec Information Technology Co Ltd
Priority to CN201810198980.9A priority Critical patent/CN108416405B/en
Publication of CN108416405A publication Critical patent/CN108416405A/en
Application granted granted Critical
Publication of CN108416405B publication Critical patent/CN108416405B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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
    • 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
    • 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

The invention provides a two-dimensional code verification method and a two-dimensional code verification system, and relates to the technical field of two-dimensional codes. The method comprises the following steps: the method comprises the steps that a first electronic device obtains a pre-generated color two-dimensional code carrying unique target anti-counterfeiting information; the first electronic equipment extracts the number, the position distribution and the RGB value of the color points in the color two-dimensional code, and determines the current anti-counterfeiting information of the color two-dimensional code according to the number, the position distribution and the RGB value; the server acquires current anti-counterfeiting information from the first electronic equipment and judges whether current authentication is first authentication or not; if so, the server compares the current anti-counterfeiting information with the target anti-counterfeiting information; and if the current anti-counterfeiting information is the same as the target anti-counterfeiting information, determining that the verification is passed. The scheme can realize anti-counterfeiting authentication by identifying and authenticating the color two-dimensional code carrying the target anti-counterfeiting information, and in addition, the color two-dimensional code is used to contribute to improving the safety of the anti-counterfeiting information.

Description

Two-dimensional code verification method and system
Technical Field
The invention relates to the technical field of two-dimensional codes, in particular to a two-dimensional code verification method and a two-dimensional code verification system.
Background
The traditional two-dimensional code is a bar code for recording data symbol information by using black and white figures which are distributed on a plane (in a two-dimensional direction) according to a certain rule by using a certain specific geometric figure. The two-dimensional code is an information carrier, is also an important method and means for information acquisition and transmission, and can play a role in improving efficiency in various fields. With the popularization of intelligent terminals and the rapid popularization of mobile networks, the two-dimensional code becomes a window of the future data era. The two-dimensional code technology is widely used in the fields of mobile electronic commerce, fast character input, food safety management and the like. In the prior art, although the color two-dimensional code appears, the information carried by the two-dimensional code is single and is not encrypted, the two-dimensional code information can be read by a terminal of the two-dimensional code recognizer, and the two-dimensional code is not beneficial to anti-counterfeiting authentication by using the two-dimensional code. Therefore, how to provide a solution to the above problems has become a big problem for those skilled in the art.
Disclosure of Invention
In order to overcome the defects in the prior art, the invention provides a two-dimensional code verification method and a two-dimensional code verification system, which are beneficial to realizing anti-counterfeiting authentication by authenticating a color two-dimensional code carrying anti-counterfeiting information, so that the problems are solved.
In order to achieve the above object, the technical solutions provided by the preferred embodiments of the present invention are as follows:
the preferred embodiment of the invention provides a two-dimensional code verification method, which is applied to a two-dimensional code verification system, wherein the two-dimensional code verification system comprises a server and a first electronic device in communication connection with the server, and the method comprises the following steps:
the first electronic equipment acquires a pre-generated color two-dimensional code carrying unique target anti-counterfeiting information;
the first electronic equipment extracts the number, the position distribution and the RGB value of the color points in the color two-dimensional code, and determines the current anti-counterfeiting information of the color two-dimensional code according to the number, the position distribution and the RGB value;
the server acquires the current anti-counterfeiting information from the first electronic equipment and judges whether the current authentication is the first authentication;
if so, the server compares the current anti-counterfeiting information with the target anti-counterfeiting information;
and when the current anti-counterfeiting information is the same as the target anti-counterfeiting information, determining that the verification is passed.
Optionally, the first electronic device stores in advance a first anti-counterfeiting code associated with the number, and a second anti-counterfeiting code associated with the position distribution and the RGB value; the first electronic device is further configured to:
determining the first anti-counterfeiting codes related to the quantity according to the quantity, and determining the second anti-counterfeiting codes related to the position distribution and the RGB value according to the position distribution and the RGB value;
and combining the first anti-counterfeiting code and the second anti-counterfeiting code according to a preset combination strategy, and taking the combined first anti-counterfeiting code and the combined second anti-counterfeiting code as the current anti-counterfeiting information.
Optionally, if the current authentication is not the first authentication, the method includes:
the server sends an authentication result representing non-first authentication to the first electronic device.
Optionally, before the step of obtaining the pre-generated color two-dimensional code carrying the unique target anti-counterfeiting information by the first electronic device, the method further includes:
the server encrypts and generates M first random numbers and N second random numbers according to preset anti-counterfeiting information, and the preset anti-counterfeiting information is used as the target anti-counterfeiting information;
the server determines the number of coloring points and the position distribution of the coloring points of the pre-generated two-dimensional code according to the M-bit first random numbers, wherein M is a positive integer greater than 1;
the server selects a second random number of a group number corresponding to the number of the colored dots from the N second random numbers according to a preset selection strategy, wherein each group of second random numbers comprises P second random numbers, P is a positive integer larger than 1, and N is a positive integer larger than P;
the server determines the RGB value of each coloring point according to the P bits of the second random number;
the server generates a color two-dimensional code based on the number of the colored dots, the position distribution of the colored dots, and the RGB values of the colored dots.
Optionally, the server stores a color two-dimensional code template in advance, where the color two-dimensional code template includes Q pre-colored dots distributed in a preset shape, where the preset shape includes one of square array distribution and annular array, and Q is a positive integer;
the step of determining the number of colored dots and the position distribution of the colored dots of the pre-generated two-dimensional code according to the M-bit first random number comprises the following steps:
determining the number of the colored dots according to the numerical value of the M-bit first random number, wherein the number of the colored dots is less than or equal to Q;
and selecting the pre-coloring points with the same number as the coloring points from the Q pre-coloring points, and taking the position distribution of the selected pre-coloring points as the position distribution of the coloring points.
Optionally, the server stores in advance an association relationship between a numerical value of a random number and an RGB value, and the step of determining the RGB value of each coloring point according to the P-bit second random number includes:
and determining an RGB value corresponding to the numerical value according to the numerical value of the P-bit second random number based on the incidence relation, and taking the RGB value as the RGB value of the coloring point.
Optionally, the first random number is a random binary number, and/or the second random number is a random binary number.
The invention also provides a two-dimensional code verification system, which comprises a server and first electronic equipment in communication connection with the server;
the first electronic equipment is used for acquiring a pre-generated color two-dimensional code carrying unique target anti-counterfeiting information; extracting the number, the position distribution and the RGB value of color points in the color two-dimensional code, and determining the current anti-counterfeiting information of the color two-dimensional code according to the number, the position distribution and the RGB value;
the server is used for acquiring the current anti-counterfeiting information from the first electronic equipment and judging whether the current authentication is the first authentication; if so, the server compares the current anti-counterfeiting information with the target anti-counterfeiting information; and when the current anti-counterfeiting information is the same as the target anti-counterfeiting information, determining that the verification is passed.
Optionally, the first electronic device stores in advance a first anti-counterfeiting code associated with the number, and a second anti-counterfeiting code associated with the position distribution and the RGB value; the first electronic device is further configured to:
determining the first anti-counterfeiting codes related to the quantity according to the quantity, and determining the second anti-counterfeiting codes related to the position distribution and the RGB value according to the position distribution and the RGB value;
and combining the first anti-counterfeiting code and the second anti-counterfeiting code according to a preset combination strategy, and taking the combined first anti-counterfeiting code and the combined second anti-counterfeiting code as the current anti-counterfeiting information.
Optionally, before the step of obtaining the pre-generated color two-dimensional code carrying the unique target anti-counterfeiting information by the first electronic device, the server is configured to:
generating M-bit first random numbers and N-bit second random numbers according to preset anti-counterfeiting information in an encryption mode, and taking the preset anti-counterfeiting information as the target anti-counterfeiting information;
determining the number of coloring points and the position distribution of the coloring points of the pre-generated two-dimensional code according to the M-bit first random numbers, wherein M is a positive integer greater than 1;
selecting a second random number of a group number corresponding to the number of the colored dots from the N second random numbers according to a preset selection strategy, wherein each group of second random numbers comprises P second random numbers, P is a positive integer larger than 1, and N is a positive integer larger than P;
determining the RGB value of each coloring point according to the P bits of the second random number;
and generating a color two-dimensional code based on the number of the colored dots, the position distribution of the colored dots and the RGB value of the colored dots.
Compared with the prior art, the two-dimensional code verification method and the two-dimensional code verification system provided by the invention at least have the following beneficial effects: the method provided by the invention comprises the following steps: the method comprises the steps that a first electronic device obtains a pre-generated color two-dimensional code carrying unique target anti-counterfeiting information; the first electronic equipment extracts the number, the position distribution and the RGB value of the color points in the color two-dimensional code, and determines the current anti-counterfeiting information of the color two-dimensional code according to the number, the position distribution and the RGB value; the server acquires current anti-counterfeiting information from the first electronic equipment and judges whether current authentication is first authentication or not; if so, the server compares the current anti-counterfeiting information with the target anti-counterfeiting information; and if the current anti-counterfeiting information is the same as the target anti-counterfeiting information, determining that the verification is passed. The scheme can realize anti-counterfeiting authentication by identifying and authenticating the color two-dimensional code carrying the target anti-counterfeiting information, and in addition, the color two-dimensional code is used to contribute to improving the safety of the anti-counterfeiting information.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required to be used in the embodiments will be briefly described below. It is appreciated that the following drawings depict only some embodiments of the invention and are therefore not to be considered limiting of its scope, for those skilled in the art will be able to derive additional related drawings therefrom without the benefit of the inventive faculty.
Fig. 1 is a block diagram of an electronic device according to a preferred embodiment of the invention.
Fig. 2 is a flowchart illustrating a two-dimensional code verification method according to a preferred embodiment of the invention.
Fig. 3 is a schematic diagram of a color two-dimensional code template according to a preferred embodiment of the invention.
Fig. 4 is a schematic diagram of a color two-dimensional code according to a preferred embodiment of the invention.
Fig. 5 is a second flowchart illustrating a two-dimensional code verification method according to a preferred embodiment of the invention.
Icon: 10-a two-dimensional code verification system; 100-a first electronic device; 200-a server; 300-a second electronic device.
Detailed Description
The technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. It is to be understood that the described embodiments are merely a few embodiments of the invention, and not all embodiments. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Furthermore, the terms "first," "second," and the like are used merely to distinguish one description from another, and are not to be construed as indicating or implying relative importance.
Some embodiments of the invention are described in detail below with reference to the accompanying drawings. The embodiments described below and the features of the embodiments can be combined with each other without conflict.
Fig. 1 is a block diagram of an electronic device according to a preferred embodiment of the invention. The two-dimensional code verification system 10 provided by the embodiment of the invention can be used for executing a two-dimensional code verification method, and the color two-dimensional code carrying target anti-counterfeiting information is authenticated, so that the anti-counterfeiting function is facilitated, and the security of the anti-counterfeiting information can be improved by adopting the color two-dimensional code.
In this embodiment, the two-dimensional code verification system 10 may include a server 200 and at least one first electronic device 100, where the at least one first electronic device 100 and the server 200 establish a communication connection through a network to perform data interaction. The first electronic device 100 is configured to read the color two-dimensional code, so as to analyze anti-counterfeiting information carried by the color two-dimensional code, and upload the anti-counterfeiting information to the server 200. The server 200 is used for identifying and authenticating the anti-counterfeiting information.
In this embodiment, the server 200 may also be configured to generate a color two-dimensional code carrying anti-counterfeit information.
Further, the two-dimensional code verification system 10 may further include a second electronic device 300 communicatively connected to the server 200. The second electronic device 300 is used for generating a color two-dimensional code carrying anti-counterfeiting information. That is, the second electronic device 300 may be configured to perform the operation of generating the two-dimensional code instead of the server 200, and then transmit the anti-counterfeiting information associated with the colored two-dimensional code to the server 200 for storage as the target anti-counterfeiting information.
Alternatively, the first electronic device 100 may be, but is not limited to, a smart phone, a Personal Computer (PC), a tablet computer, a Personal Digital Assistant (PDA), a Mobile Internet Device (MID), and the like. The second electronic device 300 may be the same or similar device as the first electronic device 100. The server 200 may be, but is not limited to, a cluster server, a distributed server, a cloud server. The network may be, but is not limited to, a limited network, a wireless network.
It should be noted that the first electronic device 100 and the second electronic device 300 may be the same device or different devices. For example, the first electronic device 100 and the second electronic device 300 may be the same smartphone.
In this embodiment, the server 200 may include a processing unit, a storage unit, and a two-dimensional certificate generation device, which are electrically connected directly or indirectly between the respective elements of the processing unit, the storage unit, and the two-dimensional certificate generation device to implement data transmission or interaction. For example, the components may be electrically connected to each other via one or more communication buses or signal lines.
The processing unit may be a processor. For example, the Processor may be a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a Network Processor (NP), or the like; but may also be 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 device, discrete hardware components. The various methods, steps and logic blocks disclosed in the embodiments of the present invention may be implemented or performed.
The memory unit may be, but is not limited to, a random access memory, a read only memory, a programmable read only memory, an erasable programmable read only memory, an electrically erasable programmable read only memory, and the like. In this embodiment, the storage unit may be configured to store a color two-dimensional code template and a random number. Of course, the storage unit may also be configured to store a program, and the processing unit executes the program after receiving the execution instruction.
Further, the two-dimensional certificate generating device includes at least one software function module which may be stored in the storage unit in the form of software or firmware (firmware) or solidified in an Operating System (OS) of the server 200. The processing unit is used for executing executable modules stored in the storage unit, such as software functional modules and computer programs included in the two-dimensional certificate generating device.
Further, the first electronic device 100 and the second electronic device 300 may have an operating system and a hardware structure similar to the server 200, and executable modules for executing the two-dimensional code verification method are stored in the corresponding operating systems.
Fig. 2 is a schematic flow chart of a two-dimensional code verification method according to a preferred embodiment of the invention. The two-dimensional code verification method provided by the invention can be applied to the two-dimensional code verification system 10, the two-dimensional code verification method is executed by the two-dimensional code verification system 10, and the anti-counterfeiting authentication is realized by identifying and authenticating the color two-dimensional code carrying the target anti-counterfeiting information.
As will be described in detail below for each step of the two-dimensional code verification method shown in fig. 2, the two-dimensional code verification method provided in this embodiment may include the following steps:
step S400, the first electronic device 100 acquires a pre-generated color two-dimensional code carrying unique target anti-counterfeiting information;
in this embodiment, the color two-dimensional code may be generated by the server 200 according to the color two-dimensional code template based on the preset anti-counterfeiting information. The color two-dimensional code template can refer to fig. 3, and the color two-dimensional code can refer to fig. 4. In the anti-counterfeiting authentication process, the color two-dimensional code can be arranged on an object to be authenticated, wherein the object to be authenticated comprises but is not limited to retail commodities, product parts, takeaway and express items and the like.
Step S410, the first electronic device 100 extracts the number, the position distribution, and the RGB values of the color points in the color two-dimensional code, and determines the current anti-counterfeit information of the color two-dimensional code according to the number, the position distribution, and the RGB values;
in this embodiment, the first electronic device 100 may store a first anti-counterfeiting code associated with the number, and a second anti-counterfeiting code associated with the position distribution and the RGB values in advance. Step S410 may be: determining the first anti-counterfeiting codes related to the quantity according to the quantity, and determining the second anti-counterfeiting codes related to the position distribution and the RGB value according to the position distribution and the RGB value; and combining the first anti-counterfeiting code and the second anti-counterfeiting code according to a preset combination strategy, and taking the combined first anti-counterfeiting code and the combined second anti-counterfeiting code as the current anti-counterfeiting information. The preset combination strategy may be to splice the first anti-counterfeiting code and the second anti-counterfeiting code, wherein the first anti-counterfeiting code may be located before the second anti-counterfeiting code or located after the second anti-counterfeiting code.
Step S420, the server 200 obtains the current anti-counterfeit information from the first electronic device 100, and determines whether the current authentication is the first authentication;
step S430, if yes, the server 200 compares the current anti-counterfeiting information with the target anti-counterfeiting information;
step S440, when the current anti-counterfeiting information is the same as the target anti-counterfeiting information, determining that the verification is passed.
Understandably, if the color two-dimensional code is authenticated for the first time and the current anti-counterfeiting information is the same as the target anti-counterfeiting information, the server 200 determines that the authentication is passed. In addition, the server 200 may further send the result of the verification to the first electronic device 100, so that the user knows that the target to be authenticated corresponding to the color two-dimensional code is a genuine product and is not a counterfeit product.
Optionally, if the current authentication is not the first authentication, the method may include: the server 200 sends an authentication result characterizing the non-first authentication to the first electronic device 100. Based on the authentication result, the user can infer that the target to be authenticated is suspected to be a counterfeit.
Fig. 5 is a second flowchart of a two-dimensional code verification method according to a preferred embodiment of the invention. Optionally, before step S400, the method may further include step S450 to step S490, and step S450 to step S490 may be executed by the server 200 or the second electronic device 300, for generating the two-dimensional color code with the anti-counterfeiting information.
Step S450, the server 200 encrypts and generates M-bit first random numbers and N-bit second random numbers according to preset anti-counterfeiting information, and takes the preset anti-counterfeiting information as the target anti-counterfeiting information;
in this embodiment, the predetermined anti-counterfeit information may be a hyperlink with an anti-counterfeit code. The anti-counterfeiting code can be a numeric string or a character string or a combination thereof. The preset anti-counterfeiting information can generate M-bit first random numbers and N-bit second random numbers through an encryption algorithm, and the encryption algorithm can be selected according to actual conditions and is not specifically described herein.
Alternatively, the first random number and the second random number may be the same type of random number or different types of random numbers. For example, the first random number may be a random binary number, and the second random number may be a random binary number or a random decimal number. Of course, the first random number may also be a random decimal number. Here, the types of the first random number and the second random number are not particularly limited. M, N are positive integers, and the numerical values may be the same or different. For example, for binary number "1001", it can be regarded as a 4-bit random binary number.
Step S460, the server 200 determines the number of colored dots of the pre-generated two-dimensional code and the position distribution of the colored dots according to the M-bit first random number, where M is a positive integer greater than 1;
understandably, the pre-generated two-dimensional code is a color two-dimensional code which needs to be generated according to the preset anti-counterfeiting information. In this embodiment, the electronic device may store a color two-dimensional code template in advance, where the color two-dimensional code template includes Q pre-colored dots distributed in a preset shape, where the preset shape includes one of a square array distribution and a circular array, and Q is a positive integer.
Fig. 3 is a schematic diagram of a color two-dimensional code template according to a preferred embodiment of the invention. The pattern shown in the square line in fig. 3 is a schematic diagram of the color two-dimensional code template. The small circles in the square frame are pre-colored dots distributed in an annular array, the large circle in the center of the square frame can be used for a user to set a label, and the label can be used for advertising and propaganda.
Alternatively, step S460 may be: determining the number of the colored dots according to the numerical value of the M-bit first random number, wherein the number of the colored dots is less than or equal to Q; and selecting the pre-coloring points with the same number as the coloring points from the Q pre-coloring points, and taking the position distribution of the selected pre-coloring points as the position distribution of the coloring points.
And randomly selecting the same number of pre-coloring points as the number of the coloring points from the Q pre-coloring points by adopting a random algorithm. The random algorithm may be selected according to actual situations, and is not specifically described here.
Step S470, the server 200 selects a second random number corresponding to the number of the colored dots from the N second random numbers according to a preset selection policy, where each group of second random numbers includes P second random numbers, P is a positive integer greater than 1, and N is a positive integer greater than P;
the preset selection strategy comprises the following steps: and sequentially selecting P adjacent second random numbers from the N second random numbers according to a preset direction. The preset direction may be understood as a left-to-right direction or a right-to-left direction if the N second random numbers are arranged in a horizontal direction.
Step S480, the server 200 determines an RGB value of each coloring point according to the P bits of the second random number;
in this embodiment, the electronic device may store an association relationship between a random number and an RGB value in a one-to-one correspondence manner. Understandably, one color corresponds to one numerical value, so that colors can be obtained by numerical values, while different colors can be obtained by different numerical values.
Alternatively, step S480 may be: and determining an RGB value corresponding to the numerical value according to the numerical value of the P-bit second random number based on the incidence relation, and taking the RGB value as the RGB value of the coloring point.
In step S490, the server 200 generates a color two-dimensional code based on the number of the colored dots, the position distribution of the colored dots, and the RGB values of the colored dots.
In order to make the solution of the present invention more specific, the above solution will be specifically explained below.
For example, the first random number and the second random number may both be random binary numbers. Step S450 may be: and generating 256-bit binary number by a random number generator based on the preset anti-counterfeiting information. The first 64-bit binary number can be selected from the 256-bit binary numbers as the first random number, and the last 192-bit binary number can be selected as the second random number.
Step S460 may be: and determining the number and the position distribution of colored dots of the pre-generated two-dimensional code according to the 64-bit binary number. For example, the number of colored dots of the pre-generated two-dimensional code is determined according to the numerical value of the 64-bit binary number. And then selecting pre-coloring points with the same number as the determined coloring points from a pre-constructed color two-dimensional code template, and taking the position distribution of the selected pre-coloring points as the coloring point distribution of the pre-generated two-dimensional code. And the number of the determined colored points is less than or equal to the number of the pre-colored points in the color two-dimensional code template.
Step S470 may be: the binary number with the same group number as the determined coloring point number is selected from 192-bit binary numbers, and each group of binary numbers can be 3-bit binary numbers. The 192-bit binary number is not sufficient to form the same number of sets of binary numbers as the number of colored dots, and repeated selection can be made through the 192-bit binary number.
The server 200 stores in advance an association relationship in which binary values and RGB values correspond one to one. Step S480 may be: the selected value of the 3-bit binary number corresponds to the RGB value of a colorant (understandably, the RGB value is the color value representing the colorant), and different values represent different color values. According to the selected value of the 3-bit binary number, the RGB value of the coloring point corresponding to the binary number can be determined.
Step S490 may be: coloring the colored points thereof based on the number of the colored points, the position distribution of the colored points and the RGB values of the colored points to generate a colored two-dimensional code.
Based on the design, the color two-dimensional code is generated through double random number control, and the generated two-dimensional code is more unique. In addition, in the process of decrypting and reading the color two-dimensional code, the device for reading the color two-dimensional code needs to acquire the information carried by the color two-dimensional code after successful verification, so that the anti-counterfeiting function of the color two-dimensional code is improved. This scheme is through carrying out the identification authentication to the above-mentioned colored two-dimensional code that carries anti-fake information, helps improving anti-fake effect.
Fig. 4 is a schematic view of a color two-dimensional code according to a preferred embodiment of the invention. Understandably, fig. 4 is a gray scale diagram of a color two-dimensional code, that is, the pattern in the box in fig. 4 is a schematic diagram of a two-dimensional code obtained based on the above method. The small gray dots shown in fig. 4 are coloring dots, and the coloring dots with different gray levels correspond to different colors of the actually generated color two-dimensional code. In addition, the plurality of colored dots in fig. 4 are distributed in a ring-shaped array, and corresponding icons can be set in the central area of the two-dimensional code according to the actual needs of the user.
It should be noted that, based on the above method, a two-dimensional code with a shape different from that shown in fig. 3 may also be generated, for example, a color two-dimensional code composed of colored dots arranged in a square array may be generated.
Referring to fig. 1 again, the two-dimensional code verification system 10 provided by the present invention may include a server 200 and a first electronic device 100 communicatively connected to the server 200.
The first electronic device 100 is configured to obtain a pre-generated color two-dimensional code carrying unique target anti-counterfeiting information; and extracting the number, the position distribution and the RGB value of the color points in the color two-dimensional code, and determining the current anti-counterfeiting information of the color two-dimensional code according to the number, the position distribution and the RGB value. Specifically, the first electronic device 100 may be configured to execute steps S400 and S410 shown in fig. 2, and the detailed operation content of the execution may refer to the detailed description of steps S400 and S410.
The server 200 is configured to obtain the current anti-counterfeiting information from the first electronic device 100, and determine whether current authentication is first authentication; if so, the server 200 compares the current anti-counterfeiting information with the target anti-counterfeiting information; and when the current anti-counterfeiting information is the same as the target anti-counterfeiting information, determining that the verification is passed. Specifically, the server 200 may be configured to execute steps S420 to S440 shown in fig. 2, and the specific operation content thereof may refer to the detailed description of steps S420 to S440.
Optionally, the first electronic device 100 stores a first anti-counterfeiting code associated with the number, and a second anti-counterfeiting code associated with the position distribution and the RGB values in advance. The first electronic device 100 is further configured to: determining the first anti-counterfeiting codes related to the quantity according to the quantity, and determining the second anti-counterfeiting codes related to the position distribution and the RGB value according to the position distribution and the RGB value; and combining the first anti-counterfeiting code and the second anti-counterfeiting code according to a preset combination strategy, and taking the combined first anti-counterfeiting code and the combined second anti-counterfeiting code as the current anti-counterfeiting information.
Optionally, before the step of acquiring the pre-generated color two-dimensional code carrying the unique target anti-counterfeiting information by the first electronic device 100, the server 200 may be configured to execute steps S450 to S490 shown in fig. 5, and specific operation contents executed by the server may refer to detailed descriptions of steps S450 to S490.
In summary, the present invention provides a two-dimensional code verification method and system. The method comprises the following steps: the method comprises the steps that a first electronic device obtains a pre-generated color two-dimensional code carrying unique target anti-counterfeiting information; the first electronic equipment extracts the number, the position distribution and the RGB value of the color points in the color two-dimensional code, and determines the current anti-counterfeiting information of the color two-dimensional code according to the number, the position distribution and the RGB value; the server acquires current anti-counterfeiting information from the first electronic equipment and judges whether current authentication is first authentication or not; if so, the server compares the current anti-counterfeiting information with the target anti-counterfeiting information; and if the current anti-counterfeiting information is the same as the target anti-counterfeiting information, determining that the verification is passed. The scheme can realize anti-counterfeiting authentication by identifying and authenticating the color two-dimensional code carrying the target anti-counterfeiting information, and in addition, the color two-dimensional code is used to contribute to improving the safety of the anti-counterfeiting information.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (9)

1. A two-dimensional code verification method is applied to a two-dimensional code verification system, the two-dimensional code verification system comprises a server and a first electronic device which is in communication connection with the server, the electronic device stores a first anti-counterfeiting code which is related to the number of color points in a pre-generated color two-dimensional code, and a second anti-counterfeiting code which is related to the position distribution and RGB value of the color points in the pre-generated color two-dimensional code, and the method comprises the following steps:
the first electronic equipment acquires a pre-generated color two-dimensional code carrying unique target anti-counterfeiting information;
the first electronic device extracts the number, the position distribution and the RGB value of the color points in the color two-dimensional code, and determines the current anti-counterfeiting information of the color two-dimensional code according to the number, the position distribution and the RGB value, and the method comprises the following steps: determining the first anti-counterfeiting codes related to the quantity according to the quantity, and determining the second anti-counterfeiting codes related to the position distribution and the RGB value according to the position distribution and the RGB value; combining the first anti-counterfeiting code and the second anti-counterfeiting code according to a preset combination strategy, and taking the combined first anti-counterfeiting code and the combined second anti-counterfeiting code as the current anti-counterfeiting information;
the server acquires the current anti-counterfeiting information from the first electronic equipment and judges whether the current authentication is the first authentication;
if so, the server compares the current anti-counterfeiting information with the target anti-counterfeiting information;
and when the current anti-counterfeiting information is the same as the target anti-counterfeiting information, determining that the verification is passed.
2. The method of claim 1, wherein if the current authentication is not the first authentication, the method comprises:
the server sends an authentication result representing non-first authentication to the first electronic device.
3. The method according to claim 1, wherein before the step of acquiring the pre-generated colored two-dimensional code carrying the unique target anti-counterfeiting information by the first electronic device, the method further comprises:
the server encrypts and generates M first random numbers and N second random numbers according to preset anti-counterfeiting information, and the preset anti-counterfeiting information is used as the target anti-counterfeiting information;
the server determines the number of coloring points and the position distribution of the coloring points of the pre-generated two-dimensional code according to the M-bit first random numbers, wherein M is a positive integer greater than 1;
the server selects a second random number of a group number corresponding to the number of the colored dots from the N second random numbers according to a preset selection strategy, wherein each group of second random numbers comprises P second random numbers, P is a positive integer larger than 1, and N is a positive integer larger than P;
the server determines the RGB value of each coloring point according to the P bits of the second random number;
the server generates a color two-dimensional code based on the number of the colored dots, the position distribution of the colored dots, and the RGB values of the colored dots.
4. The method according to claim 3, wherein the server stores a color two-dimensional code template in advance, the color two-dimensional code template comprises Q pre-coloring points distributed in a preset shape, wherein the preset shape comprises one of a square array distribution and a circular array, and Q is a positive integer;
the step of determining the number of colored dots and the position distribution of the colored dots of the pre-generated two-dimensional code according to the M-bit first random number comprises the following steps:
determining the number of the colored dots according to the numerical value of the M-bit first random number, wherein the number of the colored dots is less than or equal to Q;
and selecting the pre-coloring points with the same number as the coloring points from the Q pre-coloring points, and taking the position distribution of the selected pre-coloring points as the position distribution of the coloring points.
5. The method as claimed in claim 3, wherein the server stores a one-to-one association relationship between the value of the random number and the RGB value in advance, and the step of determining the RGB value of each coloring point according to the P bits of the second random number comprises:
and determining an RGB value corresponding to the numerical value according to the numerical value of the P-bit second random number based on the incidence relation, and taking the RGB value as the RGB value of the coloring point.
6. The method according to any of claims 3-5, wherein the first random number is a random binary number and/or the second random number is a random binary number.
7. The two-dimensional code verification system is characterized by comprising a server and first electronic equipment in communication connection with the server, wherein the first electronic equipment stores first anti-counterfeiting codes related to the number of color points in a pre-generated color two-dimensional code and second anti-counterfeiting codes related to the position distribution and RGB value of the color points in the pre-generated color two-dimensional code;
the first electronic equipment is used for acquiring a pre-generated color two-dimensional code carrying unique target anti-counterfeiting information; extracting the number, the position distribution and the RGB value of the color points in the color two-dimensional code, and determining the current anti-counterfeiting information of the color two-dimensional code according to the number, the position distribution and the RGB value, wherein the steps of: determining the first anti-counterfeiting codes related to the quantity according to the quantity, and determining the second anti-counterfeiting codes related to the position distribution and the RGB value according to the position distribution and the RGB value; combining the first anti-counterfeiting code and the second anti-counterfeiting code according to a preset combination strategy, and taking the combined first anti-counterfeiting code and the combined second anti-counterfeiting code as the current anti-counterfeiting information;
the server is used for acquiring the current anti-counterfeiting information from the first electronic equipment and judging whether the current authentication is the first authentication; if so, the server compares the current anti-counterfeiting information with the target anti-counterfeiting information; and when the current anti-counterfeiting information is the same as the target anti-counterfeiting information, determining that the verification is passed.
8. The two-dimensional code verification system according to claim 7, wherein the first electronic device stores in advance a first anti-counterfeiting code associated with the number, a second anti-counterfeiting code associated with the position distribution and the RGB values; the first electronic device is further configured to:
determining the first anti-counterfeiting codes related to the quantity according to the quantity, and determining the second anti-counterfeiting codes related to the position distribution and the RGB value according to the position distribution and the RGB value;
and combining the first anti-counterfeiting code and the second anti-counterfeiting code according to a preset combination strategy, and taking the combined first anti-counterfeiting code and the combined second anti-counterfeiting code as the current anti-counterfeiting information.
9. The two-dimensional code verification system according to claim 7 or 8, wherein before the step of acquiring the pre-generated color two-dimensional code carrying the unique target anti-counterfeiting information by the first electronic device, the server is configured to:
generating M-bit first random numbers and N-bit second random numbers according to preset anti-counterfeiting information in an encryption mode, and taking the preset anti-counterfeiting information as the target anti-counterfeiting information;
determining the number of coloring points and the position distribution of the coloring points of the pre-generated two-dimensional code according to the M-bit first random numbers, wherein M is a positive integer greater than 1;
selecting a second random number of a group number corresponding to the number of the colored dots from the N second random numbers according to a preset selection strategy, wherein each group of second random numbers comprises P second random numbers, P is a positive integer larger than 1, and N is a positive integer larger than P;
determining the RGB value of each coloring point according to the P bits of the second random number;
and generating a color two-dimensional code based on the number of the colored dots, the position distribution of the colored dots and the RGB value of the colored dots.
CN201810198980.9A 2018-03-12 2018-03-12 Two-dimensional code verification method and system Active CN108416405B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810198980.9A CN108416405B (en) 2018-03-12 2018-03-12 Two-dimensional code verification method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810198980.9A CN108416405B (en) 2018-03-12 2018-03-12 Two-dimensional code verification method and system

Publications (2)

Publication Number Publication Date
CN108416405A CN108416405A (en) 2018-08-17
CN108416405B true CN108416405B (en) 2021-07-13

Family

ID=63131006

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810198980.9A Active CN108416405B (en) 2018-03-12 2018-03-12 Two-dimensional code verification method and system

Country Status (1)

Country Link
CN (1) CN108416405B (en)

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060282500A1 (en) * 2005-06-13 2006-12-14 Yutaka Kiuchi Information management method using a managing symbol and information management server
US8430329B2 (en) * 2008-03-14 2013-04-30 Yutaka Kiuchi Two-dimensional code publishing program and two-dimensional code decoding program
CN103310255B (en) * 2013-05-31 2017-12-22 曾芝渝 A kind of coding method of color character and its coding/decoding method
CN103489026B (en) * 2013-09-24 2017-02-15 深圳市中选科技有限公司 Colorful two-dimension code, generating method and generating system thereof and printed article
CN104657698B (en) * 2015-02-10 2017-09-19 浙江科技学院 A kind of color 2 D code decoding method for carrying several black and white Quick Response Codes
CN104616049B (en) * 2015-03-10 2018-07-10 上海中商网络股份有限公司 Colored anti-fake label and the method for realizing product false proof
CN105117758A (en) * 2015-08-31 2015-12-02 武汉大学 Colored two-dimensional code based mobile platform security communication method
CN105976004B (en) * 2016-04-25 2019-05-07 华南农业大学 A kind of color 2 D code multidimensional information coding, coding/decoding method and device
CN107392270B (en) * 2017-07-23 2020-07-28 吉林东电能源发展有限公司 Two-dimensional code generation method
CN109454997B (en) * 2017-07-23 2020-11-24 泗县飞虹体育文化发展有限公司 Two-dimensional code printing generation system with electronic texture

Also Published As

Publication number Publication date
CN108416405A (en) 2018-08-17

Similar Documents

Publication Publication Date Title
CN106209886B (en) Web interface data encryption is endorsed method, apparatus and server
US11165793B2 (en) Method and system for detecting credential stealing attacks
CN108269062B (en) Electronic contract making method, device, equipment and medium based on H5
CN108154208B (en) Article identification method, article identification method and article identification system based on two-dimensional code
US20170078278A1 (en) Method of performing one-time password (otp) authentication using color code and otp authentication server using color code
US11050552B2 (en) System and method for hashing a data string using an image
CN111130793A (en) File encryption method based on block chain bidding system
CN107888553B (en) Verification method, server and system
CN105656669A (en) Remote reparation method of electronic device, device, repaired device and system
CN108416405B (en) Two-dimensional code verification method and system
CN109918877A (en) A kind of data ciphering method, system, client and computer readable storage medium
CN106934756B (en) Method and system for embedding information in single-color or special-color image
CN112399027B (en) Picture encryption and decryption method and device, storage medium and electronic equipment
US20180309579A1 (en) Secure representation via a format preserving hash function
CN115511030A (en) Anti-counterfeiting verification method and device and electronic equipment
CN115242402B (en) Signature method, signature verification method and electronic equipment
CN108460442B (en) Color two-dimensional code generation method and device
CN111050326A (en) Short message verification method, device, equipment and medium based on block chain
CN115860768A (en) Tracing method and device based on block chain and electronic equipment thereof
CN113988242A (en) Multi-region-based anti-counterfeiting code generation and verification method, system, equipment and medium
CN113901502A (en) Data processing method and device, electronic equipment and storage medium
CN109840574B (en) Two-dimensional code information hiding method and device, electronic equipment and storage medium
CN109756646B (en) Block chain-based vector chapter management method and system
CN114626860B (en) Dynamic identity identification method and device for online commodity payment
JP6253283B2 (en) Content data processing device

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
CB02 Change of applicant information

Address after: Room 311501, Unit 1, Building 5, Courtyard 1, Futong East Street, Chaoyang District, Beijing

Applicant after: Beijing Zhichuangyu Information Technology Co., Ltd.

Address before: Room 311501, Unit 1, Building 5, Courtyard 1, Futong East Street, Chaoyang District, Beijing

Applicant before: Beijing Knows Chuangyu Information Technology Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant