CN117010436A - Method and device for improving storage capacity of two-dimensional code, electronic equipment and storage medium - Google Patents

Method and device for improving storage capacity of two-dimensional code, electronic equipment and storage medium Download PDF

Info

Publication number
CN117010436A
CN117010436A CN202310645376.7A CN202310645376A CN117010436A CN 117010436 A CN117010436 A CN 117010436A CN 202310645376 A CN202310645376 A CN 202310645376A CN 117010436 A CN117010436 A CN 117010436A
Authority
CN
China
Prior art keywords
color
information blocks
brightness
block
dimensional code
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310645376.7A
Other languages
Chinese (zh)
Inventor
王飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China United Network Communications Group Co Ltd
Original Assignee
China United Network Communications Group 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 China United Network Communications Group Co Ltd filed Critical China United Network Communications Group Co Ltd
Priority to CN202310645376.7A priority Critical patent/CN117010436A/en
Publication of CN117010436A publication Critical patent/CN117010436A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K19/00Record carriers for use with machines and with at least a part designed to carry digital markings
    • G06K19/06Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code
    • G06K19/06009Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking
    • G06K19/06037Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking multi-dimensional coding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K19/00Record carriers for use with machines and with at least a part designed to carry digital markings
    • G06K19/06Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code
    • G06K19/06009Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking
    • G06K19/06046Constructional details

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)

Abstract

The invention provides a method and a device for improving storage capacity of a two-dimensional code, electronic equipment and a storage medium, and relates to the technical field of two-dimensional codes. The method comprises the following steps: generating black-and-white information blocks of the two-dimensional code from the information to be stored; and converting each group of black-and-white information blocks into a color block to form a color two-dimensional code, wherein each group of black-and-white information blocks comprises N information blocks, N is a positive integer greater than or equal to 2, and the color of each information block is black or white. At least the problem that the data storage amount of the two-dimensional code in the related technology is limited and cannot meet the data storage requirement is solved. The method is suitable for scenes such as two-dimensional code encoding and decoding.

Description

