Multi-dimensional code construction method and multi-dimensional code recognition method

By generating multiple QR codes and constructing spatial positioning images and hidden factor rules for the three-dimensional code, the problems of limited capacity and insufficient security of existing QR codes are solved, and data capacity expansion and security improvement are achieved.

CN117993416BActive Publication Date: 2025-06-03CHINA MOBILE INTERNET CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311467118.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-03
Publication Date
2025-06-03
Estimated Expiration
2043-11-03

AI Technical Summary

Technical Problem

Due to the limited information capacity of existing QR codes, they cannot meet the needs of massive information storage, and there is a problem of insufficient data security.

Method used

By generating multiple QR codes, using the spatial positioning image and hidden factor rules of the 3R code, random sorting information is constructed into the 3R code to achieve data capacity expansion and secure encryption.

Benefits of technology

It has achieved the expansion of data capacity and improved security, which can effectively solve the problem of insufficient information storage and security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117993416B_ABST
    Figure CN117993416B_ABST
Patent Text Reader

Abstract

The present application provides a multi-dimensional code construction method and a multi-dimensional code recognition method. The construction method includes: classifying data information based on category information to obtain X-level data, dividing each level of data in the X-level data into blocks to obtain multiple blocks of each level of data; for the X-level data, encrypting multiple blocks of each level of data respectively to generate N two-dimensional codes; obtaining random sorting information of the N two-dimensional codes; setting the N two-dimensional codes on the spatial positioning image of the three-dimensional code based on the random sorting information; constructing the random sorting information into the spatial positioning image of the three-dimensional code based on the hidden factor rule of the two-dimensional code to generate a three-dimensional code; and declaring the hidden factor rule of the two-dimensional code in the dimension information of the three-dimensional code. A three-dimensional code is composed of multiple two-dimensional codes, and by analogy, a multi-dimensional code is composed to realize the construction of a multi-dimensional code based on two-dimensional codes, expand the data capacity through the multi-dimensional code, and improve data security.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of multi-dimensional code construction, and particularly to a multi-dimensional code construction method and a multi-dimensional code recognition method. Background Art

[0002] In the prior art, as an encrypted information carrier with the advantage of high-density coding, two-dimensional codes are widely used. However, due to their limited information-carrying capacity, they are mostly used for automated text transmission, quick website links, identity authentication, and business transactions, etc. They cannot store a large amount of information by themselves. Even a two-dimensional code in a high-pixel format (177*177) can store at most 2953 bytes, which cannot meet the information volume requirements of more fields. Summary of the Invention

[0003] This application provides a multi-dimensional code construction method and a multi-dimensional code recognition method to expand the data capacity and improve data security through multi-dimensional codes. The technical solution of this application is as follows:

[0004] In a first aspect, an embodiment of this application provides a multi-dimensional code construction method, including:

[0005] Obtain data information, and generate N two-dimensional codes based on the data information; obtain the random sorting information of the N two-dimensional codes;

[0006] Determine the spatial positioning image of the three-dimensional code, and set the N two-dimensional codes on the spatial positioning image of the three-dimensional code based on the random sorting information;

[0007] Determine the hidden factor rule of the two-dimensional code, and construct the random sorting information into the spatial positioning image of the three-dimensional code based on the hidden factor rule of the two-dimensional code to generate a three-dimensional code; and declare the hidden factor rule of the two-dimensional code in the dimension information of the three-dimensional code.

[0008] In some implementations, the generating N two-dimensional codes based on the data information includes:

[0009] Classify the data information based on category information to obtain X-level data, and divide each level of data in the X-level data into blocks to obtain multiple blocks of each level of data; where X is a positive integer;

[0010] For the X-level data, encrypt multiple blocks of each level of data respectively to generate N two-dimensional codes.

[0011] In some implementations, the encrypting multiple blocks of each level of data respectively for the X-level data to generate N two-dimensional codes includes:

[0012] Encrypt multiple chunks of first-level data with a first-level secret key, generate multiple two-dimensional codes, and add serial number encoding to the two-dimensional codes;

[0013] Encrypt multiple chunks of the i-th level data and the (i - 1)-th level secret key with the i-th level secret key, generate multiple two-dimensional codes, and add serial number encoding to the two-dimensional codes; where i is a positive integer greater than 1 and less than or equal to X.

[0014] In some implementation manners, for each level of data in the X-level data, the corresponding user binds a private key corresponding to the corresponding level according to their own level.

[0015] In some implementation manners, the obtaining the random sorting information of the N two-dimensional codes includes:

[0016] Obtain the serial numbers of the N two-dimensional codes;

[0017] Through a random algorithm, perform permutation and combination on the serial numbers of the N two-dimensional codes to obtain random sorting information.

[0018] In some implementation manners, the determining the three-dimensional code spatial positioning image includes:

[0019] Determine a rectangular area for accommodating the N two-dimensional codes;

[0020] Based on the positioning rule of the two-dimensional code, set position detection patterns in the rectangular area and add calibration patterns; where the width ratio of the position detection patterns is determined based on the dimension of the multi-dimensional code.

[0021] In some implementation manners, the constructing the random sorting information into the three-dimensional code spatial positioning image based on the hidden factor rule of the two-dimensional code includes:

[0022] Based on the random sorting information and the serial number encoding rule, obtain a random sorting code;

[0023] Transform the random sorting code into a numerical matrix;

[0024] Determine the deformation matrix of the hidden factor;

[0025] Based on the deformation matrix of the hidden factor, perform matrix bitwise operation on the numerical matrix to generate an encrypted matrix;

[0026] Based on the hidden factor rule of the two-dimensional code and the encrypted matrix, encode the N two-dimensional codes.

[0027] In some implementation manners, the hidden factor rule of the two-dimensional code is implemented by the two-dimensional code coloring method, and the encoding the N two-dimensional codes based on the hidden factor rule of the two-dimensional code and the encrypted matrix includes:

[0028] Convert the encryption matrix into a binary matrix;

[0029] Based on the hidden factor rule of the two-dimensional code and the high bits of each binary value in the binary matrix, dye the position detection pattern of the two-dimensional code corresponding to the binary value; and based on the hidden factor rule of the two-dimensional code and the low bits of each binary value in the binary matrix, dye the data pattern part of the two-dimensional code corresponding to the binary value.

[0030] In some implementation manners, the hidden factor rule of the two-dimensional code is implemented by the interval pixel ratio of the position detection pattern of the two-dimensional code.

[0031] In some implementation manners, declaring the hidden factor rule of the two-dimensional code in the dimension information of the three-dimensional code includes:

[0032] Describe the dimension information where the three-dimensional code is located, and declare the hidden factor rule of the two-dimensional code in the dimension information.

[0033] In some implementation manners, the method further includes:

[0034] Obtain the random sorting information of multiple M-dimensional codes; where M is a positive integer greater than or equal to 3;

[0035] Determine the spatial positioning image of the (M + 1)-dimensional code, and set the multiple M-dimensional codes on the spatial positioning image of the (M + 1)-dimensional code based on the random sorting information;

[0036] Determine the hidden factor rule of the M-dimensional code, and construct the random sorting information into the spatial positioning image of the (M + 1)-dimensional code based on the hidden factor rule of the M-dimensional code to generate an (M + 1)-dimensional code;

[0037] Describe the dimension information where the (M + 1)-dimensional code is located, and declare the hidden factor rule of the M-dimensional code in the dimension information.

[0038] In a second aspect, an embodiment of the present application provides a multi-dimensional code recognition method, characterized in that the multi-dimensional code is constructed by the multi-dimensional code construction method described in the first aspect, and the recognition method includes:

[0039] Based on the spatial positioning image of the three-dimensional code, construct the coordinate system of the three-dimensional code, analyze the dimension information of the three-dimensional code, and obtain the hidden factor rule of the two-dimensional code;

[0040] Based on the coordinate system and the position detection patterns of the two-dimensional codes, obtain the relevant information of the N two-dimensional codes, and add serial number encodings to the relevant information of each two-dimensional code; wherein, the relevant information of each two-dimensional code includes encrypted data information and the image information corresponding to the hidden factor rule of the two-dimensional code;

[0041] Based on the hidden factor rule of the two-dimensional code and the image information of the N two-dimensional codes, obtain the random sorting information of the N two-dimensional codes;

[0042] Based on the random sorting information of the N two-dimensional codes and the encrypted data information of the N two-dimensional codes, obtain data information.

[0043] In some implementation manners, the obtaining data information based on the random sorting information of the N two-dimensional codes and the encrypted data information of the N two-dimensional codes includes:

[0044] Based on the random sorting information of the N two-dimensional codes and the encrypted data information of the N two-dimensional codes, determine the encrypted data information of the multiple two-dimensional codes corresponding to each level of data in the X-level data;

[0045] Based on the level to which the current user belongs, obtain the secret key corresponding to this level; and iteratively decrypt the encrypted data information of the multiple two-dimensional codes corresponding to the data at the corresponding level in the X-level data through the secret key to obtain data information.

[0046] In some implementation manners, the obtaining the relevant information of the N two-dimensional codes based on the coordinate system and the position detection patterns of the two-dimensional codes, and adding serial number encodings to the relevant information of each two-dimensional code includes:

[0047] Based on the coordinate system and the position detection patterns of the two-dimensional codes, obtain the coordinate information of the N two-dimensional codes;

[0048] Based on the coordinate information of the N two-dimensional codes and the hidden factor rule of the two-dimensional code, obtain the encrypted data information and image information of the N two-dimensional codes, and add serial number encodings to the N two-dimensional codes.

[0049] In some implementation manners, the obtaining the image information of the N two-dimensional codes includes:

[0050] Through image recognition, obtain the color of the position detection pattern and the color of the data part of each two-dimensional code.

[0051] In some implementation manners, the obtaining the random sorting information of the N two-dimensional codes based on the hidden factor rule of the two-dimensional code and the image information of the N two-dimensional codes includes:

[0052] Obtain an encryption matrix based on the hidden factor rule of the two-dimensional code and the image information of the N two-dimensional codes;

[0053] Obtain the random sorting information of the N two-dimensional codes based on the encryption matrix and the hidden factor;

[0054] In some implementation manners, determining the encrypted data information of multiple two-dimensional codes corresponding to each level of the X-level data based on the random sorting information of the N two-dimensional codes and the encrypted data information of the N two-dimensional codes includes:

[0055] Obtain the hierarchical and block information of the N two-dimensional codes based on the random sorting information of the N two-dimensional codes;

[0056] Determine the encrypted data information of multiple two-dimensional codes corresponding to each level of the X-level data based on the hierarchical and block information of the N two-dimensional codes and the encrypted data information of the N two-dimensional codes.

[0057] In some implementation manners, obtaining the secret key corresponding to the level based on the level to which the current user belongs; and iteratively decrypting the encrypted data information of multiple two-dimensional codes corresponding to the corresponding level of the X-level data through the secret key to obtain data information includes:

[0058] Decrypt the encrypted data information of multiple two-dimensional codes corresponding to the corresponding level of the X-level data through the secret key to obtain the private key corresponding to this level and the previous level of data;

