CN112070195A - Two-dimensional code identification and generation method and device, electronic equipment and storage medium - Google Patents

Two-dimensional code identification and generation method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN112070195A
CN112070195A CN202011002519.5A CN202011002519A CN112070195A CN 112070195 A CN112070195 A CN 112070195A CN 202011002519 A CN202011002519 A CN 202011002519A CN 112070195 A CN112070195 A CN 112070195A
Authority
CN
China
Prior art keywords
sequence
attribute
dimensional code
target
code
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011002519.5A
Other languages
Chinese (zh)
Inventor
邓晔
邓虎啸
周静婷
徐有亮
涂丽君
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Anz Bank Operation Service Chengdu Co ltd
Original Assignee
Anz Bank Operation Service Chengdu 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 Anz Bank Operation Service Chengdu Co ltd filed Critical Anz Bank Operation Service Chengdu Co ltd
Priority to CN202011002519.5A priority Critical patent/CN112070195A/en
Publication of CN112070195A publication Critical patent/CN112070195A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K19/00Record carriers for use with machines and with at least a part designed to carry digital markings
    • G06K19/06Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code
    • G06K19/06009Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking
    • G06K19/06037Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking multi-dimensional coding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/1408Methods for optical code recognition the method being specifically adapted for the type of code
    • G06K7/14172D bar codes

Abstract

The application provides a two-dimension code identification method, a two-dimension code generation method, a two-dimension code identification device, an electronic device and a storage medium. According to the two-dimensional code generation method, the electronic equipment provides a plurality of code element arrays, and respectively displays the colors in each acquired attribute sequence to be displayed to different code element arrays based on a preset display strategy to obtain the two-dimensional code sequence. The generated two-dimensional code sequence represents specific binary data through color changes in the same-position code elements among the two-dimensional codes, and the length of the represented binary data is positively correlated with the color types in the attribute sequences to be displayed and the number of colors in each attribute sequence to be displayed. Therefore, when the electronic device recognizes the generated two-dimensional code sequence, more data can be obtained than the two-dimensional code by the black and white color block.

Description

