CN111222610A - Coding and decoding method and system for double-ID two-dimensional code micro-code element - Google Patents

Coding and decoding method and system for double-ID two-dimensional code micro-code element Download PDF

Info

Publication number
CN111222610A
CN111222610A CN202010053254.5A CN202010053254A CN111222610A CN 111222610 A CN111222610 A CN 111222610A CN 202010053254 A CN202010053254 A CN 202010053254A CN 111222610 A CN111222610 A CN 111222610A
Authority
CN
China
Prior art keywords
micro
microcode
code
dimensional code
coding
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.)
Granted
Application number
CN202010053254.5A
Other languages
Chinese (zh)
Other versions
CN111222610B (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.)
Individual
Original Assignee
Individual
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 Individual filed Critical Individual
Publication of CN111222610A publication Critical patent/CN111222610A/en
Application granted granted Critical
Publication of CN111222610B publication Critical patent/CN111222610B/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
    • 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
    • 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

Abstract

The invention provides a method and a system for coding and decoding a double-ID two-dimensional code micro-code element, which comprises the steps of obtaining original data to be coded, preprocessing the original data to be coded to generate first micro-code metadata, wherein the preprocessing comprises the steps of carrying out binary conversion, redundant coding and scrambling processing on the original data to be coded; carrying out image coding of a first micro code element on binary data obtained by preprocessing on a code element space of the two-dimensional code, and implanting a first micro code element into a micro code element data area, wherein the micro code element data area is an area except a positioning frame in the two-dimensional code; and generating second microcode metadata by the number of the first microcode elements in the microcode metadata area, the preprocessing scheme and the check and error correction coding, performing image coding on the second microcode elements, and implanting the second microcode elements into the positioning frame. The method realizes the encoding of the micro code elements on the basis of the code elements, can correctly analyze the micro code element codes on an output carrier, and ensures that the existence of the micro code elements does not influence the correct analysis and reading of the original two-dimensional code elements.

Description

