Composite two-dimensional code generation, reading method and device
By setting a re-encoding area in the QR code and adjusting the module distribution to incorporate hidden information, a composite QR code is generated, which solves the problems of QR code being easily copied and wasting resources, and achieves the effects of security and multi-information incorporation.
Patent Information
- Application Number
- CN201710052468.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2017-01-24
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2037-01-24
AI Technical Summary
Existing QR codes are not secure enough, are easily copied and cracked, and using multiple QR codes on the same item leads to confusion and waste of resources.
A re-encoding area is set in the QR code, hidden information is encoded by adjusting the module distribution, and the error correction function of the QR code is used to ensure that decoding is not affected, thus generating a composite QR code.
It improves the security of QR codes, prevents copying, and solves the problems of resource waste and confusion by embedding multiple sets of information into a single QR code.
Smart Images

Figure CN108345925B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a method and device for generating and reading a composite two-dimensional code, and in particular to a technology for encoding multiple groups of information into a two-dimensional code to improve the security of the two-dimensional code. Background Art
[0002] QR codes have been widely used, especially for smartphones to scan QR codes for Internet access and payment. Since the encoding and decoding of QR codes are public technologies, anyone can generate QR codes through QR code generation software or websites, and the security of scanning QR codes for Internet access and payment is greatly challenged. Improving the security of QR codes is an urgent problem to be solved in the current QR code field.
[0003] Publication 1 (publication number: CN102184380.A) discloses a two-dimensional code with superimposed color information. The technical idea is to superimpose a color coating on an ordinary two-dimensional code, and the color coating is composed of modules of different colors to form hidden information. The hidden information is encrypted in an encrypted manner and requires a key to decrypt. When reading the two-dimensional code, the hidden information is read at the same time, and the authenticity of the two-dimensional code is verified by decrypting the hidden information.
[0004] Publication 2 (publication number: CN102902997A) discloses a hybrid coded QR code. It encrypts part of the original information of the QR code to form hidden information that needs to be decrypted by a key. When reading, the hidden information is decrypted using the key to obtain the complete information.
[0005] Publication 3 (publication number: CN104392260A) discloses a QR code anti-counterfeiting method based on additional information. The technical idea is to add a set of dense dots to the standard QR code, change the color of some modules of the standard QR code, change the QR code graphics, and generate a QR code graphics different from the standard QR code. The graphics and the positions of the dense dots of the standard QR code are stored in the server, and the authenticity of the QR code is determined by confirming the positions of the dense dots.
[0006] The above existing methods all set up another set of data or secret points on the basis of the existing two-dimensional code to verify the two-dimensional code information to achieve the purpose of anti-counterfeiting. Since the additional data and secret points are easy to read and identify, the problem of the two-dimensional code being easily copied still exists.
[0007] As shown in Public Document 1, although the content of the color hidden information is encrypted, as long as the coding rules are mastered, the same color coating can be reproduced by using the read bit stream without decrypting the information itself. Due to the visibility of the color coating, the coding rules can also be easily cracked by analyzing the color coating. At the same time, the addition of color coating increases the production cost of the QR code a lot.
[0008] As shown in Publication 2, although part of the information in the QR code is encrypted, the same QR code can be easily copied based on the read bit stream using existing QR code generation tools. At the same time, the QR code has a cover layer on which encryption symbols are printed, which increases the complexity of production.
[0009] In Public Document 3, the secret dots only have position information. Since the secret dots themselves do not carry information, the information of the QR code itself does not change. After copying the QR code with the read information, the copied QR code image is compared with the copied QR code image to determine the position of the secret dots. By setting the secret dots, the exact same QR code can also be copied. In addition, since the secret dots only have position information, once the secret dots are defiled, the authenticity of the QR code cannot be determined, resulting in a low reliability problem.
[0010] In addition, QR codes are also widely used in logistics tracking and management, and corporate marketing promotions also use QR codes. Multiple QR codes for different purposes are usually printed on one item or package, which not only easily causes confusion among users, but also wastes paper and ink. Summary of the invention
[0011] The purpose of the present invention is to solve the above-mentioned problems of the prior art and to provide a method and device for generating and reading a composite two-dimensional code that can be encoded with multiple sets of information and is not easily copied.
[0012] The first technical solution of the present invention is a composite two-dimensional code generating device, which is characterized by comprising a two-dimensional code encoding module (1), a two-dimensional code graphic generating module (2), an implicit information encoding module (3), a re-encoding area setting module (5), a graphic synthesis module (6), and an output module (7).
[0013] The two-dimensional code encoding module (1) generates two-dimensional code encoding information according to the two-dimensional code information.
[0014] The two-dimensional code graphic generating module (2) generates a two-dimensional code graphic according to the two-dimensional code encoding information.
[0015] The implicit information encoding module (3) generates re-encoded information according to the implicit information
[0016] The re-encoding area setting module (5) sets a re-encoding area for encoding implicit information in the two-dimensional code graphic.
[0017] The graphic synthesis module (6) adjusts the module distribution of the re-encoding area (Q) in the two-dimensional code graphic (W) according to the re-encoding information, and incorporates the implicit information into the two-dimensional code graphic to generate a composite two-dimensional code.
[0018] The second technical solution is based on the first technical solution, and is characterized in that it also includes an output module (7). Before outputting the composite two-dimensional code, the output module (7) verifies whether the bit error rate of the two-dimensional code is less than the error correction rate or the remaining error correction margin.
[0019] The third technical solution is based on the second technical solution, and is characterized in that it also has a mask processing module (8). After the graphic synthesis module (6) encodes the implicit information into the two-dimensional code graphic, the mask processing module (8) performs mask processing to generate a composite two-dimensional code.
[0020] The fourth technical solution is based on the third technical solution, and is characterized in that the implicit information encoding module (3) adds an error correction codeword when generating the re-encoded information, so that the implicit information has an error correction function.
[0021] The fifth technical solution is based on the fourth technical solution, and is characterized in that the re-encoding area setting module (5) sets multiple re-encoding areas.
[0022] The sixth technical solution is based on the fifth technical solution, and is characterized in that when generating the two-dimensional code encoding information, the two-dimensional code encoding module (1) combines the two-dimensional code information with the setting information of the re-encoding area into combined information, and generates the two-dimensional code encoding information according to the combined information.
[0023] The seventh technical solution is based on any one of the first to sixth technical solutions, and is characterized in that it also has an implicit information graphic generation module (4), which generates an implicit information coding graphic according to the shape of the re-encoding area and the number of modules contained therein, and the module distribution in the implicit information coding graphic corresponds to the re-encoding information.
[0024] The eighth technical solution is a composite two-dimensional code generation method, characterized in that it includes the following steps:
[0025] Step 1 (S2), generating QR code encoding information according to the QR code information,
[0026] Step 2 (S3), using the QR code encoding information to generate a QR code graphic (W),
[0027] Step 3 (S4), setting the re-encoding area (Q) in the generated two-dimensional code graphic (W),
[0028] Step 4 (S5), generating re-encoded information based on the implicit information,
[0029] Step 5 (S6), generating a hidden information coding graph according to the shape of the re-encoded area (Q) and the modules included, so that the module distribution in the hidden information coding graph corresponds to the re-encoded information,
[0030] Step 6 (S7), according to the implicit information coding pattern, the distribution of dark modules and light modules in the re-encoded area (Q) is replaced with the same distribution as the implicit information coding pattern, the implicit information is encoded into the two-dimensional code, and a composite two-dimensional code is generated.
[0031] The ninth technical solution is based on the eighth technical solution, and is characterized in that it also has step 7 (S8), which verifies whether the bit error rate of the composite two-dimensional code is less than the error correction rate. If the bit error rate is greater than the error correction rate, the error correction level of the two-dimensional code is reset or the position of the re-encoding area (Q) is adjusted.
[0032] The tenth technical solution is based on the ninth technical solution, and is characterized in that:
[0033] Step 6a is used to replace step 5 (S6) and step 6 (S7). In step 6a, the code elements in the re-encoded information are read in sequence, compared with the values of the corresponding modules in the re-encoded area, the inconsistent modules are inverted, the implicit information is encoded into the two-dimensional code, and a composite two-dimensional code is generated.
[0034] The eleventh technical solution is based on the tenth technical solution, and is characterized in that:
[0035] In step 4 (S5), when generating the re-encoded information, an error correction code word is added so that the implicit information has an error correction function.
[0036] The twelfth technical solution is based on the eleventh technical solution, and is characterized in that in step 3 (S4), a plurality of re-encoding areas (Q) are set in the generated two-dimensional code graphic (W).
[0037] The thirteenth technical solution is based on any one of the seventh to twelfth technical solutions, and is characterized in that in step 1 (S2), when generating two-dimensional code encoding information, the two-dimensional code information and the setting information of the re-encoding area are combined into combined information, and the two-dimensional code encoding information is generated according to the combined information.
[0038] The fourteenth technical solution is a composite two-dimensional code reading device, characterized in that it comprises a two-dimensional code pattern acquisition module (11), a two-dimensional code decoding module (12), a re-encoding area determination module (13), and a hidden information decoding module (14).
[0039] The composite two-dimensional code has two-dimensional code information and implicit information. The implicit information is encoded into the two-dimensional code graphic by re-encoding a part of the two-dimensional code module.
[0040] The two-dimensional code image acquisition module (11) is used to acquire an image of a composite two-dimensional code.
[0041] The two-dimensional code decoding module (12) decodes the acquired composite two-dimensional code image to obtain two-dimensional code information.
[0042] The re-encoding area determination module (13) determines the position of the re-encoding area in the composite two-dimensional code image according to a pre-set setting.
[0043] The implicit information decoding module (14) decodes the re-encoded area to obtain implicit information.
[0044] The fifteenth technical solution is based on the fourteenth technical solution, and is characterized in that:
[0045] The two-dimensional code information of the composite two-dimensional code contains setting information for setting a re-encoding area.
[0046] The re-encoding area determination module (13) determines the position of the re-encoding area in the composite two-dimensional code image according to the setting information encoded in the two-dimensional code information.
[0047] The sixteenth technical solution is a method for reading a composite two-dimensional code, which is characterized by comprising the following steps:
[0048] The composite two-dimensional code has two-dimensional code information and implicit information. The implicit information is encoded into the two-dimensional code graphic by re-encoding a part of the two-dimensional code module.
[0049] Step 1 (S20), obtaining an image of a composite two-dimensional code,
[0050] Step 2 (S30), decode the composite two-dimensional code to obtain the two-dimensional code information,
[0051] Step 3 (S40), determining the re-encoding area (Q) in the composite two-dimensional code image according to the preset setting information.
[0052] Step 4 (S50), decode the re-encoded area (Q) to obtain implicit information.
[0053] The seventeenth technical solution is based on the sixteenth technical solution, and is characterized in that:
[0054] The two-dimensional code information of the composite two-dimensional code contains setting information for setting a re-encoding area.
[0055] In the step 3 (S40), setting information is obtained from the decoded two-dimensional code information, and the re-encoding area (Q) in the composite two-dimensional code image is determined according to the setting information.
[0056] Effect
[0057] Since one or more re-encoding areas (Q) are set in the two-dimensional code graphic (W), the modules in the re-encoding area (Q) are re-encoded and implicit information is encoded. The size of the re-encoding area (Q) is set according to the error correction capability of the two-dimensional code, and the encoded implicit information does not affect the decoding of the two-dimensional code. Therefore, the two-dimensional code information encoded in the two-dimensional code can be read by a two-dimensional code reading device, and its versatility is not affected. The re-encoding area in the two-dimensional code is located and decoded, and the implicit information can be read. Since the two-dimensional code has no changes in appearance, the implicit information therein cannot be identified. When reading the two-dimensional code and copying it, since the bit stream does not contain implicit information, the composite two-dimensional code cannot be copied, which improves the security of the two-dimensional code. Since more than two groups of information can be encoded in one QR code image, the QR code information can be public information, such as a URL, which can be decoded and operated by general scanning software; the implicit information requires special scanning software with a re-encoding area positioning function to be identified and decoded, which can be used for the management of QR code generation to further improve the security of the QR code; in addition, one code can also have two uses, such as encoding URL information in the QR code, and the implicit information is logistics information, which unifies the user interface and saves costs at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] Figure 1 It is a structural block diagram of the composite two-dimensional code generating device of the present invention;
[0059] Figure 2 It is an explanatory diagram for setting a re-encoding area;
[0060] Figure 3 It is a code pattern after implicit information is encoded in the re-encoding area;
[0061] Figure 4 is a flow chart illustrating a method for generating a composite two-dimensional code;
[0062] Figure 5 It is a structural block diagram of a composite two-dimensional code reading device of the present invention;
[0063] Figure 6 It is a flow chart for reading composite QR codes;
[0064] Figure 7 It is a flow chart for encoding implicit information in a QR code by using a code word sequence of implicit information;
[0065] Figure 8 A variation of a composite two-dimensional code generating device;
[0066] Fig. 9 This is an example of using a composite QR code for secure payment;
[0067] Fig.10 This is an example of using a composite QR code for advertising monitoring;
[0068] Fig.11 This is an example of a composite QR code being used in logistics and marketing;
[0069] Fig.12 is an example of increasing security by adding a recoding zone;
[0070] Fig.13 This is an example of using the minimum coding unit as a re-encoding area. DETAILED DESCRIPTION
[0071] The following embodiments of the present invention are described. The following embodiments are merely illustrative of preferred embodiments and examples and should not be construed as limiting the scope of the present invention.
[0072] First, the technical concept of the present invention will be described.
[0073] Two-dimensional codes, such as QR codes, have an error correction function. If part of the two-dimensional code is missing within the error correction capability, it will not affect the decoding of the two-dimensional code. The present invention utilizes the error correction function of the two-dimensional code, sets a recoding area in the two-dimensional code, and recodes the modules in the area according to a pre-set rule, that is, by redistributing light and dark modules, implicit information is encoded in the two-dimensional code, so that a two-dimensional code graphic has both two-dimensional code information and implicit information. According to the number of recoding areas, there can be multiple groups of implicit information encoded. The size and position of the recoding area are set according to the error correction level of the two-dimensional code, and the total bit error rate of the two-dimensional code is kept lower than the error correction rate of the two-dimensional code, so that the recoding of the module does not affect the decoding of the two-dimensional code information.
[0074] When decoding the QR code, the implicit information in the re-encoded area will not be decoded, that is, for the QR code decoding device, the implicit information is hidden, and the implicit information itself can be any information, such as verification information for verifying the authenticity of the QR code information, or management information or logistics information of the item.
[0075] When reading, the positioning pattern of the two-dimensional code is used to locate the re-encoded area, and the implicit information can be obtained by decoding the re-encoded area.
[0076] Since the implicit information is realized by adjusting the distribution of some modules of the QR code, the size and shape of the modules in the re-encoded area remain unchanged, and the appearance of the QR code does not change. It is impossible to judge from the appearance that multiple sets of information are compounded in the QR code. When the QR code is decoded, since the implicit information will not be decoded, it is impossible to copy the same QR code using the decoded information. In other words, in addition to making the QR code have multiple sets of information, the implicit information encoded in the QR code actually plays the role of a digital watermark, which solves the shortcoming that the QR code is easy to copy and improves the security of the QR code.
[0077] Hereinafter, embodiments of the present invention will be described.
[0078] Figure 1 It is a structural block diagram of the composite two-dimensional code generating device of the present invention.
[0079] like Figure 1 As shown, the composite two-dimensional code generating device of the present invention includes a two-dimensional code encoding module 1, a two-dimensional code graphic generating module 2, an implicit information encoding module 3, an implicit information graphic generating module 4, a re-encoding area setting module 5, a graphic synthesis module 6, and an output module 7.
[0080] The two-dimensional code encoding module 1 is connected to the two-dimensional code graphic generation module 2; the implicit information encoding module 3 is connected to the implicit information graphic generation module 4; the two-dimensional code graphic generation module 2, the implicit information graphic generation module 4, the re-encoding area setting module 5 are connected to the graphic synthesis module 6; the graphic synthesis module 6 is connected to the output module 7.
[0081] The two-dimensional code encoding module 1 is used to convert the input two-dimensional code information into a binary code word sequence, add error correction code words to the code word sequence, and generate two-dimensional code encoding information. The error correction level of the two-dimensional code is manually set or automatically set according to the amount of information encoded into the implicit information. The generated two-dimensional code encoding information is input into the two-dimensional code graphic generation module 2.
[0082] The two-dimensional code graphic generation module 2 generates a two-dimensional code graphic according to the two-dimensional code encoding information and the version of the two-dimensional code. The two-dimensional code version is set manually or automatically according to the amount of information in the two-dimensional code encoding information. The two-dimensional code graphic is input to the graphic synthesis module 6.
[0083] The implicit information encoding module 3 is used to convert the implicit information into a binary code word sequence to generate re-encoded information. The re-encoded information is input into the implicit information graphic generation module 4. In this embodiment, an error correction code word is added to the code word sequence so that the implicit information has an error correction function. The error correction level is the same as the error correction level of the two-dimensional code. The error correction function is not necessary and can be selected as needed. The error correction level of the implicit information can also be selected to be different from the error correction level of the two-dimensional code.
[0084] The re-encoding area setting module 5 is used to set the re-encoding area for encoding the hidden information in the two-dimensional code pattern, and generates setting information including the shape of the re-encoding area, the number of modules in the area, and the reference position. The setting information is input to the pattern synthesis module 6.
[0085] Figure 2 This is an explanatory diagram for setting the re-encoding area.
[0086] like Figure 2As shown, the lower right corner of the two-dimensional code W is the coordinate origin O, and the reference point o of the re-encoding area Q is located at the coordinate origin O. The re-encoding area Q is a square containing 7*7 modules. According to the three positioning patterns d of the two-dimensional code W and the number of modules on the X and Y axes, the positions of the re-encoding area Q and each module in the area in the two-dimensional code W can be determined.
[0087] The implicit information graphic generation module 4 generates an implicit information coding graphic composed of dark modules and light modules according to the re-encoded information. In this embodiment, the shape and number of modules of the implicit information coding graphic are the same as those of the re-encoded area, but the size may be different from that of the re-encoded area. The implicit information coding graphic is input to the graphic synthesis module 6.
[0088] The graphic synthesis module 6 determines the re-encoding area Q in the two-dimensional code graphic W according to the setting information, adjusts the module distribution in the re-encoding area Q according to the implicit information encoding graphic, encodes the implicit information into the re-encoding area Q, and uses the two-dimensional code encoded with the implicit information as a composite two-dimensional code input and output module.
[0089] Figure 3 It is a code pattern after implicit information is encoded in the re-encoded area, and Figure 2 compared to, Figure 3 The module distribution in the recoding region Q1 changed, while the rest did not change.
[0090] The output module 7 is used to output the composite two-dimensional code. Before output, it is verified whether the two-dimensional code can be decoded or the remaining error correction margin is verified to ensure that the two-dimensional code can be decoded or has an error correction margin. The verification method can use the two-dimensional code reading device to actually decode the composite two-dimensional code. If it cannot be decoded, it means that the bit error rate of the entire two-dimensional code is greater than the error correction rate. It is necessary to increase the error correction level or adjust the size and position of the re-encoding area so that the bit error rate of the entire two-dimensional code is less than the error correction rate. The output module 7 inputs the composite two-dimensional code that has been decoded and verified for storage, printing, etc.
[0091] The following use Figure 1 The composite two-dimensional code generating device of the present invention describes the generating method of the composite two-dimensional code.
[0092] Figure 4 It is a flow chart for generating a composite QR code.
[0093] Step S1, initial setting. The initial setting includes the following settings: setting the error correction level of the QR code; setting the QR code version, inputting setting information, the setting information includes the shape of the re-encoding area Q, the number of modules included, and the position of the reference point o of the re-encoding area Q (refer to Figure 2 , 3 ).
[0094] Step S2, the two-dimensional code encoding module 1 generates two-dimensional code encoding information according to the two-dimensional code information and the error correction level.
[0095] Step S3, the two-dimensional code graphic generating module 2 generates a two-dimensional code graphic according to the two-dimensional code encoding information and the version of the two-dimensional code.
[0096] Step S4, the re-encoding region setting module 5 generates setting information including the shape of the re-encoding region Q, the number of modules included, and the position coordinate o information of the re-encoding region. Figure 2 As shown, it is preferably arranged in the data area. For the QR code, any position in the two-dimensional code can be arranged as long as the positioning pattern d is avoided.
[0097] Step S5, the implicit information encoding module 3 converts the implicit information into a binary codeword sequence, and adds an error correction codeword into the codeword sequence according to the set error correction level to generate re-encoded information.
[0098] Step S6, the implicit information graphic generating module 4 generates an implicit information coding graphic having the same shape as the re-encoded area Q and consisting of dark modules and light modules according to the re-encoded information.
[0099] Step S7, the graphic synthesis module 6 replaces the distribution of dark modules and light modules in the re-encoded area Q with the same distribution as the implicit information encoding graphic according to the implicit information encoding graphic, and encodes the implicit information into the two-dimensional code.
[0100] In step S8, the output module 7 verifies the two-dimensional code with implicit information, and verifies whether its overall bit error rate is less than the error correction rate. If the bit error rate is less than the error correction rate, in step S8, it is output as a composite two-dimensional code for storage, transmission or printing. If the bit error rate is greater than the error correction rate, return to step S1, reset the error correction level of the two-dimensional code, and if the setting information can be adjusted, the position or shape of the re-encoding area Q can also be adjusted until the overall bit error rate of the composite two-dimensional code is less than the error correction rate.
[0101] Hereinafter, the composite two-dimensional code reading device of the present invention will be described.
[0102] Figure 5 It is a structural block diagram of the composite two-dimensional code reading device of the present invention.
[0103] like Figure 5 As shown, the composite two-dimensional code reading device of the present invention includes a two-dimensional code graphic acquisition module 11, a two-dimensional code decoding module 12, a re-encoding area determination module 13, and an implicit information decoding module 14.
[0104] The two-dimensional code image acquisition module 11 is connected to the two-dimensional code decoding module 12 and the re-encoding area determination module 13, and the re-encoding area determination module 13 is connected to the implicit information decoding module 14. The two-dimensional code image acquisition module 11 is used to acquire the image of the composite two-dimensional code, including an optical method and a non-optical electronic method. The acquired composite two-dimensional code image is input into the two-dimensional code decoding module 12 and the re-encoding area determination module 13.
[0105] The two-dimensional code decoding module 12 decodes the entire composite two-dimensional code to obtain two-dimensional code information. During decoding, all module information causing code errors, including modules in the re-encoding area Q, is automatically corrected by the error correction codeword, and no information loss or code errors will occur.
[0106] The re-encoding area determination module 13 is as follows Figure 2 As shown, the coordinate origin O is determined based on the three positioning patterns d of the two-dimensional code W, and the re-encoded area Q is determined based on the origin O using the same setting information as when the re-encoded area Q is set. That is, the setting information for determining the re-encoded area Q is predetermined.
[0107] The implicit information decoding module 14 decodes the module code in the re-encoded area Q to obtain implicit information.
[0108] The following use Figure 5 The reading device of the composite two-dimensional code is described.
[0109] Figure 6 It is a flow chart for reading composite two-dimensional codes.
[0110] Step S20 , the two-dimensional code graphic acquisition module 11 acquires an image of the composite two-dimensional code, and the image is input to the two-dimensional code decoding module 12 and the re-encoding area determination module 13 .
[0111] Step S30, the two-dimensional code decoding module 12 decodes the entire composite two-dimensional code to obtain two-dimensional code information, including the modules in the re-encoded area, and all module information that causes code errors is automatically corrected by the error correction codeword, so that no information loss or code errors will occur.
[0112] In step S40, the re-encoding region determining module 13 determines the re-encoding region Q in the image of the composite two-dimensional code.
[0113] Step S50 , the implicit information decoding module 14 decodes the module distribution in the re-encoded area Q to obtain implicit information.
[0114] The above describes the generation, reading device and generation of the composite two-dimensional code of the present invention. Since the implicit information is realized by adjusting the distribution of the two-dimensional code module, the entire two-dimensional code does not have any shape change in appearance. In addition, the decoding device of the general two-dimensional code can only obtain the two-dimensional code information. Using the decoded information for copying, only a two-dimensional code without implicit information can be obtained, that is, the implicit information also plays the role of a digital watermark, which solves the problem that the two-dimensional code is easy to be copied and improves the security of the two-dimensional code.
[0115] Since multiple sets of information can be encoded in one QR code, it can not only encrypt implicit information for anti-counterfeiting, but also serve multiple purposes, solving the confusion problem caused by printing or pasting multiple QR codes on an item or package, and saving costs such as paper and ink.
[0116] Other modified examples will be described below.
[0117] Modification 1
[0118] In the above description, the shape of the implicit information coding graph is the same as the shape of the re-encoding area Q, and the modules in the implicit information coding graph correspond one-to-one to the modules in the re-encoding area Q. According to the corresponding relationship, the module distribution in the re-encoding area Q is replaced with the same distribution as the implicit information coding graph.
[0119] In the first modification, the implicit information is directly encoded into the re-encoded area of the two-dimensional code W using the bit stream of the re-encoded information.
[0120] Figure 7 It is a flowchart for encoding implicit information in a QR code by using a bit stream of re-encoded information.
[0121] Step S71, determine the total number of modules T in the re-encoding area Q.
[0122] Step S72, operation counter S=S+1, initially S=0.
[0123] Step S73, reading the value of each bit of the re-encoded information bit stream in sequence.
[0124] Step S74, compare the value of the bit stream with the value of the corresponding module in the re-encoded area Q, such as the value of the dark module is 1, and the value of the light module is 0.
[0125] Step S75, judging the comparison result, if they are consistent, proceeding to step S77, if they are inconsistent, proceeding to step S76, inverting the module, adjusting the dark module to a light module or adjusting the light module to a dark module.
[0126] Step S77, determine whether the count value S of the counter is greater than or equal to T. If not, return to step S72 and repeat the above steps until the count value S is greater than or equal to T. After the comparison of each bit of the encoded information bit stream is completed, the process ends.
[0127] In the modified example, the implicit information can be encoded into the two-dimensional code without setting the implicit information coding graphic according to the shape of the re-encoding area Q, and the implicit information graphic generation module 4 can be omitted to simplify the structure.
[0128] Modification 2
[0129] In the above description, the setting of the re-encoding area Q during generation and the setting of the re-encoding area Q during reading are set separately. Since the two areas must be the same to ensure the correct reading of the implicit information, their positions, shapes and the number of modules included need to be agreed in advance and cannot be changed during generation. Modification 2 is a technical solution that can change the setting of the re-encoding area Q.
[0130] In the composite two-dimensional code generating device, the re-encoding area setting module 5 is connected to the two-dimensional code encoding module 1 ( Figure 1 When the recoding region setting module 5 sets the recoding region Q, the setting information including the shape, position and number of modules included in the recoding region Q is input to the two-dimensional code encoding module 1, and the two-dimensional code encoding module 1 combines the setting information with the two-dimensional code information into combined information, and generates the two-dimensional code encoding information from the combined information. The beginning and end of the setting information are marked with special characters.
[0131] In the composite two-dimensional code reading device, the two-dimensional code decoding module 12 is connected to the re-encoding area determination module 13 ( Figure 5 The setting information obtained by decoding the two-dimensional code decoding module 12 is input to the re-encoding area determination module 13, and the re-encoding area determination module 13 sets the re-encoding area Q according to the setting information. Therefore, the composite two-dimensional code recognition device can correctly set the re-encoding area Q without pre-agreement.
[0132] When decoding, the two-dimensional code decoding module 12 detects special characters, identifies setting information, and performs non-display processing.
[0133] In the variation, since the shape, position and number of modules of the re-encoding area Q can be set arbitrarily, each QR code can have a different re-encoding area position or shape, making it difficult for someone attempting to decipher the code to find the position of the re-encoding area Q, thereby increasing the difficulty of cracking the encoding algorithm and further improving the security of the QR code.
[0134] Modification 3
[0135] Figure 8This is a modified example of a composite two-dimensional code generating device.
[0136] and Figure 1 The difference in structure is that a mask processing module 8 is added. The graphic synthesis module 6 is connected to the output module 7 through the mask processing module 8.
[0137] The two-dimensional code graphic generation module 2 may not perform mask processing when generating the two-dimensional code. After the graphic synthesis module 6 encodes the implicit information into the two-dimensional code W, the mask processing module 8 performs mask processing, and the re-encoded area is also masked. The dark modules and light modules are evenly distributed, which only improves the anti-fouling ability of the implicit information, eliminates the traces of the implicit information, and further improves the security of the two-dimensional code.
[0138] Modification 4
[0139] Fig.10 This is a modified example of the re-encoding area. Figure 2 , 3 , 9, the re-encoding area is a square, Fig.10 In the modified example, the re-encoded area Q2 in the two-dimensional code W2 is a rectangular area including 7*14 modules, and the reference position o coincides with the coordinate origin O.
[0140] Modification 5
[0141] Fig.11 is a modified example of the re-encoded area. The re-encoded area Q3 in the two-dimensional code W3 is Fig.11 Same as Fig.11 The difference is that the position of the re-encoded area Q3 is different. The reference position o of the re-encoded area Q3 is located at the coordinate (12, 4).
[0142] Modification 6
[0143] Fig.12 This is a modified example of the re-encoding area. Fig.12 In the modified example, two re-encoding areas Q4 and Q5 are set in the two-dimensional code W4. The re-encoding areas Q4 and Q5 are rectangular areas containing 7*7 modules. The reference position o1 of the re-encoding area Q4 is located at the coordinate position (6, 6), and the reference position o2 of the re-encoding area Q5 is located at the coordinate position (21, 3).
[0144] Modification 7
[0145] Fig.13 is a modified example of the re-encoding area. Fig.13In a modified example, a plurality of 1*1 module recoding units (Qa...Qn) are provided in the two-dimensional code W, 10 of which are shown in the figure, and there can be more, for example, 49. The combination of each recoding unit (Qa...Qn) constitutes a recoding area, that is, it is equivalent to dispersing the recoding area into multiple recoding units according to certain rules, and the implicit information is dispersedly encoded in each recoding unit. When reading, the recoding unit is determined according to the coordinate position of each recoding unit, and each recoding unit is arranged or restored into a recoding area with a certain shape according to the set rules, and then decoded. Since the recoding units are dispersed in different positions of the two-dimensional code, the encoded implicit information is more difficult to be read. If the dispersion rules of the recoding units are encrypted, the generation algorithm of the recoding information is more difficult to crack, which further improves the security of the two-dimensional code.
[0146] The above describes the generation and reading device and the generation and reading method of the present invention. The generated composite two-dimensional code is not only not easy to copy, but also can further improve the anti-counterfeiting function or one code for multiple purposes by using its multiple sets of information.
[0147] The following is an explanation of the use of a composite two-dimensional code through a specific example.
[0148] Figure 3 The composite QR code is used in the field of registration management. The website information is encoded in the QR code information: http: / / www.big-code.cn. The highest level of error correction for the QR code is H. The 7*7 module of the rectangular area (re-encoding area Q) is re-encoded and encoded with the number 123456. The encoding method is similar to the encoding method of the two-dimensional matrix code, and an error correction algorithm is added to ensure stable reading. The number 123456 represents the registration ID of the QR code and is used for the management of the QR code. The user's general reading software reads the QR code information and connects to the website content. The dedicated reading software locates the information that can only read the 7*7 module encoding area, and verifies the registration ID through networking or local query of the reading terminal; it can also read the information of the QR code and the 7*7 module encoding area, and verify the registration ID through networking or local query of the reading terminal. The dedicated reading software can also read the QR code information and the information of the 7*7 module encoding area. When the information of the 7*7 module encoding area is verified, the reading terminal can access the Internet through the website in the QR code. Otherwise, an error message will be displayed, ensuring the security of scanning the code to access the Internet.
[0149] Fig. 9 This is an example of using a composite QR code for secure payment.
[0150] exist Fig. 9In the composite QR code, the QR code information is the user account information: 1320 3234 4894 3928 23. The account information can be dynamically changed after being encrypted, and the QR code image after dynamic change is also a changing image. Figure 3 Similarly, select the highest level H, and select the rectangular area of 7*7 modules in the lower right corner of the QR code as the re-encoding area Q1. When setting the re-encoding area Q1, you can first test that all kinds of occlusions in the rectangular area do not affect the reading of the QR code, that is, the error rate of the QR code caused by the re-encoding area is less than the error correction rate of the QR code. Re-encode the 7*7 module of the re-encoding area Q1, encode the number 123123, use a similar encoding method to the two-dimensional matrix code, and add an error correction algorithm to ensure stable reading. The number 123123 is equivalent to the key of the account information. The reading software determines the reading of the QR code and the information (key) of the 7*7 module re-encoding area through positioning and verifies it online. If the match is correct, it enters the payment link, otherwise the payment is rejected. This method makes payment more secure.
[0151] An example of using a composite QR code for advertising monitoring.
[0152] use Figure 2 The QR code is provided for explanation. Figure 2 The website information is encoded into the QR code: http: / / www.big-code.cn, the highest level of QR code error correction is selected as level H, and the rectangular area of 7*7 modules in the lower right corner of the QR code is selected as the re-encoding area Q. The 7*7 modules in the rectangular area are re-encoded and encoded with the number 456456, using a similar encoding method to the two-dimensional matrix code, and an error correction algorithm is added to ensure stable reading. The number 456456 represents the parameters of the QR code, such as the media name, which is used to identify the source of the QR code scan. The user's reading software (which also has the function of reading the re-encoding area information) reads the QR code and the information of the re-encoding area, and the QR code information is connected to the website content; the information of the re-encoding area (456456) is imported into the back-end database through the Internet for monitoring, analysis, statistics, etc.
[0153] Fig.10 This is an example of composite QR code used in logistics and marketing.
[0154] Fig.10The website information is encoded into the QR code: http: / / www.big-code.cn. The highest QR code error correction level is selected as level H. The rectangular area of 7*14 modules in the lower right corner of the QR code is selected as the re-encoding area Q2. The 7*14 modules in the rectangular area are re-encoded and encoded with the number 1234567890. The encoding method is similar to the two-dimensional matrix code, and an error correction algorithm is added to ensure stable reading. The number 1234567890 represents the logistics code. When printing, the QR code encoding information remains unchanged, while the encoding information in the 7*14 module area changes, representing the logistics code. The user's general reading software reads the QR code information and connects to the website content; the dedicated reading software reads the information in the 7*14 module encoding area (logistics code 1234567890) by positioning, and imports it into the backend database through networking for logistics monitoring, statistics, and analysis.
[0155] Fig.11 This is an example of composite QR code being used to preserve the authenticity of QR code information.
[0156] Fig.11 The QR code W3 is encoded with "Beijing Rocket Technology Co., Ltd., unified social credit code 81210108MA003JQGOW, 201435", and the QR code error correction level is selected as the medium M level. The last "201435" of the QR code information is the position control information of the 7*14 module re-encoding area, which represents the position of the icon. The position control information can be encrypted, and after being decrypted by the reader terminal, the position of the 7*14 module encoding area is calculated by the algorithm. Fig.11 The coordinates of the reference point o of the re-encoded area Q3 are (12, 4), the module number on the X axis is 12, and the module number on the Y axis is 4. The reading terminal then decodes the encoded information of the 7*14 area, which can be a password, key, etc. The authenticity of the information in the QR code can be confirmed through networking or local operations (such as digest calculation) of the decoding terminal. This modified example uses the method of dynamic position plus graphic encryption to make the generation algorithm of the information in the re-encoded area more difficult to crack, thereby increasing security.
[0157] Fig.12 is an example of increasing security by adding a recoding area.
[0158] Fig.12The QR code is encoded with "Beijing Rocket Technology Co., Ltd., unified social credit code 81210108MA003JQGOW, 201435", and the medium M level is selected for the QR code error correction level. In the last "201435" of the QR code encoding information, "201" is the position control information of 7*7 module 1, and "435" represents the position control information of 7*7 module 2. The positions of 7*7 module 1 and 7*7 module 2 are shown in the figure. The two encoding areas can be different encoding rules or the same encoding rules. The reading terminal decodes the encoding information of the 7*7 module 1 and 7*7 module 2 areas. The combination of the two information can be a password, a key, etc. The authenticity of the information in the QR code can be confirmed through networking or local operations (such as summary calculations) of the decoding terminal. This scheme uses the method of multiple encoding areas, making the generation algorithm of the information in the re-encoded area more difficult to crack, thereby increasing security.
[0159] The above embodiments all set up one or more re-encoding areas, and encode implicit information such as keys and logistics management information in the re-encoding areas. However, the re-encoding areas can also be dispersed in the two-dimensional code graphics in units of minimum encoding units (modules), as long as the overall bit error rate caused by them is less than the error correction rate.
[0160] Fig.13 This is an example of encoding implicit information in the minimum re-encoding unit.
[0161] Fig.13 The two-dimensional code W5 is encoded with "Beijing Rocket Technology Co., Ltd., unified social credit code 81210108MA003JQGOW, 201435", and the two-dimensional code error correction level is selected as the medium M level. A plurality of 1*1 module recoding units (Qa...Qn) are set in the two-dimensional code, 10 of which are shown in the figure, and there can be more, for example, 49. The "201435" at the end of the two-dimensional code encoding information is the position distribution data or rule of these recoding units, for example, according to coordinates, or according to the distribution rules of a certain algorithm. The distribution rule data of "201435" can also be combined or calculated with another data in the reading terminal, such as "23812945", so as to obtain the distribution rule data of each recoding unit. The reading terminal decodes the minimum recoding units of these 1*1 modules according to the distribution rule data, for example, there are 49 minimum recoding units in total, and according to the distribution rule data, such as restoring the recoding area of the 7*7 module, and decoding the 7*7 module alone. The decoded information can be a password, key, etc., and the authenticity of the information in the QR code can be confirmed through networking or local operations (such as digest calculation) at the decoding terminal. This solution uses a method of multiple re-encoding units to encrypt the position of the re-encoding area, and the re-encoded information, that is, the generation algorithm of the implicit information, is more difficult to crack, further improving the security of the QR code.
Claims
1. A composite two-dimensional code generating device, characterized in that It includes a two-dimensional code encoding module, a two-dimensional code graphic generation module, an implicit information encoding module, a re-encoding area setting module, a graphic synthesis module, and an output module. The two-dimensional code encoding module generates two-dimensional code encoding information according to the two-dimensional code information. The two-dimensional code graphic generation module generates a two-dimensional code graphic according to the two-dimensional code encoding information. The implicit information encoding module generates re-encoded information according to the implicit information, The re-encoding area setting module sets a re-encoding area for encoding implicit information in the two-dimensional code graphic. The size and position of the re-encoding area are set according to the error correction level of the two-dimensional code, so that the total bit error rate of the two-dimensional code is less than the error correction rate of the two-dimensional code. The graphic synthesis module adjusts the module distribution of the re-encoding area in the two-dimensional code graphic according to the re-encoding information, and incorporates the implicit information into the two-dimensional code graphic to generate a composite two-dimensional code. When generating the two-dimensional code encoding information, the two-dimensional code encoding module combines the two-dimensional code information with the setting information of the re-encoding area into combined information. The two-dimensional code graphic generation module generates two-dimensional code encoding information according to the combination information, so that the generated two-dimensional code graphic contains two-dimensional code information and setting information of the re-encoding area, and the setting information of the re-encoding area includes the shape of the re-encoding area, the number of modules included and the reference point position of the re-encoding area.
2. The composite two-dimensional code generating device according to claim 1, characterized in that: It also includes an output module, which verifies whether the bit error rate of the two-dimensional code is less than the error correction rate before outputting the composite two-dimensional code. If the bit error rate is greater than the error correction rate, the error correction level of the two-dimensional code is reset or the position of the re-encoding area is adjusted.
3. The composite two-dimensional code generating device according to claim 2, characterized in that: It also has a mask processing module. After the graphic synthesis module encodes the implicit information into the two-dimensional code graphic, the mask processing module performs mask processing to generate a composite two-dimensional code.
4. The composite two-dimensional code generating device according to claim 2 or 3, characterized in that: The implicit information encoding module adds error correction code words when generating re-encoded information, so that the implicit information has an error correction function.
5. The composite two-dimensional code generating device according to claim 1, characterized in that: The re-encoding area setting module sets a plurality of re-encoding areas. The setting information of the re-encoding area includes the shape of each re-encoding area, the number of modules included, and the reference point position of the re-encoding area.
6. The composite two-dimensional code generating device according to claim 1, characterized in that The re-encoding area is composed of a plurality of re-encoding units dispersed according to a certain rule, and the implicit information is dispersed in each re-encoding unit.
7. The composite two-dimensional code generating device according to claim 1, characterized in that: It also has an implicit information graphic generation module, which generates an implicit information coding graphic according to the shape of the re-encoding area and the number of modules contained therein, and the module distribution in the implicit information coding graphic corresponds to the re-encoding information.
8. The composite two-dimensional code generating device according to claim 1, characterized in that: The beginning and end of the setting information of the re-encoding area are marked with special characters.
9. A composite two-dimensional code generation method, characterized in that: The following steps are included: Step 1: Generate QR code encoding information based on the QR code information. Step 2, generate a QR code graphic using the QR code encoding information, Step 3, setting a re-encoding area in the generated two-dimensional code graphic, wherein the size and position of the re-encoding area are set according to the error correction level of the two-dimensional code, so that the total bit error rate of the two-dimensional code is less than the error correction rate of the two-dimensional code, Step 4: Generate re-encoded information based on implicit information. Step 5, generating an implicit information coding graph according to the shape of the re-encoded area and the modules contained therein, so that the module distribution in the implicit information coding graph corresponds to the re-encoded information, Step 6: According to the implicit information coding pattern, the distribution of the dark modules and the light modules in the re-encoded area is replaced with the same distribution as the implicit information coding pattern, and the implicit information is encoded into the two-dimensional code to generate a composite two-dimensional code. In the step 1, when generating the two-dimensional code information, the two-dimensional code information and the setting information of the re-encoding area are combined into combined information. In step 2, two-dimensional code encoding information is generated according to the combination information, so that the generated two-dimensional code graphic contains two-dimensional code information and setting information of the re-encoding area, and the setting information of the re-encoding area includes the shape of the re-encoding area, the number of modules included, and the reference point position of the re-encoding area.
10. The composite two-dimensional code generation method according to claim 9, characterized in that: There is also step 7, verifying whether the bit error rate of the composite two-dimensional code is less than the error correction rate. If the bit error rate is greater than the error correction rate, the error correction level of the two-dimensional code is reset or the position of the re-encoding area is adjusted.
11. The composite two-dimensional code generation method according to claim 10, characterized in that: Step 6a is used to replace step 5 and step 6. In step 6a, the code elements in the re-encoded information are read in sequence, compared with the values of the corresponding modules in the re-encoded area, the inconsistent modules are inverted, the implicit information is encoded into the two-dimensional code, and a composite two-dimensional code is generated.
12. The composite two-dimensional code generation method according to claim 9, characterized in that: In step 4, when generating the re-encoded information, an error correction code word is added so that the implicit information has an error correction function.
13. The composite two-dimensional code generation method according to claim 9 or 12, characterized in that: In step 3, a plurality of re-encoding areas are set in the generated two-dimensional code graphic. The setting information of the re-encoding area includes the shape of each re-encoding area, the number of modules included, and the reference point position of the re-encoding area.
14. A composite two-dimensional code reading device, used for reading a composite two-dimensional code generated by the composite two-dimensional code generating device as claimed in claim 1, characterized in that The composite two-dimensional code reading device comprises a two-dimensional code pattern acquisition module, a two-dimensional code decoding module, a re-encoding area determination module, and a hidden information decoding module. The composite two-dimensional code has two-dimensional code information and implicit information. The implicit information is encoded into the two-dimensional code graphic by re-encoding a part of the two-dimensional code module. The two-dimensional code image acquisition module is used to acquire the image of the composite two-dimensional code. The two-dimensional code decoding module decodes the acquired composite two-dimensional code image to obtain two-dimensional code information. The re-encoding region determination module determines the position of the re-encoding region in the composite two-dimensional code image according to a pre-set setting. The implicit information decoding module decodes the re-encoded area to obtain implicit information. The two-dimensional code information of the composite two-dimensional code contains setting information for setting a re-encoding area. The re-encoding area determination module (13) determines the position of the re-encoding area in the composite two-dimensional code image according to the setting information encoded in the two-dimensional code information.
15. A composite two-dimensional code reading method, used for reading a composite two-dimensional code generated by the composite two-dimensional code generation method according to claim 9, characterized in that: The composite two-dimensional code reading method comprises the following steps: The composite two-dimensional code has two-dimensional code information and implicit information. The implicit information is encoded into the two-dimensional code graphic by re-encoding a part of the two-dimensional code module. Step 1, obtain the image of the composite QR code, Step 2: Decode the composite QR code to obtain the QR code information. Step 3, determining the re-encoding area in the composite two-dimensional code image according to the preset setting information, Step 4: Decode the re-encoded area to obtain implicit information. The two-dimensional code information of the composite two-dimensional code contains setting information for setting a re-encoding area. In the step 3, the setting information is obtained from the decoded two-dimensional code information, and the re-encoding area in the composite two-dimensional code image is determined according to the setting information.