Two-dimensional code identification and generation method and device, electronic equipment and storage medium
Technical Field
The application relates to the field of computers, in particular to a two-dimensional code identification and generation method and device, an electronic device and a storage medium.
Background
QR Code (Quick Response Code, Quick Response matrix map Code) is one of two-dimensional codes, invented by DENSO WAVE corporation of japan in 1994. QR is from the acronym of english Quick Response, i.e., fast Response, because the inventors expect that a QR code can quickly decode its contents. The QR code stores data using four standardized encoding modes, numeric, alphanumeric, byte (binary), and japanese (Shift _ JIS). QR codes are common in Japan, are the most common two-dimensional space bar codes in Japan at present, and are widely applied to mobile phone code reading operation in various countries in the world. Compared with the common one-dimensional bar code, the QR code has the advantages of quick reading and larger storage data capacity, and does not need to be aligned with a scanner in a straight line during scanning like the one-dimensional bar code. Therefore, the application range thereof has been expanded to aspects including product tracking, item identification, document management, inventory marketing, and the like.
The two-dimensional code is as same as the previous one-dimensional bar code, is widely applied to commercial activities, and is particularly widely applied to industries needing cheap and quick information marking on articles in high-tech industries, storage and transportation industries, wholesale and retail industries and the like. In some countries and regions, bar codes that are as easy to generate and read as QR codes have become a fast and convenient way of communicating information in life. In some countries, the code PDF417 has been adopted as an identification label and printed directly on an identification document for quick reading. Even in some regions, the two-dimensional code is applied to one of tax return modes of comprehensive acquired tax, and tax return data is printed in the two-dimensional code, so that the time for inputting data by a tax authority is saved.
At present, two-dimensional codes in daily use represent 0 and 1 in binary data using two color patches. Because one color block can only represent 1bit of information, the limited area can only carry limited data volume, and the two-dimensional code used daily also comprises redundant information, so that the data carrying volume is further reduced. Therefore, if more data volume needs to be carried, only a larger area of the two-dimensional code can be provided, and therefore, the data volume carried by the two-dimensional code needs to be further improved.
Disclosure of Invention
In order to overcome at least one of the deficiencies in the prior art, an object of the present application is to provide a two-dimensional code identification method applied to an electronic device, where the electronic device prestores code correspondence between different attribute sequences and different binary codes, where the attribute sequences are variation characteristics between a plurality of first attribute values belonging to a same target color attribute, the method including:
acquiring a target two-dimensional code sequence, wherein the target two-dimensional code sequence comprises a plurality of target two-dimensional codes with sequence relation;
extracting first attribute values carried by code elements at the same position of each target two-dimensional code according to the target color attributes to obtain a plurality of attribute sequences to be identified, wherein the arrangement order of the first attribute values in each attribute sequence to be identified corresponds to the sequence relation;
and according to the code corresponding relation, sequentially determining binary codes corresponding to the attribute sequences to be identified according to a code element analysis sequence, and obtaining target data carried by the target two-dimensional code sequence.
Optionally, each target two-dimensional code displays sequence information, and the sequence information represents different sequence positions through a plurality of second attribute values respectively;
before extracting the first attribute value displayed by the code element at the same position of each target two-dimensional code according to the target color attribute, the method further includes:
detecting the second attribute value in each target two-dimensional code;
and determining the sequence relation among the target two-dimensional code sequences according to the sequence positions corresponding to the second attribute values.
Optionally, the step of acquiring a target two-dimensional code sequence includes:
acquiring a plurality of to-be-processed two-dimensional codes, wherein each to-be-processed two-dimensional code is displayed with grouping information, the grouping information is identified through a third attribute value, and the display style of the third attribute value is different from the display styles of other code elements of the to-be-processed two-dimensional code;
detecting the third attribute value in each two-dimensional code to be processed to obtain grouping information among the multiple two-dimensional codes to be processed;
and splitting the two-dimensional codes to be processed into a plurality of target two-dimensional code sequences according to grouping information among the two-dimensional codes to be processed, wherein each target two-dimensional code in the same target two-dimensional code sequence displays the third attribute value at the same position.
Optionally, each of the target two-dimensional code sequences carries the same target data; when each target two-dimensional code sequence is displayed, a display position of a color carrying the third attribute value in each target two-dimensional code sequence forms a specific moving track, and the moving track corresponds to the code element analysis sequence;
before sequentially determining the binary codes corresponding to the attribute sequences to be identified according to the code corresponding relation and the code element analysis sequence, the method comprises the following steps:
detecting the third attribute value in each of the target two-dimensional code sequences;
obtaining the movement track according to the display position of each third attribute value in each target two-dimensional code sequence;
and obtaining the code element analysis sequence according to the movement track.
Optionally, each of the target two-dimensional code sequences carries different target data; the third attribute values comprise at least three, and code elements occupied by the third attribute values in the target two-dimensional code are in a preset arrangement mode and used as locators in the target two-dimensional code to which the third attribute values belong;
before sequentially determining the binary codes corresponding to the attribute sequences to be identified according to the code corresponding relation and the code element analysis sequence, the method comprises the following steps:
detecting the third attribute value in each target two-dimensional code;
and determining the code element analysis sequence of the target two-dimensional code to which the third attribute value belongs according to the arrangement mode of the code elements occupied by the third attribute value in the target two-dimensional code to which the third attribute value belongs.
Optionally, each target two-dimensional code sequence carries numbering information, where the numbering information is characterized by a change between the first attribute values, and the method further includes:
for each target two-dimensional code sequence, extracting a first attribute value of a preset position of each target two-dimensional code in the target two-dimensional code sequence according to the target color attribute to obtain a number attribute sequence;
determining the number information corresponding to the number attribute sequence according to the coding corresponding relation;
and combining the target data carried by each target two-dimensional code sequence according to the number information of each target two-dimensional code sequence to obtain data carried by a plurality of target two-dimensional code sequences.
Optionally, the target color attribute is lightness or hue of a color.
Another object of the present invention is to provide a two-dimensional code generating method applied to an electronic device, the method including:
acquiring a plurality of attribute sequences to be displayed with a sequence relationship, wherein the attribute sequences to be displayed are variation characteristics among a plurality of first attribute values belonging to the same target color attribute, different attribute sequences to be displayed respectively correspond to different binary codes, and the length of the binary codes is positively correlated with the number of the different first attribute values in the attribute sequences to be displayed and the sequence length of each attribute sequence to be displayed;
providing a plurality of code element arrays, wherein each code element array respectively comprises data code elements corresponding to the number of the attribute sequences to be displayed;
determining a target data code element from each code element array according to the sequence relation aiming at each attribute sequence to be displayed; the sequence position of each target data code element in the data code element corresponds to the sequence position of the attribute sequence to be displayed;
respectively displaying each first attribute value in the attribute sequence to be displayed to each target data code element according to the arrangement sequence of the first attribute values in each attribute sequence to be displayed and the preset corresponding relation between each code element array;
and obtaining a two-dimensional code sequence according to the display result of each data code element in the plurality of code element arrays.
Optionally, each of the symbol arrays further includes a first identification symbol for displaying sequence information, where the sequence information respectively characterizes different sequence positions by a plurality of second attribute values, and the method further includes:
and respectively displaying the plurality of second attribute values to each first identification code element according to the arrangement sequence of the first attribute values in each attribute sequence to be displayed and the preset corresponding relation between each code element array.
Optionally, the electronic device prestores corresponding coding relationships between different attribute sequences and different binary codes, and the step of acquiring a plurality of attribute sequences to be displayed having sequence relationships includes:
acquiring target data;
splitting the target data into a plurality of data fragments according to the length of the binary code;
and according to the coding corresponding relation, taking the attribute sequence corresponding to each data fragment as the plurality of attribute sequences to be displayed, wherein the sequence relation among the plurality of attribute sequences to be displayed corresponds to the sequence relation among the data fragments corresponding to the plurality of attribute sequences to be displayed.
Optionally, each symbol array further includes a second identification symbol for displaying grouping information, where a display position of the second identification symbol in the symbol array divides the plurality of symbol arrays into a plurality of symbol array groups, where each symbol array group corresponds to the target data, the second identification symbols in the same symbol array group are located at the same display position, and the grouping information is identified by a third attribute value;
determining an arrangement order between each of the plurality of symbol array groups;
determining the display positions of the second identification symbols in each symbol array group according to a preset symbol analysis sequence, wherein the display positions of the second identification symbols in the plurality of symbol array groups form a specific movement track according to the arrangement sequence, and the movement track corresponds to the symbol analysis sequence;
for each of the symbol array groups, displaying the third attribute value to a second identification symbol in the symbol array group; and the display mode of the third attribute value is different from the display modes of other symbols in the symbol array to be coded.
Optionally, the step of acquiring target data includes:
acquiring data to be processed;
and splitting the data to be processed into a plurality of target data.
Optionally, each symbol array further includes a second identification symbol for displaying grouping information, where a display position of the second identification symbol in the symbol array divides the plurality of symbol arrays into a plurality of symbol array groups, where each symbol array group corresponds to each target data one to one, the second identification symbols in the same symbol array group are located at the same display position, and the grouping information is identified by a third attribute value;
for each of the symbol array groups, displaying the third attribute value to a second identification symbol in the symbol array group; wherein the display style of the third attribute value is different from the display styles of other symbols in the symbol array.
Optionally, the third attribute values include at least three, and the symbols occupied by the third attribute values in the symbol array to which the third attribute values belong are in a preset arrangement mode, and are used as locators of the two-dimensional code corresponding to the symbol array to which the third attribute values belong.
Optionally, each of the symbol arrays further includes a number symbol for displaying number information at a preset position; wherein the number information characterizes a sequence position of the target data in the data to be processed, the method further comprising:
for each target data, determining the number of the target data and a corresponding target code element array group;
acquiring an attribute sequence corresponding to the number of the target data as a number attribute sequence according to the coding corresponding relation;
and distributing each first attribute value in the numbering attribute sequence to different numbering code elements according to the arrangement sequence of the first attribute values in the numbering attribute sequence and the preset corresponding relation between the code element arrays in the target code element array group.
Optionally, the method further comprises:
providing a display medium;
and displaying each two-dimensional code in the two-dimensional code sequence through the display medium.
Another objective of the embodiments of the present application is to provide a two-dimensional code recognition apparatus, which is applied to an electronic device, where the electronic device prestores code correspondence between different attribute sequences and different binary codes, where the attribute sequences are variation characteristics between a plurality of first attribute values belonging to a same target color attribute, and the two-dimensional code recognition apparatus includes:
the device comprises a two-dimensional code acquisition module, a two-dimensional code acquisition module and a two-dimensional code acquisition module, wherein the two-dimensional code acquisition module is used for acquiring a target two-dimensional code sequence, and the target two-dimensional code sequence comprises a plurality of target two-dimensional codes with a sequence relation;
the two-dimensional code processing module is used for extracting first attribute values carried by code elements at the same position of each target two-dimensional code according to the target color attributes to obtain a plurality of attribute sequences to be identified, wherein the arrangement order of the first attribute values in each attribute sequence to be identified corresponds to the sequence relation;
and the two-dimensional code processing module is further configured to sequentially determine binary codes corresponding to the attribute sequences to be identified according to the code element analysis sequence according to the code correspondence, and obtain target data carried by the target two-dimensional code sequence.
An object of the fourth embodiment of the present application is to provide a two-dimensional code generating device, which is applied to an electronic device, the two-dimensional code generating device includes:
the display device comprises a sequence acquisition module and a display control module, wherein the sequence acquisition module is used for acquiring a plurality of attribute sequences to be displayed with a sequence relation, the attribute sequences to be displayed are variation characteristics among a plurality of first attribute values belonging to the same target color attribute, different attribute sequences to be displayed respectively correspond to different binary codes, and the length of the binary codes is positively correlated with the number of the different first attribute values in the attribute sequences to be displayed and the sequence length of each attribute sequence to be displayed.
A sequence processing module, configured to provide a plurality of symbol arrays, where each symbol array includes data symbols corresponding to the number of the attribute sequences to be displayed;
the sequence processing module is further used for determining a target data code element from each code element array according to the sequence relation aiming at each attribute sequence to be displayed; the sequence position of each target data code element in the data code element corresponds to the sequence position of the attribute sequence to be displayed;
the sequence processing module is further configured to display each first attribute value in each attribute sequence to be displayed to each target data symbol according to a preset corresponding relationship between an arrangement order of the first attribute values in each attribute sequence to be displayed and each symbol array;
and the sequence processing module is further used for obtaining a two-dimensional code sequence according to the display result of each data code element in the plurality of code element arrays.
It is a fifth object of the embodiments of the present application to provide an electronic device, which includes a processor and a memory; the memory stores computer-executable instructions that, when executed by the processor, implement the two-dimensional code recognition method or the two-dimensional code generation method.
It is a sixth object of the embodiments of the present application to provide a storage medium storing a computer program, which when executed by a processor, implements the two-dimensional code recognition method or the two-dimensional code generation method.
Compared with the prior art, the method has the following beneficial effects:
the embodiment of the application provides a two-dimensional code identification method, a two-dimensional code generation method, a two-dimensional code identification device, a two-dimensional code generation device, electronic equipment and a storage medium. According to the two-dimensional code generation method, the electronic equipment provides a plurality of code element arrays, and displays the first attribute value in each acquired attribute sequence to be displayed to different code element arrays respectively based on a preset display strategy to obtain the two-dimensional code sequence. The generated two-dimensional code sequence represents a specific binary code through the change of the first attribute value carried by the same position code element among the two-dimensional codes, and the length of the represented binary code is positively correlated with the number of different first attribute values in the attribute sequence to be displayed and the sequence length of each attribute sequence to be displayed. Therefore, when the electronic device recognizes the generated two-dimensional code sequence, more data can be obtained than the two-dimensional code by the black and white color block.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
Fig. 1 is a schematic diagram of a conventional two-dimensional code provided in an embodiment of the present application;
fig. 2 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure;
fig. 3 is a schematic flow chart illustrating steps of a two-dimensional code production method according to an embodiment of the present application;
FIG. 4 is a color gamut diagram provided by an embodiment of the present application;
fig. 5 is a schematic diagram of a principle for generating a two-dimensional code sequence according to an embodiment of the present disclosure;
fig. 6 is a second schematic diagram illustrating a principle of generating a two-dimensional code sequence according to an embodiment of the present application;
fig. 7 is one of schematic diagrams illustrating a correspondence between an attribute sequence and a binary code according to an embodiment of the present application;
FIG. 8 is a second diagram illustrating the correspondence between the attribute sequence and the binary code according to the embodiment of the present application;
fig. 9 is one of schematic diagrams of a second identification symbol and grouping information provided in the embodiment of the present application;
FIG. 10 is a diagram illustrating a second identification symbol indicating a decoding order according to an embodiment of the present application;
fig. 11 is a second schematic diagram of a second identification symbol and grouping information provided in the embodiment of the present application;
fig. 12 is a schematic diagram of a first identification symbol provided in an embodiment of the present application;
fig. 13 is a second schematic diagram of a first identification symbol according to an embodiment of the present application;
FIG. 14 is a second schematic diagram illustrating a second identification symbol indicating a decoding order according to an embodiment of the present application;
FIG. 15 is a third schematic diagram illustrating a second identification symbol indicating a decoding order according to an embodiment of the present application;
fig. 16 is a schematic flowchart illustrating steps of a two-dimensional code recognition method according to an embodiment of the present application;
fig. 17 is a schematic diagram illustrating a two-dimensional code recognition method according to an embodiment of the present disclosure;
fig. 18 is a second schematic diagram illustrating a two-dimensional code recognition method according to an embodiment of the present disclosure;
fig. 19 is a schematic structural diagram of a two-dimensional code generation apparatus according to an embodiment of the present application;
fig. 20 is a schematic structural diagram of a two-dimensional code recognition device according to an embodiment of the present application.
Icon: 10-first color patch; 11-a second color patch; 12-positioning the color blocks; 100-an electronic device; 110-software virtual devices; 120-a memory; 130-a processor; 200-a first array of symbols; 210-a second array of symbols; 220-a third array of symbols; 230-a fourth symbol array; 300-a first two-dimensional code sequence; 310-a second two-dimensional code sequence; 320-a third two-dimensional code sequence; 330-packet information; 340-a fourth two-dimensional code sequence; 350-a fifth two-dimensional code sequence; 400-a first identification symbol; 500-first array direction; 510-a second array direction; 1110A-sequence acquisition module; 1101A-sequence processing module; 1101B-two-dimensional code obtaining module; 1102B-two-dimensional code processing module.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that like reference numerals 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.
In the description of the present application, it is noted that the terms "first", "second", "third", and the like are used merely for distinguishing between descriptions and are not intended to indicate or imply relative importance.
As introduced in the background art, two-dimensional codes currently use two color patches to represent 0 and 1 in binary data. Because one color block can only represent 1bit of information, the two-dimensional code with a limited area can only carry limited data volume, and the two-dimensional code used daily also comprises redundant information, so that the data carrying volume is further reduced. Therefore, if more data volume needs to be carried, only a larger area of the two-dimensional code can be provided, and therefore, the data volume carried by the two-dimensional code needs to be further improved.
The principle of two-dimensional codes in use in the day is exemplified below with reference to fig. 1. As shown in fig. 1, a two-dimensional code used in daily life mainly includes three parts, namely a first color block 10 and a second color block 11 for representing data, and a positioning color block 12 for representing a two-dimensional code placing mode, where colors corresponding to the first color block 10 and the second color block 11 are different (for example, the first color block 10 is black, and the second color block 11 is white). Wherein, the first color block 10 represents a 0 in the binary system, and the second color block 11 represents a1 in the binary system (or, the first color block 10 represents a1 in the binary system, and the second color block 11 represents a 0 in the binary system). When the device scans and identifies the two-dimensional code, the placing mode of the two-dimensional code is determined by positioning the color block 12, and then the data corresponding to the first color block 10 and the second color block 11 in the two-dimensional code is determined according to a preset decoding sequence.
Since the two-dimensional code represents 0 and 1 in binary system by limited two colors, a single color block can only carry 1bit of information. Therefore, if the data size carried by the two-dimensional code is to be increased, the number of color blocks in a unit area can be increased, or the area of the two-dimensional code can be increased under the condition that the number of color blocks which can be accommodated in the unit area is not changed. Based on the above description of the current two-dimensional code principle, it can be seen that the data volume carried by the current two-dimensional code needs to be further improved.
Considering that two dimensions in daily use represent 0 and 1 in binary system through color in single color block, and two-dimensional codes are relatively independent, the amount of data carried by two-dimensional code in daily use is limited. In view of this, in the embodiment of the present application, binary codes are represented by variation characteristics between first attribute values belonging to the same target color attribute, so as to increase the data volume carried by two-dimensional codes.
It should be understood that the color attributes include hue, gradation, lightness, and the like of a color. Wherein, the hue is the kind of color. For example, red, orange, yellow, green, cyan, blue, violet, and the like. The color gradation is the shade variation of the same color. Such as deep red, light red, etc. Lightness is the change in the intensity of the light and shade of the color perceived by the naked eye.
In the embodiment of the application, different binary codes can be characterized by the change of the hue. For example, red to green and green to red, respectively, represent different binary encodings. Different binary encodings can also be characterized by a change in lightness, e.g., lightness from "90" to "50" and "50" to "90," respectively. Of course, those skilled in the art can also characterize different binary codes according to the variation of the color level, and the embodiments of the present application are not particularly limited, and do not need to make creative contribution based on the technical solutions disclosed in the present application.
Based on the above principle, the embodiment of the application provides a two-dimensional code generation method, which is applied to electronic equipment. The electronic equipment generates a plurality of two-dimensional codes with a sequence relation through the two-dimensional code generation method, wherein the generated two-dimensional codes can carry more data compared with daily-used two-dimensional codes.
Correspondingly, the embodiment of the application also provides a two-dimensional identification method which is applied to the electronic equipment. The electronic equipment acquires the data carried in the two-dimensional code generated by the two-dimensional code generation method through a two-dimensional identification method.
It should be noted that the electronic devices for executing the two-dimensional code generation method and the two-dimensional recognition method may be the same electronic device or different electronic devices. The electronic device may be, but is not limited to, a data server, a video server, a Web server, and an FTP (File Transfer Protocol) server. Of course, the electronic Device may also be, but is not limited to, a smart phone, a Personal Computer (PC), a tablet PC, a Personal Digital Assistant (PDA), a Mobile Internet Device (MID), and the like.
Referring to fig. 2, in a possible implementation manner, a schematic structural diagram of the electronic device is provided. The electronic device 100 includes a software virtualization apparatus 110, a memory 120, and a processor 130. When the electronic device 100 for executing the two-dimensional code generation method and the two-dimensional identification method is the same electronic device, the software virtual device 110 includes a two-dimensional code generation device and a two-dimensional code identification device. When the electronic device 100 for executing the two-dimensional code generation method and the two-dimensional recognition method is a different electronic device, the software virtual device 110 includes a two-dimensional code generation device or a two-dimensional code recognition device.
The memory 120, processor 130, and other components are electrically connected to each other, directly or indirectly, to enable data transfer or interaction. For example, the components may be electrically connected to each other via one or more communication buses or signal lines. The software virtualization device 110 includes at least one software functional module which can be stored in the memory 120 in the form of software or Firmware (Firmware) or solidified in an Operating System (OS) of the electronic device 100. The processor 130 is used for executing executable modules stored in the memory 120, such as software functional modules and computer programs included in the software virtualization device 110. The computer-executable instructions in the software virtualization apparatus 110, when executed by the processor 130, implement the two-dimensional code generation method or the two-dimensional code recognition method described above.
The Memory 120 may be, but is not limited to, a Random Access Memory (RAM), a Read Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Read-Only Memory (EPROM), an electrically Erasable Read-Only Memory (EEPROM), and the like. The memory 120 is used for storing programs, and the processor 130 executes the programs after receiving the execution instructions.
The processor 130 may be an integrated circuit chip having signal processing capabilities. The Processor 130 may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and 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 application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Referring to fig. 3, a schematic flow chart of steps of the two-dimensional code generation method is shown. In a possible implementation manner, each step of the two-dimensional code generation method is described in detail below with reference to fig. 3.
Step S100A, acquiring a plurality of attribute sequences to be displayed having a sequence relationship.
The attribute sequence to be displayed is the variation characteristic among a plurality of first attribute values belonging to the same target color attribute, different attribute sequences to be displayed respectively correspond to different binary codes, and the length of the binary codes is positively correlated with the number of the different first attribute values in the attribute sequence to be displayed and the sequence length of each attribute sequence to be displayed.
The length of the binary code represents the data volume that can be carried by a single attribute sequence to be displayed, that is, the data volume carried by the single attribute sequence to be displayed is positively correlated with the length of the binary code.
In addition, the sequence relation among the attribute sequences to be displayed represents the sequence relation among the data fragments carried by the attribute sequences to be displayed. That is, in the present example, a plurality of to-be-displayed attribute sequences collectively correspond to a piece of target data, and each to-be-displayed attribute sequence corresponds to a certain data segment in the piece of target data. Because each data segment of the target data has a specific sequence relationship, the attribute sequence to be displayed corresponding to each data segment also has a sequence relationship.
It should be noted that the attribute sequence to be displayed may be generated by the electronic device 100 in a local processor based on the target data, or may be a plurality of attribute sequences to be displayed generated by other electronic devices obtained by being communicatively connected to other electronic devices 100 through a communication unit.
Step S110A, providing a plurality of symbol arrays, wherein each symbol array includes data symbols corresponding to the number of the attribute sequences to be displayed.
The code element array comprises data code elements corresponding to the number of the attribute sequences to be displayed and is used for displaying the attribute sequences to be displayed.
Step S120A, for each attribute sequence to be displayed, determining a target data symbol from each symbol array according to the sequence relationship.
And the sequence position of each target data code element in the data code element corresponds to the sequence position of the attribute sequence to be displayed.
Because each data segment of the target data has a specific sequence relationship, the attribute sequence to be displayed corresponding to each data segment also has a sequence relationship. Therefore, in order to ensure that the order between the obtained binary sequences is not disordered when decoding the two-dimensional code sequence obtained based on the symbol array, the position of the target data symbol for displaying the single attribute sequence to be displayed in the data symbol is required to correspond to the sequence position of the display attribute sequence.
Step S130A, respectively displaying each first attribute value in the attribute sequence to be displayed to each target data symbol according to the preset corresponding relationship between the arrangement order of the first attribute values in each attribute sequence to be displayed and each symbol array.
In order to enable the generated two-dimensional code sequence to be capable of representing the carried data based on the change of the first attribute value at the same position, it is necessary to display the first attribute values at the same sequence position in each attribute sequence to be displayed in the same symbol array.
It should be noted that there are various ways to display each first attribute value in the attribute sequence to be displayed to each target data symbol. As a possible implementation manner, the electronic device may display each first attribute value in the attribute sequence to be displayed to the target data symbol, carried in a specific color.
Step S140A is to obtain a two-dimensional code sequence from the display result of each data symbol in the plurality of symbol arrays.
The target color attribute may be of various types. Such as hue, gradation, and lightness of a color. The selection can be made by those skilled in the art according to actual needs. As a possible way of reality, the following takes lightness of color as an example, and the above steps are exemplified.
That is, different binary codes are represented by different lightness changes of color lightness, so that the hue and the tone scale changes of the color do not substantially affect the representation of the binary codes. Therefore, a hue and a color level combination which are consistent with the mass aesthetic sense can be selected for generating the two-dimensional code sequence.
In general terms, in the same display medium, as few as 5 colors are present, otherwise a visually cluttered feeling is presented. In view of this, the embodiments of the present application provide a possible color scheme, which selects 5 colors as the color scheme, wherein the colors include white, black and other 3 colors. White and black are the necessary colors, and the other 3 colors are the custom color scheme.
For the other 3 colors being custom Color schemes, as shown in fig. 4, the embodiment of the present application makes another 3 Color schemes based on the definition of Munsell Color System. In the munsell color system, the color system is divided into three different color gamut, namely, a red color gamut, a blue color gamut, and a yellow-green color gamut.
First, the color matching strategy based on the hue and lightness is:
case one, when one of the alternative color combinations falls within the yellow color gamut of the yellow-green color gamut, there are the following constraints:
(1) other alternative colors may not fall in the yellow color gamut anymore.
(2) Any two alternative color schemes have a number of adjacency in the color gamut greater than 30 degrees.
(3) An alternative color scheme falling in the yellow domain need only contain two levels of lightness, the levels of lightness being calculated from 0% to 100%, and the difference in lightness level for each color must be greater than 30%.
(4) The other two alternative color schemes must contain four levels of brightness, the levels of brightness being calculated from 0% to 100%, and the difference in brightness levels for each color must be greater than 30%.
Wherein the difference value of each level must be greater than 30% in order to improve the recognition effect of the generated two-dimensional code. It should be understood that, if the brightness of the displayed colors of two adjacent symbols in the generated two-dimensional code is too close, the recognition effect will be affected to a certain extent.
Case two, when no alternative color scheme falls in the yellow gamut of the yellow-green gamut, there are the following constraints:
(1) any two alternative color schemes have a number of adjacency in the color gamut greater than 30 degrees.
(2) Any one of the alternative color schemes need only contain two brightness levels, the brightness levels being calculated from 0% to 100%, and the difference in brightness levels for each color must be greater than 30%.
(3) The other two alternative color schemes must contain four levels of lightness, the levels of lightness being calculated from 0% to 100%, and the difference in lightness level for each color must be greater than 30%.
In addition, saturation may also be added. Wherein the strategy after adding the saturation is as follows:
(1) where any two alternative color schemes must contain four levels of brightness in a hierarchy, the levels of brightness being calculated from 0% to 100%, the difference in brightness levels for each color must be greater than 30%, and the brightness variation is significant.
(2) Another alternative color scheme need only contain two brightness levels, the brightness levels being calculated from 0% to 100%, and the difference in brightness levels for each color must be greater than 30%.
Based on the above strategies, a possible color scheme provided in the embodiments of the present application is: white, black, red, yellow and blue.
Wherein, the electronic device selects 4 brightness reds, which are respectively 30, 60, 120 and 200; similarly, 4 brightnesses of blue are selected, respectively, 30, 60, 120 and 200; yellow of 2 lightness was selected, 30 and 60 respectively.
As shown in fig. 5, based on the selected brightness value, the electronic device 100 sorts a plurality of attribute sequences to be displayed according to a sequence relationship between the attribute sequences to be displayed; and provides two symbol arrays. Wherein, the symbol arrays are a first symbol array 200 and a second symbol array 210 respectively; the sequencing result of the attribute sequences to be displayed is as follows:
"red (120) -red (60)", "red (120) -red (30)", "red (30) -blue (120)" … … "blue (120) -blue (30)".
It should be understood that the above-mentioned "red (120)" represents red having a lightness of 120. Based on the preset corresponding relationship between the arrangement order of the first attribute values in each attribute sequence to be displayed and each code element array, the electronic device 100 sequentially displays the first attribute values in each attribute sequence to be displayed to the first code element array 200; the second attribute value in each attribute sequence to be displayed is displayed to the second symbol array 210. Thus, the electronic device 100 obtains the two-dimensional code sequence according to the display rule and the display result of the two symbol arrays.
It should be noted that the above-mentioned example is only one possible example provided by the embodiments of the present application for explanation, and does not represent that only the above-mentioned embodiments of the present application exist. Because the length of the binary code is positively correlated with the number of different first attribute values in the attribute sequence to be displayed and the sequence length of each attribute sequence to be displayed. Therefore, the brightness included in the attribute sequence to be displayed can be adaptively increased or decreased based on the above example. Accordingly, the number of symbol arrays can be increased or decreased adaptively based on the above examples, which do not need to be creatively contributed based on the technical solution disclosed in the present application.
As a possible practical way, the above steps are exemplified below by taking the hue of the color as an example. As shown in fig. 6, the electronic device provides a plurality of attribute sequences to be displayed and two symbol arrays. The hue types mainly included in the attribute sequences to be displayed are "red", "green", "blue" and "yellow". The electronic device 100 sorts a plurality of two-dimensional code sequences to be displayed according to a sequence relationship between the plurality of attribute sequences to be displayed. The sequencing result is as follows:
"red-red", "green-blue", "blue-yellow" … … "red-yellow".
The two symbol arrays are a third symbol array 220 and a fourth symbol array 230. Based on the preset corresponding relationship between the color ordering of each to-be-displayed attribute sequence and each code element array, the electronic device 100 sequentially displays the first color in each to-be-displayed attribute sequence to the third code element array 220; the second color in each sequence of attributes to be displayed is displayed to the fourth symbol array 230. Thus, the electronic device 100 obtains the two-dimensional code sequence according to the display rule and the display result of the two symbol arrays.
It should be noted that the above-mentioned example is only one possible example provided by the embodiments of the present application for explanation, and does not represent that only the above-mentioned embodiments of the present application exist. Since the length of the binary code is positively correlated with the color type in the attribute sequence to be displayed and the number of colors in each attribute sequence to be displayed, the color type included in the attribute sequence to be displayed can be adaptively adjusted on the basis of the above example. Accordingly, the number of two-dimensional code columns can also be adjusted adaptively based on the above example, which does not need to be contributed creatively based on the technical solution disclosed in the present application.
Through the two-dimensional code generation method, the electronic device 100 provides a plurality of symbol arrays, and respectively displays the first attribute value in each acquired attribute sequence to be displayed to different symbol arrays based on a preset display strategy, so as to obtain a two-dimensional code sequence. The generated two-dimensional code sequence represents a specific binary code through the change of the first attribute value carried by the same position code element among the two-dimensional codes, and the length of the represented binary code is in positive correlation with the number of different first attribute values in the attribute sequence to be displayed and the sequence length of each attribute sequence to be displayed, so that the generated two-dimensional code sequence can carry more data compared with the two-dimensional code passing through the black and white block.
Considering that the generated two-dimensional code sequence is to convert the target data into a two-dimensional code for displaying in a manner of color attribute change characteristics, the target data needs to be converted into an attribute sequence to be displayed first. In view of the above, the electronic device 100 prestores the code correspondence between different attribute sequences and different binary codes, and step S100A includes:
step S100A-1, target data is acquired.
Step S100A-2, splitting the target data into a plurality of data fragments according to the length of the binary code.
When the target data is split, the target data needs to be split according to the length of the binary code, so that the split data fragments can be matched with the binary code, and then the corresponding attribute sequences are determined.
Step S100A-3, according to the coding correspondence, taking the attribute sequence corresponding to each data segment as a plurality of attribute sequences to be displayed, wherein the sequence relationship among the plurality of attribute sequences to be displayed corresponds to the sequence relationship among the data segments corresponding to the plurality of attribute sequences to be displayed.
Based on the above steps, brightness in color attributes is taken as an example, and a possible implementation manner is provided, and the above steps are exemplarily explained. Referring to fig. 7, the electronic device provides 4 brightness reds, which are 30, 60, 120, and 200, respectively; similarly, 4 brightnesses of blue are provided, 30, 60, 120 and 200, respectively; yellow of 2 lightness, 30 and 60 respectively, is provided. Because, in this embodiment, different binary encodings are characterized by different variations in lightness. Therefore, the hue and the tone scale do not affect the data expression, and therefore, 16 combinations of the above lightness can be arranged:
“30-30”、“30-60”、“30-120”、“30-200”;
“60-30”、“60-60”、“60-120”、“60-200”;
“120-30”、“120-60”、“120-120”、“120-200”;
“200-30”、“200-60”、“200-120”、“200-200”;
namely the above attribute sequence, the range of the characterized binary sequence is "0000-. The above example is only one possible example provided by the embodiments of the present application for explanation, and does not represent that only the above embodiments exist in the present application. Those skilled in the art can select other more brightness values to form the attribute sequence to be displayed according to actual requirements, and can adjust the sequence length in each attribute sequence to be displayed according to actual requirements.
Of course, as the number of different first attribute values increases, and the sequence length of each attribute sequence to be displayed increases, a single attribute sequence to be displayed may represent a longer binary code.
Taking the color as an example, another possible implementation is provided, and the above steps are exemplified. Referring to fig. 8, the electronic device provides 4 colors for composing the to-be-displayed attribute sequence, which respectively include red, green, blue, and yellow. And the number of colors in each sequence of attributes to be displayed is 2. The above-mentioned 4 colors of red, green, blue and yellow can constitute 16 color sequence combinations, which are:
"red-red", "red-green", "red-blue", "red-yellow";
"green-red", "green-green", "green-blue", "green-yellow";
"blue-red", "blue-green", "blue-blue", "blue-yellow";
"yellow-red", "yellow-green", "yellow-blue", "yellow-yellow".
I.e., the color sequence described above, the range of the characterized binary sequence is "0000-. The above example is only one possible example provided by the embodiments of the present application for explanation, and does not represent that only the above embodiments exist in the present application. The skilled person in the art can select other more kinds of colors to form the attribute sequence to be displayed according to actual requirements, and can adjust the number of colors in each attribute sequence to be displayed according to actual requirements.
Of course, as the color types increase and the sequence length in each attribute sequence to be displayed increases, a single attribute sequence to be displayed can represent a longer binary sequence.
For example, as a possible example, when the number of colors in each attribute sequence to be displayed is 3, 4 colors of the red, green, blue and yellow may be combined into 64 color sequence combinations, that is, the range of the characterized binary sequence is "0000000-.
As another possible example, 5 colors are provided for composing the sequence of attributes to be displayed, including red, green, blue, yellow, and purple, respectively. When the number of colors in each attribute sequence to be displayed is 2, the above-mentioned red, green, blue, yellow and purple can form 25 color sequence combinations, that is, the range of the characterized binary sequence is "00000-.
Based on the above two-dimensional code sequence generation method, in order to make the generated two-dimensional code carry more data, or in order to facilitate the identification device to identify and decode the generated two-dimensional code, a plurality of two-dimensional code sequences need to be provided.
Therefore, as a possible implementation manner, the embodiments of the present application provide that a plurality of symbol arrays are split into a plurality of symbol array groups, so as to characterize the same target data into a plurality of two-dimensional code sequences. Namely, the two-dimensional code sequences corresponding to different two-dimensional code array groups all carry the same target data. Since the generated two-dimensional code sequences include a plurality of two-dimensional codes, it is necessary to provide a way to distinguish two-dimensional codes belonging to the same two-dimensional code sequence among the plurality of two-dimensional codes.
In view of this, embodiments of the present application provide a two-dimensional code identification method, a two-dimensional code generation method, a two-dimensional code identification device, an electronic device, and a storage medium. According to the two-dimensional code generation method, the electronic equipment provides a plurality of code element arrays, and displays the first attribute value in each acquired attribute sequence to be displayed to different code element arrays respectively based on a preset display strategy to obtain the two-dimensional code sequence. The generated two-dimensional code sequence represents a specific binary code through the change of the first attribute value carried by the same position code element among the two-dimensional codes, and the length of the represented binary code is positively correlated with the number of different first attribute values in the attribute sequence to be displayed and the sequence length of each attribute sequence to be displayed. Therefore, when the electronic device recognizes the generated two-dimensional code sequence, more data can be obtained than the two-dimensional code by the black and white color block.
The symbol array also comprises a second identification symbol used for displaying grouping information, the display position of the second identification symbol in the symbol array divides the symbol arrays into a plurality of symbol array groups, wherein each symbol array group corresponds to the same target data, the second identification symbol in the same symbol array group is located at the same display position, and the grouping information is identified through a third attribute value.
Based on the symbol array group, an embodiment of the present application provides a method for identifying a decoding order of a two-dimensional code sequence corresponding to the symbol array group. Therefore, the two-dimensional code generation method further includes:
step S150A-a1 determines the arrangement order among the respective plurality of symbol array groups.
And S150A-A2, determining the display position of the second identification symbol in each symbol array group according to the preset symbol analysis sequence.
And displaying the second identification code element in a plurality of code element array groups according to the arrangement sequence, wherein the display positions of the second identification code element in the plurality of code element array groups form a specific movement track, and the movement track corresponds to the code element analysis sequence.
Step S150-a3, for each symbol array group, displays the third attribute value to the second identification symbol in the symbol array group.
And the display mode of the third attribute value is different from the display modes of other symbols in the symbol array to be subjected to display. Of course, the electronic device 100 may also select a display pattern that is not displayed by other code elements for displaying the second identification code element, and use the display result as the grouping information. Therefore, the display patterns displayed by other code elements can be prevented from generating interference on the grouping information and influencing the subsequent identification effect on the two-dimensional code sequence.
It should be noted that the third attribute value and the first attribute value may belong to the same color attribute, or may belong to different color attributes. The embodiments of the present application are not particularly limited.
Based on the above steps, the electronic device adjusts the position of each second identification symbol in each symbol array group based on the arrangement order among the symbol array groups, so that the second identification symbol presents a specific movement track when the two-dimensional code sequence corresponding to each symbol array group is displayed according to the arrangement order. Accordingly, the displayed grouping information also presents a specific movement track. Wherein, the moving track is the code element analysis sequence of the two-dimensional code.
Taking the lightness attribute of the color as an example, a possible example provided by the embodiment of the present application for the above steps is used to exemplify the above steps. Referring to fig. 9, a plurality of two-dimensional code sequences can be generated based on the above steps, as shown in fig. 9, 3 two-dimensional code sequences are selected and are respectively described as a first two-dimensional code sequence 300, a second two-dimensional code sequence 310 and a third two-dimensional code sequence 320, wherein each two-dimensional code carries the same target data.
As shown in fig. 9, the grouping information 330 includes three colors, red, blue and yellow, and the combined display pattern is different from the display patterns of other symbols in the two-dimensional code. That is, the third attribute value for representing the grouping information 330 is a hue attribute, the first attribute value for representing the binary code is a lightness attribute, and the two attribute values belong to color attributes with different dimensions.
As shown in fig. 9, compared to the first two-dimensional code sequence 300, the symbols occupied by the grouping information 330 are shifted by a distance of one symbol according to a specific track in the second two-dimensional code sequence 310; the symbols occupied by the grouping information 330 are also shifted by a distance of one symbol according to a specific track in the third two-dimensional code sequence 320 compared to the second two-dimensional code sequence 310.
The dotted line shown in fig. 10 is a moving track of the symbols occupied by the grouping information 330, and the track is a symbol parsing order of the two-dimensional code.
In addition, when the two-dimensional code is generated, different brightness values can be dynamically selected according to an actual use scene to represent the binary code; also, the electronic device for decoding need not record a specific luma value. The grouping information 330 carries different lightness by three colors, respectively. That is, after the display pattern recognition based on the grouping information 330 is successful, the electronic device for decoding extracts the luma values therein, i.e., knows all the luma values used for characterizing the binary code.
For example, the lightness value carried in red is "30", the lightness value carried in blue is "60", and the lightness value carried in yellow is "120". The electronic device for decoding may sort the extracted luma values in an increasing manner, i.e., "30, 60, 120". Then, the electronic device for decoding determines the coding correspondence between different attribute sequences and different two-level system codes based on a preset combination mode of the arrangement sequence.
For example, the first position corresponds to "0000" for the first position (30-30), the first position corresponds to "0001" for the second position (30-60), and the first position corresponds to "0010" for the third position (30-120).
And repeating the steps to obtain the code corresponding relation between the different attribute sequences and the different secondary system codes, and decoding the two-dimensional code sequence.
It should be noted that the movement trajectory only represents the general direction of the symbol sequence, and specifically how to decode along the general direction, and those skilled in the art can adapt according to the requirement. The number of symbols provided by the electronic device 100 for being a second identification symbol is not limited to 3. Accordingly, the colors displayed by the second identification symbols are not limited to red, blue and yellow. Those skilled in the art can perform adaptive adjustment according to actual requirements, as long as the display pattern of the grouping information 330 is different from the display patterns of other symbols in the two-dimensional code in the same two-dimensional code.
As another possible implementation, it is considered that as the amount of data carried by a single two-dimensional code sequence is limited, that is, one two-dimensional code sequence corresponds to a target data. When the data to be converted is large, a plurality of two-dimensional code sequences can be provided. In view of this, step S100A-1 includes:
and step S100A-1-1, acquiring data to be processed.
Step S100A-1-2, the data to be processed is split into a plurality of target data.
When splitting the data to be processed, as a possible implementation manner, the electronic device 100 may split the data according to the same data size, that is, the data size of each target data is the same.
As another possible implementation manner, the electronic device 100 may split the data to be processed into target data with different sizes, and the generated two-dimensional code sequence also has multiple sizes accordingly.
Since one target data generates a two-dimensional code sequence, a plurality of target data generates a plurality of two-dimensional code sequences, and each two-dimensional code sequence corresponds to a plurality of two-dimensional codes. Therefore, a plurality of target data generate a plurality of two-dimensional codes. When decoding a two-dimensional code, it is necessary to use a two-dimensional code sequence as a unit, and therefore, it is necessary to provide a method for distinguishing two-dimensional codes belonging to the same two-dimensional code sequence among a plurality of two-dimensional codes.
This is illustrated below with reference to fig. 11. The fourth two-dimensional code sequence 340 and the fifth two-dimensional code sequence 350 shown in fig. 11 correspond to different target data, respectively. Wherein, each two-dimensional code sequence includes 2 two-dimensional codes respectively. The electronic device 100 provides 3 symbols for displaying the grouping information 330. The grouping information 330 includes red, blue, and green. And, the display pattern of the grouping information 330 is distinguished from the display pattern of other symbols in the two-dimensional code. As shown in fig. 11, the symbols occupied by the grouping information 330 are located at different positions between the fourth two-dimensional code sequence 340 and the fifth two-dimensional code sequence 350. In the same two-dimensional code sequence, the symbols occupied by the grouping information 330 are located at the same position.
In view of the above requirement, each symbol array provided by the electronic device 100 further includes a second identification symbol for displaying the grouping information 330, where a display position of the second identification symbol in the symbol array divides the plurality of symbol arrays into a plurality of symbol array groups, where each symbol array group corresponds to each target data one to one, the second identification symbols in the same symbol array group are located at the same display position, and the grouping information 330 is identified by a third attribute value. The two-dimensional code generation method further comprises the following steps:
steps S150A-B1, for each symbol array group, display a third attribute value to the second identification symbol in the symbol array group.
And the display mode of the third attribute value is different from the display modes of other symbols in the symbol array.
Since the positions of the second identification symbols are the same between different symbol array groups, the symbols occupied by the grouping information 330 are also located at different positions between the generated different two-dimensional code sequences. And, in the same two-dimensional code sequence, the symbols occupied by the grouping information 330 are located at the same position. In this way, two-dimensional codes belonging to the same two-dimensional code sequence can be bound by the display position of the grouping information 330.
Of course, the electronic device 100 may also select a display pattern that is not displayed by other code elements for displaying the second identification code element, and use the display result as the grouping information 330. Therefore, the display patterns of other code elements can be prevented from interfering the packet information 330 and affecting the subsequent identification effect of the two-dimensional code sequence.
It should be understood that the number of symbols provided by the electronic device 100 for being a second identification symbol is not limited to 3. Accordingly, the colors displayed by the second identification symbols are not limited to red, blue and yellow. Those skilled in the art can perform adaptive adjustment according to actual requirements, as long as the display pattern of the grouping information 330 is different from the display patterns of other symbols in the two-dimensional code in the same two-dimensional code.
The electronic device 100 determines the second identification symbol in each symbol array group based on a specific position strategy, as a possible implementation. The electronic device 100 randomly assigns the second identification symbol in each symbol array group.
As another possible implementation manner, the electronic device 100 determines the position of the second identification symbol in each corresponding symbol array group according to the display order when each two-dimensional code sequence is displayed, so that when each generated two-dimensional code sequence is displayed, the grouping information 330 displayed by the second identification symbol moves in a specific direction between the two-dimensional code sequences.
Considering that there is an arrangement order of the colors in each to-be-displayed attribute sequence and the colors at the same sequence position in the to-be-displayed attribute sequence are displayed in the same symbol array, the arrangement order of the colors in each to-be-displayed attribute sequence determines that there is a specific sequence relationship between the two-dimensional codes in the generated two-dimensional code sequence. Therefore, it is also necessary to identify the sequence position between the two-dimensional codes in the same generated two-dimensional code sequence.
In addition, when there are a plurality of two-dimensional code sequences and each two-dimensional code sequence corresponds to a different number of targets, the sequence relationship between the plurality of target data causes the sequence relationship between the plurality of two-dimensional code sequence data to exist in the same way, and therefore, it is necessary to identify the sequence relationship between the two-dimensional code sequences.
In view of this, in order to identify the sequence relationship between the two-dimensional codes in the same two-dimensional code sequence, each symbol array further includes a first identification symbol for displaying sequence information, where the sequence information represents different sequence positions by a plurality of second attribute values, respectively. Therefore, the two-dimensional code generation method further includes:
step S160A, respectively displaying a plurality of second attribute values to each first identification symbol according to the preset corresponding relationship between the arrangement order of the first attribute values in each attribute sequence to be displayed and each symbol array.
The sequence relation between the two-dimensional codes in the same two-dimensional code sequence is characterized by a plurality of second attribute values. In a possible implementation manner, taking a two-dimensional code sequence including 2 two-dimensional codes and a hue attribute as an example, the plurality of second attribute values are respectively white and black, wherein white represents that the sequence position is 1, and black identifies that the sequence position is 2.
It should be noted that, those skilled in the art may also select other second attribute values to identify the sequence relationship between the two-dimensional codes in the same two-dimensional code sequence according to actual requirements. In addition, the second attribute may belong to the same color attribute as the first attribute value, or may belong to different color attributes respectively.
Moreover, according to the number of the two-dimensional codes in the same two-dimensional code sequence, more second attribute values may be selected to identify the sequence relationship between the two-dimensional codes in the same two-dimensional code sequence (for example, when there are 3 two-dimensional codes in the same two-dimensional code sequence, 3 different second attribute values may be selected to identify the sequence relationship between the two-dimensional codes). Which do not need to make inventive contributions based on the technical solutions disclosed in the present application.
As shown in fig. 12, the symbol array for displaying the first attribute value in the attribute sequence to be displayed, wherein the first identification symbol 400 displays white; and a symbol array for displaying a second attribute value in the attribute sequence to be displayed, wherein the first identification symbol 400 displays black.
It should be understood that the electronic device 100 treats the symbol at a specific position in the symbol array as the first identification symbol 400. The specific position may be an absolute position in the symbol array or may be a relative position in the symbol array.
Referring to fig. 12 again, taking the absolute position as an example, the electronic device 100 uses the last symbol in the symbol array according to the symbol parsing order as the first identification symbol 400. Of course, those skilled in the art can select other absolute position symbols as the first identification symbol 400 according to actual requirements, which do not need to make any inventive contribution based on the technical solution disclosed in the present application.
Taking the relative position as an example, as another possible example, as shown in fig. 13, the position of the first identification symbol 400 varies with the position of the second identification symbol for displaying the grouping information 330. That is, when there are a plurality of two-dimensional code sequences, the electronic device 100 determines the position of the first identification symbol 400 according to a preset relative positional relationship between the first identification symbol 400 and the second identification symbol after determining the position of the second identification symbol in the symbol array based on the relative positional relationship.
Referring again to fig. 13, the first identification symbol 400 for displaying the sequence information is located at the upper left corner of the rectangular region occupied by the second identification symbol for displaying the grouping information 330.
Further, in the embodiment of the present application, in order to mark the sequence relationship between the two-dimensional code sequences, each symbol array further includes a number symbol for displaying number information at a preset position; the serial number information represents the sequence position of the target data in the data to be processed. The two-dimensional code identification method further comprises the following steps:
step S170A is to determine, for each target data, the number of the target data and the corresponding target symbol array group.
Step S180A, obtaining an attribute sequence corresponding to the number of the target data as a number attribute sequence according to the coding correspondence.
Step S190A, according to the preset corresponding relationship between the arrangement order of the first attribute values in the number attribute sequence and each symbol array in the target symbol array group, assigning each first attribute value in the number attribute sequence to a different number symbol.
Through the above steps, the electronic device 100 uses the code element at the preset position in the code element array as a number code element, and is configured to display the sequence position of the target data carried by the two-dimensional code sequence corresponding to the code element array in the data to be processed.
The number symbol may have a relative position in the symbol array as a way of selecting the first identification symbol 400, or an absolute position in the symbol array as a way of selecting the first identification symbol 400, as well as the first identification symbol 400 for displaying sequence information. The person skilled in the art can choose according to the actual needs, and also does not need to make inventive contributions based on the technical solutions disclosed in the present application.
Each two-dimensional code in the generated two-dimensional code sequence comprises a first array direction and a second array direction. Therefore, if the symbol analysis order is not specified, each two-dimensional code includes at least 8 symbol analysis orders. Therefore, based on the grouping information, the number information, and the sequence information, the electronic device 100 needs to provide decoding information indicating the order of symbol analysis in the two-dimensional code when generating the two-dimensional code sequence.
As a possible implementation manner, since the color characteristics of the grouping information 330 are different from the characteristics displayed by other symbols, the grouping information 330 can be used to distinguish the two-dimensional code sequences, and the arrangement of the second identification symbols used to display the grouping information 330 can be adjusted, so that the grouping information 330 can also be used to indicate the symbol parsing order of the symbols in the two-dimensional code.
As a possible implementation manner, the grouping information 330 occupies at least three code elements in the two-dimensional code to which the grouping information 330 belongs, and the at least three code elements are in a preset arrangement manner and used for identifying the positioning information of the two-dimensional code to which the grouping information 330 belongs.
Referring to fig. 14, fig. 15 shows an example of three symbols occupied by the grouping information 330 in the two-dimensional code. As shown in fig. 14, one of the three symbols is arranged adjacent to the other two symbols in an "L" shape, which indicates a first array direction 500 and a second array direction 510 of the two-dimensional code, respectively. Through the arrangement mode of the L shape, the two-dimensional code positioning information is indicated, and the code element analysis sequence is further determined according to a preset decoding strategy.
As shown in fig. 15, the three symbols are distributed at intervals; the two-dimensional code is arranged in an "L" shape along the first array direction 500 and the second array direction 510, respectively, and indicates the first array direction 500 and the second array direction 510 of the two-dimensional code, respectively. And indicating the positioning information of the two-dimensional code through an L-shaped arrangement mode, and further determining a code element analysis sequence according to a preset decoding strategy.
Based on the at least one two-dimensional code sequence generated in the above manner, the two-dimensional code generation method further includes:
step S200A, providing a display medium;
in step S210A, each two-dimensional code in the two-dimensional code sequence is displayed on a display medium.
It should be understood that the display medium may be an electronic display screen, a projection, a static medium, etc. Taking an electronic display screen as an example, the electronic display screen displays two-dimensional codes in at least one generated two-dimensional code sequence at the same position of the screen in a circulating manner. Of course, the display can be cycled between different positions on the display screen.
Taking the projection method as an example, the projector projects the two-dimensional code in the generated at least one two-dimensional code sequence to a specific display medium for circular display.
Of course, all the two-dimensional codes in the generated at least one two-dimensional code sequence may be printed on a specific material for display.
Taking the two-dimensional code sequence generated by the two-dimensional code generation method as a target two-dimensional code sequence, an embodiment of the present application further provides a two-dimensional code identification method, which is used for identifying the target two-dimensional code sequence and is applied to the electronic device 100. The electronic equipment prestores corresponding coding relations between different attribute sequences and different binary codes, wherein the attribute sequences are variation characteristics among a plurality of first attribute values belonging to the same target color attribute. The following describes in detail the steps of the two-dimensional code identification method with reference to fig. 16.
In step S100B, a target two-dimensional code sequence is acquired.
The target two-dimensional code sequence comprises a plurality of target two-dimensional codes with sequence relation;
step S130B, according to the target color attributes, extracting first attribute values carried by the code elements at the same position of each target two-dimensional code, and obtaining a plurality of attribute sequences to be identified.
And the arrangement order among the first attribute values in each attribute sequence to be identified corresponds to the sequence relation.
Step S170B, sequentially determining binary codes corresponding to the attribute sequences to be identified according to the code correspondence and the symbol parsing order, and obtaining target data carried by the target two-dimensional code sequence.
The color attributes include hue, gradation, lightness, and the like of a color. As a possible implementation manner, the brightness is taken as an example, and the above steps are exemplified below. Referring to fig. 17 and 7, fig. 17 is a target two-dimensional code sequence generated by characterizing binary codes based on lightness variations. The two-dimensional code specifically comprises 2 two-dimensional codes which belong to a target two-dimensional code sequence. The placing sequence of the 2 two-dimensional codes is the sequence relation between the two-dimensional codes. As shown in fig. 17, the symbol analysis order of the two-dimensional codes is to decode the two-dimensional codes from the upper left corner of the two-dimensional code into an "S" shaped trace.
The electronic device 100 extracts the first attribute value at the same position of the 2 two-dimensional codes based on the 2 two-dimensional symbol analysis order shown in fig. 17, and can obtain the corresponding attribute order as follows:
"red (120) -red (120)", "red (30) -blue (60)", "blue (60) -yellow (200)", "red (120) -red (120)";
"red (30) -blue (60)", "red (30) -red (30)", "red (120) -red (30)", "yellow (200) -blue (60)";
"blue (60) -red (30)", "red (30) -red (120)", "yellow (200) -blue (60)", "red (120) -red (120)";
"yellow (200) -yellow (200)", "red (30) -red (30)", "blue (60) -red (120)", and "red (120) -blue (60)".
The electronic device 100 converts the extracted attribute sequence to be identified into a corresponding binary code, that is, target data corresponding to the target two-dimensional code sequence, in combination with the code correspondence between different attribute sequences and different binary codes shown in fig. 7. The specific binary code is:
“1010 0100 1101 11100100 0000 0010 0111 0001 1000 0111 1010 111100001001 0110”
as another possible implementation manner, the above steps are exemplified below by taking the color as an example. Referring to fig. 18 and 8, fig. 18 is a target two-dimensional code sequence generated based on hue change characterization binary coding. The two-dimensional code specifically comprises 2 two-dimensional codes which belong to a target two-dimensional code sequence. The placing sequence of the 2 two-dimensional codes is the sequence relation between the two-dimensional codes. As shown in fig. 18, the symbol analysis order of the two-dimensional codes is to decode the two-dimensional codes from the upper left corner of the two-dimensional code into an "S" shaped trace.
The electronic device 100 extracts the first attribute value at the same position of the 2 two-dimensional codes based on the 2 two-dimensional symbol analysis order shown in fig. 17, and can obtain the corresponding attribute order as follows:
"red-red", "green-blue", "blue-yellow", "red-red";
"green-blue", "green-green", "red-green", "yellow-blue";
"blue-green", "green-red", "yellow-blue", "red-red";
"yellow-yellow", "green-green", "blue-red" and "red-yellow".
The electronic device 100 converts the extracted color sequence into a corresponding binary code, i.e., target data corresponding to the target two-dimensional code sequence, by combining the code correspondence between different attribute sequences and different binary codes shown in fig. 8. The specific binary code is:
“0000、0110、1011、0000、0110、0101、0001、1110、1001、0100、1110、0000、1111、0101、1000、0011”
the sequence relation among the colors in the color sequence to be recognized is considered to depend on the sequence relation among the two-dimensional codes in the target two-dimensional code sequence. Therefore, each target two-dimensional code displays sequence information, and the sequence information represents different sequence positions through a plurality of second attribute values. Before step S130B, the two-dimensional code recognition method further includes:
in step S110B, the second attribute value in each target two-dimensional code is detected.
Step S120B, determining a sequence relationship between the target two-dimensional code sequences according to the sequence positions corresponding to the second attribute values.
In the embodiment of the present application, sequence positions between the target two-dimensional codes in the same target two-dimensional code sequence are represented by a plurality of second attribute values. As shown in fig. 12 or 13, in the two-dimensional code sequence generated by the two-dimensional code generation method, the sequence relationship between 2 two-dimensional codes indicates that the sequence position is 1 in white and the sequence position is 2 in black.
Based on the description of the sequence information, the electronic device 100 identifies the sequence position of each target two-dimensional code in the target two-dimensional code sequence by the plurality of second attribute values. Therefore, when each target two-dimensional code in the target two-dimensional code sequence is identified, the sequence relationship between the target two-dimensional codes is determined by the detected second attribute value in each target two-dimensional code.
When a plurality of target two-dimensional code sequences exist, a single target two-dimensional code sequence comprises a plurality of target two-dimensional codes. Therefore, before performing the identification, a grouping relationship needs to be determined from the plurality of to-be-processed two-dimensional codes, and a plurality of target two-dimensional code sequences need to be split from the grouping relationship. Therefore, step S100B includes:
and step S100B-1, acquiring a plurality of to-be-processed two-dimensional codes.
And the grouping information 330 is displayed on each two-dimensional code to be processed, the grouping information 330 is identified through a third attribute value, and the display style of the third attribute value is different from the display styles of other code elements of the two-dimensional code to be processed.
Step S100B-2, detecting a third attribute value in each to-be-processed two-dimensional code, and obtaining grouping information 330 between multiple to-be-processed two-dimensional codes.
Step S100B-3, the two-dimensional codes to be processed are split into a plurality of target two-dimensional code sequences according to the grouping information 330 between the two-dimensional codes to be processed.
And displaying the third attribute value at the same position by each target two-dimensional code in the same target two-dimensional code sequence.
The grouping information 330 can be described in detail with reference to the grouping information 330 in the process of generating the two-dimensional code sequence by the two-dimensional code generation method shown in fig. 9, 10, and 11.
Due to the fact that a plurality of target two-dimensional code sequences exist, each target two-dimensional code sequence can carry the same target data, and each target two-dimensional code sequence can also carry different target data.
As a possible implementation manner, each target two-dimensional code sequence carries the same target data. When each target two-dimensional code sequence is displayed, the display position of the symbol displaying the third attribute value in each target two-dimensional code sequence is a specific movement track, and the movement track corresponds to the symbol analysis order. Therefore, the two-dimensional code recognition method includes, before step S170B:
in step S140B-a, the third attribute value in each target two-dimensional code sequence is detected.
Step S150B-a is to obtain a movement trajectory according to the display position of each third attribute value in each target two-dimensional code sequence.
Step S160B-a, a symbol parsing order is obtained according to the movement trajectory.
When each target two-dimensional code sequence carries the same target data, specific description about binding a plurality of target two-dimensional codes into different target two-dimensional code sequences through a third attribute value and providing a preset symbol parsing order may refer to the related description in fig. 9 and fig. 10.
It should be noted that the third attribute value used for characterizing the grouping information 330 may be the same as or different from the first attribute value used for characterizing the binary code.
Taking the target color attribute as lightness of a color as an example, when the third attribute value is the same as the first attribute value, the display style carrying the third attribute value can be adjusted from the dimension of the hue, so as to be different from the display styles of other symbols. For example, selecting specific colors, and adjusting the brightness of each color to the third attribute value. The electronic equipment can accurately determine the grouping information 330 in one two-dimensional code based on the characteristic that the display style carrying the third attribute value is different from the display styles of other code elements; and extracting the carried third attribute value.
Since the third attribute value is identical to the first attribute value, the third attribute value corresponds to the number of the first attribute values. The electronic equipment takes the extracted third attribute values as first attribute values and sorts the first attribute values in a brightness increasing mode; according to the sorting result, the corresponding relation between different attribute sequences and different binary codes is obtained according to the preset combination mode of the sorting positions (for example, the first position and the second position, the first position and the third position, the first position and the fourth position, and the like correspond to different binary codes respectively).
For example, the first attribute values include 120, 60, 200, and 30. The result of sorting the corresponding first attribute values in a brightness increasing manner is as follows:
“30、60、120、200”
based on the preset combination, it may be determined that the binary code of the first attribute value corresponding to the first attribute value (30-30) is "0001", the binary code of the first attribute value corresponding to the second attribute value (30-90) is "0001", the binary code of the first attribute value corresponding to the third attribute value (30-120) is "0010", and the binary code of the first attribute value corresponding to the fourth attribute value (30-200) is "0011".
Repeating the above steps to obtain binary codes corresponding to all permutation combinations of 30, 60, 120 and 200. Due to the preset combination mode based on the sequencing position, the electronic equipment does not need to record a specific third attribute value, and the flexibility of selecting the first attribute value can be improved.
As another possible implementation manner, each target two-dimensional code sequence carries different target data, the third attribute values include at least three, and the code elements occupied by the third attribute values in the target two-dimensional code to which the third attribute values belong are in a preset arrangement manner, which is used as the locators in the target two-dimensional code to which the third attribute values belong, so that the two-dimensional code identification method includes, before step S170B:
and step S140B-B, detecting a third attribute value in each target two-dimensional code.
Step S150B-B, determining the symbol analysis order of the target two-dimensional code to which the third attribute value belongs according to the arrangement mode of the symbols occupied by the third attribute value in the target two-dimensional code to which the third attribute value belongs.
When each target two-dimensional code sequence carries different target data, a specific description about binding a plurality of target two-dimensional codes into different target two-dimensional code sequences through a third attribute value and providing a preset symbol parsing order may refer to the related descriptions in fig. 13 and fig. 14.
It should be understood that, in actual use, the target two-dimensional code may present different display modes or placement modes due to various factors, and therefore, before decoding, it is necessary to determine the correct display mode or placement mode of the target two-dimensional code. In this embodiment of the application, the grouping information 330 may not only group a plurality of to-be-processed two-dimensional codes by a display pattern different from other symbols, but also may be used to indicate a symbol parsing order of the two-dimensional codes.
In addition, it is considered that different target two-dimensional code sequences correspond to different target data, and a specific sequence relationship exists between the target data. Therefore, each target two-dimensional code sequence carries number information, and the number information is represented by the change between the first attribute values. As a possible implementation manner, the two-dimensional code recognition method further includes:
step S180B: and aiming at each target two-dimensional code sequence, extracting a first attribute value of a preset position of each target two-dimensional code in the target two-dimensional code sequence according to the target color attribute, and obtaining a serial number attribute sequence.
Step S190B: and determining the number information corresponding to the number attribute sequence according to the coding correspondence.
Step S200B: and combining the target data carried by each target two-dimensional code sequence according to the number information of each target two-dimensional code sequence to obtain the data carried by a plurality of target two-dimensional code sequences.
Through the above steps, the electronic device 100 extracts, according to the target color attributes, the first attribute value of the preset position in each target two-dimensional code sequence, and obtains the number color sequence. Since the color sequence corresponds to a binary code, the corresponding value of the binary code is used to identify the sequence position of the target two-dimensional code sequence corresponding to the target data.
Further, the electronic device 100 combines the target data based on the sequence position of each target data to obtain data carried by a plurality of target two-dimensional code sequences.
The embodiment of the application further provides a two-dimensional code generation device, which is applied to the electronic device 100. Referring to fig. 19, the two-dimensional code recognition apparatus includes at least one functional module that can be stored in the memory 120 in a software form. Functionally divided, the two-dimensional code generating device includes:
the sequence obtaining module 1110A is configured to obtain a plurality of attribute sequences to be displayed having a sequence relationship, where the attribute sequences to be displayed are variation characteristics between a plurality of first attribute values belonging to a same target color attribute, different attribute sequences to be displayed respectively correspond to different binary codes, and a length of the binary code is positively correlated with a number of the different first attribute values in the attribute sequences to be displayed and a sequence length of each attribute sequence to be displayed.
In the embodiment of the present application, the sequence acquiring module 1110A is configured to execute step S100A in fig. 3, and as to the detailed description of the sequence acquiring module 1110A, reference may be made to the detailed description of step S100A.
A sequence processing module 1101A, configured to provide a plurality of symbol arrays, where each symbol array includes data symbols corresponding to the number of attribute sequences to be displayed;
the sequence processing module 1101A is further configured to determine, for each attribute sequence to be displayed, a target data symbol from each symbol array according to a sequence relationship; the sequence position of each target data code element in the data code element corresponds to the sequence position of the attribute sequence to be displayed;
the sequence processing module 1101A is further configured to respectively display each first attribute value in the attribute sequence to be displayed to each target data symbol according to a preset corresponding relationship between an arrangement order of the first attribute values in each attribute sequence to be displayed and each symbol array;
the sequence processing module 1101A is further configured to obtain a two-dimensional code sequence according to a display result of each data symbol in the plurality of symbol arrays.
In the embodiment of the present application, the sequence processing module 1101A is configured to execute step S140A in fig. 3, and as to the detailed description of the sequence acquiring module 1110A, reference may be made to the detailed description of step S140A.
The embodiment of the present application further provides a two-dimensional code recognition apparatus, which is applied to an electronic device 100, where the electronic device prestores code correspondence between different attribute sequences and different binary codes, where an attribute sequence is a change characteristic between a plurality of first attribute values belonging to a same target color attribute. Referring to fig. 20, the two-dimensional code recognition apparatus includes at least one functional module that can be stored in the memory 120 in a software form. Functionally divided, the two-dimensional code recognition apparatus includes:
the two-dimensional code acquisition module 1101B is configured to acquire a target two-dimensional code sequence, where the target two-dimensional code sequence includes multiple target two-dimensional codes in a sequence relationship.
In the embodiment of the present application, the two-dimensional code acquisition module 1101B is configured to execute step S100B in fig. 16, and as to the detailed description of the two-dimensional code acquisition module 1101B, reference may be made to the detailed description of step S100B.
The two-dimensional code processing module 1102B is configured to extract, according to the target color attribute, first attribute values carried by code elements at the same position of each target two-dimensional code, and obtain a plurality of attribute sequences to be identified, where an arrangement order between the first attribute values in each attribute sequence to be identified corresponds to a sequence relationship;
the two-dimensional code processing module 1102B is further configured to sequentially determine binary codes corresponding to the attribute sequences to be identified according to the code element parsing order according to the code correspondence, and obtain target data carried by the target two-dimensional code sequence.
In the embodiment of the present application, the two-dimensional code processing module 1102B is configured to perform steps S110B-S170B in fig. 16, and for a detailed description of the two-dimensional code processing module 1102B, reference may be made to the detailed description of steps S110B-S170B.
The embodiment of the present application further provides an electronic device 100, where the electronic device 100 includes a processor 130 and a memory 120; the memory 120 stores computer-executable instructions that, when executed by the processor 130, implement a two-dimensional code recognition method or a two-dimensional code generation method.
The embodiment of the present application further provides a storage medium, where a computer program is stored, and when the computer program is executed by the processor 130, the two-dimensional code recognition method or the two-dimensional code generation method is implemented.
In summary, the embodiments of the present application provide a two-dimensional code identification method, a two-dimensional code generation method, a two-dimensional code identification device, an electronic device, and a storage medium. According to the two-dimensional code generation method, the electronic equipment provides a plurality of code element arrays, and displays the first attribute value in each acquired attribute sequence to be displayed to different code element arrays respectively based on a preset display strategy to obtain the two-dimensional code sequence. The generated two-dimensional code sequence represents a specific binary code through the change of the first attribute value carried by the same position code element among the two-dimensional codes, and the length of the represented binary code is positively correlated with the number of different first attribute values in the attribute sequence to be displayed and the sequence length of each attribute sequence to be displayed. Therefore, when the electronic device recognizes the generated two-dimensional code sequence, more data can be obtained than the two-dimensional code by the black and white color block.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, 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.
In addition, functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The above description is only for various embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of changes or substitutions within the technical scope of the present application, and all such changes or substitutions are included in the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (20)