Coding and decoding method and system for double-ID two-dimensional code micro-code element
RELATED APPLICATIONS
The priority of chinese patent application No. 202010023386.3, filed on 09/01/2020, which is hereby incorporated by reference in its entirety, is claimed.
Technical Field
The invention relates to the technical field of two-dimensional code anti-counterfeiting, in particular to a method and a system for coding and decoding a double-ID two-dimensional code micro-code element.
Background
The two-dimensional code is an imaging representation of numerical and character codes and is generated for facilitating the identification of automatic identification equipment. The two-dimensional code which is widely applied comprises a QR code, a DM code, a PDF417 code and the like, wherein the QR code is fast and efficient in identification, and is adopted by popular mobile phone APP software such as WeChat and Payment treasures. Due to the adoption of popular mobile phone APP such as WeChat and Payment treasures, the using number of the QR codes on a single commodity is increased rapidly in an objective manner, and the application in the fields of commercial circulation and the like is greatly popularized, such as member management, point counting, lottery drawing and the like, and even the application in the special fields of commodity anti-counterfeiting, goods fleeing prevention, tracing and the like is included, so that the number of the QR codes is increased in an explosion manner, and the QR codes are applied everywhere where. On the other hand, however, the open source of the QR code generation algorithm causes the generation channel of the QR two-dimensional code to be non-exclusive, that is, different subjects can generate the same two-dimensional code by using the open source code, which brings a great risk to applications that need to strictly limit the digital code generation subject or range. For example, the QR code is applied in the anti-counterfeiting field, an anti-counterfeiting system adopts the QR code to carry out encoding imaging, counterfeiters can generate the same two-dimensional code as long as knowing the encoding content, and the encoding content can be easily analyzed reversely according to the existing two-dimensional code image.
One of the methods for improving the security of the two-dimensional code is to generate a double-ID two-dimensional code, and realize new rule control through the double ID when generating and analyzing the two-dimensional code, so that the security of the common two-dimensional code is improved. On one hand, the existing coding scheme of the common two-dimensional code is inherited to carry out image coding on the original coding character string, so that the two-dimensional code generated by adopting the new method and the common two-dimensional code generated according to the original rule can be compatible in the using link; on the other hand, a new image coding scheme is added on the basis of the generation rule of the common two-dimensional code, and the coding scheme utilizes the physical space of the code element of the common two-dimensional code and adopts smaller microcode elements to carry out image coding on the physical space of the code element on the basis of the code element representation coding of the common two-dimensional code, so that the parasitic of the new code on the physical space of the original image coding is realized, and a third-dimensional independent image coding is formed. The third-dimensional image code is independently generated and analyzed, but the coded content of the common two-dimensional code and the coded content of the third-dimensional code are supposed to have correlation, and the authenticity and validity of the common two-dimensional code are judged by judging whether the analyzed two codes meet the correlation rule or not in the content during verification, if the correlation exists, the two-dimensional code is authentic and valid, and if not, the two-dimensional code is invalid. The coding rule of the third-dimensional image coding is carried out by adopting a custom coding standard and is not disclosed, so that the third-dimensional coding has confidentiality, and any unauthorized third party cannot generate the same code, thereby ensuring the safety of the third-dimensional image coding.
However, the two-dimensional code is generally used in a size of about 12mm by 12mm to 16mm by 16mm due to a reason such as a product label area. Under this condition, the physical size of its symbol is small. Taking the QR two-dimensional code with the size of 14mm x 14mm and the version of 5 as an example, the symbol size is about 0.37 mm. Given that the symbols are already small, the microcode elements will certainly be smaller. How does the micro-symbol encoding take place on symbols of smaller size? On the other hand, how to analyze and read a microcode element with a smaller area size? Thirdly, after the code element is encoded by the microcode element, the analysis of the original code element cannot be negatively influenced, otherwise, the correct reading of the common two-dimensional code is influenced. How to ensure that no influence is given? The above problems need to be solved.
Disclosure of Invention
In order to solve the problems that in the prior art, encoding of micro code elements on code elements with smaller sizes is difficult, analysis and reading of micro code elements with smaller area sizes are difficult, and correct reading of common two-dimensional codes is influenced, the invention provides a method and a system for encoding and decoding micro code elements of double-ID two-dimensional codes, which are used for solving the technical problems.
In one aspect, the present invention provides a method for encoding a dual-ID two-dimensional code micro-symbol, including:
acquiring original data to be coded, and preprocessing the original data to be coded to generate first microcode metadata, wherein preprocessing comprises binary conversion, redundant coding and scrambling processing of the original data to be coded;
carrying out image coding of a first micro code element on binary data obtained by preprocessing on a code element space of the two-dimensional code, and implanting a first micro code element into a micro code element data area, wherein the micro code element data area is an area except a positioning frame in the two-dimensional code; and
and generating second microcode metadata by the number of the first microcode elements in the microcode metadata area, the preprocessing scheme and the check and error correction coding, performing image coding on the second microcode elements, and implanting the second microcode elements into the positioning frame.
Preferably, the symbol space of a two-dimensional code includes at least one coding space of micro-symbols, and the interval between any two spaced micro-code elements is larger than the size of one micro-symbol. A plurality of microcode element coding spaces can be arranged, the spacing distance of the microcode elements can ensure that the identification of the microcode elements can be accurate according to the data needing to be coded actually.
Preferably, the image coding rule of the first micro-symbol and the second micro-symbol is specifically as follows: in the black symbols of the two-dimensional code, the white micro-symbol is represented as binary "1", and the black micro-symbol is represented as binary "0"; in the white symbols of the two-dimensional code, the black micro-symbol is represented as binary "1" and the white micro-symbol is represented as binary "0". The different colors of the micro code elements form color difference with the code elements, so that the identification is convenient.
Preferably, the redundant coding and scrambling in the preprocessing includes at least two rules, and the number of the preprocessing scheme is generated according to different rules. Different rules may have variability, which can improve security.
Preferably, the image encoding rule of the first micro-symbol and/or the second micro-symbol further includes: the image coding of the first and/or second micro-symbols is carried out in line or sequence. The coding rules of different sequences can increase the diversity of coding schemes and prevent counterfeiting.
Preferably, the encoding sequence of the image encoding of the second microcode metadata in the positioning frame of the two-dimensional code is: from left to right, from top to bottom. The coding sequence of the second micro-code elements is set, so that different modes can be used for sequencing during coding, the cracking difficulty is improved, and the accuracy of the obtained data can be ensured according to the coding sequence during decoding.
According to a second aspect of the present invention, a method for decoding a dual-ID two-dimensional code micro-symbol is provided, the method comprising the steps of:
acquiring two-dimensional code information by using an image scanning device, wherein the two-dimensional code information comprises the version number and the code element number of a two-dimensional code;
based on a gradient discrimination method of pixel gray difference of adjacent images, carrying out blind search discrimination processing on the image in the recognition frame to obtain a clear image;
extracting second microcode metadata contained in a positioning frame of the two-dimensional code to obtain the key parameters of the first microcode element number, the verification and scrambling scheme parameter and the sequence number of the primary sequence scheme; and
traversing each code element of the two-dimensional code based on the arrangement main sequence scheme to obtain first microcode metadata of a microcode metadata area, performing redundancy removal and anti-scrambling processing based on redundant coding and scrambling processing, and converting binary data into original data.
According to a third aspect of the present invention, a computer-readable storage medium is proposed, on which a computer program is stored, which computer program, when being executed by a computer processor, carries out the above-mentioned method.
According to a third aspect of the present invention, a system for encoding a microcode element of a dual-ID two-dimensional code is provided, the system comprising:
a pretreatment unit: the method comprises the steps that configuration is used for obtaining original data to be coded and preprocessing the original data to be coded to generate first microcode metadata, wherein preprocessing comprises binary conversion, redundant coding and scrambling processing of the original data to be coded;
a first microcode element generation unit: the method comprises the steps of configuring image coding of a first micro code element on a code element space of a two-dimensional code for binary data obtained through preprocessing, and implanting a first micro code element into a micro code element data area, wherein the micro code element data area is an area except a positioning frame in the two-dimensional code;
a second microcode element generation unit: and configuring the number, the preprocessing scheme and the check and error correction codes of the first microcode elements in the microcode element data area to generate second microcode element data, carrying out image coding on the second microcode elements and implanting the second microcode elements into the positioning frame.
According to a fourth aspect of the present invention, a decoding system for a microcode element of a dual-ID two-dimensional code is provided, the system comprising:
an image scanning unit: the method comprises the steps that the two-dimension code information is configured and used for obtaining by an image scanning device, wherein the two-dimension code information comprises the version number and the code element number of a two-dimension code;
an image processing unit: a gradient discrimination method based on the pixel gray difference of adjacent images is configured, and the images in the identification frame are subjected to blind search discrimination processing of the definition degree to obtain clear images;
a second microcode element fetch unit: configuring second microcode metadata contained in a positioning frame for extracting the two-dimensional code, and obtaining key parameters of the first microcode element number, the verification and scrambling scheme parameter and the sequence number of the primary sequence scheme;
a decoding unit: and configuring each code element for traversing the two-dimensional code based on the arrangement main sequence scheme to obtain first microcode metadata of a microcode metadata area, performing redundancy removal and anti-scrambling processing based on redundant coding and scrambling processing, and converting binary data into original data.
The invention provides a method and a system for coding and decoding a double-ID two-dimensional code micro-code element, which realize the coding of the micro-code element on the basis of the code element, can correctly analyze a micro-code element code on an output carrier, and ensure that the existence of the micro-code element does not influence the correct analysis and reading of the original two-dimensional code element.
Drawings
The accompanying drawings are included to provide a further understanding of the embodiments and are incorporated in and constitute a part of this specification. The drawings illustrate embodiments and together with the description serve to explain the principles of the invention. Other embodiments and many of the intended advantages of embodiments will be readily appreciated as they become better understood by reference to the following detailed description. Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
fig. 1 is a flowchart of a method for encoding a dual-ID two-dimensional code micro-symbol according to an embodiment of the present invention;
FIG. 2 is a flow chart of a method for decoding a dual ID two-dimensional code micro-symbol according to an embodiment of the invention;
FIG. 3 is a schematic diagram of a micro-symbol of a specific embodiment of the present invention;
FIG. 4 is a block diagram of a system for encoding dual ID two-dimensional code microcode elements according to one embodiment of the invention;
FIG. 5 is a block diagram of a system for decoding double ID two-dimensional code microcode elements according to one embodiment of the invention;
FIG. 6 is a schematic block diagram of a computer system suitable for use in implementing an electronic device according to embodiments of the present application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
In a benchmarking method for data items according to an embodiment of the present invention, fig. 1 shows a flowchart of an encoding method of an intelligent anti-counterfeiting code according to an embodiment of the present invention. As shown in fig. 1, the method comprises the steps of:
s101: the method comprises the steps of obtaining original data to be coded, and preprocessing the original data to be coded to generate first microcode metadata, wherein preprocessing comprises binary conversion, redundant coding and scrambling processing of the original data to be coded.
In a specific embodiment, after the original data is organized, the original data needs to be converted from characters to binary, redundantly encoded and scrambled, wherein the redundantly encoded and scrambled scheme adopts a self-defined rule and has more than 2 sets of schemes, and is kept secret to the outside, so that the method has strong random variability, the safety is improved, and the data to be encoded in the microcode metadata area is prevented from being forged or cracked.
S102: and carrying out image coding on a first micro code element on the binary data obtained by preprocessing on a code element space of the two-dimensional code, and implanting the first micro code element into a micro code element data area, wherein the micro code element data area is an area except for a positioning frame in the two-dimensional code.
In a specific embodiment, the normal two-dimensional code is composed of a number of black and white alternating symbols, each symbol representing a binary number 0 or 1. Logically, the code element coding space of the common two-dimensional code can be infinitely subdivided to divide a smaller coding space, but the actual subdividable space is limited by the precision of printing equipment and the analysis capability of reading equipment, so the size of the subdividing space needs to meet the requirements of actual printout and accurate analysis. For the current printing output equipment with the mainstream precision of more than 600dpi, a matrix formed by four pixels can be accurately and stably analyzed into a point on a physical space by a common mobile phone with more than 800 ten thousand pixels. Therefore, a matrix formed by four pixels becomes the minimum constituent size limit of the micro-symbol. The spacing between microcode elements of a symbol is also at least one pixel wide in order to identify adjacent symbols. Therefore, in the QR two-dimensional code with the size of 12mm × 12mm to 16mm × 16mm and the version number of 5, each code element can be divided into 1 to 4 subdivided micro code element coding spaces, each subdivided space stores one micro code element, and each micro code element can represent one binary number.
In a specific embodiment, among the black symbols of the two-dimensional code, the white micro-symbol is represented as binary "1", and the black micro-symbol is represented as binary "0"; in the white symbols of the two-dimensional code, the black micro-symbol is represented as binary "1" and the white micro-symbol is represented as binary "0". The binary number of the micro code elements in the two-dimensional code can be represented by different colors, and the micro code element information can be implanted simply and conveniently.
In a specific embodiment, since four subdivision schemes of 1-4 micro code elements can be performed on the code elements, the currently adopted micro code element number scheme must be recorded during encoding, so that the number of the micro code elements contained in each code element is known during decoding, and the micro code elements are correctly analyzed. In order to realize the recording of the scheme, the complete area of the two-dimensional code is divided into two spaces of a scheme recording area and a microcode metadata area. The scheme recording area is an area to which the two-dimensional code positioning frame belongs, and an area outside the positioning frame is a microcode metadata area. Besides the number parameter of the microcode elements in the code element, the scheme recording area can also be used for recording other important parameters. Through the division of the two areas, the setting of the micro-code element can be orderly divided into two parts, on one hand, the coding of the micro-code element is convenient to realize during the coding, and simultaneously, the reverse decoding work can be carried out according to the content of the recording area during the decoding.
S103: and generating second microcode metadata by the number of the first microcode elements in the microcode metadata region, the preprocessing scheme and the check and error correction coding, performing image coding on the second microcode elements, and implanting the second microcode elements into the positioning frame.
In a specific embodiment, in the scheme recording area of the micro-symbol, in the central black area of a positioning frame, because the space is larger than that of the common symbol, 16 (4 rows and 4 columns) white micro-symbols are fixedly used for representing the micro-symbol allocation scheme of the data area and other schemes, and 48 micro-symbols are represented by 3 positioning frames in total, and 48 binary numbers are represented. The data of the 3 positioning frames are connected in series according to the sequence of upper left, upper right and lower left. In the positioning frame, the microcode elements are arranged by taking the row sequence as the main sequence. Of the 48-bit binary numbers, 12 bits are used for scheme sequence number encoding (including the number of microcode elements and redundant encoding and scrambling scheme sequence numbers) and 24 bits are used for checking and error correction. After the content recorded in the recording area is organized into original data, the original data needs to be subjected to binary conversion, redundant coding and scrambling, and the scrambled binary data is subjected to image reproduction by using micro-code elements in a code element space by taking a line sequence as a main sequence to realize coding. The redundant coding and scrambling scheme adopts custom rules and algorithms and is kept secret from the outside so as to safely and reliably record the distributed number of the micro-code elements in each code element in the data area and other important parameters. It should be appreciated that the concatenation sequence of the data of the 3 positioning frames may be in other sequences besides the sequence of upper left, upper right and lower left, for example, concatenation may be performed in other manners such as clockwise (lower left, upper left and upper right), and the technical effect of the present invention may also be achieved.
In a specific embodiment, the scrambled binary data is further image-encoded in a symbol space by using micro-symbols in a row sequence or a sequence as a primary sequence. For the coding, checking and scrambling of a certain two-dimensional code realized by the scheme, a line sequence bit main sequence or a sequence is adopted as a main sequence, and the sum of ASCII values of each bit of the two-dimensional code is determined by a modulus of m (m is the number of the scheme). Each scheme is assigned a sequence number, and its scheme sequence number is recorded in the scheme recording area.
In a specific embodiment, after the micro-code element coding is realized according to the method, the analysis of the two-dimensional code element is not affected. Under the convention that each code element is at least represented by a dot matrix of 10X10, microcode elements are at least represented by a minimum dot matrix of 2X2, and the interval (rows and columns) between the microcode elements is not less than the distance of 2 dot matrixes, except that each microcode element can be clearly printed and output, the gray value of each code element cannot be changed essentially, and the original code element can still be correctly read. For example, in the case where the number of allocated micro-code elements is the largest, when 4 white micro-code elements are included in one black symbol, the area ratio of the black part is (10 × 10- (2 × 2) × 4)/100 ═ 84%, and in the single-tone two-dimensional code, the integrated gray value of the symbol is still greater than the standard black threshold value and is still read as black. That is, although the symbol contains the microcode element with the reversed color, the meaning represented by the original symbol will not be interfered and influenced by the presence of the microcode element. Likewise, in a white symbol, correct recognition is not affected by black micro-symbols as a result. The specific microcode elements are shown in the schematic diagram of FIG. 3.
Fig. 2 is a flowchart illustrating a decoding method of a dual ID two-dimensional code micro-symbol according to an embodiment of the present invention, where as shown in fig. 2, the decoding method includes:
s201: and acquiring the two-dimensional code information by using an image scanning device, wherein the two-dimensional code information comprises the version number and the code element number of the two-dimensional code.
In a specific embodiment, the recognition method uses a common mobile phone as a background, and the camera resolution index is 1920 × 1080 or more and the screen resolution index is 1920 × 1080 or more. For a two-dimensional code frame with the size of 370 × 370 pixels in a mobile phone screen, when the frame is filled with a two-dimensional code, if the version number of the framed two-dimensional code is 5 and the number of symbols is 37 × 37, then exactly 10 × 10 camera pixels represent one symbol at this time. And each micro code element has exactly 2x2 pixels, and the interval of 2x2 pixels is arranged between the micro code elements and is basically consistent with the parameters of the double-ID two-dimensional code during generation and output, so that the requirement of correctly analyzing the imaging quality condition is met.
S202: and (3) carrying out blind search and discrimination on the image in the recognition frame according to a gradient discrimination method based on the pixel gray difference of adjacent images to obtain a clear image.
In a specific embodiment, an identification frame is arranged in the interface of the mobile phone APP, and the length and the width of the identification frame are 370 × 370 screen pixels or more respectively. And basically filling the generated two-dimensional code into the identification frame. And setting the mobile phone camera to be in a macro photographing state so that the microcode elements can be imaged clearly. And (3) performing blind search and discrimination on the definition degree of the image in the recognition frame by adopting a gradient discrimination method of the pixel gray level difference of the adjacent images, when the gradient of the pixel gray level difference of the plurality of adjacent images is greater than a specified threshold value, indicating that the definition index meets the requirement, and storing the image at the moment. And after a clear image is obtained, correcting the image to obtain a double-ID two-dimensional code image in a standard shape after reshaping.
S203: and extracting second microcode metadata contained in a positioning frame of the two-dimensional code to obtain the key parameters of the first microcode element number, the verification and scrambling scheme parameter and the sequence number of the primary sequence scheme. And extracting microcode element allocation scheme, redundancy coding and scrambling scheme parameters and microcode element sorting scheme parameters in the scheme recording area.
In a specific embodiment, the method of extracting the protocol record is: firstly, a positioning frame, namely a scheme recording area, is searched, a black core area is positioned in the positioning frame, 16 microcode element pixel intervals are calculated according to pixel intervals occupied by the black core area, microcode element colors are identified according to an absolute value judgment method of adjacent image pixel gray difference gradient in the specifically pointed microcode element position intervals, the encoding value is obtained, when the absolute value of the gradient is greater than 0, the encoding value is represented as '1', otherwise, the encoding value is '0'. After reading the values of all the record area micro code elements, the micro code elements are connected in series according to the appointed sequence, and are subjected to inverse scrambling, error correction, redundancy removal and restoration to be the original code, so that key parameters such as the distribution of the micro code elements in the code area, the algorithm scheme parameters of the verification and scrambling, the sequence number of the main sequence scheme and the like are obtained.
S204: traversing each code element of the two-dimensional code based on the arrangement main sequence scheme to obtain first microcode metadata of a microcode metadata area, performing redundancy removal and anti-scrambling processing based on redundant coding and scrambling processing, and converting binary data into original data.
In a specific embodiment, the method for obtaining microcode metadata encoded data of the data area comprises the following steps: and calculating the number of code elements according to the version number of the two-dimensional code, taking the outer boundary pixels of the positioning frame as end points and the number of the code elements as denominators, and equally dividing the pixel space in the transverse direction and the longitudinal direction to obtain each code element pixel interval. In one code element, calculating and acquiring a micro code element pixel space according to the number of the extracted micro code elements, and identifying the color of the micro code elements to acquire the coding value of the micro code elements according to an absolute value discrimination method of the gradient of the gray level difference of the adjacent image pixels. When the gradient absolute value of the adjacent pixel is calculated by recursion from the outer side of the code element to the center of the microcode element, if the absolute value is larger than 0, the microcode element is coded to be 1, otherwise, the absolute value is 0. This algorithm does not distinguish whether the symbol background is white or black.
In a specific embodiment, traversing each symbol in an agreed main sequence order according to the obtained main sequence parameter will obtain a string of complete analytic data. According to the obtained redundant coding and disorder algorithm scheme parameters, adopting an agreed algorithm to perform reverse scrambling and redundancy removal, and performing binary-to-character conversion to finally obtain original data.
With continued reference to fig. 4, fig. 4 shows a block diagram of an encoding system of an intelligent anti-counterfeiting code according to an embodiment of the invention. The encoding system comprises a preprocessing unit 401, a first microcode element generating unit 402 and a second microcode element generating unit 403 which are connected in sequence.
In a particular embodiment, the pre-processing unit 401: the method comprises the steps that configuration is used for obtaining original data to be coded and preprocessing the original data to be coded to generate first microcode metadata, wherein preprocessing comprises binary conversion, redundant coding and scrambling processing of the original data to be coded; first microcode element generation unit 402: the method comprises the steps of configuring image coding of a first micro code element on a code element space of a two-dimensional code for binary data obtained through preprocessing, and implanting a first micro code element into a micro code element data area, wherein the micro code element data area is an area except a positioning frame in the two-dimensional code; second microcode element generation unit 403: and configuring the number, the preprocessing scheme and the check and error correction codes of the first microcode elements in the microcode element data area to generate second microcode element data, carrying out image coding on the second microcode elements and implanting the second microcode elements into the positioning frame.
With continued reference to FIG. 5, FIG. 5 illustrates a block diagram of a decoding system for intelligent anti-counterfeiting codes, according to an embodiment of the invention. The decoding system comprises an image scanning unit 501, an image processing unit 502, a second microcode element extraction unit 503 and a decoding unit 504 which are connected in sequence.
In a specific embodiment, the image scanning unit 501: the method comprises the steps that the two-dimension code information is configured and used for obtaining by an image scanning device, wherein the two-dimension code information comprises the version number and the code element number of a two-dimension code; the image processing unit 502: a gradient discrimination method based on the pixel gray difference of adjacent images is configured, and the images in the identification frame are subjected to blind search discrimination processing of the definition degree to obtain clear images; second microcode element fetch unit 503: configuring second microcode metadata contained in a positioning frame for extracting the two-dimensional code, and obtaining key parameters of the first microcode element number, the verification and scrambling scheme parameter and the sequence number of the primary sequence scheme; the decoding unit 504: and configuring each code element for traversing the two-dimensional code based on the arrangement main sequence scheme to obtain first microcode metadata of a microcode metadata area, performing redundancy removal and anti-scrambling processing based on redundant coding and scrambling processing, and converting binary data into original data.
Referring now to FIG. 6, shown is a block diagram of a computer system 600 suitable for use in implementing the electronic device of an embodiment of the present application. The electronic device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 6, the computer system 600 includes a Central Processing Unit (CPU)601 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the system 600 are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output portion 607 including a display such as a Liquid Crystal Display (LCD) and a speaker; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that a computer program read out therefrom is mounted in the storage section 608 as necessary.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable storage medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609, and/or installed from the removable medium 611. The computer program performs the above-described functions defined in the method of the present application when executed by a Central Processing Unit (CPU) 601. It should be noted that the computer readable storage medium of the present application can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable storage medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable storage medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, or the like, as well as conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present application may be implemented by software or hardware.
As another aspect, the present application also provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiments; or may exist separately without being assembled into the electronic device. The computer-readable storage medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: acquiring original data to be coded, and preprocessing the original data to be coded to generate first microcode metadata, wherein preprocessing comprises binary conversion, redundant coding and scrambling processing of the original data to be coded; carrying out image coding of a first micro code element on binary data obtained by preprocessing on a code element space of the two-dimensional code, and implanting a first micro code element into a micro code element data area, wherein the micro code element data area is an area except a positioning frame in the two-dimensional code; and generating second microcode metadata by the number of the first microcode elements in the microcode metadata area, the preprocessing scheme and the check and error correction coding, performing image coding on the second microcode elements, and implanting the second microcode elements into the positioning frame.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the invention. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the invention. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (10)