[0059] Loop to execute the following steps until the first-level data is obtained;

[0060] Decrypt the encrypted data information of multiple two-dimensional codes corresponding to the previous level of data through the private key corresponding to the previous level of data to obtain the private key corresponding to the previous level of data and the data at the level above the previous level.

[0061] In some implementation manners, the method further includes:

[0062] Loop to execute the following steps until the spatial positioning image of the three-dimensional code is obtained;

[0063] Based on the spatial positioning image of the M-dimensional code, construct the coordinate system of the M-dimensional code, and analyze the dimensional information of the M-dimensional code to obtain the hidden factor rule of the M-1-dimensional code;

[0064] Based on the coordinate system, obtain the image information and coordinate information corresponding to the hidden factor rule of the multiple M-1-dimensional codes;

[0065] Obtain the random sorting information of the multiple M-1-dimensional codes based on the hidden factor rule of the M-1-dimensional code and the image information of the multiple M-1-dimensional codes;

[0066] Obtain the spatial positioning image of the target M-1D code based on the random sorting information of the multiple M-1D codes and the coordinate information of the M-1D codes.

[0067] In a third aspect, an embodiment of the present application provides a multi-dimensional code construction device, including:

[0068] A two-dimensional code generation module, configured to obtain data information and generate N two-dimensional codes based on the data information;

[0069] A data sorting module, configured to obtain the random sorting information of the N two-dimensional codes;

[0070] An image formation module, configured to determine the spatial positioning image of the three-dimensional code and set the N two-dimensional codes on the spatial positioning image of the three-dimensional code based on the random sorting information;

[0071] A data encoding module, configured to determine the hidden factor rule of the two-dimensional code and construct the random sorting information into the spatial positioning image of the three-dimensional code based on the hidden factor rule of the two-dimensional code to generate a three-dimensional code; and declare the hidden factor rule of the two-dimensional code in the dimension information of the three-dimensional code.

[0072] In some implementation manners, the two-dimensional code generation module includes:

[0073] A data classification unit, configured to classify the data information based on category information to obtain X-level data, and divide each level of data in the X-level data into blocks to obtain multiple blocks of each level of data; where X is a positive integer;

[0074] A two-dimensional code generation unit, configured to encrypt multiple blocks of each level of data for the X-level data respectively to generate N two-dimensional codes.

[0075] In some implementation manners, the two-dimensional code generation unit is specifically configured to:

[0076] Encrypt multiple blocks of the first-level data through the first-level secret key to generate multiple two-dimensional codes, and add serial number encoding to the two-dimensional codes;

[0077] Encrypt multiple blocks of the i-level data and the (i - 1)-level secret key through the i-level secret key to generate multiple two-dimensional codes, and add serial number encoding to the two-dimensional codes; where i is a positive integer greater than 1 and less than or equal to X.

[0078] In some implementation manners, the user corresponding to each level of the X-level data binds the private key corresponding to the corresponding level according to their own level.

[0079] In some implementation manners, the data sorting module is specifically configured to:

[0080] Obtain the serial numbers of the N two-dimensional codes;

[0081] Through a random algorithm, perform permutation and combination on the serial numbers of the N two-dimensional codes to obtain random sorting information.

[0082] In some implementation manners, the image forming module is specifically configured to:

[0083] Determine a rectangular area for accommodating the N two-dimensional codes;

[0084] Based on the positioning rule of the two-dimensional code, set position detection patterns in the rectangular area and add calibration patterns; wherein, the width ratio of the position detection patterns is determined based on the dimension of the multi-dimensional code.

[0085] In some implementation manners, the data encoding module is specifically configured to:

[0086] Based on the random sorting information and the serial number encoding rule, obtain a random sorting code;

[0087] Transform the random sorting code into a numerical matrix;

[0088] Determine the deformation matrix of the hidden factor;

[0089] Based on the deformation matrix of the hidden factor, perform matrix bitwise operation on the numerical matrix to generate an encrypted matrix;

[0090] Encode the N two-dimensional codes based on the hidden factor rule of the two-dimensional code and the encrypted matrix.

[0091] In some implementation manners, the hidden factor rule of the two-dimensional code is implemented by the two-dimensional code coloring method, and the data encoding module is specifically configured to:

[0092] Convert the encrypted matrix into a binary matrix;

[0093] Based on the hidden factor rule of the two-dimensional code and the high bits of each binary value in the binary matrix, color the position detection patterns of the two-dimensional code corresponding to the binary value; and based on the hidden factor rule of the two-dimensional code and the low bits of each binary value in the binary matrix, color the data graphic part of the two-dimensional code corresponding to the binary value.

[0094] In some implementation manners, the hidden factor rule of the two-dimensional code is implemented by the interval pixel ratio of the position detection patterns of the two-dimensional code.

[0095] In some implementation manners, the data encoding module is further specifically configured to:

[0096] Describe the dimensional information where the three-dimensional code is located, and declare the hidden factor rule of the two-dimensional code in the dimensional information.

[0097] In some implementation manners, the device further includes a loop execution module, configured to:

[0098] Obtain the random sorting information of multiple M-dimensional codes; where M is a positive integer greater than or equal to 3;

[0099] Determine the spatial positioning image of the (M + 1)-dimensional code, and set the multiple M-dimensional codes on the spatial positioning image of the (M + 1)-dimensional code based on the random sorting information;

[0100] Determine the hidden factor rule of the M-dimensional code, and construct the random sorting information into the spatial positioning image of the (M + 1)-dimensional code based on the hidden factor rule of the M-dimensional code to generate the (M + 1)-dimensional code;

[0101] Describe the dimensional information where the (M + 1)-dimensional code is located, and declare the hidden factor rule of the M-dimensional code in the dimensional information.

[0102] In a fourth aspect, an embodiment of the present application provides a multi-dimensional code recognition device, where the multi-dimensional code is constructed by the multi-dimensional code construction method described in the first aspect, and the recognition device includes:

[0103] An image recognition module, configured to construct a coordinate system of the three-dimensional code based on the spatial positioning image of the three-dimensional code, parse the dimensional information of the three-dimensional code, and obtain the hidden factor rule of the two-dimensional code;

[0104] The image recognition module is further configured to obtain the relevant information of the N two-dimensional codes based on the coordinate system and the position detection pattern of the two-dimensional code, and add a serial number encoding to the relevant information of each two-dimensional code; where the relevant information of each two-dimensional code includes encrypted data information and the image information corresponding to the hidden factor rule of the two-dimensional code;

[0105] A data decoding module, configured to obtain the random sorting information of the N two-dimensional codes based on the hidden factor rule of the two-dimensional code and the image information of the N two-dimensional codes;

[0106] A data acquisition module, configured to obtain data information based on the random sorting information of the N two-dimensional codes and the encrypted data information of the N two-dimensional codes.

[0107] In some implementation manners, the data acquisition module includes:

[0108] A data hierarchical reduction unit, configured to determine the encrypted data information of multiple two-dimensional codes corresponding to each level of data in the X-level data based on the random sorting information of the N two-dimensional codes and the encrypted data information of the N two-dimensional codes;

[0109] A data decryption unit, configured to obtain a secret key corresponding to the current user's level based on the level to which the current user belongs; and iteratively decrypt the encrypted data information of multiple two-dimensional codes corresponding to the data at the corresponding level in the X-level data through the secret key to obtain data information.

[0110] In some implementation manners, the image recognition module is specifically configured to:

[0111] Based on the coordinate system and the position detection pattern of the two-dimensional code, obtain the coordinate information of the N two-dimensional codes;

[0112] Based on the coordinate information of the N two-dimensional codes and the hidden factor rule of the two-dimensional code, obtain the encrypted data information and image information of the N two-dimensional codes, and add serial number encoding to the N two-dimensional codes.

[0113] In some implementation manners, when the image recognition module obtains the image information of the N two-dimensional codes, it is specifically configured to:

[0114] Through image recognition, obtain the color of the position detection pattern of each two-dimensional code and the color of the data part.

[0115] In some implementation manners, the data decoding module is specifically configured to:

[0116] Based on the hidden factor rule of the two-dimensional code and the image information of the N two-dimensional codes, obtain an encryption matrix;

[0117] Based on the encryption matrix and the hidden factor, obtain the random sorting information of the N two-dimensional codes.

[0118] In some implementation manners, the data hierarchical restoration unit is specifically configured to:

[0119] Based on the random sorting information of the N two-dimensional codes, obtain the hierarchical block information of the N two-dimensional codes;

[0120] Based on the hierarchical block information of the N two-dimensional codes and the encrypted data information of the N two-dimensional codes, determine the encrypted data information of multiple two-dimensional codes corresponding to each level of data in the X-level data.

[0121] In some implementation manners, the data decryption unit is specifically configured to:

[0122] Decrypt the encrypted data information of multiple two-dimensional codes corresponding to the data at the corresponding level in the X-level data through the secret key to obtain the private key corresponding to the data at this level and the previous level;

[0123] Loop to execute the following steps until the first-level data is obtained;

[0124] Decrypt the encrypted data information of multiple two-dimensional codes corresponding to the upper-level data through the private key corresponding to the upper-level data to obtain the upper-level data and the private key of the upper-level's upper-level data.

[0125] In some implementation manners, the device further includes a loop execution module, configured to:

[0126] Loop and execute the following steps until the spatial positioning image of the three-dimensional code is obtained;

[0127] Based on the spatial positioning image of the M-dimensional code, construct the coordinate system of the M-dimensional code, and analyze the dimensional information of the M-dimensional code to obtain the hidden factor rule of the M-1-dimensional code;

[0128] Based on the coordinate system, obtain the image information and coordinate information corresponding to the hidden factor rules of the multiple M-1-dimensional codes;

[0129] Based on the hidden factor rule of the M-1-dimensional code and the image information of the multiple M-1-dimensional codes, obtain the random sorting information of the multiple M-1-dimensional codes;

[0130] Based on the random sorting information of the multiple M-1-dimensional codes and the coordinate information of the M-1-dimensional code, obtain the spatial positioning image of the target M-1-dimensional code.

[0131] In a fifth aspect, an embodiment of the present application provides an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the multi-dimensional code construction method described in the first aspect embodiment of the present application.

[0132] In a sixth aspect, an embodiment of the present application provides a non-transitory computer-readable storage medium storing computer instructions, where the computer instructions are used to cause the computer to execute the multi-dimensional code construction method described in the first aspect embodiment of the present application, or the multi-dimensional code recognition method described in the second aspect embodiment of the present application.

[0133] In a seventh aspect, an embodiment of the present application provides a computer program product, including computer instructions, where when the computer instructions are executed by a processor, the steps of the multi-dimensional code construction method described in the first aspect embodiment of the present application, or the steps of the multi-dimensional code recognition method described in the second aspect embodiment of the present application are implemented.

[0134] The technical solutions provided by the embodiments of the present application at least bring the following beneficial effects:

[0135] Using a single two-dimensional code as the basic unit of the multi-dimensional code, by defining the decoding and encoding rules in three-dimensional space, a three-dimensional code is composed of multiple two-dimensional codes to achieve the construction of a multi-dimensional code based on two-dimensional codes, and the data capacity is expanded through the multi-dimensional code. It has a high level of security encryption, improving security. And at the same time, a method for identifying the multi-dimensional code is provided.