1. A two-dimension code identification method is applied to electronic equipment, wherein the electronic equipment prestores code corresponding relations between different attribute sequences and different binary codes, wherein the attribute sequences are variation characteristics among a plurality of first attribute values belonging to the same target color attribute, and the method comprises the following steps:
acquiring a target two-dimensional code sequence, wherein the target two-dimensional code sequence comprises a plurality of target two-dimensional codes with sequence relation;
extracting first attribute values carried by code elements at the same position of each target two-dimensional code according to the target color attributes to obtain a plurality of attribute sequences to be identified, wherein the arrangement order of the first attribute values in each attribute sequence to be identified corresponds to the sequence relation;
and according to the code corresponding relation, sequentially determining binary codes corresponding to the attribute sequences to be identified according to a code element analysis sequence, and obtaining target data carried by the target two-dimensional code sequence.
2. The two-dimensional code recognition method according to claim 1, wherein each target two-dimensional code displays sequence information, and the sequence information represents different sequence positions by a plurality of second attribute values, respectively;
before extracting the first attribute value displayed by the code element at the same position of each target two-dimensional code according to the target color attribute, the method further includes:
detecting the second attribute value in each target two-dimensional code;
and determining the sequence relation among the target two-dimensional code sequences according to the sequence positions corresponding to the second attribute values.
3. The two-dimensional code recognition method of claim 1, wherein the step of obtaining the target two-dimensional code sequence comprises:
acquiring a plurality of to-be-processed two-dimensional codes, wherein each to-be-processed two-dimensional code is displayed with grouping information, the grouping information is identified through a third attribute value, and the display style of the third attribute value is different from the display styles of other code elements of the to-be-processed two-dimensional code;
detecting the third attribute value in each two-dimensional code to be processed to obtain grouping information among the multiple two-dimensional codes to be processed;
and splitting the two-dimensional codes to be processed into a plurality of target two-dimensional code sequences according to grouping information among the two-dimensional codes to be processed, wherein each target two-dimensional code in the same target two-dimensional code sequence displays the third attribute value at the same position.
4. The two-dimensional code recognition method of claim 3, wherein each of the target two-dimensional code sequences carries the same target data; when each target two-dimensional code sequence is displayed, a display position of a color carrying the third attribute value in each target two-dimensional code sequence forms a specific moving track, and the moving track corresponds to the code element analysis sequence;
before sequentially determining the binary codes corresponding to the attribute sequences to be identified according to the code corresponding relation and the code element analysis sequence, the method comprises the following steps:
detecting the third attribute value in each of the target two-dimensional code sequences;
obtaining the movement track according to the display position of each third attribute value in each target two-dimensional code sequence;
and obtaining the code element analysis sequence according to the movement track.
5. The two-dimensional code recognition method of claim 3, wherein each of the target two-dimensional code sequences carries different target data; the third attribute values comprise at least three, and code elements occupied by the third attribute values in the target two-dimensional code are in a preset arrangement mode and used as locators in the target two-dimensional code to which the third attribute values belong;
before sequentially determining the binary codes corresponding to the attribute sequences to be identified according to the code corresponding relation and the code element analysis sequence, the method comprises the following steps:
detecting the third attribute value in each target two-dimensional code;
and determining the code element analysis sequence of the target two-dimensional code to which the third attribute value belongs according to the arrangement mode of the code elements occupied by the third attribute value in the target two-dimensional code to which the third attribute value belongs.
6. The two-dimensional code identification method according to claim 5, wherein each of the target two-dimensional code sequences carries numbering information, the numbering information being characterized by a change between the first attribute values, the method further comprising:
for each target two-dimensional code sequence, extracting a first attribute value of a preset position of each target two-dimensional code in the target two-dimensional code sequence according to the target color attribute to obtain a number attribute sequence;
determining the number information corresponding to the number attribute sequence according to the coding corresponding relation;
and combining the target data carried by each target two-dimensional code sequence according to the number information of each target two-dimensional code sequence to obtain data carried by a plurality of target two-dimensional code sequences.
7. The two-dimensional code recognition method according to claim 1, wherein the target color attribute is lightness or hue of color.
8. A two-dimensional code generation method is applied to electronic equipment, and comprises the following steps:
acquiring a plurality of attribute sequences to be displayed with a sequence relationship, wherein the attribute sequences to be displayed are variation characteristics among a plurality of first attribute values belonging to the same target color attribute, different attribute sequences to be displayed respectively correspond to different binary codes, and the length of the binary codes is positively correlated with the number of the different first attribute values in the attribute sequences to be displayed and the sequence length of each attribute sequence to be displayed;
providing a plurality of code element arrays, wherein each code element array respectively comprises data code elements corresponding to the number of the attribute sequences to be displayed;
determining a target data code element from each code element array according to the sequence relation aiming at each attribute sequence to be displayed; the sequence position of each target data code element in the data code element corresponds to the sequence position of the attribute sequence to be displayed;
respectively displaying each first attribute value in the attribute sequence to be displayed to each target data code element according to the arrangement sequence of the first attribute values in each attribute sequence to be displayed and the preset corresponding relation between each code element array;
and obtaining a two-dimensional code sequence according to the display result of each data code element in the plurality of code element arrays.
9. The two-dimensional code generating method according to claim 8, wherein each of the symbol arrays further includes a first identification symbol for displaying sequence information, wherein the sequence information respectively represents different sequence positions by a plurality of second attribute values, the method further comprising:
and respectively displaying the plurality of second attribute values to each first identification code element according to the arrangement sequence of the first attribute values in each attribute sequence to be displayed and the preset corresponding relation between each code element array.
10. The two-dimensional code generation method according to claim 8, wherein the electronic device prestores code correspondence between different attribute sequences and different binary codes, and the step of acquiring the plurality of attribute sequences to be displayed having sequence relationships includes:
acquiring target data;
splitting the target data into a plurality of data fragments according to the length of the binary code;
and according to the coding corresponding relation, taking the attribute sequence corresponding to each data fragment as the plurality of attribute sequences to be displayed, wherein the sequence relation among the plurality of attribute sequences to be displayed corresponds to the sequence relation among the data fragments corresponding to the plurality of attribute sequences to be displayed.
11. The two-dimensional code generation method according to claim 10, wherein each of the symbol arrays further includes a second identification symbol for displaying grouping information, a display position of the second identification symbol in the symbol array divides the symbol arrays into a plurality of symbol array groups, wherein each of the symbol array groups corresponds to the target data, the second identification symbols in the same symbol array group are located at the same display position, and the grouping information is identified by a third attribute value;
determining an arrangement order between each of the plurality of symbol array groups;
determining the display positions of the second identification symbols in each symbol array group according to a preset symbol analysis sequence, wherein the display positions of the second identification symbols in the plurality of symbol array groups form a specific movement track according to the arrangement sequence, and the movement track corresponds to the symbol analysis sequence;
for each of the symbol array groups, displaying the third attribute value to a second identification symbol in the symbol array group; and the display mode of the third attribute value is different from the display modes of other symbols in the symbol array to be coded.
12. The two-dimensional code generation method according to claim 10, wherein the step of acquiring target data includes:
acquiring data to be processed;
and splitting the data to be processed into a plurality of target data.
13. The two-dimensional code generation method according to claim 12, wherein each of the symbol arrays further includes a second identification symbol for displaying grouping information, a display position of the second identification symbol in the symbol array divides the symbol arrays into a plurality of symbol array groups, wherein each of the symbol array groups corresponds to each of the target data one to one, the second identification symbols in the same symbol array group are located at the same display position, and the grouping information is identified by a third attribute value;
for each of the symbol array groups, displaying the third attribute value to a second identification symbol in the symbol array group; wherein the display style of the third attribute value is different from the display styles of other symbols in the symbol array.
14. The method according to claim 13, wherein the third attribute values include at least three, and the symbols occupied by the third attribute values in the symbol array to which the third attribute values belong are arranged in a predetermined arrangement manner, and are used as locators of the two-dimensional code corresponding to the symbol array to which the third attribute values belong.
15. The two-dimensional code generation method according to claim 12, wherein each of the symbol arrays further includes a number symbol for displaying number information at a preset position; wherein the number information characterizes a sequence position of the target data in the data to be processed, the method further comprising:
for each target data, determining the number of the target data and a corresponding target code element array group;
acquiring an attribute sequence corresponding to the number of the target data as a number attribute sequence according to the coding corresponding relation;
and distributing each first attribute value in the numbering attribute sequence to different numbering code elements according to the arrangement sequence of the first attribute values in the numbering attribute sequence and the preset corresponding relation between the code element arrays in the target code element array group.
16. The two-dimensional code generation method according to claim 8, further comprising:
providing a display medium;
and displaying each two-dimensional code in the two-dimensional code sequence through the display medium.
17. A two-dimensional code recognition device is applied to electronic equipment, wherein the electronic equipment prestores code corresponding relations between different attribute sequences and different binary codes, the attribute sequences are variation characteristics among a plurality of first attribute values belonging to the same target color attribute, and the two-dimensional code recognition device comprises:
the device comprises a two-dimensional code acquisition module, a two-dimensional code acquisition module and a two-dimensional code acquisition module, wherein the two-dimensional code acquisition module is used for acquiring a target two-dimensional code sequence, and the target two-dimensional code sequence comprises a plurality of target two-dimensional codes with a sequence relation;
the two-dimensional code processing module is used for extracting first attribute values carried by code elements at the same position of each target two-dimensional code according to the target color attributes to obtain a plurality of attribute sequences to be identified, wherein the arrangement order of the first attribute values in each attribute sequence to be identified corresponds to the sequence relation;
and the two-dimensional code processing module is further configured to sequentially determine binary codes corresponding to the attribute sequences to be identified according to the code element analysis sequence according to the code correspondence, and obtain target data carried by the target two-dimensional code sequence.
18. The two-dimensional code generation device is applied to electronic equipment, and comprises:
the display device comprises a sequence acquisition module, a display module and a display module, wherein the sequence acquisition module is used for acquiring a plurality of attribute sequences to be displayed with a sequence relation, the attribute sequences to be displayed are variation characteristics among a plurality of first attribute values belonging to the same target color attribute, different attribute sequences to be displayed respectively correspond to different binary codes, and the length of the binary codes is positively correlated with the number of the different first attribute values in the attribute sequences to be displayed and the sequence length of each attribute sequence to be displayed;
a sequence processing module, configured to provide a plurality of symbol arrays, where each symbol array includes data symbols corresponding to the number of the attribute sequences to be displayed;
the sequence processing module is further used for determining a target data code element from each code element array according to the sequence relation aiming at each attribute sequence to be displayed; the sequence position of each target data code element in the data code element corresponds to the sequence position of the attribute sequence to be displayed;
the sequence processing module is further configured to display each first attribute value in each attribute sequence to be displayed to each target data symbol according to a preset corresponding relationship between an arrangement order of the first attribute values in each attribute sequence to be displayed and each symbol array;
and the sequence processing module is further used for obtaining a two-dimensional code sequence according to the display result of each data code element in the plurality of code element arrays.
19. An electronic device, comprising a processor and a memory; the memory stores computer-executable instructions that, when executed by the processor, implement the two-dimensional code recognition method of any one of claims 1 to 7 or the two-dimensional code generation method of any one of claims 8 to 16.
20. A storage medium storing a computer program that, when executed by a processor, implements the two-dimensional code recognition method according to any one of claims 1 to 7 or the two-dimensional code generation method according to any one of claims 8 to 16.
CN202011002519.5A 2020-09-22 2020-09-22 Two-dimensional code identification and generation method and device, electronic equipment and storage medium Pending CN112070195A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011002519.5A CN112070195A (en) 2020-09-22 2020-09-22 Two-dimensional code identification and generation method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011002519.5A CN112070195A (en) 2020-09-22 2020-09-22 Two-dimensional code identification and generation method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112070195A true CN112070195A (en) 2020-12-11