Method and device for improving storage capacity of two-dimensional code, electronic equipment and storage medium
Technical Field
The present invention relates to the field of two-dimensional codes, and in particular, to a method and apparatus for improving storage capacity of a two-dimensional code, an electronic device, and a computer readable storage medium.
Background
Along with popularization of two-dimensional code application, the application range of the two-dimensional code is wider and wider, and the data storage requirement is also more and more.
The two-dimensional code is limited by the size, the data storage amount is limited, and the data storage requirement cannot be met.
Disclosure of Invention
The technical problem to be solved by the invention is to provide a method, a device, electronic equipment and a computer readable storage medium for improving the storage capacity of a two-dimensional code aiming at the defects in the prior art, so as to at least solve the problem that the data storage capacity of the two-dimensional code in the related art is limited and cannot meet the data storage requirement.
In a first aspect, the present invention provides a method for improving the storage capacity of a two-dimensional code, including: generating black-and-white information blocks of the two-dimensional code from the information to be stored; and converting each group of black-and-white information blocks into a color block to form a color two-dimensional code, wherein each group of black-and-white information blocks comprises N information blocks, N is a positive integer greater than or equal to 2, and the color of each information block is black or white.
Preferably, said converting each set of black and white information blocks into a color block specifically includes: obtaining a mapping relation between a group of information blocks and a color block; each set of black and white information blocks is converted into a color block according to the mapping relation between the set of information blocks and the color block.
Preferably, the obtaining a mapping relationship between a set of information blocks and a color block specifically includes: acquiring all permutation and combination of N information blocks to obtain 2 N A result of each permutation and combination; obtaining the color brightness combinations corresponding to M brightness levels of the optical three primary colors to obtain M 3 A combination of color brightness, wherein M 3 Greater than or equal to 2 N The method comprises the steps of carrying out a first treatment on the surface of the From M 3 Selection 2 from the color brightness combinations N A combination of color brightness; will 2 N The brightness of each color is respectively combined with 2 N The arrangement and combination results are mapped one by one to form a mapping relation between a group of information blocks and a color block, wherein the group of information blocks corresponds to one arrangement and combination result, and the color block corresponds to one color brightness combination.
Preferably, n=4, m=3.
Preferably, n=5 or n=6, m=4.
Preferably, after said converting each set of black and white information blocks into one color patch to form a color two-dimensional code, the method further comprises: and decoding the color two-dimensional code.
Preferably, the decoding color two-dimensional code specifically includes: acquiring a target color block of the color two-dimensional code; acquiring a target group information block corresponding to the target color block; and analyzing the information of the target group information block.
Preferably, the acquiring the target group information block corresponding to the target color block specifically includes: filtering the target color block based on a color filter to obtain a color brightness combination of the target color block; and obtaining a target group information block corresponding to the color brightness combination according to the mapping relation between one group of information blocks and one color block.
Preferably, the filtering the target color patch based on the color filter obtains a color brightness combination of the target color patch, which specifically includes: filtering out the first color and the second color of the target color patch based on the color filter; identifying a brightness level of a third color; filtering out the second color and the third color of the target color patch based on the color filter; identifying a brightness level of a first color; filtering out the first color and the third color of the target color patch based on the color filter; identifying a brightness level of the second color; and combining the brightness levels of the first color, the second color and the third color to obtain the color brightness combination of the target color block.
In a second aspect, the invention further provides a device for improving the storage capacity of the two-dimensional code, which comprises a generating module and a converting module.
And the generation module is used for generating black-and-white information blocks of the two-dimensional code from the information to be stored.
The conversion module is connected with the generation module and used for converting each group of black-and-white information blocks into a color block so as to form a color two-dimensional code, wherein each group of black-and-white information blocks comprises N information blocks, N is a positive integer greater than or equal to 2, and the color of each information block is black or white.
Preferably, the conversion module includes an acquisition unit and a conversion unit.
And the acquisition unit is used for acquiring the mapping relation between a group of information blocks and one color block.
And the conversion unit is connected with the acquisition unit and is used for converting each group of black-and-white information blocks into a color block according to the mapping relation between one group of information blocks and one color block.
Preferably, the acquisition unit is configured toObtaining 2 from all the permutation and combination of N information blocks N The arrangement and combination result is obtained, and the color brightness combination corresponding to M brightness levels of the optical three primary colors is obtained to obtain M 3 A combination of color brightness, wherein M 3 Greater than or equal to 2 N And, for from M 3 Selection 2 from the color brightness combinations N The brightness of each color is combined, and 2 N The brightness of each color is respectively combined with 2 N The arrangement and combination results are mapped one by one to form a mapping relation between a group of information blocks and a color block, wherein the group of information blocks corresponds to one arrangement and combination result, and the color block corresponds to one color brightness combination.
In a third aspect, the present invention further provides an electronic device, including a memory and a processor, where the memory stores a computer program, and the processor is configured to run the computer program to implement a method for improving a two-dimensional code storage amount according to the first aspect.
In a fourth aspect, the present invention further provides a computer readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a method for enhancing a storage amount of a two-dimensional code according to the first aspect.
According to the method, the device, the electronic equipment and the computer readable storage medium for improving the storage capacity of the two-dimensional code, disclosed by the invention, the data volume of one group of information blocks is compressed into the data volume of one information block by converting the black-and-white information blocks into one color block, so that the information bearing capacity of the two-dimensional code is improved by multiple times under the condition that the whole size of the two-dimensional code is not changed.
Drawings
Fig. 1 is a flow chart of a method for improving the storage capacity of a two-dimensional code according to embodiment 1 of the present invention;
fig. 2 is a schematic diagram of an information block packet according to embodiment 1 of the present invention;
FIG. 3 is a diagram showing one-to-one mapping of color brightness combinations and permutation and combination results according to embodiment 1 of the present invention;
FIG. 4 is a schematic diagram of an RGB color mode according to embodiment 1 of the present invention;
fig. 5 is a schematic structural diagram of a device for improving two-dimensional code storage capacity according to embodiment 2 of the present invention;
fig. 6 is a schematic structural diagram of an electronic device according to embodiment 3 of the present invention.
Detailed Description
In order to make the technical scheme of the present invention better understood by those skilled in the art, the following detailed description of the embodiments of the present invention will be given with reference to the accompanying drawings.
It is to be understood that the specific embodiments and figures described herein are merely illustrative of the invention, and are not limiting of the invention.
It is to be understood that the various embodiments of the invention and the features of the embodiments may be combined with each other without conflict.
It is to be understood that only the portions relevant to the present invention are shown in the drawings for convenience of description, and the portions irrelevant to the present invention are not shown in the drawings.
It should be understood that each unit and module in the embodiments of the present invention may correspond to only one physical structure, may be formed by a plurality of physical structures, or may be integrated into one physical structure.
It will be appreciated that, without conflict, the functions and steps noted in the flowcharts and block diagrams of the present invention may occur out of the order noted in the figures.
It is to be understood that the flowcharts and block diagrams of the present invention illustrate the architecture, functionality, and operation of possible implementations of systems, apparatuses, devices, methods according to various embodiments of the present invention. Where each block in the flowchart or block diagrams may represent a unit, module, segment, code, or the like, which comprises executable instructions for implementing the specified functions. Moreover, each block or combination of blocks in the block diagrams and flowchart illustrations can be implemented by hardware-based systems that perform the specified functions, or by combinations of hardware and computer instructions.
It should be understood that the units and modules related in the embodiments of the present invention may be implemented by software, or may be implemented by hardware, for example, the units and modules may be located in a processor.
Example 1:
as shown in fig. 1, this embodiment provides a method for improving the storage capacity of a two-dimensional code, including:
and step 101, generating black-and-white information blocks of the two-dimensional code from the information to be stored.
In this embodiment, instead of generating a two-dimensional code, black-and-white information blocks of the two-dimensional code are generated from information to be stored, for example, when the two-dimensional code information blocks are generated from related websites, the content of the websites is converted into white blocks, and the white blocks are used for identifying the content of the website information.
Step 102, converting each group of black-and-white information blocks into a color block to form a color two-dimensional code, wherein each group of black-and-white information blocks comprises N information blocks, N is a positive integer greater than or equal to 2, and the color of each information block is black or white.
In this embodiment, when the value of N is 2, 2 black-and-white information blocks are used as a group, and each group of black-and-white information blocks is converted into a color block, so as to achieve the effect of improving the data bearing capacity by 2 times. When the value of N is 3, 3 black-and-white information blocks are taken as a group, and each group of black-and-white information blocks is converted into a color block, so that the effect of improving the data bearing capacity by 3 times is realized. Therefore, the data bearing capacity is improved under the condition that the size of the two-dimensional code is not changed. In this embodiment, the method is described with a value of N being 4, where each 4 information blocks are defined as a group of black-and-white information blocks, and each group of black-and-white information blocks is correspondingly converted into a color block. For example, as shown in fig. 2, the information to be stored is represented by grouping black-and-white information blocks with 4 information blocks as basic units, where the first group of black-and-white information blocks is specifically represented by black-and-white blocks, the second group is specifically represented by black-and-white blocks, and the third group is specifically represented by white-and-black-and-white blocks.
Specifically, converting each set of black and white information blocks into a color block includes: obtaining a mapping relation between a group of information blocks and a color block; and converting each group of black and white information blocks into a corresponding color block according to the mapping relation between one group of information blocks and one color block.
In this embodiment, in order to distinguish information block groups in different forms, it is necessary to construct mapping relationships between information blocks in different groups and different color blocks, and then perform conversion between black and white information blocks and color blocks according to the mapping relationships.
Optionally, obtaining a mapping relationship between a set of information blocks and a color block specifically includes:
step S01, all permutation and combination of N information blocks are obtained to obtain 2 N The results are combined in a permutation.
Step S02, obtaining the color brightness combinations corresponding to M brightness levels of the optical three primary colors to obtain M 3 A combination of color brightness, wherein M 3 Greater than or equal to 2 N
Step S03, slave M 3 Selection 2 from the color brightness combinations N And the individual color brightness combinations.
Step S04, 2 N The brightness of each color is respectively combined with 2 N The arrangement and combination results are mapped one by one to form a mapping relation between a group of information blocks and a color block, wherein the group of information blocks corresponds to one arrangement and combination result, and the color block corresponds to one color brightness combination.
In this embodiment, n=4 and m=3 will be described as an example. All permutation and combination of the 4 information blocks are obtained, and 16 permutation and combination results shown in fig. 3 are obtained. The optical three primary colors are red, blue and green, color brightness combinations corresponding to 3 brightness levels (such as 0,126 and 255) of the optical three primary colors are obtained, 27 color brightness combinations are obtained, 16 color brightness combinations (such as 16 color blocks shown in fig. 3) are selected for mapping with 16 arrangement combination results one by one respectively, wherein each color brightness combination corresponds to one color block, and color brightness combination values are corresponding, for example, the color brightness combination value of the color block 13 in fig. 3 is (255,255,0), so that the color block 13 is a yellow color block. For another example, the color intensity combination value of the color patch 6 is (0,126,0), so the color patch 6 is a dark green color patch. For another example, the color intensity combination value of color patch 2 is (255,126,126), so that color patch 2 is a pink color patch. The conversion mode of converting a group of information blocks into one color block is simple and easy to operate, so that the improvement of the data bearing capacity of the two-dimensional code can be rapidly realized based on the conversion mode, and the data identification efficiency of the color two-dimensional code is high during decoding.
The logical principle of substituting color blocks for 4 information blocks is as follows:
as shown in fig. 4, the RGB (red, green, blue) color mode, also called additive color mode, is a color mode used for all devices that emit light to represent colors, and is commonly used for televisions, displays, electronic screens, mobile phones, and the like. The red light, the green light and the blue light are superimposed to represent various colors, each light has 0-255 brightness levels, in this mode, white is that the brightness levels of three colors reach the maximum value, and black is that the brightness levels of three colors are zero. The 3 brightness levels of 0,126 and 255 of R (red) G (green) B (blue) are taken for color mixing, 27 colors can be obtained, 16 colors are selected from the 27 colors to represent information expression of 4 information blocks, and the storage capacity of the two-dimensional code can be expanded to 4 times, namely, each color block stores the information quantity of the original 4 color blocks. The values of N and M can also be other values, and only M needs to be satisfied 3 Greater than or equal to 2 N . Pure red, pure green and pure blue color blocks of the color two-dimensional code can be obtained through red, green and blue filters, and the pure color blocks can finish information expression of the color blocks only by judging non-color expression (0), half-brightness color expression (126) and full-brightness color expression (255), and have the characteristic of high recognition efficiency. In other words, from the brightness of 255 colors, the three dimensions of the color-free expression (0), the half-brightness color expression (126) and the full-brightness color expression (255) are analyzed, and due to the high redundancy, the high recognition degree can be realized under the condition that the color is not bright.
Alternatively, n=5 or n=6, m=4.
In this embodiment, when n=5, there are 32 permutation and combination results corresponding to 5 information blocks, and when n=6, there are 64 permutation and combination results corresponding to 5 information blocks. M=4, corresponding to 64 color brightness combinations, i.e. 64 color patches of different colors.
Optionally, after converting each set of black and white information blocks into one color patch to form a color two-dimensional code, the method further comprises: and decoding the color two-dimensional code.
Specifically, decoding the color two-dimensional code includes: acquiring a target color block of the color two-dimensional code; acquiring a target group information block corresponding to the target color block; and analyzing the information of the target group information block.
Optionally, obtaining a target group information block corresponding to the target color block specifically includes:
filtering the target color block based on a color filter to obtain a color brightness combination of the target color block;
and obtaining a target group information block corresponding to the color brightness combination according to the mapping relation between one group of information blocks and one color block.
Optionally, filtering the target color patch based on the color filter to obtain a color brightness combination of the target color patch specifically includes:
filtering out the first color and the second color of the target color patch based on the color filter;
identifying a brightness level of a third color;
filtering out the second color and the third color of the target color patch based on the color filter;
identifying a brightness level of a first color;
filtering out the first color and the third color of the target color patch based on the color filter;
identifying a brightness level of the second color;
and combining the brightness levels of the first color, the second color and the third color to obtain the color brightness combination of the target color block.
In this embodiment, for example, for an arbitrary color block of a color two-dimensional code, the cyan is filtered by the color filter, only the red remains, and the brightness of the filtered red is determined as belonging to any of the color expression (0), the half-brightness color expression (126), and the full-brightness color expression (255). And then sequentially obtaining the brightness expressions of green and blue, thereby obtaining the information represented by the color blocks. The process of generating the color two-dimensional code is simple and convenient, so that the color two-dimensional code is also simple and convenient to decode, and the efficiency of improving the data bearing capacity of the two-dimensional code can be improved.
For another example, decoding a color two-dimensional code includes: acquiring a color two-dimensional code; and positioning the first color block, filtering the bluish green two colors through a color filter, leaving only red, and judging the brightness of the filtered red, wherein the color block belongs to the color expression (0), the half-brightness color expression (126) and the full-brightness color expression (255). Similarly, sequentially obtaining the brightness expressions of green and blue, thereby obtaining the represented information; completing the identification of all color blocks and sequentially combining all original information; all stored information is acquired.
According to the method for improving the storage capacity of the two-dimensional code, black-and-white information blocks of the two-dimensional code are generated through information to be stored, and each group of black-and-white information blocks are converted into one color block to form the color two-dimensional code, so that the information carrying capacity of the two-dimensional code is improved by multiple times under the condition that the whole size of the two-dimensional code is not changed, and the multiple of the improvement depends on the number of the information blocks included in one group of black-and-white information blocks. Furthermore, the conversion mode of converting a group of information blocks into one color block is simple and easy to operate, so that the improvement of the data bearing capacity of the two-dimensional code can be rapidly realized based on the conversion mode, and the data identification efficiency of the color two-dimensional code is high during decoding. Specifically, the M brightness levels are determined from the brightness ranges (0-255) of the three optical primary colors to perform color brightness combination, due to the higher color redundancy, under the condition that the color is not bright, the formed color two-dimensional code can be decoded with higher recognition degree, the decoding process is simple and convenient, for example, pure red, pure green and pure blue blocks of the color two-dimensional code can be obtained through red, green and blue filters, and the pure color blocks only need to judge no color expression (0), half-brightness color expression (126) and full-brightness color expression (255), so that the information expression of the color blocks can be completed, and the method has the characteristic of high recognition efficiency.
Example 2:
as shown in fig. 5, the present embodiment provides a device for improving the storage capacity of a two-dimensional code, which includes a generating module 51 and a converting module 52.
The generating module 51 is configured to generate a black-and-white information block of the two-dimensional code from the information to be stored.
The conversion module 52 is connected to the generation module 51, and is configured to convert each set of black-and-white information blocks into a color block to form a color two-dimensional code, where each set of black-and-white information blocks includes N information blocks, and each information block has a color of black or white, and N is a positive integer greater than or equal to 2.
Alternatively, the conversion module 52 includes an acquisition unit 521 and a conversion unit 522.
An obtaining unit 521, configured to obtain a mapping relationship between a set of information blocks and a color block.
A conversion unit 522, coupled to the acquisition unit 521, is configured to convert each set of black and white information blocks into a color patch according to a mapping relationship between a set of information blocks and a color patch.
Optionally, the acquiring unit is configured to acquire all permutation and combination of the N information blocks to obtain 2 N The arrangement and combination result is obtained, and the color brightness combination corresponding to M brightness levels of the optical three primary colors is obtained to obtain M 3 A combination of color brightness, wherein M 3 Greater than or equal to 2 N And, for from M 3 Selection 2 from the color brightness combinations N The brightness of each color is combined, and 2 N The brightness of each color is respectively combined with 2 N The arrangement and combination results are mapped one by one to form a mapping relation between a group of information blocks and a color block, wherein the group of information blocks corresponds to one arrangement and combination result, and the color block corresponds to one color brightness combination.
The device for improving the storage capacity of the two-dimensional code is used for generating black-and-white information blocks of the two-dimensional code from information to be stored, and converting each group of black-and-white information blocks into a color block to form the color two-dimensional code, so that the information carrying capacity of the two-dimensional code is improved by multiple times under the condition that the whole size of the two-dimensional code is not changed, and the multiple of the improvement depends on the number of the information blocks included in one group of black-and-white information blocks. Furthermore, the conversion mode of converting a group of information blocks into one color block is simple and easy to operate, so that the improvement of the data bearing capacity of the two-dimensional code can be rapidly realized based on the conversion mode, and the data identification efficiency of the color two-dimensional code is high during decoding. Specifically, the method is used for determining M brightness levels from the brightness ranges (0-255) of the three optical primary colors to perform color brightness combination, and has the advantages that due to higher color redundancy, under the condition that the color is not bright, the formed color two-dimensional code can be decoded to have higher recognition degree, the decoding process is simple and convenient, for example, pure red, pure green and pure blue color blocks of the color two-dimensional code can be obtained through red, green and blue filters, and the pure color blocks only need to judge no color expression (0), half-brightness color expression (126) and full-brightness color expression (255), so that the information expression of the color blocks can be completed, and the method has the characteristic of high recognition efficiency.
Example 3:
as shown in fig. 6, the present embodiment provides an electronic device, including a memory 61 and a processor 62, where the memory 61 stores a computer program, and the processor 62 is configured to run the computer program to implement the method for improving the storage amount of the two-dimensional code as described in embodiment 1.
Example 4:
the present embodiment provides a computer-readable storage medium on which a computer program is stored, which when executed by a processor, implements the secondary carrier deactivation and activation method described in embodiment 1 or the secondary two-dimensional code storage amount promotion method described in embodiment 1.
In summary, the method, the device, the electronic device and the computer readable storage medium for improving the storage capacity of the two-dimensional code provided by the embodiments of the present invention are used for generating black-and-white information blocks of the two-dimensional code from information to be stored, and converting each group of black-and-white information blocks into a color block to form a color two-dimensional code, so that the information carrying capacity of the two-dimensional code is improved by multiple times under the condition that the overall size of the two-dimensional code is not changed, and the multiple of the improvement depends on the number of the information blocks included in one group of black-and-white information blocks. Furthermore, the conversion mode of converting a group of information blocks into one color block is simple and easy to operate, so that the improvement of the data bearing capacity of the two-dimensional code can be rapidly realized based on the conversion mode, and the data identification efficiency of the color two-dimensional code is high during decoding. Specifically, the method is used for determining M brightness levels from the brightness ranges (0-255) of the three optical primary colors to perform color brightness combination, and has the advantages that due to higher color redundancy, under the condition that the color is not bright, the formed color two-dimensional code can be decoded to have higher recognition degree, the decoding process is simple and convenient, for example, pure red, pure green and pure blue color blocks of the color two-dimensional code can be obtained through red, green and blue filters, and the pure color blocks only need to judge no color expression (0), half-brightness color expression (126) and full-brightness color expression (255), so that the information expression of the color blocks can be completed, and the method has the characteristic of high recognition efficiency.
It is to be understood that the above embodiments are merely illustrative of the application of the principles of the present invention, but not in limitation thereof. Various modifications and improvements may be made by those skilled in the art without departing from the spirit and substance of the invention, and are also considered to be within the scope of the invention.