[0136] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and do not limit this application. BRIEF DESCRIPTION OF THE DRAWINGS

[0137] The drawings herein are incorporated into the specification and constitute a part of this specification, showing embodiments consistent with this application, and are used together with the specification to explain the principles of this application, and do not constitute an improper limitation of this application.

[0138] Figure 1 It is a flowchart of a method for constructing a multi-dimensional code shown according to an exemplary embodiment.

[0139] Figure 2 It is a schematic diagram of hierarchical and block division of different categories of information shown according to an example.

[0140] Figure 3 It is an example diagram of the structure of a multi-dimensional code shown according to an example.

[0141] Figure 4 It is a flowchart of a method for identifying a multi-dimensional code shown according to an exemplary embodiment.

[0142] Figure 5 It is an example diagram of a method for constructing a multi-dimensional code according to an example of this application.

[0143] Figure 6 It is an example diagram of a method for identifying a multi-dimensional code according to an example of this application.

[0144] Figure 7 It is a block diagram of a device for constructing a multi-dimensional code shown according to an example.

[0145] Figure 8 It is a block diagram of a device for identifying a multi-dimensional code shown according to an example.

[0146] Figure 9 It is a block diagram of an electronic device shown according to an exemplary embodiment. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0147] In order to enable those of ordinary skill in the art to better understand the technical solutions of this application, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the drawings.

[0148] It should be noted that the terms "first", "second", etc. in this application are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the application described here can be implemented in an order other than those illustrated or described here. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0149] As a technology for information storage, transmission and identification, QR code has attracted the attention of many countries in the world since its birth. QR code is a black and white graphic that records data symbol information distributed in a plane (two-dimensional direction) according to a certain pattern using certain geometric figures. In the compilation of the code, the concept of "0" and "1" bit streams that constitute the internal logic basis of the computer is cleverly used, and several geometric figures corresponding to binary are used to represent textual numerical information, which is automatically read by image input devices or photoelectric scanning devices to realize automatic information processing.

[0150] In view of the above characteristics of QR code, it is widely used in various information management fields. When it is combined with mobile terminals, it enables mobile devices to have the functions of reading and electronic credentials. In the era of the Internet of Everything, QR code technology plays the role of a bridge that "links" online and offline, and has a wide range of use value.

[0151] For example, China Mobile's cloud disk contains notes and files that can be shared in the form of QR codes; 139 mailbox internal information is released, and email information is collected and transmitted through QR codes; China Mobile's office APP login uses QR code scanning and recognition for login authorization, and users add friends; Internet Evolution poster sharing and registration QR code sharing, etc. At present, information collection, management and sharing are directly shared through QR code links. If multi-dimensional codes are used, while continuing to use the existing QR code link method to collect information, sharing business scenarios can also carry more information. Users can scan and identify codes to obtain more information about the current information level based on the current user level, improving the security and capacity of shared QR codes.

[0152] At present, QR code is widely used as an encrypted information carrier with the advantage of high-density encoding. However, due to its limited information carrying capacity, it is mostly used for automatic text transmission, quick URL links, identity authentication and business transactions. It cannot store massive amounts of information. Even the highest pixel format (177*177) QR code can only store a maximum of 2953 bytes, which cannot meet the information requirements of more fields.

[0153] On the other hand, due to the inability to authenticate and encrypt, the existing two-dimensional code technology poses a risk of personal information leakage. For example, two-dimensional codes on train tickets, takeaway orders, etc. that are casually discarded can be used by criminals to obtain user information for illegal activities. At the same time, since they are mostly used for website links, they not only provide an opportunity for potential cyberattacks because they cannot provide visibility into the web pages and applications behind them, resulting in criminals being able to redirect web pages or app stores and conduct business transactions; but also due to their dependence on the network, they also provide the possibility of man-in-the-middle attacks and WIFI eavesdropping for attackers, making it difficult to meet the requirements of some services.

[0154] The technical solution of this application aims to fundamentally solve the above two major problems, give full play to the original advantages of two-dimensional codes, and formulate a hierarchical loading and encryption data scheme to ensure the security and reliability of data; at the same time, expand the dimension of the information carried by two-dimensional codes, from two-dimensional to three-dimensional, and then to ten-thousand-dimensional, realizing the display of N-dimensional security information in one code.

[0155] To solve the above technical problems, the embodiments of this application provide a method for constructing a multi-dimensional code and a method for identifying a multi-dimensional code based on two-dimensional codes. Adopting the core idea of bottom-up and dimension iteration, with a single two-dimensional code as the basic unit of the multi-dimensional code, for the decoding process of the two-dimensional code, its version information, format information, data, error correction code, etc. are decoded one by one in units of black and white pixel points. These data information are converted into a bit stream of 0s and 1s, and the Reed-Solomon error correction algorithm is used to check and correct the bit stream. The multi-dimensional code system provided by this application is based on the same design principle. Multiple two-dimensional codes form a three-dimensional code. After positioning and calibration in three-dimensional space, a set of three-dimensional space identification information coding and transformation matrices are agreed upon. All two-dimensional codes can be marked by features such as color. For the two-dimensional code itself, color does not have any information meaning. Only in the three-dimensional code space, through color and a custom information matching mechanism, can the information contained in the three-dimensional code composed of all two-dimensional codes be obtained. This information can either contain the combination rules, decoding methods, and secret keys of all two-dimensional codes, or contain the hidden information of the three-dimensional code. By analogy, a multi-dimensional code integrating multiple dimensions and massive information is finally formed.

[0156] Figure 1 It is a flowchart of a method for constructing a multi-dimensional code according to an embodiment of this application. It should be noted that the method for constructing a multi-dimensional code in the embodiments of this application can be applied to the device for constructing a multi-dimensional code in the embodiments of this application. This device for constructing a multi-dimensional code can be configured on an electronic device. As Figure 1 shown, the method for constructing a multi-dimensional code may include the following steps.

[0157] Step S101, obtain data information, and generate N two-dimensional codes based on the data information.

[0158] As an implementation manner, an implementation manner for generating N two-dimensional codes based on data information includes: grading the data information based on category information to obtain X-level data, and dividing each level of data in the X-level data into blocks to obtain multiple blocks of each level of data; where X is a positive integer; for the X-level data, encrypt multiple blocks of each level of data respectively to generate N two-dimensional codes.

[0159] In the embodiments of the present application, due to the large amount of data, the massive data is first graded and divided into blocks.

[0160] It can be understood that grading means splitting different category information into multiple levels to enable different-level users to see different categories of information. For example, as Figure 2 shown, different category information includes: contact information of type A employees, salary information of type B, and performance information of type C. Ordinary users can only see the contact information of employees, senior leadership users can see the salary information of employees, and higher-level leadership can see the performance information.

[0161] It can be understood that dividing into blocks means splitting the same category of information into multiple blocks to solve the problem that a single two-dimensional code can only contain limited information. For example, for the contact information of employees, the contact information of employees numbered 1-100 is divided into a single piece of category A information A1, and the contact information of employees numbered 101-200 is divided into a single piece of category A information A2; the salary information of employees numbered 1-100 is divided into category B information B1, and the salary information of employees numbered 101-200 is divided into category B information B2, and so on.

[0162] For the X-level data, encrypt multiple blocks of each level of data respectively to generate N two-dimensional codes. That is, in this embodiment, encrypt multiple blocks of the first-level data with the first-level secret key to generate multiple two-dimensional codes, and add a serial number encoding to the two-dimensional codes; encrypt multiple blocks of the i-level data and the (i-1)-level secret key with the i-level secret key to generate multiple two-dimensional codes, and add a serial number encoding to the two-dimensional codes; where i is a positive integer greater than 1 and less than or equal to X.

[0163] Thus, add the private key corresponding to the previous-level data to the current-level data for encryption, so that after decrypting the current-level data, the private key of the previous-level data can be obtained, and decrypt level by level to obtain multi-level data information lower than the current-level data.

[0164] In some embodiments, add the serial number encoding of the data block corresponding to the two-dimensional code to the hidden information of each two-dimensional code.

[0165] Exemplarily, taking the above employee information as an example, the A-category information after chunking is encrypted asymmetrically. The A-category information corresponds to an asymmetric key pair (public key A and private key A). The original text of the chunked A-category information is encrypted using public key A, and finally the encrypted ciphertext is integrated into multiple two-dimensional codes. Since the amount of information that a single two-dimensional code can accommodate is limited, the data of A1, A2, and A3 are encrypted and placed into 3 two-dimensional codes respectively. And in the hidden information of the two-dimensional code, the serial number encoding of the data block to which the two-dimensional code belongs is added. This hidden information can be restored to the serial number encoding of the data block corresponding to the two-dimensional code through a uniqueness matrix and perspective transformation, facilitating the later splicing and restoration of the information of multiple two-dimensional codes into the original data information.

[0166] The B-category information after chunking is encrypted asymmetrically. The B-category information corresponds to an asymmetric key pair (public key B and private key B). The private key A generated by fusing the B-category information with the A-category information is encrypted using public key B. Finally, the encrypted ciphertext is integrated into m two-dimensional codes, and the serial number encoding of the data block to which the current two-dimensional code belongs is marked in the hidden information of the two-dimensional code. The purpose of integrating the private key A of the A-category information into the B-category information here is that when a B-category user obtains the B-category information, they can also parse out the private key of the A-category information through the private key of the B-category information and decrypt and load the n two-dimensional code information generated by the A-category information. In this way, the B-category user can obtain the B-category information and the A-category information (which means the B-category user can obtain the contact information and salary information of the original information user). By analogy, for the C-category information, after splicing the multiple pieces of data obtained by splitting the C-category information with the private key B generated by the B-category information, it is encrypted using the newly generated asymmetric key pair of the C-category information (public key C and private key C), and serialized into multiple two-dimensional codes. The above steps are executed in a loop until all hierarchical data information is encrypted and serialized into N two-dimensional codes.

[0167] It should be noted that each level of data in the X-level data corresponds to a user who binds the private key corresponding to their own level to decrypt the data information corresponding to the corresponding level.

[0168] Users bind the private keys corresponding to the information of the corresponding hierarchical levels according to their own levels. The corresponding levels can view all the information of the corresponding levels and the levels below. For example, A-level users can view A-level information, that is, the contact information of all users. B-level users can view B-level information and A-level information, that is, they can query the salary situation information and contact information of all users. A-level users bind the asymmetric encryption private key A generated by A-level information, B-level users bind the asymmetric encryption private key B generated by B-level information, and so on. All levels of users bind the asymmetric encryption keys generated by the information of the corresponding levels to decrypt the information of the corresponding levels.

[0169] Step S102, obtain the random sorting information of N two-dimensional codes.

[0170] As an implementation method, the implementation method for obtaining the random sorting information of N two-dimensional codes includes:

[0171] Obtain the serial numbers of N two-dimensional codes; through a random algorithm, perform permutation and combination on the serial numbers of N two-dimensional codes to obtain random sorting information.