Family

ID=73681550

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011002519.5A Pending CN112070195A (en) 2020-09-22 2020-09-22 Two-dimensional code identification and generation method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112070195A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114692800A (en) * 2020-12-29 2022-07-01 华为技术有限公司 Two-dimensional code generation method and related equipment

Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070297679A1 (en) * 2006-06-21 2007-12-27 Namco Bandai Games Inc. Two-dimensional code generation method, two-dimensional code, two-dimensional code recognition method, and image recognition device
CN101296280A (en) * 2007-04-26 2008-10-29 佳能株式会社 Image processing apparatus and control method thereof
JP2010165340A (en) * 2008-12-18 2010-07-29 Exfrontier Co Ltd Method for generating two-dimensional code superimposed on color image
CN101944187A (en) * 2010-09-07 2011-01-12 龚湘明 Two-dimensional micro code and processing method and device thereof
CN103440516A (en) * 2013-08-26 2013-12-11 李晶 Two-dimensional code label and generation method and device thereof
CN104281865A (en) * 2013-07-04 2015-01-14 百度在线网络技术(北京)有限公司 Method and equipment for generating two-dimensional codes
CN104680218A (en) * 2015-02-12 2015-06-03 航天信息股份有限公司 Multi-space two-dimensional code, and generation method and decoding method of multi-space two-dimensional code
CN104933386A (en) * 2015-06-12 2015-09-23 矽照光电(厦门)有限公司 Multi-grayscale invisible two-dimensional code recognizing method
CN105679179A (en) * 2014-11-18 2016-06-15 北京世纪云联科技发展有限公司 Anti-counterfeit label as well as manufacturing and identification methods thereof
CN206164722U (en) * 2016-09-21 2017-05-10 深圳市泛海三江科技发展有限公司 Discuss super electronic monitoring system based on face identification
CN108280500A (en) * 2017-01-06 2018-07-13 百度在线网络技术(北京)有限公司 Coding method, coding/decoding method, relevant apparatus and the equipment of Quick Response Code
CN109784451A (en) * 2017-11-13 2019-05-21 卓望数码技术(深圳)有限公司 A kind of method and apparatus expanding two dimensional code code capacity using more colors
CN110941971A (en) * 2019-12-10 2020-03-31 浩云科技股份有限公司 Two-dimensional code ferrying method, encoding method, decoding method and device
WO2020156552A1 (en) * 2019-01-31 2020-08-06 北京嘀嘀无限科技发展有限公司 Two-dimensional code generation and recognition methods and devices

