CN111353321B - Data generation and analysis method and device, computer storage medium and electronic equipment - Google Patents

Data generation and analysis method and device, computer storage medium and electronic equipment Download PDF

Info

Publication number
CN111353321B
CN111353321B CN202010112366.3A CN202010112366A CN111353321B CN 111353321 B CN111353321 B CN 111353321B CN 202010112366 A CN202010112366 A CN 202010112366A CN 111353321 B CN111353321 B CN 111353321B
Authority
CN
China
Prior art keywords
original
dimensional code
information
data
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010112366.3A
Other languages
Chinese (zh)
Other versions
CN111353321A (en
Inventor
钱鸿强
张莹
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Koubei Shanghai Information Technology Co Ltd
Original Assignee
Koubei Shanghai Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Koubei Shanghai Information Technology Co Ltd filed Critical Koubei Shanghai Information Technology Co Ltd
Priority to CN202010112366.3A priority Critical patent/CN111353321B/en
Publication of CN111353321A publication Critical patent/CN111353321A/en
Application granted granted Critical
Publication of CN111353321B publication Critical patent/CN111353321B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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
    • 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/1434Barcodes with supplemental or add-on codes

Abstract

The application discloses a data generation method and device, a data analysis method and device, a computer storage medium and an electronic device, wherein the generation method comprises the following steps: encoding the obtained original information and the adding information required to be added into the original information to generate a first encoded data stream corresponding to the original information and a second encoded data stream corresponding to the adding information; generating an original two-dimensional code according to the first coded data stream, and generating corresponding target color data according to the second coded data stream; replacing original pixels in the original two-dimensional code data area with pixels corresponding to the target color data to generate a target two-dimensional code compatible with the original two-dimensional code; therefore, the generated target two-dimensional code not only comprises the added information added into the original two-dimensional code, but also can be compatible with the original information of the original two-dimensional code, and the expansion of the data storage of the original two-dimensional code is realized.

Description

Data generation and analysis method and device, computer storage medium and electronic equipment
Technical Field
The present application relates to the field of computer technologies, and in particular, to a data generating method and apparatus, a data analyzing method and apparatus, a computer storage medium, and an electronic device.
Background
To improve the efficiency of business operations, data information is identified by scanning codes. The bar code with lower data storage quantity at first evolves to the two-dimensional code which can expand the data storage quantity today, so that life is more convenient, and working efficiency is more excellent.
Although a two-dimensional code is a popular coding mode on terminal equipment in recent years, and can store more information and represent more data types than a traditional barcode, with the increase of business data information volume and business complexity, the information which can be carried by the two-dimensional code still has a certain limitation, and when facing a large amount of complex data, the storage capacity of the two-dimensional code is obviously insufficient and the recognition difficulty is increased.
Disclosure of Invention
The application provides a data generation method, which aims to solve the problem of limited data storage capacity in the prior art.
The application provides a data generation method, which comprises the following steps:
encoding the obtained original information and the adding information required to be added into the original information to generate a first encoded data stream corresponding to the original information and a second encoded data stream corresponding to the adding information;
Generating an original two-dimensional code according to the first coded data stream, and generating corresponding target color data according to the second coded data stream;
and replacing original pixels in the original two-dimensional code data area with pixels corresponding to the target color data to generate a target two-dimensional code compatible with the original two-dimensional code.
In some embodiments, the encoding the obtained original information and the additional information that needs to be added to the original information, generating a first encoded data stream corresponding to the original information and a second encoded data stream corresponding to the additional information includes:
dividing the acquired original information to obtain divided information at least comprising two parts, wherein a second part after division is added information for adding to the first part;
the divided first part division information and the divided second part division information are respectively encoded to generate a first encoded data stream corresponding to the first part division information and a second encoded data stream corresponding to the second part division information.
In some embodiments, the obtained adding information for adding to the original information includes:
Determining extension information with association relation with the original information;
and acquiring the adding information required to be added into the original information according to the determined extension information.
In some embodiments, the encoding the obtained original information and the added information for adding to the original information, generating a first encoded data stream corresponding to the original information and a second encoded data stream corresponding to the added information, includes:
encoding the obtained original information and the obtained added information respectively to obtain a first encoding value corresponding to the original information and a second encoding value corresponding to the added information;
the first encoded value and the second encoded value are respectively converted into a binary encoded data stream.
In some embodiments, the generating the original two-dimensional code according to the first encoded data stream includes:
generating the original two-dimensional code according to a binary coded data stream corresponding to the first coded value;
the generating corresponding target color data according to the second coded data stream includes:
dividing the binary coded data stream corresponding to the second coded data stream according to the bit number of the color value, and generating target color data corresponding to the binary coded data stream.
In some embodiments, the dividing the binary coded data stream corresponding to the second coded data stream according to the number of bits of the color value, generating the target color data corresponding to the binary coded data stream includes:
dividing the binary coded data stream corresponding to the second coded data stream according to three-bit color values to obtain divided binary coded data;
target color data corresponding to the binary coded data stream is generated from the binary coded data.
In some embodiments, the dividing the binary coded data stream corresponding to the second coded data stream according to the three-bit color value to obtain divided binary coded data includes:
and when the binary coded data stream is divided according to the three-bit color value, supplementing the missing bit when the three-bit color value requirement is not met, and obtaining the divided binary coded data.
In some embodiments, the replacing the original pixel in the original two-dimensional code data area with the pixel corresponding to the target color data, generating the target two-dimensional code compatible with the original two-dimensional code, includes:
and replacing the black pixel value in the original two-dimensional code data area with the pixel value corresponding to the target color data to generate a target two-dimensional code compatible with the original two-dimensional code.
In some embodiments, further comprising:
and marking color verification data for verifying the target color data in the target two-dimensional code in a positioning area of the original two-dimensional code.
In some embodiments, the marking, in the positioning area of the original two-dimensional code, color verification data for verifying the target color data in the target two-dimensional code includes:
determining the selected color data excluding the original color data in the original two-dimensional code as the color verification data;
and replacing the original pixel data in the original two-dimensional code positioning area with the color verification data.
In some embodiments, further comprising:
aiming at the obtained added information which needs to be added into the original information, generating information verification data for verifying the added information;
and adding the information verification data into a positioning area of the target two-dimensional code.
In some embodiments, the adding the information verification data to the location area of the target two-dimensional code includes:
encoding the information verification data to obtain verification color data for verifying the added information;
and replacing black pixels in the target two-dimensional code positioning area with color pixels corresponding to the verification color data.
The application also provides a data generating device, which comprises:
the encoding unit is used for encoding the acquired original information and the adding information required to be added into the original information, and generating a first encoded data stream corresponding to the original information and a second encoded data stream corresponding to the adding information;
the first generation unit is used for generating an original two-dimensional code according to the first coded data stream and generating corresponding target color data according to the second coded data stream;
the second generation unit is used for replacing original pixels in the original two-dimensional code data area with pixels corresponding to the target color data to generate a target two-dimensional code compatible with the original two-dimensional code.
The application also provides a data analysis method, which comprises the following steps:
scanning a target two-dimensional code compatible with an original two-dimensional code, analyzing a first code value corresponding to the original two-dimensional code, and analyzing a second code value corresponding to target color data of a data area in the target two-dimensional code;
decoding the first code value and the second code value to obtain original information in the original two-dimensional code and added information added into a data area of the original two-dimensional code;
And determining the original information and the added information as data content compatible with the target two-dimensional code of the original two-dimensional code.
In some embodiments, scanning a target two-dimensional code compatible with an original two-dimensional code, and analyzing a first encoded value corresponding to the original two-dimensional code includes:
performing binarization processing on the target two-dimensional code to obtain a binarized two-dimensional code image;
and scanning the binarized two-dimensional code image, and analyzing a first coding value corresponding to the original two-dimensional code.
In some embodiments, scanning a target two-dimensional code compatible with an original two-dimensional code, analyzing a first encoded value corresponding to the original two-dimensional code, and analyzing a second encoded value corresponding to target color data of a data area in the target two-dimensional code, including:
analyzing the original two-dimensional code and the target two-dimensional code to obtain a binary data stream corresponding to the original two-dimensional code and a binary data stream corresponding to target color data of a data area in the target two-dimensional code;
the first coding value is obtained according to the binary data stream of the original two-dimensional code, and the second coding value is obtained according to the binary data stream of the target color data of the data area in the target two-dimensional code.
In some embodiments, further comprising:
scanning a target two-dimensional code compatible with an original two-dimensional code, and analyzing a positioning code value of positioning area color verification data in the target two-dimensional code;
the scanning is compatible with a target two-dimensional code of an original two-dimensional code, and the second coding value corresponding to the target color data of the data area in the target two-dimensional code is analyzed, and the scanning comprises the following steps:
and comparing the scanned target color data of the target two-dimensional code data area with the color verification data of the target two-dimensional code positioning area, and if the comparison result is the same, analyzing a second coding value corresponding to the target color data of the data area in the target two-dimensional code.
In some embodiments, the scanned target color data of the target two-dimensional code data area is compared with the color verification data of the target two-dimensional code positioning area, and if the comparison results are different, a prompt message with wrong analysis is output.
In some embodiments, further comprising:
analyzing information verification data in a positioning area in the target two-dimensional code, wherein the information verification data is used for verifying the added information;
generating information verification data for verifying the added information with respect to the added information;
Comparing the analyzed information verification data with the generated information verification data to determine whether the generated information verification data is correct;
if yes, determining that the analysis of the added information is successful.
In some embodiments, the comparing the parsed information verification data with the generated information verification data determines whether the parsed information verification data is correct, and if not, determines that the parsing of the added information fails.
In some embodiments, further comprising:
and outputting the data content of the target two-dimensional code compatible with the original two-dimensional code.
The application also provides a data analysis device, which comprises:
the analysis unit is used for scanning a target two-dimensional code compatible with the original two-dimensional code, analyzing a first code value corresponding to the original two-dimensional code and analyzing a second code value corresponding to target color data of a data area in the target two-dimensional code;
the decoding unit is used for decoding the first coding value and the second coding value to obtain the original information in the original two-dimensional code and the added information added into the original two-dimensional code data area;
and the determining unit is used for determining the original information and the added information as the data content compatible with the target two-dimensional code of the original two-dimensional code.
The application also provides a computer storage medium for storing the network platform generated data and a program for processing the network platform generated data;
the program, when read and executed, performs the steps of:
encoding the obtained original information and the adding information required to be added into the original information to generate a first encoded data stream corresponding to the original information and a second encoded data stream corresponding to the adding information;
generating an original two-dimensional code according to the first coded data stream, and generating corresponding target color data according to the second coded data stream;
replacing original pixels in the original two-dimensional code data area with pixels corresponding to the target color data to generate a target two-dimensional code compatible with the original two-dimensional code;
alternatively, the following steps are performed:
scanning a target two-dimensional code compatible with an original two-dimensional code, analyzing a first code value corresponding to the original two-dimensional code, and analyzing a second code value corresponding to target color data of a data area in the target two-dimensional code;
decoding the first code value and the second code value to obtain original information in the original two-dimensional code and added information added into a data area of the original two-dimensional code;
And determining the original information and the added information as data content compatible with the target two-dimensional code of the original two-dimensional code.
The present application also provides an electronic device including:
a processor;
a memory for storing a program for processing network platform generated data, said program, when read and executed by said processor, performing the steps of:
encoding the obtained original information and the adding information required to be added into the original information to generate a first encoded data stream corresponding to the original information and a second encoded data stream corresponding to the adding information;
generating an original two-dimensional code according to the first coded data stream, and generating corresponding target color data according to the second coded data stream;
replacing original pixels in the original two-dimensional code data area with pixels corresponding to the target color data to generate a target two-dimensional code compatible with the original two-dimensional code;
alternatively, the following steps are performed:
scanning a target two-dimensional code compatible with an original two-dimensional code, analyzing a first code value corresponding to the original two-dimensional code, and analyzing a second code value corresponding to target color data of a data area in the target two-dimensional code;
Decoding the first code value and the second code value to obtain original information in the original two-dimensional code and added information added into a data area of the original two-dimensional code;
and determining the original information and the added information as data content compatible with the target two-dimensional code of the original two-dimensional code.
Compared with the prior art, the application has the following advantages:
according to the data generation method, the obtained original information and the added information required to be added to the original information are encoded to generate a first encoded data stream and a second encoded data stream, then an original two-dimensional code is generated according to the first encoded data stream, corresponding target color data is generated according to the second encoded data stream, original pixels in a data area of the original two-dimensional code are replaced with pixels corresponding to the target color data, and a target two-dimensional code compatible with the original two-dimensional code is generated. Therefore, the generated target two-dimensional code not only comprises the added information added into the original two-dimensional code, but also can be compatible with the original information of the original two-dimensional code, and the expansion of the data storage of the original two-dimensional code is realized.
According to the data analysis method provided by the application, the target two-dimensional code compatible with the original two-dimensional code is scanned, so that a first code value corresponding to the original two-dimensional code is analyzed, and a second code value corresponding to target color data in a data area in the target two-dimensional code is analyzed; decoding the first code value and the second code value to obtain original information in the original two-dimensional code and added information added into the original two-dimensional code data area; determining the original information and the added information as data content compatible with a target two-dimensional code of the original two-dimensional code; therefore, under the condition that the original information is obtained, the added information added into the original information can be obtained, the target two-dimensional code expands the data storage capacity of the original two-dimensional code, and after the target two-dimensional code is analyzed, the original information can be obtained, and the added information can also be obtained.
Drawings
FIG. 1 is a flow chart of an embodiment of a data generation method provided by the present application;
fig. 2 is a schematic structural diagram of a general black-and-white two-dimensional code;
FIG. 3 is an image schematic diagram of a target two-dimensional code compatible with an original two-dimensional code;
fig. 4 is a schematic structural diagram of an embodiment of a data generating device according to the present application;
FIG. 5 is a flowchart of an embodiment of a data parsing method provided by the present application;
fig. 6 is a schematic structural diagram of an embodiment of a data parsing device according to the present application.
Detailed Description
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application. The present application may be embodied in many other forms than those herein described, and those skilled in the art will readily appreciate that the present application may be similarly embodied without departing from the spirit or essential characteristics thereof, and therefore the present application is not limited to the specific embodiments disclosed below.
The terminology used in the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The manner of description used in the present application and in the appended claims is for example: "a", "a" and "a" etc. are not limited in number or order, but are used to distinguish the same type of information from each other.
Before describing a data generating method provided by the application, a detailed description is made of the conceptual background of the application so as to facilitate the subsequent understanding of the application.
The Bar Code provides great convenience for life, for example, when shopping, commodity information can be obtained by scanning the Bar Code on the commodity through the scanning equipment, so that the working efficiency of settlement work is greatly improved. With the continuous improvement of society, the continuous improvement of living standard of people, the continuous innovation of technology and technology, the mode of storing data information by the bar code gradually highlights the shortage of storage capacity and a plurality of defects of limited data identification direction and storage direction, and then the two-dimensional code (Quick Response Code) replaces the bar code and fills all aspects in life.
The two-dimensional code has more storage than the bar code, and is not limited by the scanning direction. Two-dimensional codes are also called as two-dimensional Bar codes (QR codes), which are more common coding modes on mobile devices in recent years, and can store more information and represent more data types than traditional Bar codes (Bar codes).
The two-dimensional code is a graph which is distributed on a plane (in a two-dimensional direction) according to a certain rule by using a certain specific geometric figure, is alternately black and white and records data symbol information; the concept of a binary bit stream of 0 and 1 which form the internal logic foundation of a computer is utilized in code programming, a plurality of geometric shapes corresponding to binary are used for representing literal numerical information, and the information is read by terminal equipment to realize automatic information processing.
Along with the continuous development of application business, the complexity and the data volume of data are improved, and the data expansion cannot be performed on the basis of the conventional universal black-and-white two-dimensional code composed of black-and-white colors, namely, under the environment with complex data, the conventional universal black-and-white two-dimensional code can only take the expanded data and the original data as a whole to generate the universal black-and-white two-dimensional code comprising a large amount of complex data to realize the bearing of the data, however, even if the universal black-and-white two-dimensional code is generated, the recognition difficulty of the universal black-and-white two-dimensional code is correspondingly increased, and accordingly, better requirements are also put forward on recognition equipment.
Under the application background, the application provides a data generation method, which can generate a target two-dimensional code capable of carrying data of a general two-dimensional code and additional data on the basis of the existing general two-dimensional code, in other words, the target two-dimensional code not only comprises the data borne by the general two-dimensional code, but also comprises data except the data borne by the general two-dimensional code. Next, a detailed description will be given of a specific implementation procedure of the data generation method provided by the present application.
Referring to fig. 1, fig. 1 is a flowchart of an embodiment of a data generating method according to the present application.
The generating method embodiment comprises the following steps:
step S101: encoding the obtained original information and the adding information required to be added into the original information to generate a first encoded data stream corresponding to the original information and a second encoded data stream corresponding to the adding information;
the purpose of the step S101 is to determine the original information and the added information added to the original information, that is, the information included in the original information and other information to be carried, so as to expand the capacity of the original two-dimensional code carrying information, and the expansion part is the added information part.
In this embodiment, the original information may also be understood as information based on a two-dimensional code to be generated, for example: the website link information, picture information, text information and the like can be evolutionary data, and do not only refer to information traced back to the root cause.
It can be understood that, based on the application scenario with a large amount of complex data, the original information is a large amount of complex data, in order to facilitate reducing the generation and recognition difficulty of the two-dimensional code, the step S101 provides two implementation manners as follows:
mode one, including:
step S101-11: dividing the acquired original information to obtain dividing information at least comprising two parts, namely first part dividing information and second part dividing information, wherein the second part dividing information is added information for adding to the first part dividing information.
Step S101-12: the first part of split information and the second part of split information after splitting are coded, and a first coded data stream corresponding to the first part of split information and the second coded data stream corresponding to the second part of split information are generated.
The division of the original information in step S101-11 may be determined according to the complexity of the specific information of the original information or according to the requirement of generating the two-dimensional code, and the manner of this embodiment is merely illustrative for convenience of explanation, and is not limited to the above.
Typically, the added information may be an unnecessary information part, such as: some of the original information is auxiliary descriptive information.
Mode two, including:
step S101-21: acquiring original information of an original two-dimensional code to be generated; step S101-22: determining extension information with association relation with the original information;
step S101-23: and acquiring the adding information required to be added into the original information according to the determined extension information.
In the second mode of the present embodiment, the original information may be understood as basic information, the added information may be extended information based on the basic information, and the extended information may be a supplementary description of the original information, where a certain association relationship exists between the two.
Based on the above, the added information in this embodiment may be a part of the original information or a part of the non-original information, and in short, the added information may be information that needs to be added to the original two-dimensional code according to the requirement.
The above description is given of the original information and the added information in two ways only, and it is understood that the source of the original information and the added information is not limited to the above.
After the original information and the additional information are obtained, the original information is encoded to generate a first encoded data stream, and the additional information is also encoded to generate a second encoded data stream, which are described below, wherein the encoding of the original information belongs to the prior art, so the following description is focused on the encoding process of the additional information.
First, the encoding process of the original information is schematically described, namely: encoding the obtained original information to generate a first encoded data stream, including:
encoding the acquired original information to obtain a first encoded value;
the first encoded value is converted into a binary encoded data stream.
Next, the process of encoding the obtained added information to generate a second encoded data stream is described, including:
Step S102-1: encoding the obtained added information to obtain a second encoded value;
step S102-2: the second encoded value is converted into a binary encoded data stream.
Step S102-1 is to encode the added information, and a Unicode encoding mode can be adopted to obtain a Unicode value, wherein Unicode (world Unicode) is a set of character encoding formulated by the world Unicode Union, and comprises most of language words and expression words in the world. Unicode encoding provides a set of base unit codes, each base unit being assigned a unique Code Point. A text element is composed of one or more basic units. Of course, other coding schemes may be used. After the encoded values are obtained, the encoded values need to be converted into a binary encoded data stream.
Step S103: generating an original two-dimensional code according to the first coded data stream, and generating corresponding target color data according to the second coded data stream.
The specific implementation of step S103 is also described from two angles, namely, for the original information and the added information, respectively.
Firstly, based on the above steps 101-102, it can be known that the obtained original information is encoded to generate a first encoded value, the first encoded value is converted into a binary encoded data stream, and then an original two-dimensional code is generated according to the binary encoded data stream corresponding to the first encoded value, and the generation process of the original two-dimensional code can be obtained by adopting the existing generation method, and the outline of the original two-dimensional code is described below.
In this embodiment, the obtaining of the original two-dimensional code may be performed by using the existing process of generating the black-and-white two-dimensional code, that is, determining the original information needed to generate the original two-dimensional code, and obtaining the original two-dimensional code generated according to the original information, specifically please refer to fig. 2, where fig. 2 is a schematic structural diagram of the general black-and-white two-dimensional code. The original two-dimensional code may also be referred to as a universal black-and-white two-dimensional code in this embodiment, and there are 40 sizes, which may be named Version. There is a linear relationship between size and Version: version 1 is a 21 x 21 matrix and Version 2 is a 25 x 25 matrix, with 4 increases in Size for each Version added, so the linear relationship between Size and Version is: the maximum value of Version is 40, so the size maximum is a matrix of (40-1) x 4+21=177, i.e. 177x 177.
Each part of the original two-dimensional code has the function of the original two-dimensional code, and can be basically divided into three parts of positioning, functional data and data content, namely the structure of the original two-dimensional code comprises a positioning area, a functional data area and a data content area.
A blank area 20;
the location area includes:
positioning pattern 21 (Position Detection Pattern): the method is used for marking the size of the two-dimensional code rectangle, and the position and the direction of one two-dimensional code rectangle can be marked and determined by using three positioning patterns, i.e. three positioning pattern areas are shown as the upper left, the lower left and the upper right in fig. 2.
Positioning the pattern divider 22 (Separators for Position Detection Patterns): the positioning pattern is distinguished from other areas by white borders.
Timing pattern 23 (Timing Patterns): for positioning, if the two-dimensional code is oversized, the two-dimensional code is easy to distort during scanning, and the time sequence pattern is used for preventing the distortion during scanning.
Alignment pattern 24 (Alignment Patterns): only Version 2 and above would be required.
Functional data:
format information 25 (Format Information): storing the formatted data in all sizes;
version information 26 (Version Information): for Version 7 or above, two 3×6 regions need to be reserved to store partial Version information;
the data content is as follows: the remainder storing data content
Data Code 27 (Data Code) and error correction Code 27 (Error Correction Code).
Then, the data is encoded to generate corresponding original two-dimensional codes. The form of data encoding may include: numerical code (numerical Mode), character code (Alphanumeric Mode), byte code (Byte Mode), japanese code (Kanji Mode), other codes. After data encoding, the original two-dimensional code structure can be drawn, and finally the pattern of the original two-dimensional code is obtained, and redundant description is omitted here.
In the step S103, the generating corresponding target color data according to the second encoded data stream may include:
step S103-1: dividing the binary coded data stream corresponding to the second coded data stream according to the bit number of the color value, and generating target color data corresponding to the binary coded data stream.
The step S103-1 may specifically be divided according to the number of bits of the RGB color values, that is, three bits, and it can be understood that, because the original two-dimensional code mainly adopts black and white, that is: RGB color values are 0,0 (black) and 1,1 (white), and thus, black and white are thrown out, and division of the binary coded data stream may result in RGB (1, 0) red for the corresponding target color data, RGB (0, 1, 0) green, RGB (0, 1) blue, RGB (1, 0) yellow, RGB (1, 0, 1) bright purple, RGB (0, 1) cyan, whereby corresponding color information can be obtained from RGB color values.
It will be appreciated that when dividing the binary coded stream by three-bit color values, if it is up to the last less than three bits, the missing bits may be complemented to keep the division still three bits, and the complemented bits may be zero. Of course, in dividing a binary coded stream, if the divided three bits are (1, 1) or (0, 0), it should be noted that there is a corresponding protocol to convert the binary stream into a corresponding bin at the time of encoding and decoding. The corresponding binary is a scalable protocol, and in this embodiment six color binary streams can be used, so the conversion is based on planing off white and black, so the case of division (1, 1) or (0, 0) does not occur. However, according to further development of the imaging technology, in other embodiments, the present application is turned into more color to increase the data capacity, and thus is not limited to the above 6 colors. Namely: the 8-ary conversion is performed to the 6 (8-2) ary. More color expansion is that the third power (three channel) system of the single channel tone scale k (2 in this embodiment) is converted to the k-th power of 3-2 system.
Step S104: and replacing original pixels in the original two-dimensional code data area with pixels corresponding to the target color data to generate a target two-dimensional code compatible with the original two-dimensional code.
The specific implementation process of step S104 may include:
and replacing the black pixel value in the original two-dimensional code data area with the pixel value corresponding to the target color data to generate a target two-dimensional code compatible with the original two-dimensional code, wherein as shown in fig. 3, fig. 3 is an image schematic diagram of the target two-dimensional code compatible with the original two-dimensional code.
In this embodiment, in order to ensure accuracy of identifying the color in the target two-dimensional code under different environmental conditions, or to improve the fault tolerance of the identification. The embodiment may further include:
and marking color verification data for verifying the target color data in the target two-dimensional code in a positioning area of the original two-dimensional code. As shown in fig. 3, the upper left corner and the lower left corner in fig. 3 are the positioning areas, and in this embodiment, the positioning area in the upper left corner is taken as an example, and the color verification data is marked in the positioning area. Likewise, the color verification data may be color data excluding the original color data in the original two-dimensional code, which is selected to be determined as the color verification data, and in this embodiment, the color verification data includes 6 color verification data, that is: RGB (1, 0) red, RGB (0, 1, 0) green, RGB (0, 1) blue, RGB (1, 0) yellow, RGB (1, 0, 1) bright purple, RGB (0, 1) cyan. After the color verification data is determined, the black pixel data in the positioning area is replaced by the six color verification data. For the original two-dimensional code, the positioning area and even the data area are displayed in black and white colors, so that the original pixel data can be in black and white colors, and in the embodiment, the positioning area is mainly displayed in black pixels, so that the color verification data can be marked to replace the black pixel value of the positioning area with the six color verification values. The color verification data are marked in the positioning area, so that the accuracy of information can be guaranteed, and the space of the two-dimensional code can be saved.
When the target two-dimensional code is identified, the color part in the data area can be compared with the color check value of the positioning area, so that the accuracy of color identification is ensured.
In order to ensure accuracy of data identification, in this embodiment, the method may further include:
aiming at the obtained added information required to be added into the original two-dimensional code, generating information verification data for verifying the added information; the generation of the information verification data can adopt a hash algorithm to generate a hash value representing the added information, namely the identifier, so that the added information is verified when the added information is analyzed, and the accuracy of the added information is ensured.
And adding the information verification data into a positioning area of the target two-dimensional code. In this embodiment, the information verification data is added to the positioning area, so that the two-dimensional code space can be saved.
That is, it is determined whether the identified added information is correct by the information verification data. And similarly, encoding the information verification data to obtain verification color data for verifying the added information, and replacing black pixels in the target two-dimensional code positioning area with color pixels corresponding to the verification color data.
It should be noted that, when the color verification data is located at the upper left of the target two-dimensional code, the information verification data may be a location area at the lower left or a location area at the upper right.
Any one of the color verification data and the information verification data in the embodiment can be generated after the original two-dimensional code is generated, or can be generated while the target two-dimensional code compatible with the original two-dimensional code is generated, or can be generated after the original pixels in the original two-dimensional code data area are replaced by the pixels corresponding to the target color data, and finally the target two-dimensional code is generated according to the color verification data, the information verification data and the target color data in the data area.
According to the data generation method provided by the application, the finally generated target two-dimensional code can be compatible with the information of the conventional black Bai Erwei code (original two-dimensional code) and can also comprise added information, and under the condition that the original information is complex, the target two-dimensional code can be encoded, so that the data storage capacity can be expanded, and the recognition error rate is reduced.
The foregoing is a detailed description of an embodiment of a data generating method according to the present application, which corresponds to the foregoing embodiment of the data generating method, and the present application further discloses an embodiment of a data generating apparatus, please refer to fig. 4, and since the embodiment of the apparatus is substantially similar to the embodiment of the method, the description is relatively simple, and the relevant points refer to the partial description of the embodiment of the method. The device embodiments described below are merely illustrative.
As shown in fig. 4, fig. 4 is a schematic structural diagram of an embodiment of a data generating device provided by the present application, where the generating device embodiment includes:
an encoding unit 401, configured to encode the obtained original information and additional information that needs to be added to the original information, and generate a first encoded data stream corresponding to the original information and a second encoded data stream corresponding to the additional information;
when the original information and the additional information acquired by the encoding unit 401 are two acquisition modes, in the first mode, the encoding unit 401 includes:
the segmentation subunit is used for segmenting the acquired original information to obtain segmentation information at least comprising two parts, wherein a second part after segmentation is added information for being added to the first part; the encoding subunit is configured to encode the divided first partial division information and the divided second partial division information, and generate a first encoded data stream corresponding to the first partial division information and a second encoded data stream corresponding to the second partial division information.
In the second mode, the encoding unit 401 includes:
the information processing device comprises a determination subunit and an acquisition subunit, wherein the determination subunit is used for determining extension information with an association relation with the original information; the obtaining subunit is configured to obtain, according to the extension information determined in the determining subunit, addition information that needs to be added to the original information.
The encoding unit 401 includes: the first coding subunit is used for respectively coding the acquired original information and the acquired added information to obtain a first coding value corresponding to the original information and a second coding value corresponding to the added information; the conversion subunit is configured to convert the first encoded value and the second encoded value into binary encoded data streams, respectively.
A first generating unit 402, configured to generate an original two-dimensional code according to the first encoded data stream, and generate corresponding target color data according to the second encoded data stream;
the first generating unit 402 includes an original two-dimensional code generating subunit and a dividing subunit, where the original two-dimensional code generating subunit is configured to generate the original two-dimensional code according to a binary coded data stream corresponding to the first coded value. The dividing subunit is configured to divide a binary coded data stream corresponding to the second coded data stream according to the number of bits of the color value, and generate target color data corresponding to the binary coded data stream.
The dividing subunit may specifically include an obtaining subunit and a data generating subunit, where the obtaining subunit is configured to divide a binary coded data stream corresponding to the second coded data stream according to a three-bit color value, to obtain divided binary coded data; the data generation subunit is configured to generate target color data corresponding to the binary coded data stream according to the binary coded data.
The obtaining subunit includes: and the bit supplementing subunit is used for supplementing the bit deficiency when the three-bit color value requirement is not met when the binary coded data stream is partitioned according to the three-bit color value, so as to obtain partitioned binary coded data.
For the specific content of the first generating unit, reference may be made to the description of step S103-1, and the detailed description is not repeated here.
The second generating unit 403 is configured to replace an original pixel in the original two-dimensional code data area with a pixel corresponding to the target color data, and generate a target two-dimensional code compatible with the original two-dimensional code.
And the third generating unit 404 is configured to replace an original pixel in the original two-dimensional code data area with a pixel corresponding to the target color data, and generate a target two-dimensional code compatible with the original two-dimensional code.
The third generating unit 404 is specifically configured to replace a black pixel value in the original two-dimensional code data area with a pixel value corresponding to the target color data, and generate a target two-dimensional code compatible with the original two-dimensional code.
In this embodiment, the method may further include:
the marking unit is used for marking the color verification data for verifying the target color data in the target two-dimensional code in the positioning area of the original two-dimensional code.
The marking unit may include: the determining subunit is used for determining the selected color data excluding the original color data in the original two-dimensional code as the color verification data; the replacing subunit is configured to replace original pixel data in the original two-dimensional code positioning area with the color verification data.
The embodiment further comprises:
the verification generation subunit is used for generating information verification data for verifying the added information aiming at the obtained added information required to be added into the original two-dimensional code;
and the verification adding subunit is used for adding the information verification data into the positioning area of the target two-dimensional code.
The check adding subunit includes: the verification coding subunit is used for coding the information verification data to obtain verification color data for verifying the added information; and the verification replacing subunit is used for replacing the black pixels in the target two-dimensional code positioning area with the color pixels corresponding to the verification color data.
The foregoing is a description of an embodiment of a data generating apparatus provided by the present application, and reference may be made to the content of an embodiment of a data generating method for specific content of the data generating apparatus, where the content is the same, and only a schematic description is omitted.
Based on the foregoing, the present application also provides a data parsing method, where the data parsing method is similar to the parsing method of the target two-dimensional code generated in the data generating method embodiment, so descriptions of the data parsing method embodiments also have contents corresponding to the data generating method embodiments, so in the process of parsing the data parsing method embodiment, reference may also be made to the data generating method embodiment, that is, the data parsing method embodiment provided by the present application is actually a reverse process of the data generating method embodiment, and therefore, in the following description, it is necessary to understand the data generating method embodiment in conjunction with the foregoing description.
Referring to fig. 5, fig. 5 is a flowchart of an embodiment of a data parsing method according to the present application, where the embodiment of the data parsing method includes:
step S501: scanning a target two-dimensional code compatible with an original two-dimensional code, analyzing a first code value corresponding to the original two-dimensional code, and analyzing a second code value corresponding to target color data of a data area in the target two-dimensional code;
the purpose of the step S501 is to analyze two parts of data content when scanning a target two-dimensional code compatible with the original two-dimensional code, wherein one is a first code value corresponding to the original two-dimensional code; and secondly, a second coding value corresponding to the target color data in the target two-dimensional code data area.
Since the parsing method of the original two-dimensional code corresponds to the generating method of the original two-dimensional code, the step S501 may directly use a decoding method corresponding to the encoding method used when the original two-dimensional code is generated to decode the original two-dimensional code, so as to obtain the original information stored in the original two-dimensional code, and for the target two-dimensional code, the image information includes a black-white display area and a color display area, and the parsing method of the original information stored in the original two-dimensional code may include:
step S501-1: performing binarization processing on the target two-dimensional code to obtain a binarized two-dimensional code image;
in the step S501-1, gray processing is actually performed on the target two-dimensional code image, that is, the whole target two-dimensional code image shows a black-and-white effect, and the target two-dimensional code image is processed into a binary two-dimensional code image only including black and white two colors.
Step S501-2: and scanning the binarized two-dimensional code image, and analyzing the original information corresponding to the original two-dimensional code.
Step S501-2 is to scan and decode the binarized two-dimensional code image by adopting a decoding mode corresponding to the original two-dimensional code encoding mode, so as to analyze the original information corresponding to the original two-dimensional code.
The specific implementation process of step S501 may further include:
analyzing the target two-dimensional code to obtain a binary data stream corresponding to the original two-dimensional code and a binary data stream corresponding to target color data of a data area in the target two-dimensional code;
because the analysis of the original two-dimensional code belongs to the prior art, a conventional analysis mode is adopted, and the analysis process corresponding to the original two-dimensional code is not described in detail here. Only the analysis of the target color data of the data area in the target two-dimensional code is described, because the color area of the target two-dimensional code image comprises 6 RGB values, namely: RGB (1, 0) red, RGB (0, 1, 0) green, RGB (0, 1) blue, RGB (1, 0) yellow, RGB (1, 0, 1) bright purple, RGB (0, 1) cyan, and further, the partial analysis of the scanned color region can obtain the corresponding RGB values, namely binary data stream.
Step S501-4: and acquiring the first coding value according to the binary data stream of the original two-dimensional code, and acquiring the second coding value according to the binary data stream of the target color data of the data area in the target two-dimensional code.
To ensure the accuracy of the parsed encoded value, the method further comprises:
Scanning a target two-dimensional code compatible with an original two-dimensional code, and analyzing a positioning code value of positioning area color verification data in the target two-dimensional code;
the scanning is compatible with a target two-dimensional code of an original two-dimensional code, and the second coding value corresponding to the target color data of the data area in the target two-dimensional code is analyzed, and the scanning comprises the following steps:
and comparing the scanned target color data of the target two-dimensional code data area with the color verification data of the target two-dimensional code positioning area, and if the comparison result is the same, analyzing a second coding value corresponding to the target color data of the data area in the target two-dimensional code.
If the comparison results are different, outputting prompt information of wrong analysis or not responding to the scanning operation.
Step S502: decoding the first code value and the second code value to obtain original information in the original two-dimensional code and added information added into the original two-dimensional code data area;
the decoding process in step S502 decodes by adopting a decoding mode corresponding to the encoding mode, so as to obtain the added information added to the original two-dimensional code data area.
To ensure the correctness of the obtained added information, the method further comprises:
Analyzing information verification data in a positioning area in the scanned target two-dimensional code, wherein the information verification data are used for verifying the added information;
generating information verification data for verifying the added information with respect to the obtained added information; the information verification data for verifying the added information may be generated by using the same algorithm as the information verification data in the embodiment of the data generation method, for example, a hash algorithm, that is, an identification information for indicating the added information.
Comparing the analyzed information verification data with the generated information verification data to determine whether the generated information verification data is correct;
if yes, determining that the analysis of the added information is successful.
That is, when the parsed information verification data and the generated information verification data are identical, the parsed additional information is correct, and thus, it is determined that the additional information is parsed successfully. Otherwise, if the information verification data are different, the generated information verification data are wrong, the problem of the added information is described, and further analysis of the added information in the target two-dimensional code is failed.
Step S503: and determining the original information and the added information as data content compatible with the target two-dimensional code of the original two-dimensional code.
Based on the above, after scanning the target two-dimensional code and completing analysis, the method further comprises:
outputting the data content compatible with the target two-dimensional code with the original two-dimensional code, wherein the output data content can comprise the data content corresponding to the original two-dimensional code in the target two-dimensional code and the added data content corresponding to the color region in the target two-dimensional code data region.
The foregoing is a detailed description of an embodiment of a data parsing method, corresponding to the foregoing embodiment of a data generating method, and the application further discloses an embodiment of a data parsing apparatus, referring to fig. 6, and since the embodiment of the apparatus is substantially similar to the embodiment of the method, the description is relatively simple, and the relevant points refer to part of the description of the embodiment of the method. The device embodiments described below are merely illustrative.
Fig. 6 is a schematic structural diagram of an embodiment of a data analysis device according to the present application. The data parsing device embodiment comprises:
the parsing unit 601 is configured to scan a target two-dimensional code compatible with an original two-dimensional code, parse a first encoded value corresponding to the original two-dimensional code, and parse a second encoded value corresponding to target color data in a data area in the target two-dimensional code;
The parsing unit 601 may include: the binarization processing subunit is used for performing binarization processing on the target two-dimensional code to obtain a binarization two-dimensional code image. The analysis subunit is used for scanning the binarized two-dimensional code image and analyzing a first coding value corresponding to the original two-dimensional code.
The parsing unit 601 may include: the data stream acquisition subunit is used for analyzing the original two-dimensional code and the target two-dimensional code to obtain a binary data stream corresponding to the original two-dimensional code and a binary data stream corresponding to target color data of a data area in the target two-dimensional code; the encoding value obtaining subunit is configured to obtain the first encoding value according to the binary data stream of the original two-dimensional code obtained in the data stream obtaining subunit, and obtain the second encoding value according to the binary data stream of the target color data of the data area in the target two-dimensional code obtained in the data stream obtaining subunit.
That is, the parsing unit parses two parts of content, namely, a first encoding value for the original two-dimensional code and a second encoding value corresponding to the target color data in the target two-dimensional code.
The decoding unit 602 is configured to decode the first encoded value and the second encoded value to obtain original information in the original two-dimensional code and added information added to the original two-dimensional code data area;
the determining unit 603 is configured to determine the original information and the added information as data content compatible with a target two-dimensional code of the original two-dimensional code.
In order to ensure the accuracy of the analysis result, the method further comprises the following steps:
the color verification unit is used for scanning a target two-dimensional code compatible with the original two-dimensional code and analyzing the coded value of the color verification data of the positioning area in the target two-dimensional code.
The analysis unit 601 may specifically compare the scanned target color data of the target two-dimensional code data area with the color verification data of the target two-dimensional code positioning area, and if the comparison result is the same, analyze the encoded value corresponding to the target color data of the data area in the target two-dimensional code. If the comparison results are different, outputting prompt information of wrong analysis. Of course, no response may be made.
Further comprises:
the information verification unit is used for analyzing information verification data in the positioning area in the target two-dimensional code, and the information verification data are used for verifying the added information;
A generation unit configured to generate information verification data for verifying the added information with respect to the added information;
the comparison unit is used for comparing the analyzed information verification data with the generated information verification data and determining whether the generated information verification data is correct or not;
and the determining unit is used for determining that the analysis of the added information is successful if the comparison result of the comparing unit is yes. And if the comparison result of the comparison unit is negative, determining that the analysis of the added information fails.
Further comprises: and the output unit is used for outputting the data content of the target two-dimensional code compatible with the original two-dimensional code.
The above description of the embodiment of the data analysis device provided by the present application is relatively brief, and specific contents may be combined with the description of the embodiment of the data analysis method, which is not repeated herein.
Based on the above, the present application also provides a computer storage medium for storing network platform generated data and a program for processing the network platform generated data;
the program, when read and executed, performs the steps of:
encoding the obtained original information and the adding information required to be added into the original information to generate a first encoded data stream corresponding to the original information and a second encoded data stream corresponding to the adding information;
Generating an original two-dimensional code according to the first coded data stream, and generating corresponding target color data according to the second coded data stream;
replacing original pixels in the original two-dimensional code data area with pixels corresponding to the target color data to generate a target two-dimensional code compatible with the original two-dimensional code;
alternatively, the following steps are performed:
scanning a target two-dimensional code compatible with an original two-dimensional code, analyzing a first code value corresponding to the original two-dimensional code, and analyzing a second code value corresponding to target color data of a data area in the target two-dimensional code;
decoding the first code value and the second code value to obtain original information in the original two-dimensional code and added information added into the original two-dimensional code data area;
and determining the original information and the added information as data content compatible with the target two-dimensional code of the original two-dimensional code.
Based on the above, the present application also provides an electronic device, including:
a processor;
a memory for storing a program for processing network platform generated data, said program, when read and executed by said processor, performing the steps of:
Encoding the obtained original information and the adding information required to be added into the original information to generate a first encoded data stream corresponding to the original information and a second encoded data stream corresponding to the adding information;
generating an original two-dimensional code according to the first coded data stream, and generating corresponding target color data according to the second coded data stream;
replacing original pixels in the original two-dimensional code data area with pixels corresponding to the target color data to generate a target two-dimensional code compatible with the original two-dimensional code;
alternatively, the following steps are performed:
scanning a target two-dimensional code compatible with an original two-dimensional code, analyzing a first code value corresponding to the original two-dimensional code, and analyzing a second code value corresponding to target color data of a data area in the target two-dimensional code;
decoding the first code value and the second code value to obtain original information in the original two-dimensional code and added information added into the original two-dimensional code data area;
and determining the original information and the added information as data content compatible with the target two-dimensional code of the original two-dimensional code.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
1. Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer readable media, as defined herein, does not include non-transitory computer readable media (transmission media), such as modulated data signals and carrier waves.
2. It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
While the application has been described in terms of preferred embodiments, it is not intended to be limiting, but rather, it will be apparent to those skilled in the art that various changes and modifications can be made herein without departing from the spirit and scope of the application as defined by the appended claims.

Claims (24)

1. A data generation method, comprising:
encoding the obtained original information and the adding information required to be added into the original information to generate a first encoded data stream corresponding to the original information and a second encoded data stream corresponding to the adding information; wherein, the original information and the added information have an association relation;
Generating an original two-dimensional code according to the first coded data stream, and generating corresponding target color data according to the second coded data stream;
and replacing original pixels in the original two-dimensional code data area with pixels corresponding to the target color data to generate a target two-dimensional code compatible with the original two-dimensional code.
2. The data generating method according to claim 1, wherein the encoding the acquired original information and the additional information to be added to the original information to generate a first encoded data stream corresponding to the original information and a second encoded data stream corresponding to the additional information includes:
dividing the acquired original information to obtain divided information at least comprising two parts, wherein a second part after division is added information for adding to the first part;
the first part of the split information and the second part of the split information are coded to generate a first coded data stream corresponding to the first part of the split information and a second coded data stream corresponding to the second part of the split information.
3. The data generating method according to claim 1, wherein the encoding the acquired original information and the acquired added information to be added to the original information to generate a first encoded data stream corresponding to the original information and a second encoded data stream corresponding to the added information includes:
Acquiring original information of an original two-dimensional code to be generated;
determining extension information with association relation with the original information;
and acquiring the adding information required to be added into the original information according to the determined extension information.
4. The data generating method according to claim 1, wherein the encoding the acquired original information and the added information to be added to the original information according to the acquisition of the original information, generating a first encoded data stream corresponding to the original information and a second encoded data stream corresponding to the added information, comprises:
encoding the obtained original information and the obtained added information respectively to obtain a first encoding value corresponding to the original information and a second encoding value corresponding to the added information;
the first encoded value and the second encoded value are respectively converted into a binary encoded data stream.
5. The method of claim 4, wherein generating the original two-dimensional code from the first encoded data stream comprises:
generating the original two-dimensional code according to a binary coded data stream corresponding to the first coded value;
the generating corresponding target color data according to the second coded data stream includes:
Dividing the binary coded data stream corresponding to the second coded data stream according to the bit number of the color value, and generating target color data corresponding to the binary coded data stream.
6. The data generating method according to claim 5, wherein the dividing the binary coded data stream corresponding to the second coded data stream by the number of bits of the color value to generate the target color data corresponding to the binary coded data stream includes:
dividing the binary coded data stream corresponding to the second coded data stream according to three-bit color values to obtain divided binary coded data;
target color data corresponding to the binary coded data stream is generated from the binary coded data.
7. The method of generating data according to claim 6, wherein dividing the binary coded data stream corresponding to the second coded data stream by three-bit color values to obtain divided binary coded data, comprises:
and when the binary coded data stream is divided according to the three-bit color value, supplementing the missing bit when the three-bit color value requirement is not met, and obtaining the divided binary coded data.
8. The method of claim 1, wherein the replacing the original pixels in the original two-dimensional code data area with the pixels corresponding to the target color data to generate the target two-dimensional code compatible with the original two-dimensional code includes:
and replacing the black pixel value in the original two-dimensional code data area with the pixel value corresponding to the target color data to generate a target two-dimensional code compatible with the original two-dimensional code.
9. The data generation method according to claim 1, characterized by further comprising:
and marking color verification data for verifying the target color data in the target two-dimensional code in a positioning area of the original two-dimensional code.
10. The method of claim 9, wherein marking color verification data for verifying the target color data in the target two-dimensional code in the positioning area of the original two-dimensional code comprises:
determining the selected color data excluding the original color data in the original two-dimensional code as the color verification data;
and replacing the original pixel data in the original two-dimensional code positioning area with the color verification data.
11. The data generation method according to claim 1, characterized by further comprising:
aiming at the obtained added information which needs to be added into the original information, generating information verification data for verifying the added information;
and adding the information verification data into a positioning area of the target two-dimensional code.
12. The method of claim 11, wherein the adding the information verification data to the location area of the target two-dimensional code comprises:
encoding the information verification data to obtain verification color data for verifying the added information;
and replacing black pixels in the target two-dimensional code positioning area with color pixels corresponding to the verification color data.
13. A data generating apparatus, comprising:
the encoding unit is used for encoding the acquired original information and the adding information required to be added into the original information, and generating a first encoded data stream corresponding to the original information and a second encoded data stream corresponding to the adding information; wherein, the original information and the added information have an association relation;
the first generation unit is used for generating an original two-dimensional code according to the first coded data stream and generating corresponding target color data according to the second coded data stream;
The second generation unit is used for replacing original pixels in the original two-dimensional code data area with pixels corresponding to the target color data to generate a target two-dimensional code compatible with the original two-dimensional code.
14. A data parsing method, comprising:
scanning a target two-dimensional code compatible with an original two-dimensional code, analyzing a first code value corresponding to the original two-dimensional code, and analyzing a second code value corresponding to target color data of a data area in the target two-dimensional code;
decoding the first code value and the second code value to obtain original information in the original two-dimensional code and added information added into the original two-dimensional code data area; wherein, the original information and the added information have an association relation;
and determining the original information and the added information as data content compatible with the target two-dimensional code of the original two-dimensional code.
15. The method for analyzing data according to claim 14, wherein the scanning a target two-dimensional code compatible with an original two-dimensional code, analyzing a first encoded value corresponding to the original two-dimensional code, includes:
performing binarization processing on the target two-dimensional code to obtain a binarized two-dimensional code image;
And scanning the binarized two-dimensional code image, and analyzing a first coding value corresponding to the original two-dimensional code.
16. The method for analyzing data according to claim 14, wherein scanning a target two-dimensional code compatible with an original two-dimensional code, analyzing a first encoded value corresponding to the original two-dimensional code, and analyzing a second encoded value corresponding to target color data of a data area in the target two-dimensional code, includes:
analyzing the original two-dimensional code and the target two-dimensional code to obtain a binary data stream corresponding to the original two-dimensional code and a binary data stream corresponding to target color data of a data area in the target two-dimensional code;
and acquiring the first coding value according to the binary data stream of the original two-dimensional code, and acquiring the second coding value according to the binary data stream of the target color data of the data area in the target two-dimensional code.
17. The method of claim 14, further comprising:
scanning a target two-dimensional code compatible with an original two-dimensional code, and analyzing a positioning code value of positioning area color verification data in the target two-dimensional code;
the scanning is compatible with a target two-dimensional code of an original two-dimensional code, and the second coding value corresponding to the target color data of the data area in the target two-dimensional code is analyzed, and the scanning comprises the following steps:
And comparing the scanned target color data of the target two-dimensional code data area with the color verification data of the target two-dimensional code positioning area, and if the comparison result is the same, analyzing a second coding value corresponding to the target color data of the data area in the target two-dimensional code.
18. The data analysis method according to claim 17, wherein the scanned target color data of the target two-dimensional code data area is compared with the color verification data of the target two-dimensional code positioning area, and if the comparison results are different, a prompt message indicating that the analysis is wrong is output.
19. The data parsing method of claim 14, further comprising:
analyzing information verification data in a positioning area in the target two-dimensional code, wherein the information verification data is used for verifying the added information;
generating information verification data for verifying the added information with respect to the added information;
comparing the analyzed information verification data with the generated information verification data to determine whether the generated information verification data is correct;
if yes, determining that the analysis of the added information is successful.
20. The data analysis method according to claim 19, wherein the analyzed information verification data and the generated information verification data are compared to determine whether the analyzed information verification data is correct, and if not, the additional information analysis is determined to fail.
21. The data parsing method of claim 14, further comprising:
and outputting the data content of the target two-dimensional code compatible with the original two-dimensional code.
22. A data analysis device, comprising:
the analysis unit is used for scanning a target two-dimensional code compatible with the original two-dimensional code, analyzing a first code value corresponding to the original two-dimensional code and analyzing a second code value corresponding to target color data of a data area in the target two-dimensional code;
the decoding unit is used for decoding the first coding value and the second coding value to obtain the original information in the original two-dimensional code and the added information added into the original two-dimensional code data area; wherein, the original information and the added information have an association relation;
and the determining unit is used for determining the original information and the added information as the data content compatible with the target two-dimensional code of the original two-dimensional code.
23. A computer storage medium for storing network platform generated data and a program for processing the network platform generated data;
the program, when read and executed, performs the steps of:
encoding the obtained original information and the adding information required to be added into the original information to generate a first encoded data stream corresponding to the original information and a second encoded data stream corresponding to the adding information; wherein, the original information and the added information have an association relation;
Generating an original two-dimensional code according to the first coded data stream, and generating corresponding target color data according to the second coded data stream;
replacing original pixels in the original two-dimensional code data area with pixels corresponding to the target color data to generate a target two-dimensional code compatible with the original two-dimensional code;
alternatively, the following steps are performed:
scanning a target two-dimensional code compatible with an original two-dimensional code, analyzing a first code value corresponding to the original two-dimensional code, and analyzing a second code value corresponding to target color data of a data area in the target two-dimensional code;
decoding the first code value and the second code value to obtain original information in the original two-dimensional code and added information added into a data area of the original two-dimensional code; wherein, the original information and the added information have an association relation;
and determining the original information and the added information as data content compatible with the target two-dimensional code of the original two-dimensional code.
24. An electronic device, comprising:
a processor;
a memory for storing a program for processing network platform generated data, said program, when read and executed by said processor, performing the steps of:
Encoding the obtained original information and the adding information required to be added into the original information to generate a first encoded data stream corresponding to the original information and a second encoded data stream corresponding to the adding information; wherein, the original information and the added information have an association relation;
generating an original two-dimensional code according to the first coded data stream, and generating corresponding target color data according to the second coded data stream;
replacing original pixels in the original two-dimensional code data area with pixels corresponding to the target color data to generate a target two-dimensional code compatible with the original two-dimensional code;
alternatively, the following steps are performed:
scanning a target two-dimensional code compatible with an original two-dimensional code, analyzing a first code value corresponding to the original two-dimensional code, and analyzing a second code value corresponding to target color data of a data area in the target two-dimensional code;
decoding the first code value and the second code value to obtain original information in the original two-dimensional code and added information added into a data area of the original two-dimensional code; wherein, the original information and the added information have an association relation;
And determining the original information and the added information as data content compatible with the target two-dimensional code of the original two-dimensional code.
CN202010112366.3A 2020-02-24 2020-02-24 Data generation and analysis method and device, computer storage medium and electronic equipment Active CN111353321B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010112366.3A CN111353321B (en) 2020-02-24 2020-02-24 Data generation and analysis method and device, computer storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010112366.3A CN111353321B (en) 2020-02-24 2020-02-24 Data generation and analysis method and device, computer storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN111353321A CN111353321A (en) 2020-06-30
CN111353321B true CN111353321B (en) 2023-11-10

Family

ID=71197124

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010112366.3A Active CN111353321B (en) 2020-02-24 2020-02-24 Data generation and analysis method and device, computer storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN111353321B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112686355B (en) * 2021-01-12 2024-01-05 树根互联股份有限公司 Image processing method and device, electronic equipment and readable storage medium
CN114330405A (en) * 2021-12-28 2022-04-12 珠海格力电器股份有限公司 Data acquisition method and device, electronic device and readable storage medium
CN115310572B (en) * 2022-08-05 2024-04-16 蚂蚁区块链科技(上海)有限公司 Graphic code generation method and graphic code verification method
CN117556851A (en) * 2023-11-17 2024-02-13 广东新亚光电缆股份有限公司 Power cable management system based on two-dimensional code image recognition

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006178692A (en) * 2004-12-21 2006-07-06 Adoin Kenkyusho:Kk Colored two-dimensional code
CN103065177A (en) * 2012-12-14 2013-04-24 苏州阔地网络科技有限公司 Coding method and system of two-dimension code
CN104239927A (en) * 2014-08-01 2014-12-24 周奇 Colored two-dimension code generating method and decoding method
CN106022431A (en) * 2016-05-18 2016-10-12 北京鼎九信息工程研究院有限公司 Method and device for generating and reading color two-dimensional diagram code of color identification type
CN109784451A (en) * 2017-11-13 2019-05-21 卓望数码技术(深圳)有限公司 A kind of method and apparatus expanding two dimensional code code capacity using more colors

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006178692A (en) * 2004-12-21 2006-07-06 Adoin Kenkyusho:Kk Colored two-dimensional code
CN103065177A (en) * 2012-12-14 2013-04-24 苏州阔地网络科技有限公司 Coding method and system of two-dimension code
CN104239927A (en) * 2014-08-01 2014-12-24 周奇 Colored two-dimension code generating method and decoding method
CN106022431A (en) * 2016-05-18 2016-10-12 北京鼎九信息工程研究院有限公司 Method and device for generating and reading color two-dimensional diagram code of color identification type
WO2017198189A1 (en) * 2016-05-18 2017-11-23 北京鼎九信息工程研究院有限公司 Generation and reading method and device for colour identified colour two-dimensional figure code
CN109784451A (en) * 2017-11-13 2019-05-21 卓望数码技术(深圳)有限公司 A kind of method and apparatus expanding two dimensional code code capacity using more colors

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
张灵凤 ; 冯锋 ; 黄恒 ; .二维码技术的生成原理的分析与研究.电子设计工程.2017,(第17期),全文. *
赵水平 ; .二维码结构编码及生成技术探讨与实现.电脑知识与技术.(第08期),全文. *

Also Published As

Publication number Publication date
CN111353321A (en) 2020-06-30

Similar Documents

Publication Publication Date Title
CN111353321B (en) Data generation and analysis method and device, computer storage medium and electronic equipment
RU2251734C2 (en) Machine-readable code, method and device for encoding and decoding
US8483499B2 (en) Image processing apparatus, image processing method, computer-readable medium and computer data signal
US20080199081A1 (en) Image processing apparatus, image processing method and computer-readable medium
CN111476067A (en) Character recognition method and device for image, electronic equipment and readable storage medium
EP0483936A2 (en) Pseudo-bar code control of image transmission
JPH07121664A (en) Automatic decision apparatus of european language
JPH10134192A (en) Device and method for pattern matching encoding
US20170039463A1 (en) Two-dimensional code, two-dimensional-code analysis system, and two-dimensional-code generation system
CN112508145B (en) Electronic seal generation and verification method and device, electronic equipment and storage medium
EP1300779B1 (en) Form recognition system, form recognition method, program and storage medium
US6701022B2 (en) Pattern matching coding device and method thereof
WO2014116222A1 (en) Modifying data-bearing images
CN112069991A (en) PDF table information extraction method and related device
CN111046996A (en) Color QR code generation and identification method
US7453594B2 (en) Document filing apparatus for storing information added to a document file
US20050226516A1 (en) Image dictionary creating apparatus and method
CN112949471A (en) Domestic CPU-based electronic official document identification reproduction method and system
JPH09198511A (en) Method for sorting symbol
CN111666442B (en) Image retrieval method and device and computer equipment
CN114519788A (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
CN115620039A (en) Image labeling method, device, equipment, medium and program product
JP5720182B2 (en) Image processing apparatus and image processing program
CN112069549B (en) Method and system for downloading picture when Bootstrap-table plug-in exports table
CN113935448A (en) Double-channel color QR code encoding/decoding method

Legal Events

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