[0172] Optionally, use the Shuffle random sorting algorithm (shuffle algorithm) to perform permutation and combination on the serial numbers of N two-dimensional codes to obtain random sorting information.

[0173] With the help of the Random() function of the random factor, use the shuffle algorithm to equally probabilistically shuffle the serial number encodings corresponding to all two-dimensional codes. The obtained random sequence cannot be restored by code, preventing others from finding the sorting rule through multiple multi-dimensional codes and thus restoring the original sorting sequence of all two-dimensional codes.

[0174] For example, there are three two-dimensional codes A1, A2, and A3 for type A information, three two-dimensional codes B1, B2, and B3 for type B information, and three two-dimensional codes C1, C2, and C3 for type C information. The original sorting should be A1, A2, A3, B1, B2, B3, C1, C2, C3. After random sorting, the serial number encoding sequence of multiple two-dimensional codes becomes A1, B1, C2, B2, B3, A3, C3, A2, C1. This random sorting information needs to be recorded for the encoding implementation of the three-dimensional code.

[0175] Step S103, determine the spatial positioning image of the three-dimensional code, and set the N two-dimensional codes on the spatial positioning image of the three-dimensional code based on the random sorting information.

[0176] As an implementation method, the method for determining the spatial positioning image of the three-dimensional code includes:

[0177] Determine the rectangular area for accommodating N two-dimensional codes; based on the positioning rules of the two-dimensional codes, set position detection patterns in the rectangular area and add calibration patterns; among them, the width of the position detection pattern is determined based on the dimension of the multi-dimensional code.

[0178] It can be understood that, according to the current number of two-dimensional codes, a rectangular area is determined. For example, if there are 9 two-dimensional codes, a 3*3 rectangular area needs to be determined to accommodate all the two-dimensional codes. And according to the positioning rules of the two-dimensional codes, position detection patterns are marked at the upper left, upper right, and lower left positions of the rectangular area (these three positions can not only determine the position of the rectangle but also determine the direction of the rectangle), and correction patterns are supplemented (to facilitate determining the current dimensional coordinate system). Among them, the position detection pattern is used to detect and locate the matrix space of the three-dimensional code when scanning the three-dimensional code. It should be noted that the position detection patterns corresponding to the spatial positioning images of different dimensions are all different. For example, the width ratio of the position detection pattern of the three-dimensional code is different from that of the two-dimensional code. The width ratio of the position detection pattern of the two-dimensional code is 1:1:3:1:1, and the width ratio of the position detection pattern of the three-dimensional code is 1:2:3:2:1. When expanding to higher dimensions, the width ratio of the corresponding position detection pattern can be dynamically adjusted to locate the matrix position and direction of the corresponding dimensional code respectively.

[0179] After determining the spatial positioning image of the three-dimensional code, N two-dimensional codes are set in the spatial positioning image of the three-dimensional code based on the random sorting information.

[0180] Optionally, after determining the spatial positioning image of the three-dimensional code, according to the random sorting information, the corresponding two-dimensional codes are inserted one by one in the order from left to right and from top to bottom of the matrix.

[0181] Exemplarily, the three-dimensional code structure is as Figure 3 shown, and it consists of position detection pattern 1, format information 3, positioning pattern 4, correction pattern 5, dimension information 6, and multiple two-dimensional codes 2, etc. Among them, the dimension information 6 includes: the relationship mapping between internal two-dimensional codes, the definition of combination rules, the label convergence information carried by the multi-dimensional code, verification information, etc.

[0182] Step S104, determine the hidden factor rule of the two-dimensional code, and build the random sorting information into the spatial positioning image of the three-dimensional code based on the hidden factor rule of the two-dimensional code to generate a three-dimensional code; and declare the hidden factor rule of the two-dimensional code in the dimension information of the three-dimensional code.

[0183] As an implementation method, the method of building the random sorting information into the spatial positioning image of the three-dimensional code includes: obtaining a random sorting code based on the random sorting information and the serial number encoding rule; transforming the random sorting code into a numerical matrix; determining the deformation matrix of the hidden factor; performing matrix bitwise operation on the numerical matrix based on the deformation matrix of the hidden factor to generate an encryption matrix; encoding N two-dimensional codes based on the hidden factor rule of the two-dimensional code and the encryption matrix.

[0184] The purpose of this step is to mark the information on how to parse the encrypted data of the QR code in the three-dimensional code dimension, and inject this set of hidden rules into the three-dimensional code in a customized manner. Taking the above three categories of information A, B, and C in 3*3 as an example, the randomly sorted information of the QR code is constructed into the current three-dimensional code space in the way of hidden factors.

[0185] First, determine the encoding corresponding to the original serial number of the QR code.

[0186]

[0187] Then, the sorting sequence A1, B1, C2, B2, B3, A3, C3, A2, C1 of the original serial numbers after being sorted by the random algorithm corresponds to the serial number encoding 148563927. Convert this serial number encoding into a numerical matrix [[1, 4, 8], [5, 6, 3], [9, 2, 7]]. Determine a transformed matrix of the hidden factor, such as [[2, 2, 0], [1, 0, 2], [1, 2, 1]] (perform invertible encoding on the original numerical matrix). This transformed matrix exists in the multi-dimensional code recognition system and is used to retrieve the original serial number encoding reversely later. After the numerical matrix becomes an encrypted matrix [[3, 6, 8], [4, 6, 1], [8, 0, 6]] through the bit operation XOR encryption and decryption by the transformed matrix. Based on the determined hidden factor rules of the QR code and this encrypted matrix, encode N QR codes, that is, construct the randomly sorted information of the QR code into the current three-dimensional code space.

[0188] The hidden factor rules of the QR code can be customized. The following describes two possible implementation methods, but it is not limited to this.

[0189] As a possible implementation method, the hidden factor rules of the QR code are implemented through the QR code coloring method. Based on the hidden factor rules of the QR code and the encrypted matrix, encode N QR codes, including:

[0190] Convert the encrypted matrix into a binary matrix; based on the hidden factor rules of the QR code and the high bits of each binary value in the binary matrix, color the position detection pattern of the QR code corresponding to this binary value; and based on the hidden factor rules of the QR code and the low bits of each binary value in the binary matrix, color the data pattern part of the QR code corresponding to this binary value.

[0191] Exemplarily, the hidden factor rules of the QR code are implemented through the QR code coloring method, and the color encoding is as follows:

[0192] Encoding 00 01 10 11 Color Red Blue Green Black

[0193] The binary encoding corresponding to the encrypted matrix is the following binary matrix:

[0194] [[0011,0110,1000],[0100,0110,0001],[1000,0000,0110]]

[0195] Taking the matrix subscript (1,1) as an example, for 0011, the high-order bits of the binary are 00 and the low-order bits are 11. The color corresponding to 00 is red, and the color corresponding to 11 is black. Then, to find the spatial image of the three-dimensional code, for the first two-dimensional code in the upper left corner, color the position detection pattern red and color the data part of this two-dimensional code black. In the two-dimensional code system, the position detection pattern being red or other colors has no other meaning. For the coordinate (1,2), the binary is 0110, the high-order bits are 01, and the low-order bits are 10. Then, for the second two-dimensional code in the first row, color its position detection pattern blue and color the data part green. And so on, using the custom hidden factor rule, color all the two-dimensional codes.

[0196] As another possible implementation, the hidden factor rule of the two-dimensional code is implemented by the interval pixel ratio of the position detection pattern of the two-dimensional code.

[0197] Exemplarily, the hidden factor rule is implemented by the interval pixel ratio of the position detection pattern of the two-dimensional code.

[0198] Encoding 00 01 10 11 Interval Ratio 1:2 1:3 1:4 1:5

[0199] First, determine the spacing pixels of the position detection pattern of the two-dimensional code. For example, it is 1000 pixels (that is, the X-axis of the coordinate system of the two-dimensional code). For example, the spacing between the upper left and upper right of the first two-dimensional code is 200 pixels (interval ratio 1:5), and the spacing between the upper left and upper right of the second two-dimensional code is 500 pixels (interval ratio 1:2).

[0200] In this embodiment, describe the dimensional information where the three-dimensional code is located and declare the hidden factor rule of the two-dimensional code in the dimensional information.

[0201] Describe the dimensional information where the three-dimensional code is located, and declare the hidden factor rule method in the dimensional information verification module and version information. The function is that it can be extended to other dimensions, and other methods can be used for underlying encoding. For example, when the three-dimensional code is extended to the four-dimensional code space, the interval pixel ratio of each position detection pattern of the three-dimensional code can be used to carry the hidden factor information rule, and the scheme rule used is marked in the four-dimensional code space.

[0202] The above steps describe the creation process of the three-dimensional code provided by the embodiment of the present application. Next, on the basis of the creation of the three-dimensional code, describe the creation process of the multi-dimensional code with a higher dimension.

[0203] Step S105, loop to execute the following steps until the number of loops reaches a preset value to generate a multi-dimensional code with more than three dimensions.

[0204] Step S106, obtain the random sorting information of multiple M-dimensional codes; where M is a positive integer greater than or equal to 3.

[0205] In the embodiment of the present application, the implementation manner of step S106 can refer to the implementation manner of step S102 and will not be elaborated here.

[0206] Step S107, determine the spatial positioning image of the M+1-dimensional code, and set multiple M-dimensional codes on the spatial positioning image of the M+1-dimensional code based on the random sorting information.

[0207] In the embodiment of the present application, the implementation manner of step S107 can refer to the implementation manner of step S103 and will not be elaborated here.

[0208] Step S108, determine the hidden factor rule of the M-dimensional code, and construct the random sorting information into the spatial positioning image of the M+1-dimensional code based on the hidden factor rule of the M-dimensional code to generate the M+1-dimensional code.

[0209] In the embodiment of the present application, the implementation manner of step S108 can refer to the implementation manner of step S104 and will not be elaborated here.

[0210] Step S109, describe the dimension information where the M+1-dimensional code is located, and declare the hidden factor rule of the M-dimensional code in the dimension information.

[0211] Exemplarily, taking the construction of the multi-dimensional code of employee information as an example: each two-dimensional code carries information such as the name, mobile phone, position, and employee number of a single employee. There are 3 employees corresponding to 3 two-dimensional codes. Then in the dimension information of the three-dimensional code, it can be defined which ranges of employee numbers the two-dimensional codes are grouped by (for example, employees No. 1-2 are in group a, and No. 3 is in group b), and it is stated that the label convergence information of this three-dimensional code is the set of employee information in department A (such as the information of business department A), as well as the group check code. And so on, a three-dimensional code containing the employee information of department A, plus the three-dimensional codes of the information of department B and department C, can form the company information of a four-dimensional code. Multiple four-dimensional codes can form the group information of a five-dimensional code, and multiple five-dimensional codes can form the industry information of a six-dimensional code.

[0212] It can be seen that the expansion between the dimensions of the multi-dimensional code increases at the dimension level, and the amount of data carried is increased by a factor of one hundred thousand or one hundred compared with the existing two-dimensional code, greatly improving the existing situation of data shortage.