Patent Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070297679A1 (en) * 2006-06-21 2007-12-27 Namco Bandai Games Inc. Two-dimensional code generation method, two-dimensional code, two-dimensional code recognition method, and image recognition device
CN101296280A (en) * 2007-04-26 2008-10-29 佳能株式会社 Image processing apparatus and control method thereof
JP2010165340A (en) * 2008-12-18 2010-07-29 Exfrontier Co Ltd Method for generating two-dimensional code superimposed on color image
CN101944187A (en) * 2010-09-07 2011-01-12 龚湘明 Two-dimensional micro code and processing method and device thereof
CN104281865A (en) * 2013-07-04 2015-01-14 百度在线网络技术(北京)有限公司 Method and equipment for generating two-dimensional codes
CN103440516A (en) * 2013-08-26 2013-12-11 李晶 Two-dimensional code label and generation method and device thereof
CN105679179A (en) * 2014-11-18 2016-06-15 北京世纪云联科技发展有限公司 Anti-counterfeit label as well as manufacturing and identification methods thereof
CN104680218A (en) * 2015-02-12 2015-06-03 航天信息股份有限公司 Multi-space two-dimensional code, and generation method and decoding method of multi-space two-dimensional code
CN104933386A (en) * 2015-06-12 2015-09-23 矽照光电(厦门)有限公司 Multi-grayscale invisible two-dimensional code recognizing method
CN206164722U (en) * 2016-09-21 2017-05-10 深圳市泛海三江科技发展有限公司 Discuss super electronic monitoring system based on face identification
CN108280500A (en) * 2017-01-06 2018-07-13 百度在线网络技术(北京)有限公司 Coding method, coding/decoding method, relevant apparatus and the equipment of Quick Response Code
CN109784451A (en) * 2017-11-13 2019-05-21 卓望数码技术(深圳)有限公司 A kind of method and apparatus expanding two dimensional code code capacity using more colors
WO2020156552A1 (en) * 2019-01-31 2020-08-06 北京嘀嘀无限科技发展有限公司 Two-dimensional code generation and recognition methods and devices
CN110941971A (en) * 2019-12-10 2020-03-31 浩云科技股份有限公司 Two-dimensional code ferrying method, encoding method, decoding method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
HIREN J. GALIYAWALA: "To increase data capacity of QR code using multiplexing with color coding: An example of embedding speech signal in QR code", 《2014 ANNUAL IEEE INDIA CONFERENCE (INDICON)》 *
王超: "可拆分彩色二维码方案设计", 《计算机应用于软件》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114692800A (en) * 2020-12-29 2022-07-01 华为技术有限公司 Two-dimensional code generation method and related equipment