1. A coding method of a double-ID two-dimensional code micro-code element is characterized by comprising the following steps:
acquiring original data to be coded, and preprocessing the original data to be coded to generate first microcode metadata, wherein the preprocessing comprises binary conversion, redundant coding and scrambling processing of the original data to be coded;
carrying out image coding of a first micro code element on binary data obtained by preprocessing on a code element space of the two-dimensional code, and implanting the first micro code element into a micro code element data area, wherein the micro code element data area is an area except a positioning frame in the two-dimensional code; and
and generating second microcode metadata by the number of the first microcode elements in the microcode metadata region, the preprocessing scheme and the check and error correction coding, performing image coding on the second microcode elements, and implanting the second microcode elements into the positioning frame.
2. The method of claim 1, wherein the symbol space of one of the two-dimensional codes comprises at least one coding space of the micro-symbols, and the interval between any two spaced micro-symbols is larger than the size of one micro-symbol.
3. The method for encoding the double-ID two-dimensional code micro-code element according to claim 1 or 2, wherein the image encoding rule of the first micro-code element and the second micro-code element is specifically as follows: in the black symbols of the two-dimensional code, the white micro-symbols are represented as binary '1', and the black micro-symbols are represented as binary '0'; in the white symbols of the two-dimensional code, the black micro-symbol is represented as binary "1" and the white micro-symbol is represented as binary "0".
4. The method for encoding double-ID two-dimensional code micro-symbols according to claim 1, wherein the redundant encoding and scrambling in the preprocessing includes at least two rules, and the number of the preprocessing scheme is generated according to different rules.
5. The method for encoding a dual-ID two-dimensional code micro-symbol according to claim 1, wherein the image encoding rule of the first micro-symbol and/or the second micro-symbol further includes: image encoding of the first and/or second micro-symbols is performed in line or sequence.
6. The method for encoding double-ID two-dimensional code micro-symbols according to claim 1, wherein the encoding order of the image encoding of the second micro-code metadata in the positioning frame of the two-dimensional code is: from left to right, from top to bottom.
7. A decoding method of a double-ID two-dimensional code micro code element is characterized by comprising the following steps:
acquiring two-dimensional code information by using an image scanning device, wherein the two-dimensional code information comprises the version number and the code element number of a two-dimensional code;
based on a gradient discrimination method of pixel gray difference of adjacent images, carrying out blind search discrimination processing on the image in the recognition frame to obtain a clear image;
extracting second microcode metadata contained in a positioning frame of the two-dimensional code to obtain key parameters of a first microcode element number, a verification and scrambling scheme parameter and a sequence number of a primary sequence scheme; and
traversing each code element of the two-dimensional code based on a main sequence arrangement scheme to obtain first microcode metadata of a microcode metadata area, performing redundancy removal and anti-scrambling processing based on redundant coding and scrambling processing, and converting binary data into original data.
8. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a computer processor, carries out the method of any one of claims 1 to 7.
9. A coding system of a double-ID two-dimensional code microcode element is characterized by comprising the following steps:
a pretreatment unit: the method comprises the steps that configuration is used for obtaining original data to be coded and preprocessing the original data to be coded to generate first microcode metadata, wherein preprocessing comprises binary conversion, redundant coding and scrambling processing of the original data to be coded;
a first microcode element generation unit: the method comprises the steps of configuring image coding of a first micro code element on a code element space of the two-dimensional code for binary data obtained by preprocessing, and implanting the first micro code element into a micro code element data area, wherein the micro code element data area is an area except a positioning frame in the two-dimensional code;
a second microcode element generation unit: and configuring the number, the preprocessing scheme and the check and error correction codes of the first microcode elements in the microcode element data area to generate second microcode element data, performing image coding on the second microcode element, and implanting the second microcode element into the positioning frame.
10. A decoding system of a double-ID two-dimensional code microcode element is characterized by comprising the following steps:
an image scanning unit: the method comprises the steps that the two-dimension code information is configured and used for obtaining by an image scanning device, wherein the two-dimension code information comprises the version number and the code element number of a two-dimension code;
an image processing unit: a gradient discrimination method based on the pixel gray difference of adjacent images is configured, and the images in the identification frame are subjected to blind search discrimination processing of the definition degree to obtain clear images;
a second microcode element fetch unit: configuring second microcode metadata contained in a positioning frame for extracting the two-dimensional code, and obtaining key parameters of a first microcode element number, a verification and scrambling scheme parameter and a sequence number of a primary sequence scheme;
a decoding unit: and configuring each code element for traversing the two-dimensional code based on a main sequence arrangement scheme to obtain first microcode metadata of a microcode metadata area, performing redundancy removal and anti-scrambling processing based on redundant coding and scrambling processing, and converting binary data into original data.
CN202010053254.5A 2020-01-09 2020-01-17 Coding and decoding method and system for double-ID two-dimensional code micro-code element Active CN111222610B (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN2020100233863 2020-01-09
CN202010023386 2020-01-09

Publications (2)

Publication Number Publication Date
CN111222610A true CN111222610A (en) 2020-06-02
CN111222610B CN111222610B (en) 2022-09-02

Family

ID=70831197

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010053254.5A Active CN111222610B (en) 2020-01-09 2020-01-17 Coding and decoding method and system for double-ID two-dimensional code micro-code element

Country Status (1)

Country Link
CN (1) CN111222610B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113988243A (en) * 2021-10-19 2022-01-28 艾斯芸防伪科技(福建)有限公司 Three-dimensional code generation and verification method, system, equipment and medium with verification code

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100195834A1 (en) * 2009-01-30 2010-08-05 Sharp Kabushiki Kaisha Image generating apparatus, image processing apparatus, image forming apparatus, and recording medium
US20110000958A1 (en) * 2009-07-02 2011-01-06 John Herzig Systems and Methods for Animating Barcodes
CN105550730A (en) * 2016-01-28 2016-05-04 北京兆信信息技术股份有限公司 Safe two-dimensional code manufacture method and decoding method, and safe two-dimensional code identifier
CN106384143A (en) * 2016-09-20 2017-02-08 北京兆信信息技术股份有限公司 Dynamic electronic two-dimensional code generation and recognition method
CN107220578A (en) * 2017-05-31 2017-09-29 维沃移动通信有限公司 A kind of two-dimensional code scanning recognition methods, device, mobile terminal and storage medium
CN108665041A (en) * 2018-05-09 2018-10-16 深圳市码云可变数据科技有限公司 Quick Response Code generates and recognition methods, device, computer equipment and storage medium
CN108764420A (en) * 2018-04-24 2018-11-06 中国人民银行印制科学技术研究所 A kind of Quick Response Code and its coding, have anti-fraud functional product at recognition methods
CN109191360A (en) * 2018-08-17 2019-01-11 河南工业大学 SAR image digital watermarking generation and analysis method and device based on scrambling encryption two dimensional code
JP2019192193A (en) * 2017-12-29 2019-10-31 株式会社I・Pソリューションズ Complex code pattern, generating device, reading device, method, and program
CN110414243A (en) * 2018-04-26 2019-11-05 杭州海康威视数字技术股份有限公司 A kind of two dimensional code encryption method, device and two dimensional code decryption method, device

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100195834A1 (en) * 2009-01-30 2010-08-05 Sharp Kabushiki Kaisha Image generating apparatus, image processing apparatus, image forming apparatus, and recording medium
US20110000958A1 (en) * 2009-07-02 2011-01-06 John Herzig Systems and Methods for Animating Barcodes
CN105550730A (en) * 2016-01-28 2016-05-04 北京兆信信息技术股份有限公司 Safe two-dimensional code manufacture method and decoding method, and safe two-dimensional code identifier
CN106384143A (en) * 2016-09-20 2017-02-08 北京兆信信息技术股份有限公司 Dynamic electronic two-dimensional code generation and recognition method
CN107220578A (en) * 2017-05-31 2017-09-29 维沃移动通信有限公司 A kind of two-dimensional code scanning recognition methods, device, mobile terminal and storage medium
JP2019192193A (en) * 2017-12-29 2019-10-31 株式会社I・Pソリューションズ Complex code pattern, generating device, reading device, method, and program
CN108764420A (en) * 2018-04-24 2018-11-06 中国人民银行印制科学技术研究所 A kind of Quick Response Code and its coding, have anti-fraud functional product at recognition methods
CN110414243A (en) * 2018-04-26 2019-11-05 杭州海康威视数字技术股份有限公司 A kind of two dimensional code encryption method, device and two dimensional code decryption method, device
CN108665041A (en) * 2018-05-09 2018-10-16 深圳市码云可变数据科技有限公司 Quick Response Code generates and recognition methods, device, computer equipment and storage medium
CN109191360A (en) * 2018-08-17 2019-01-11 河南工业大学 SAR image digital watermarking generation and analysis method and device based on scrambling encryption two dimensional code

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113988243A (en) * 2021-10-19 2022-01-28 艾斯芸防伪科技(福建)有限公司 Three-dimensional code generation and verification method, system, equipment and medium with verification code
CN113988243B (en) * 2021-10-19 2023-10-27 艾斯芸防伪科技(福建)有限公司 Three-dimensional code generation and verification method, system, equipment and medium with verification code

Also Published As

Publication number Publication date
CN111222610B (en) 2022-09-02

Similar Documents

Publication Publication Date Title
CN106529633B (en) Generation method, coding/decoding method and the device of two dimensional code
US10089508B2 (en) System and method of embedding a two dimensional code with concealed secure message
US7751629B2 (en) Method and apparatus for decoding mixed code
US7702162B2 (en) Mixed code, and method and apparatus for generating the same
EP1807796B1 (en) Mixed code, and method and apparatus for generating the same, and method and appratus for decoding the same
CN105224974B (en) The method and method for anti-counterfeit of hiding information in a kind of matrix two-dimensional code
US20140119647A1 (en) Method and Apparatus for Decoding Mixed Code
US20060210138A1 (en) Verification of authenticity of check data
CN108062668B (en) Two-dimensional code payment method and system based on background picture encryption identification
US20060255141A1 (en) Machine readable data
WO2021169502A1 (en) A pixel image as well as its processing method and application system
CN111222610B (en) Coding and decoding method and system for double-ID two-dimensional code micro-code element
CN115293311A (en) Color watermark anti-counterfeiting method and device based on micro-point code
CN107249903B (en) The identification file of personal images including printing
US11388310B2 (en) Computer method and system for generating images with encoded information, images obtained by this method and image reading method and system
CN111428532A (en) Encryptable three-dimensional code and encoding and decoding method
CN115423063B (en) Anti-copying shading anti-counterfeiting method and device based on micro-point code
Aljarf et al. Develop a Detection System for Grey and ColourStego Images
RU2446464C2 (en) Method and system for embedding and extracting hidden data in printed documents
CN114549698A (en) Text synthesis method and device and electronic equipment
CN114254719B (en) Anti-counterfeiting two-dimensional code generation method and device
RU2249853C2 (en) Method for reading full data block from cards with graphic symbols
RU2495494C2 (en) Method of incorporating additional information into digital graphic images (versions)
CN115470878B (en) Variable anti-counterfeiting super-line anti-counterfeiting method and device based on micro-point code
CN1665182A (en) Coding and decoding method for quick response code

Legal Events

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