[0213] The data capacity is expanded through multi-dimensional codes. After completing the vertical positioning of the basic dimension, all the data information contained in the multi-dimensional code is hierarchically loaded. These data information includes core data information, data matching rules, etc. The M-dimensional code includes the composition and decoding / encoding rules of M-dimensional information, as well as the arrangement encryption / decryption rules of the (M - 1)-dimensional code, etc.

[0214] The multi-dimensional code construction method of the embodiments of the present application takes a single two-dimensional code as the basic unit of the multi-dimensional code. By defining the decoding / encoding rules in three-dimensional space, a three-dimensional code is composed of multiple two-dimensional codes, and so on, to form a multi-dimensional code, realizing the construction of a multi-dimensional code based on two-dimensional codes, and expanding the data capacity through the multi-dimensional code. By encrypting data hierarchically, the security of the data is improved. It can be used to enhance various usage scenarios of information security management and sharing.

[0215] The above describes the multi-dimensional code construction method. Next, the recognition method of the multi-dimensional code obtained through the above construction method will be described.

[0216] Based on any of the above embodiments, Figure 4 is a flowchart of the multi-dimensional code recognition method according to an embodiment of the present application. It should be noted that the multi-dimensional code recognition method of the embodiments of the present application can be applied to the multi-dimensional code recognition device of the embodiments of the present application. The multi-dimensional code construction device can be configured on an electronic device. As Figure 4 shown, the multi-dimensional code construction method may include the following steps.

[0217] Step S201, based on the spatial positioning image of the three-dimensional code, construct the coordinate system of the three-dimensional code, and analyze the dimensional information of the three-dimensional code to obtain the hidden factor rule of the two-dimensional code.

[0218] It can be understood that only by constructing the coordinate system of the three-dimensional code can the coordinate information of each two-dimensional code in the spatial positioning image of the three-dimensional code be determined, so as to perform operations such as adding serial numbers, sorting, or saving relevant information for N two-dimensional codes according to the coordinate information.

[0219] As an implementation method, based on the position detection pattern of the three-dimensional code in the spatial positioning image of the three-dimensional code, establish the coordinate system of the three-dimensional code.

[0220] Referring to the positioning detection process of the two-dimensional code, use median filtering, Sobel operator edge extraction, maximum inter-class variance method, Hough transform, etc. to correct and preprocess the three-dimensional code graph. Detect and identify the range coordinates of the three-dimensional code according to the width ratio (for example, 1:2:3:2:1) structure of the position detection pattern of the three-dimensional code. Accurately locate the dimension where it is located with the help of the correction symbol, and establish the coordinate system of the current three-dimensional code. The coordinate system is used to carry the coordinates of all two-dimensional codes.

[0221] It can be understood that in order to parse the random sorting information of the two-dimensional code so as to restore the block-level and hierarchical information of the original massive data according to the random sorting information, it is necessary to obtain the hidden factor rules of the two-dimensional code declared in the dimensional information of the three-dimensional code. During the construction of the three-dimensional code, the hidden factor rules of the two-dimensional code are declared in the dimensional information of the three-dimensional code. Parse the dimensional information of the three-dimensional code to obtain the hidden factor rules of the two-dimensional code (for example, the rules include the color coding rules for constructing the three-dimensional code, such as red corresponding to 00).

[0222] Step S202: Based on the coordinate system and the position detection patterns of the two-dimensional codes, obtain the relevant information of N two-dimensional codes, and add serial number coding to the relevant information of each two-dimensional code; wherein, the relevant information of each two-dimensional code includes encrypted data information and image information corresponding to the hidden factor rules of the two-dimensional code.

[0223] As an implementation method, based on the coordinate system and the position detection patterns of the two-dimensional codes, obtain the coordinate information of N two-dimensional codes; based on the coordinate information of N two-dimensional codes and the hidden factor rules of the two-dimensional code, obtain the encrypted data information and image information of N two-dimensional codes, and add serial number coding to N two-dimensional codes.

[0224] According to the existing two-dimensional code detection technologies: positioning and correction, transformation and decoding, etc. In the two-dimensional information area, convert the pixel points in a zigzag pattern into binary decoding, determine the coding type, information length, arrangement rules, and label convergence information of the two-dimensional code, parse out the information of all two-dimensional codes (here the information is all encrypted information and the order is disrupted) and load it into the memory, that is, after the two-dimensional code numerical conversion, obtain the encrypted ciphertext contained in all two-dimensional codes. Then mark the coordinates of each two-dimensional code in the coordinate system of the constructed three-dimensional code, for example, add serial number coding to each two-dimensional code from left to right and from top to bottom.

[0225] As an implementation method, the method for obtaining the image information of N two-dimensional codes includes: through image recognition, obtain the colors of the position detection patterns and the data parts of each two-dimensional code.

[0226] It can be understood that after obtaining the hidden factor rules of the two-dimensional code, the corresponding image information can be obtained. For example, when the hidden factor rules of the two-dimensional code are implemented by the two-dimensional code dyeing method, during the recognition of the two-dimensional code, OpenCV can be used to perform image recognition on all two-dimensional codes to recognize the colors of the position detection patterns and the data pattern parts of the two-dimensional codes. For example, during the construction of the multi-dimensional code, a total of 9 two-dimensional codes of 3*3 are generated. The color of the position detection pattern of the first two-dimensional code in the upper left corner is red, and the color of the data pattern is black, and so on. Perform image recognition on the colors of the position detection patterns and the data pattern parts of all two-dimensional codes and load the relevant data into the memory.

[0227] Step S203: Obtain the random sorting information of N two-dimensional codes based on the hidden factor rule of the two-dimensional code and the image information of the N two-dimensional codes.

[0228] It can be understood that when constructing the three-dimensional code, the random sorting information is constructed into the spatial positioning image of the three-dimensional code based on the hidden factor rule of the two-dimensional code. During recognition, the random sorting information hidden in the two-dimensional code is obtained through the reverse process.

[0229] As an implementation method, the method for obtaining the random sorting information of N two-dimensional codes includes: obtaining an encryption matrix based on the hidden factor rule of the two-dimensional code and the image information of the N two-dimensional codes; and obtaining the random sorting information of the N two-dimensional codes based on the encryption matrix and the hidden factor.

[0230] According to the hidden factor rule of the two-dimensional code, decode and translate the colors of the position detection patterns of all the obtained two-dimensional codes and the color data of the data pattern parts. For example, if the red color of the position detection pattern of the first two-dimensional code is restored to the encoding 00 and the color of the data pattern is black 11, then the binary data of the first two-dimensional code is restored to 0011. After restoring all the color data of the two-dimensional codes through decoding and translation, a numerical matrix, that is, the encryption matrix, is generated for the following matrix transformation to restore the original matrix data.

[0231] After performing a transformation operation (XOR algorithm) on the encryption matrix through the deformation matrix [[2, 2, 0], [1, 0, 2], [1, 2, 1]] of the hidden factor, the original numerical matrix [[1, 4, 8], [5, 6, 3], [9, 2, 7]] can be obtained, and then the numerical matrix is converted into the serial number encoding 148563927 of the original two-dimensional code. Then, according to the serial number encoding rule, it is restored to the serial number sorting after the original two-dimensional code serial numbers are randomly sorted as A1, B1, C2, B2, B3, A3, C3, A2, C1.

[0232] Step S204: Obtain data information based on the random sorting information of N two-dimensional codes and the encrypted data information of the N two-dimensional codes.

[0233] As an implementation method, the implementation method for obtaining data information based on the random sorting information of N two-dimensional codes and the encrypted data information of the N two-dimensional codes includes: determining the encrypted data information of multiple two-dimensional codes corresponding to each level of data in the X-level data based on the random sorting information of N two-dimensional codes and the encrypted data information of the N two-dimensional codes; obtaining the secret key corresponding to this level based on the level to which the current user belongs; and iteratively decrypting the encrypted data information of multiple two-dimensional codes corresponding to the corresponding level of data in the X-level data through the secret key to obtain data information.

[0234] As an implementation, a method for determining the encrypted data information of multiple two-dimensional codes corresponding to each level of X-level data; including: based on the random sorting information of N two-dimensional codes, obtaining the hierarchical and segmented information of N two-dimensional codes; based on the hierarchical and segmented information of N two-dimensional codes and the encrypted data information of N two-dimensional codes, determining the encrypted data information of multiple two-dimensional codes corresponding to each level of X-level data.

[0235] After obtaining the random sorting of multiple two-dimensional codes, restore and combine the original two-dimensional code data to restore the original three levels of data A, B, and C. Each level of data contains 3 two-dimensional code data, corresponding to the segmented data of the same-level data information when constructing the multi-dimensional code. Then, assemble the encrypted ciphertexts corresponding to the previously obtained two-dimensional codes in order according to the parsed hierarchical and segmented data.

[0236] Exemplarily, after obtaining the serial number sequence A1, B1, C2, B2, B3, A3, C3, A2, C1, according to the previous serial number addition rule, restore and obtain the 3 encrypted ciphertexts A1, A2, A3 corresponding to class A data and assemble them. Assemble the 3 encrypted ciphertexts B1, B2, B3 corresponding to class B data; Assemble the 3 encrypted ciphertexts C1, C2, C3 corresponding to class C data.

[0237] As an implementation, a method for obtaining data information by iteratively decrypting the encrypted data information of multiple two-dimensional codes corresponding to the corresponding level of X-level data through a secret key, including: after obtaining the secret key corresponding to this level, decrypting the encrypted data information of multiple two-dimensional codes corresponding to the corresponding level of X-level data through the secret key to obtain the private key corresponding to this level of data and the previous level of data;

[0238] Loop and execute the following steps until the first-level data is obtained;

[0239] Decrypt the encrypted data information of multiple two-dimensional codes corresponding to the previous level of data through the private key corresponding to the previous level of data to obtain the private key of the previous level of data and the previous level of the previous level of data.

[0240] Exemplarily, the user obtains the decryption key corresponding to the current level. For example, a C-level user obtains the decryption key C for C-level information, decrypts the three assembled pieces of C-level information C1, C2, and C3, and obtains the original C-level information (the performance of all employees) and the private key B for B-level information. Continuing, using the obtained private key B, decrypt the three assembled pieces of B-level information B1, B2, and B3 to obtain the original B-level information (the salary of all employees) and the private key A for A-level information. Continuing, using the obtained private key A, decrypt the three assembled pieces of A-level information A1, A2, and A3 to obtain the original A-level information (the contact information of all employees). In this way, the C-level user obtains all the information contained in the three-dimensional code through the C-level key. The B-level user can only obtain the private key B for the bound B-level information, so it can only decrypt and obtain B-level (employee salary) and A-level (employee contact information) information.

[0241] It can be seen that the multi-dimensional code constructed in the embodiment of the present application can not only ensure the security of the data contained in the multi-dimensional code, but also achieve precise hierarchical control of the data.

[0242] The above steps describe the entire process of identifying and parsing a three-dimensional code. The identification method for a multi-dimensional code with a higher dimension than a three-dimensional code needs to first execute the following steps. After obtaining the spatial positioning image of the three-dimensional code, transfer to execute the above steps to complete the identification process of the multi-dimensional code.