Similar Documents

Publication Publication Date Title
JP4557866B2 (en) Mixed code, mixed code generation method and apparatus, and recording medium
CA2586274C (en) Mixed code, and method and apparatus for generating the same, and method and apparatus for decoding the same
JP4515999B2 (en) Mixed code decoding method and apparatus, and recording medium
JP5269123B2 (en) Color discrimination method for color-based image code
ES2341607T3 (en) METHOD AND DEVICE FOR CODING AND DECODING.
RU2251734C2 (en) Machine-readable code, method and device for encoding and decoding
US20140119647A1 (en) Method and Apparatus for Decoding Mixed Code
US7905411B2 (en) Barcode reading apparatus and reading method
CN105447546A (en) Two-dimensional code capable of being embedded with large-ratio graph as well as coding and decoding method and device therefor
JP2008004101A (en) Method of discriminating colors of color based image code
CN107392270B (en) Two-dimensional code generation method
RU2729399C1 (en) Method for detection and recognition of visual markers of long range and high density
US20230094590A1 (en) Information code and information code generation method
CN112070195A (en) Two-dimensional code identification and generation method and device, electronic equipment and storage medium
RU2706475C1 (en) Methods and a computing device for determining whether a mark is genuine
US10891704B2 (en) M-ary cyclic coding
CN105095938A (en) Method for generating color multi-order invisible image code
Ramalho et al. Coloured QR codes for the Internet of Things
AU2001258868B2 (en) Machine readable code and method and device of encoding and decoding the same
KR20120065842A (en) Two-dimensions code with seperate code, computer network system and method for forming of the same
AU2001258868A1 (en) Machine readable code and method and device of encoding and decoding the same

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
AD01 Patent right deemed abandoned
AD01 Patent right deemed abandoned

Effective date of abandoning: 20231117