Claims (13)

1. The method for improving the storage capacity of the two-dimensional code is characterized by comprising the following steps of:
generating black-and-white information blocks of the two-dimensional code from the information to be stored;
and converting each group of black-and-white information blocks into a color block to form a color two-dimensional code, wherein each group of black-and-white information blocks comprises N information blocks, N is a positive integer greater than or equal to 2, and the color of each information block is black or white.
2. The method according to claim 1, wherein said converting each set of black and white information blocks into a color block, comprises:
obtaining a mapping relation between a group of information blocks and a color block;
and converting each group of black and white information blocks into a corresponding color block according to the mapping relation between one group of information blocks and one color block.
3. The method according to claim 2, wherein the obtaining a mapping relationship between a set of information blocks and a color block specifically includes:
acquiring all permutation and combination of N information blocks to obtain 2 N A result of each permutation and combination;
obtaining the color brightness combinations corresponding to M brightness levels of the optical three primary colors to obtain M 3 A combination of color brightness, wherein M 3 Greater than or equal to 2 N
From M 3 Selection 2 from the color brightness combinations N A combination of color brightness;
will 2 N The brightness of each color is respectively combined with 2 N The arrangement and combination results are mapped one by one to form a mapping relation between a group of information blocks and a color block, wherein the group of information blocks corresponds to one arrangement and combination result, and the color block corresponds to one color brightness combination.
4. A method according to claim 3, wherein n=4 and m=3.
5. A method according to claim 3, wherein n=5 or n=6, m=4.
6. The method of claim 3, further comprising, after said converting each set of black and white information blocks into one color block to form a color two-dimensional code:
the color two-dimensional code is decoded,
the decoding color two-dimensional code specifically comprises:
acquiring a target color block of the color two-dimensional code;
acquiring a target group information block corresponding to the target color block;
and analyzing the information of the target group information block.
7. The method according to claim 6, wherein the obtaining the target group information block corresponding to the target color block specifically includes:
filtering the target color block based on a color filter to obtain a color brightness combination of the target color block;
and obtaining a target group information block corresponding to the color brightness combination according to the mapping relation between one group of information blocks and one color block.
8. The method according to claim 7, wherein the filtering the target color patch based on the color filter obtains a color brightness combination of the target color patch, specifically comprising:
filtering out the first color and the second color of the target color patch based on the color filter;
identifying a brightness level of a third color;
filtering out the second color and the third color of the target color patch based on the color filter;
identifying a brightness level of a first color;
filtering out the first color and the third color of the target color patch based on the color filter;
identifying a brightness level of the second color;
and combining the brightness levels of the first color, the second color and the third color to obtain the color brightness combination of the target color block.
9. A device for improving the storage capacity of two-dimension codes is characterized by comprising a generating module and a converting module,
a generation module for generating black-and-white information blocks of the two-dimensional code from the information to be stored,
the conversion module is connected with the generation module and used for converting each group of black-and-white information blocks into a color block so as to form a color two-dimensional code, wherein each group of black-and-white information blocks comprises N information blocks, N is a positive integer greater than or equal to 2, and the color of each information block is black or white.
10. The apparatus of claim 9, wherein the conversion module comprises an acquisition unit and a conversion unit,
an acquisition unit for acquiring a mapping relationship between a set of information blocks and a color block,
and the conversion unit is connected with the acquisition unit and is used for converting each group of black-and-white information blocks into a color block according to the mapping relation between one group of information blocks and one color block.
11. The apparatus according to claim 10, wherein the obtaining unit is configured to obtain all permutation and combination of the N information blocks to obtain 2 N The arrangement and combination result is obtained, and the color brightness combination corresponding to M brightness levels of the optical three primary colors is obtained to obtain M 3 A combination of color brightness, wherein M 3 Greater than or equal to 2 N
And for from M 3 Selection 2 from the color brightness combinations N The brightness of each color is combined, and 2 N The brightness of each color is respectively combined with 2 N The arrangement and combination results are mapped one by one to form a mapping relation between a group of information blocks and a color block, wherein the group of information blocks corresponds to one arrangement and combination result, and the color block corresponds to one color brightness combination.
12. An electronic device comprising a memory and a processor, the memory having a computer program stored therein, the processor being arranged to run the computer program to implement a method of increasing the amount of two-dimensional code storage as claimed in any one of claims 1 to 8.
13. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements a method for increasing the storage capacity of a two-dimensional code according to any one of claims 1-8.
CN202310645376.7A 2023-06-01 2023-06-01 Method and device for improving storage capacity of two-dimensional code, electronic equipment and storage medium Pending CN117010436A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310645376.7A CN117010436A (en) 2023-06-01 2023-06-01 Method and device for improving storage capacity of two-dimensional code, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310645376.7A CN117010436A (en) 2023-06-01 2023-06-01 Method and device for improving storage capacity of two-dimensional code, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117010436A true CN117010436A (en) 2023-11-07