[0243] Step S205, repeatedly execute the following steps until the spatial positioning image of the three-dimensional code is obtained.

[0244] Step S206, based on the spatial positioning image of the M-dimensional code, construct the coordinate system of the M-dimensional code, analyze the dimension information of the M-dimensional code, and obtain the hidden factor rule of the M-1-dimensional code.

[0245] In the embodiment of the present application, the implementation method of step S206 can refer to the implementation method of step S201 and will not be elaborated here.

[0246] Step S207, based on the coordinate system, obtain the image information and coordinate information corresponding to the hidden factor rules of multiple M-1-dimensional codes.

[0247] In the embodiment of the present application, the implementation method of step S207 can refer to the implementation method of step S202 and will not be elaborated here.

[0248] Step S208, based on the hidden factor rules of the M-1-dimensional code and the image information of multiple M-1-dimensional codes, obtain the random sorting information of multiple M-1-dimensional codes.

[0249] In the embodiment of the present application, the implementation method of step S208 can refer to the implementation method of step S203 and will not be elaborated here.

[0250] Step S209: Based on the random sorting information of multiple (M - 1)-dimensional codes and the coordinate information of the (M - 1)-dimensional codes, obtain the spatial positioning image of the target (M - 1)-dimensional code.

[0251] Obtaining the random sorting information of multiple (M - 1)-dimensional codes can determine the position of the target (M - 1)-dimensional code. Combining with the coordinate information, the spatial positioning image of the target (M - 1)-dimensional code can be located.

[0252] After this step is looped through, obtain the spatial positioning image of the target three-dimensional code, and then return to execute steps S201 - S204 to complete the recognition of the multi-dimensional code and obtain the corresponding information.

[0253] The multi-dimensional code recognition method in the embodiments of the present application uses a single two-dimensional code as the basic unit of the multi-dimensional code. By defining the decoding and encoding rules in three-dimensional space, multiple two-dimensional codes are combined to form a three-dimensional code, and so on, to form a multi-dimensional code, realizing the construction of a multi-dimensional code based on two-dimensional codes and expanding the data capacity through the multi-dimensional code. By encrypting data hierarchically, the security of the data is improved. By recognizing the constructed multi-dimensional code, a large amount of secure and reliable data can be obtained.

[0254] The following describes the multi-dimensional code construction process and the corresponding multi-dimensional code recognition process through some specific examples.

[0255] Figure 5 It is a flowchart of an example of a multi-dimensional code construction method according to an example of the present application. Refer to Figure 5 , the multi-dimensional code construction method includes:

[0256] Step 1: Block and classify the massive information based on the category information.

[0257] Step 2: Encrypt the Class A information after blocking to generate multiple two-dimensional codes.

[0258] Step 3: Encrypt the Class B information after blocking, fuse the private key A of the encrypted Class A information and the original blocked Class B information, and generate multiple two-dimensional codes.

[0259] Step 4: Loop to encrypt the Class B information and the information of the upper level to generate two-dimensional codes.

[0260] Step 5: The user binds the private key corresponding to their own level according to their level.

[0261] Step 6: Arrange and combine all the generated N two-dimensional codes through a random algorithm, and record the random sorting rule.

[0262] Step 7: Determine the spatial positioning image of the three-dimensional code, and place the above two-dimensional codes on the graph of the three-dimensional code according to the random arrangement rule.

[0263] Step 8, customize the hidden factor rule and incorporate this hidden factor rule into the QR code included in the 3D code through matrix transformation.

[0264] Step 9, improve the verification rule for dimension information to complete the construction of the 3D code.

[0265] Step 10, loop through the above steps to generate a multi-dimensional code.

[0266] For example, after generating a 3D code, the 3D code can be regarded as a QR code, and N 3D codes form a four-dimensional code space. The random sorting information and decoding rules of the 3D code can be declared in the four-dimensional space. After sorting, clarify the positions of the position detection patterns in the four-dimensional code space, and gradually place the 3D codes into the four-dimensional code space. By analogy, the multi-dimensional code space data can be expanded to higher dimensions to make it contain richer information.

[0267] Taking the implementation of the hidden factor rule of the QR code by the QR code coloring method as an example, Figure 6 is an example flowchart of a multi-dimensional code recognition method according to an example of the present application. See Figure 6 , the multi-dimensional code recognition method may include the following steps:

[0268] Step 1, based on the position detection pattern of the 3D code, construct the coordinate system of the 3D code.

[0269] Step 2, analyze the hidden factor rule of the QR code customized in the 3D code.

[0270] Step 3, through the position detection pattern of the QR code, determine the encrypted content and coordinates of all QR codes that make up the 3D code.

[0271] Step 4, through image recognition means, recognize the position detection pattern and the color of the data part pattern that make up the QR code.

[0272] Step 5, through the recognized colors, after decoding, restore the random sorting rule of the QR code through matrix transformation.

[0273] Step 6, restore the original sorting of the QR code and perform hierarchical and block decoding and assembly.

[0274] Step 7, obtain the user level corresponding to the current user, obtain the decryption private key corresponding to the level, and use the private key to iteratively decrypt the corresponding encrypted content to obtain the current level information and lower level information.

[0275] Step 8, supplement the recognition of the position detection pattern of higher dimensions and the hidden factor rule of the current dimension.

[0276] Step 9, through the recognized hidden factor rule, analyze the position detection pattern of the multi-dimensional code of N-1 dimensions, and through decoding and matrix transformation, restore it to the original information.

[0277] Step 10, repeat steps 9 and 10 iteratively, and combine the above steps 1-8 to parse the original information flow, so as to realize the closed-loop recognition process of the overall multi-dimensional code.

[0278] Figure 7 It is a block diagram of a multi-dimensional code construction device shown according to an exemplary embodiment. Refer to Figure 7 , the multi-dimensional code construction device may include: a two-dimensional code generation module 701, a data sorting module 702, an image formation module 703, and a data encoding module 704.

[0279] Specifically, the two-dimensional code generation module 701 is configured to obtain data information and generate N two-dimensional codes based on the data information.

[0280] The data sorting module 702 is configured to obtain random sorting information of N two-dimensional codes;

[0281] The image formation module 703 is configured to determine the spatial positioning image of the three-dimensional code, and set N two-dimensional codes on the spatial positioning image of the three-dimensional code based on the random sorting information;

[0282] The data encoding module 704 is configured to determine the hidden factor rule of the two-dimensional code, and construct the random sorting information into the spatial positioning image of the three-dimensional code based on the hidden factor rule of the two-dimensional code to generate a three-dimensional code; and declare the hidden factor rule of the two-dimensional code in the dimension information of the three-dimensional code.

[0283] In some implementation manners, the two-dimensional code generation module 701 includes:

[0284] The data grading unit 7011 is configured to grade the data information based on the category information to obtain X-level data, and divide each level of data in the X-level data into blocks to obtain multiple blocks of each level of data; where X is a positive integer;

[0285] The two-dimensional code generation unit 7012 is configured to encrypt multiple blocks of each level of data for the X-level data respectively to generate N two-dimensional codes.

[0286] In some implementation manners, the two-dimensional code generation unit 7012 is specifically configured to:

[0287] Encrypt multiple blocks of the first-level data through the first-level secret key to generate multiple two-dimensional codes, and add serial number encoding to the two-dimensional codes;

[0288] Encrypt multiple blocks of the i-level data and the (i-1)-level secret key through the i-level secret key to generate multiple two-dimensional codes, and add serial number encoding to the two-dimensional codes; where i is a positive integer greater than 1 and less than or equal to X.

[0289] In some implementations, the users corresponding to each level of data in the X-level data bind private keys corresponding to their own levels.

[0290] In some implementations, the data sorting module 702 is specifically configured to:

[0291] Obtain the serial numbers of N two-dimensional codes;

[0292] Through a random algorithm, perform permutations and combinations on the serial numbers of N two-dimensional codes to obtain random sorting information.

[0293] In some implementations, the image formation module 703 is specifically configured to:

[0294] Determine a rectangular area for accommodating N two-dimensional codes;

[0295] Based on the positioning rules of the two-dimensional code, set position detection patterns in the rectangular area and add calibration patterns; wherein, the width of the position detection pattern is determined based on the dimension of the multi-dimensional code.

[0296] In some implementations, the data encoding module 704 is specifically configured to:

[0297] Based on the random sorting information and the serial number encoding rules, obtain a random sorting code;

[0298] Transform the random sorting code into a numerical matrix;

[0299] Determine the deformation matrix of the hidden factor;

[0300] Based on the deformation matrix of the hidden factor, perform matrix bitwise operations on the numerical matrix to generate an encrypted matrix;

[0301] Based on the hidden factor rules of the two-dimensional code and the encrypted matrix, encode N two-dimensional codes.

[0302] In some implementations, the hidden factor rules of the two-dimensional code are implemented through the two-dimensional code coloring method. The data encoding module 704 is specifically configured to:

[0303] Convert the encrypted matrix into a binary matrix;

[0304] Based on the hidden factor rules of the two-dimensional code and the high bits of each binary value in the binary matrix, color the position detection patterns of the two-dimensional code corresponding to the binary value; and based on the hidden factor rules of the two-dimensional code and the low bits of each binary value in the binary matrix, color the data graphic part of the two-dimensional code corresponding to the binary value.

[0305] In some implementations, the hidden factor rules of the two-dimensional code are implemented through the interval pixel ratio of the position detection pattern of the two-dimensional code.

[0306] In some implementations, the data encoding module 704 is further specifically configured to:

[0307] Describe the dimensional information in which the three-dimensional code is located, and declare the hidden factor rule of the two-dimensional code in the dimensional information.

[0308] In some implementations, the device further includes a loop execution module 705, which is used for:

[0309] Obtain the random sorting information of multiple M-dimensional codes; where M is a positive integer greater than or equal to 3;

[0310] Determine the spatial positioning image of the (M + 1)-dimensional code, and set the multiple M-dimensional codes on the spatial positioning image of the (M + 1)-dimensional code based on the random sorting information;

[0311] Determine the hidden factor rule of the M-dimensional code, and construct the random sorting information into the spatial positioning image of the (M + 1)-dimensional code based on the hidden factor rule of the M-dimensional code to generate the (M + 1)-dimensional code;

[0312] Describe the dimensional information in which the (M + 1)-dimensional code is located, and declare the hidden factor rule of the M-dimensional code in the dimensional information.

[0313] Regarding the device in the above embodiments, the specific manners in which each module performs operations have been described in detail in the embodiments related to the method, and will not be elaborated herein.

[0314] The multi-dimensional code construction device according to the embodiments of the present application uses a single two-dimensional code as the basic unit of the multi-dimensional code. By defining the decoding and encoding rules in three-dimensional space, multiple two-dimensional codes form a three-dimensional code, and so on, to form a multi-dimensional code, realizing the construction of a multi-dimensional code based on two-dimensional codes, and expanding the data capacity through the multi-dimensional code. By encrypting data hierarchically, the security of the data is improved. It can be used to enhance various usage scenarios of information security management and sharing.

[0315] Figure 8 It is a block diagram of a multi-dimensional code recognition device shown according to an exemplary embodiment. The multi-dimensional code is constructed by the above multi-dimensional code construction method. Refer to Figure 8 As shown in, the multi-dimensional code recognition device may include: an image recognition module 801, a data decoding module 802, and a data acquisition module 803.

[0316] Specifically, the image recognition module 801 is configured to construct a coordinate system of the three-dimensional code based on the spatial positioning image of the three-dimensional code, analyze the dimensional information of the three-dimensional code, and obtain the hidden factor rule of the two-dimensional code;

[0317] The image recognition module 801 is further configured to obtain the relevant information of N two-dimensional codes based on the coordinate system and the position detection pattern of the two-dimensional code, and add a serial number encoding to the relevant information of each two-dimensional code; wherein, the relevant information of each two-dimensional code includes encrypted data information and image information corresponding to the hidden factor rule of the two-dimensional code.

[0318] The data decoding module 802 is configured to obtain the random sorting information of N two-dimensional codes based on the hidden factor rule of the two-dimensional code and the image information of N two-dimensional codes.

[0319] The data acquisition module 803 is configured to obtain data information based on the random sorting information of N two-dimensional codes and the encrypted data information of N two-dimensional codes.

[0320] In some implementation manners, the image recognition module 801 is specifically configured to:

[0321] Based on the coordinate system and the position detection pattern of the two-dimensional code, obtain the coordinate information of N two-dimensional codes;

[0322] Based on the coordinate information of N two-dimensional codes and the hidden factor rule of the two-dimensional code, obtain the encrypted data information and image information of N two-dimensional codes, and add a serial number encoding to N two-dimensional codes.

[0323] In some implementation manners, when the image recognition module 801 obtains the image information of N two-dimensional codes, it is specifically configured to:

[0324] Through image recognition, obtain the color of the position detection pattern of each two-dimensional code and the color of the data part.

[0325] In some implementation manners, the data decoding module 802 is specifically configured to:

[0326] Based on the hidden factor rule of the two-dimensional code and the image information of N two-dimensional codes, obtain an encryption matrix;

[0327] Based on the encryption matrix and the hidden factor, obtain the random sorting information of N two-dimensional codes.

[0328] In some implementation manners, the data acquisition module 803 includes:

[0329] The data hierarchical reduction unit 8031 is configured to determine the encrypted data information of multiple two-dimensional codes corresponding to each level of data in the X-level data based on the random sorting information of N two-dimensional codes and the encrypted data information of N two-dimensional codes;

[0330] The data decryption unit 8032 is configured to obtain the secret key corresponding to the current user's level based on the current user's level; and decrypt the encrypted data information of multiple two-dimensional codes corresponding to the corresponding level of data in the X-level data through the secret key iteration to obtain data information.

[0331] In some implementations, the data hierarchical restoration unit 8031 is specifically configured to:

[0332] Obtain the hierarchical block information of N two-dimensional codes based on the random sorting information of the N two-dimensional codes;

[0333] Determine the encrypted data information of multiple two-dimensional codes corresponding to each level of data in the X-level data based on the hierarchical block information of the N two-dimensional codes and the encrypted data information of the N two-dimensional codes.

[0334] In some implementations, the data decryption unit 8032 is specifically configured to:

[0335] Decrypt the encrypted data information of multiple two-dimensional codes corresponding to the corresponding level of data in the X-level data through a secret key to obtain the private key corresponding to this level of data and the previous level of data;

[0336] Loop through the following steps until the first-level data is obtained;

[0337] Decrypt the encrypted data information of multiple two-dimensional codes corresponding to the previous level of data through the private key corresponding to the previous level of data to obtain the private key of the previous level of data and the previous level's upper-level data.

[0338] In some implementations, the apparatus further includes a loop execution module 804, configured to:

[0339] Loop through the following steps until the spatial positioning image of the three-dimensional code is obtained;

[0340] Based on the spatial positioning image of the M-dimensional code, construct the coordinate system of the M-dimensional code, and analyze the dimensional information of the M-dimensional code to obtain the hidden factor rule of the M-1-dimensional code;

[0341] Based on the coordinate system, obtain the image information and coordinate information corresponding to the hidden factor rules of multiple M-1-dimensional codes;

[0342] Based on the hidden factor rule of the M-1-dimensional code and the image information of multiple M-1-dimensional codes, obtain the random sorting information of multiple M-1-dimensional codes;

[0343] Based on the random sorting information of multiple M-1-dimensional codes and the coordinate information of the M-1-dimensional codes, obtain the spatial positioning image of the target M-1-dimensional code.

[0344] The multi-dimensional code recognition apparatus according to the embodiments of the present application uses a single two-dimensional code as the basic unit of the multi-dimensional code. By defining the decoding and encoding rules of the three-dimensional space, a three-dimensional code is composed of multiple two-dimensional codes, and so on, to form a multi-dimensional code, realizing the construction of a multi-dimensional code based on two-dimensional codes, and expanding the data capacity through the multi-dimensional code. By encrypting data hierarchically, the security of the data is improved. By recognizing the constructed multi-dimensional code, a large amount of secure and reliable data is obtained.

[0345] According to an embodiment of the present application, the present application also provides an electronic device and a readable storage medium.

[0346] As Figure 9 shown, it is a block diagram of an electronic device for implementing a method of constructing a multi-dimensional code according to an embodiment of the present application. The electronic device is intended to represent various forms of digital computers, such as, a laptop computer, a desktop computer, a workbench, a personal digital assistant, a server, a blade server, a mainframe computer, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as, a personal digital processor, a cellular phone, a smart phone, a wearable device, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or claimed herein.

[0347] As Figure 9 shown, the electronic device includes: one or more processors 901, a memory 902, and an interface for connecting each component, including a high-speed interface and a low-speed interface. Each component is interconnected using different buses and can be installed on a common motherboard or in other ways as needed. The processor can process instructions executed within the electronic device, including instructions stored in the memory or on the memory to display graphical information of a GUI on an external input / output device (such as a display device coupled to the interface). In other embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple electronic devices can be connected, and each device provides part of the necessary operations (such as, as a server array, a group of blade servers, or a multi-processor system). Figure 9 One processor 901 is taken as an example herein.

[0348] The memory 902 is the non-transitory computer-readable storage medium provided by the present application. Wherein, the memory stores instructions executable by at least one processor, so that the at least one processor executes the method of constructing a multi-dimensional code provided by the present application. The non-transitory computer-readable storage medium of the present application stores computer instructions, and the computer instructions are used to cause a computer to execute the method of constructing a multi-dimensional code provided by the present application.

[0349] The memory 902, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as program instructions / modules corresponding to the method of constructing a multi-dimensional code in the embodiment of the present application (for example, attached Figure 7The QR code generation module 701, data sorting module 702, image formation module 703, and data encoding module 704 shown). The processor 901 executes various functional applications and data processing of the server by running non-transitory software programs, instructions, and modules stored in the memory 902, that is, implements the method for constructing a multi-dimensional code in the above method embodiments.

[0350] The memory 902 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system and application programs required for at least one function; the data storage area can store data created according to the use of the electronic device for constructing a multi-dimensional code, etc. In addition, the memory 902 may include a high-speed random access memory, and may also include a non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some embodiments, the memory 902 may optionally include a memory remotely set relative to the processor 901, and these remote memories can be connected to the electronic device for constructing a multi-dimensional code through a network. Examples of the above network include but are not limited to the Internet, enterprise intranet, local area network, mobile communication network, and combinations thereof.

[0351] The electronic device for the method of constructing a multi-dimensional code may further include: an input device 903 and an output device 904. The processor 901, the memory 902, the input device 903, and the output device 904 can be connected through a bus or other means, Figure 9 Taking connection through the bus as an example.

[0352] The input device 903 can receive input digital or character information, and generate key signal inputs related to the user settings and function control of the electronic device for constructing a multi-dimensional code, such as input devices like a touch screen, keypad, mouse, trackpad, touchpad, joystick, one or more mouse buttons, trackball, joystick, etc. The output device 904 may include a display device, an auxiliary lighting device (such as an LED), and a tactile feedback device (such as a vibration motor), etc. The display device may include but is not limited to a liquid crystal display (LCD), a light-emitting diode (LED) display, and a plasma display. In some embodiments, the display device may be a touch screen.

[0353] The various embodiments of the systems and techniques described herein can be implemented in digital electronic circuitry, integrated circuit systems, ASICs (application specific integrated circuits), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be a special-purpose or general-purpose programmable processor that receives data and instructions from, and transmits data and instructions to, a storage system, at least one input device, and at least one output device.

[0354] These computer programs (also referred to as programs, software, software applications, or code) include machine instructions for a programmable processor and can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and / or device (e.g., a disk, optical disk, memory, programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal for providing machine instructions and / or data to a programmable processor.

[0355] For providing interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic, speech, or tactile input).

[0356] The systems and techniques described herein can be implemented in a computing system including backend components (e.g., as a data server), or a computing system including middleware components (e.g., an application server), or a computing system including frontend components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described herein), or a computing system including any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected to each other by digital data communication in any form or medium (e.g., a communication network). Examples of communication networks include: local area network (LAN), wide area network (WAN), and the Internet.

[0357] A computer system can include a client and a server. The client and the server are generally remote from each other and typically interact through a communication network. The client-server relationship is created by computer programs running on respective computers and having a client-server relationship with each other.

[0358] In an exemplary embodiment, a computer program product is also provided, which enables an electronic device to execute the above method when the instructions in the computer program product are executed by a processor of the electronic device.

[0359] It should also be noted that in the exemplary embodiments of the present invention, some methods or systems are described based on a series of steps or devices. However, the present invention is not limited to the order of the above steps, that is, the steps can be executed in the order mentioned in the embodiments, or different from the order in the embodiments, or several steps can be executed simultaneously.

[0360] Those skilled in the art will readily conceive of other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any variations, uses, or adaptations of the present application, which follow the general principles of the present application and include known common knowledge or conventional technical means in the technical field not disclosed in the present application. The specification and embodiments are only regarded as exemplary.

[0361] It should be understood that the present application is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present application is only limited by the appended claims.

Claims

1. A method for constructing a multi-dimensional code, characterized in that, it includes: Obtain data information, and generate N two-dimensional codes based on the data information; where N is a positive integer greater than or equal to 2; Obtain the random sorting information of the N two-dimensional codes; Determine the spatial positioning image of the three-dimensional code, and set the N two-dimensional codes on the spatial positioning image of the three-dimensional code based on the random sorting information; Determine the hidden factor rule of the two-dimensional code, and construct the random sorting information into the spatial positioning image of the three-dimensional code based on the hidden factor rule of the two-dimensional code to generate a three-dimensional code; and declare the hidden factor rule of the two-dimensional code in the dimension information of the three-dimensional code.

2. The method according to claim 1, characterized in that, the generating N two-dimensional codes based on the data information; includes: Classify the data information based on category information to obtain X-level data, and divide each level of data in the X-level data into blocks to obtain multiple blocks of each level of data; where X is a positive integer; For the X-level data, encrypt multiple blocks of each level of data respectively to generate N two-dimensional codes.