Family

ID=88562615

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310645376.7A Pending CN117010436A (en) 2023-06-01 2023-06-01 Method and device for improving storage capacity of two-dimensional code, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117010436A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117560402A (en) * 2024-01-12 2024-02-13 凌锐蓝信科技(北京)有限公司 SD-WAN-based system and method for industrial security isolation and data exchange

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117560402A (en) * 2024-01-12 2024-02-13 凌锐蓝信科技(北京)有限公司 SD-WAN-based system and method for industrial security isolation and data exchange
CN117560402B (en) * 2024-01-12 2024-04-19 凌锐蓝信科技(北京)有限公司 SD-WAN-based system and method for industrial security isolation and data exchange

Similar Documents

Publication Publication Date Title
US9414087B2 (en) Compression of light field images
CN110796595B (en) Tone mapping method and device and electronic equipment
CN102812705B (en) image encoder and image decoder
Wan et al. A novel framework for optimal RGB to grayscale image conversion
CN117010436A (en) Method and device for improving storage capacity of two-dimensional code, electronic equipment and storage medium
CN108259911A (en) A kind of OLED screen Demura lossless date-compress, decompression method
US20150365685A1 (en) Method and system for encoding and decoding, encoder and decoder
CN105681775A (en) White balance method and device
CN113784175A (en) HDR video conversion method, device, equipment and computer storage medium
CN111861964B (en) Image processing method, device and storage medium
CN105578080A (en) Imaging method, image sensor, imaging device and electronic device
CN110533117A (en) Image comparison method, device, equipment and storage medium
EP3298766A1 (en) Method and device for processing color image data representing colors of a color gamut.
CN109214486B (en) Three-dimensional code, three-dimensional code generation method and device, and three-dimensional code identification method and device
CN105654017B (en) two-dimensional code transmission method and system
CN109784451B (en) Method and device for expanding two-dimensional code coding capacity by using multiple colors
CN107948652B (en) Method and equipment for image conversion
EP3029925A1 (en) A method and device for estimating a color mapping between two different color-graded versions of a picture
CN105991937A (en) Virtual exposure method and device based on Bayer format image
AU2015243117A1 (en) Method, apparatus and system for encoding and decoding image data
CN116436974B (en) Data transmission method and system
KR102162715B1 (en) Receiving device for visible light communication, and method for visible light communication using the same
CN109712216A (en) Chart rendering method, device, readable storage medium storing program for executing and electronic equipment
CN117408872B (en) Color image data conversion method, device, equipment and storage medium
US20240144426A1 (en) Super resolution image generation circuit

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