3. The method according to claim 2, characterized in that, the encrypting multiple blocks of each level of data respectively for the X-level data to generate N two-dimensional codes; includes: Encrypt multiple blocks of the first-level data with the first-level secret key to generate multiple two-dimensional codes, and add serial number encoding to the two-dimensional codes; Encrypt multiple blocks of the i-level data and the (i - 1)-level secret key with the i-level secret key to generate multiple two-dimensional codes, and add serial number encoding to the two-dimensional codes; where i is a positive integer greater than 1 and less than or equal to X.

4. The method according to claim 3, characterized in that, the users corresponding to each level of the X-level data bind the private keys corresponding to their own levels.

5. The method according to claim 1, characterized in that, the obtaining the random sorting information of the N two-dimensional codes, includes: Obtain the serial numbers of the N two-dimensional codes; Through a random algorithm, perform permutation and combination on the serial numbers of the N two-dimensional codes to obtain random sorting information.

6. The method according to claim 1, characterized in that, the determining the spatial positioning image of the three-dimensional code, includes: Determine a rectangular area for accommodating the N two-dimensional codes; Based on the positioning rule of the two-dimensional code, set position detection patterns in the rectangular area and add calibration patterns; where the width ratio of the position detection patterns is determined based on the dimension of the multi-dimensional code.

7. The method according to claim 1, characterized in that, the constructing the random sorting information into the spatial positioning image of the three-dimensional code based on the hidden factor rule of the two-dimensional code, includes: Based on the random sorting information and the serial number encoding rule, obtain a random sorting code; Transform the random sorting code into a numerical matrix; Determine the deformation matrix of the hidden factor; Perform matrix change bit operation on the numerical matrix based on the deformation matrix of the hidden factor to generate an encryption matrix; Encode the N two-dimensional codes based on the hidden factor rule of the two-dimensional code and the encryption matrix.

8. The method according to claim 7, wherein, the hidden factor rule of the two-dimensional code is implemented by the two-dimensional code coloring method, and encoding the N two-dimensional codes based on the hidden factor rule of the two-dimensional code and the encryption matrix includes: Converting the encryption matrix into a binary matrix; each binary value in the binary matrix is equally divided into a high bit and a low bit from left to right; Based on the hidden factor rule of the two-dimensional code and the high bit of each binary value in the binary matrix, dyeing the position detection pattern of the two-dimensional code corresponding to the binary value; and based on the hidden factor rule of the two-dimensional code and the low bit of each binary value in the binary matrix, dyeing the data pattern part of the two-dimensional code corresponding to the binary value.

9. The method according to claim 7, wherein, the hidden factor rule of the two-dimensional code is implemented by the interval pixel ratio of the position detection pattern of the two-dimensional code.

10. The method according to claim 1, wherein, stating the hidden factor rule of the two-dimensional code in the dimension information of the three-dimensional code includes: Describing the dimension information where the three-dimensional code is located, and stating the hidden factor rule of the two-dimensional code in the dimension information.

11. The method according to claim 1, wherein, the method further includes: Obtaining the random sorting information of multiple M-dimensional codes; where M is a positive integer greater than or equal to 3; Determining the spatial positioning image of the (M + 1)-dimensional code, and arranging the multiple M-dimensional codes on the spatial positioning image of the (M + 1)-dimensional code based on the random sorting information; Determining the hidden factor rule of the M-dimensional code, and constructing the random sorting information into the spatial positioning image of the (M + 1)-dimensional code based on the hidden factor rule of the M-dimensional code to generate the (M + 1)-dimensional code; Describing the dimension information where the (M + 1)-dimensional code is located, and stating the hidden factor rule of the M-dimensional code in the dimension information.

12. A multi-dimensional code recognition method, wherein, the multi-dimensional code is constructed by the multi-dimensional code construction method according to any one of claims 1 to 11, and the recognition method includes: Based on the spatial positioning image of the three-dimensional code, constructing the coordinate system of the three-dimensional code, and analyzing the dimension information of the three-dimensional code to obtain the hidden factor rule of the two-dimensional code; Based on the coordinate system and the position detection pattern of the two-dimensional code, obtaining the relevant information of the N two-dimensional codes, and adding serial number encoding to the relevant information of the two-dimensional code; where the relevant information of the two-dimensional code includes encrypted data information and image information corresponding to the hidden factor rule of the two-dimensional code; Based on the hidden factor rule of the two-dimensional code and the image information of the N two-dimensional codes, obtaining the random sorting information of the N two-dimensional codes; Based on the random sorting information of the N two-dimensional codes and the encrypted data information of the N two-dimensional codes, obtaining the data information.

13. The method according to claim 12, wherein, the multi-dimensional code construction method includes: Classify the data information based on the category information to obtain X-level data, and block each level of data in the X-level data to obtain multiple blocks of each level of data; where X is a positive integer; For the X-level data, encrypt multiple blocks of each level of data respectively to generate N two-dimensional codes; Obtain data information based on the random sorting information of the N two-dimensional codes and the encrypted data information of the N two-dimensional codes; including: Based on the random sorting information of the N two-dimensional codes and the encrypted data information of the N two-dimensional codes, determine the encrypted data information of multiple two-dimensional codes corresponding to each level of data in the X-level data; Based on the level to which the current user belongs, obtain the secret key corresponding to this level; and iteratively decrypt the encrypted data information of multiple two-dimensional codes of the corresponding level of data in the X-level data through the secret key to obtain data information.

14. The method according to claim 12, wherein, Obtain the relevant information of the N two-dimensional codes based on the coordinate system and the position detection pattern of the two-dimensional code, and add a serial number encoding to the relevant information of the two-dimensional code; including: Based on the coordinate system and the position detection pattern of the two-dimensional code, obtain the coordinate information of the N two-dimensional codes; Based on the coordinate information of the N two-dimensional codes and the hidden factor rule of the two-dimensional code, obtain the encrypted data information and image information of the N two-dimensional codes, and add a serial number encoding to the N two-dimensional codes.

15. The method according to claim 14, wherein, Obtain the image information of the N two-dimensional codes, including: Through image recognition, obtain the color of the position detection pattern and the color of the data part of each two-dimensional code.

16. The method according to claim 12, wherein, Obtain the random sorting information of the N two-dimensional codes based on the hidden factor rule of the two-dimensional code and the image information of the N two-dimensional codes; including: Based on the hidden factor rule of the two-dimensional code and the image information of the N two-dimensional codes, obtain an encryption matrix; Based on the encryption matrix and the hidden factor, obtain the random sorting information of the N two-dimensional codes.

17. The method according to claim 13, wherein, Based on the random sorting information of the N two-dimensional codes and the encrypted data information of the N two-dimensional codes, determine the encrypted data information of multiple two-dimensional codes corresponding to each level of data in the X-level data; including: Based on the random sorting information of the N two-dimensional codes, obtain the hierarchical block information of the N two-dimensional codes; Based on the hierarchical block information of the N two-dimensional codes and the encrypted data information of the N two-dimensional codes, determine the encrypted data information of multiple two-dimensional codes corresponding to each level of data in the X-level data.

18. The method according to claim 13, wherein, Based on the level to which the current user belongs, obtain the secret key corresponding to this level; and iteratively decrypt the encrypted data information of multiple two-dimensional codes of the corresponding level of data in the X-level data through the secret key to obtain data information; including: Decrypt the encrypted data information of multiple two-dimensional codes corresponding to the data at the corresponding level in the X-level data through the secret key to obtain the private key corresponding to the data at this level and the previous level of data; Loop through the following steps until the first-level data is obtained; Decrypt the encrypted data information of multiple two-dimensional codes corresponding to the previous-level data through the private key corresponding to the previous-level data to obtain the private key of the previous-level data and the private key of the level above the previous level of data.

19. The method according to claim 12, wherein, The multi-dimensional code is constructed by the multi-dimensional code construction method as described in claim 11, and the method further includes: Loop through the following steps until the spatial positioning image of the three-dimensional code is obtained; Based on the spatial positioning image of the M-dimensional code, construct the coordinate system of the M-dimensional code, and analyze the dimension information of the M-dimensional code to obtain the hidden factor rule of the M-1-dimensional code; Based on the coordinate system, obtain the image information and coordinate information corresponding to the hidden factor rules of multiple M-1-dimensional codes; Based on the hidden factor rule of the M-1-dimensional code and the image information of the multiple M-1-dimensional codes, obtain the random sorting information of the multiple M-1-dimensional codes; Based on the random sorting information of the multiple M-1-dimensional codes and the coordinate information of the M-1-dimensional code, obtain the spatial positioning image of the target M-1-dimensional code.

20. A multi-dimensional code construction device, wherein, It includes: A two-dimensional code generation module, configured to obtain data information and generate N two-dimensional codes based on the data information; where N is a positive integer greater than or equal to 2; A data sorting module, configured to obtain the random sorting information of the N two-dimensional codes; An image formation module, configured to determine the spatial positioning image of the three-dimensional code and set the N two-dimensional codes on the spatial positioning image of the three-dimensional code based on the random sorting information; A data encoding module, configured to determine the hidden factor rule of the two-dimensional code and construct the random sorting information into the spatial positioning image of the three-dimensional code based on the hidden factor rule of the two-dimensional code to generate a three-dimensional code; and declare the hidden factor rule of the two-dimensional code in the dimension information of the three-dimensional code.

21. A multi-dimensional code recognition device, wherein, The multi-dimensional code is constructed by the multi-dimensional code construction method as described in any one of claims 1 to 10, and the recognition device includes: An image recognition module, configured to construct the coordinate system of the three-dimensional code based on the spatial positioning image of the three-dimensional code, and analyze the dimension information of the three-dimensional code to obtain the hidden factor rule of the two-dimensional code; The image recognition module is further configured to obtain the relevant information of the N two-dimensional codes based on the coordinate system and the position detection pattern of the two-dimensional code, and add serial number encoding to the relevant information of the two-dimensional code; where the relevant information of the two-dimensional code includes encrypted data information and image information corresponding to the hidden factor rule of the two-dimensional code; A data decoding module, configured to obtain the random sorting information of the N two-dimensional codes based on the hidden factor rule of the two-dimensional code and the image information of the N two-dimensional codes; A data acquisition module, configured to acquire data information based on the random sorting information of the N two-dimensional codes and the encrypted data information of the N two-dimensional codes.

22. An electronic device, characterized in that it includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the multi-dimensional code construction method according to any one of claims 1 to 11, or the multi-dimensional code recognition method according to any one of claims 12 to 19.

23. A non-transitory computer-readable storage medium storing computer instructions, characterized in that the computer instructions are used to cause the computer to execute the multi-dimensional code construction method according to any one of claims 1 to 11, or the multi-dimensional code recognition method according to any one of claims 12 to 19.

Citation Information

Patent Citations

  • Encryptable three-dimensional code and encoding and decoding method

    CN111428532A

  • High-capacity data transmission method and system based on two-dimensional code

    CN115378931A