A coding method and a decoding method for a multi-frame matrix two-dimensional code

By designing a superframe structure and hue color reference unit in a matrix QR code, combining error correction encoding of fountain code and polarization code, the problem of insufficient ability to identify multiple color information in the prior art is solved, and higher information capacity and anti-pollution ability are achieved, and it is suitable for a variety of communication scenarios.

CN118761430BActive Publication Date: 2025-06-10NANTONG UNIV
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202410694562.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-31
Publication Date
2025-06-10
Estimated Expiration
2044-05-31

AI Technical Summary

Technical Problem

The prior art has failed to effectively design a matrix QR code that recognizes multiple color information in the overall frame structure, resulting in limited performance improvements.

Method used

The encoding method of multi-frame matrix QR code is adopted to design an enhanced matrix QR code with a super-frame structure with multi-color phase, light and dark levels, and the hues and color reference unit is used to ensure that the receiving device accurately recognizes multiple color information, and uses cascaded fountain codes and polarization codes as error correction codes.

Benefits of technology

The information capacity and image anti-pollution ability are improved, and a certain information transmission rate can be achieved through ordinary optical color display and imaging equipment without the need for radio frequency equipment, which is suitable for point-to-point and broadcast communication scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118761430B_ABST
    Figure CN118761430B_ABST
Patent Text Reader

Abstract

The present invention discloses an encoding method for a multi-frame matrix two-dimensional code, which maps the information to be transmitted into multiple image frames. Each image frame is divided into a reference frame and a data frame. The reference frame is used to provide reference information for automatic decoding, including a geometric reference unit, a time positioning unit, an overall control information unit, and a hue color reference unit. The data frame is used to carry data information, including a geometric reference unit, a time positioning unit, a local control information unit, and a data information unit. At the same time, polar codes are used as inner codes and fountain codes are used as outer codes for error correction codes in the data frame, providing good error correction and decoding capabilities for two-dimensional codes of various sizes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to data recognition technology, and particularly to an encoding method and a decoding method for a multi-frame matrix two-dimensional code. Background Art

[0002] Two-dimensional codes, also known as two-dimensional barcodes or QR codes, refer to barcodes that expand another dimension with readability on the basis of one-dimensional barcodes. They can use rectangular patterns to represent binary data, and the information contained therein can be obtained after being scanned by a device. The width of a one-dimensional barcode records data, while its length does not record data. Both the length and width of a two-dimensional code record data. Compared with one-dimensional barcodes (barcodes) that only have information in the horizontal direction, the information density per unit area of matrix two-dimensional codes is higher. For the same amount of encoded data, the printing and display area of two-dimensional codes will be smaller. In addition, two-dimensional codes have "positioning points" and "error correction mechanisms" that one-dimensional barcodes do not have. The error correction mechanism means that even when the barcode is contaminated or partially damaged, the information on the barcode can still be correctly restored.

[0003] The common technical elements of two-dimensional codes are listed as follows:

[0004] Geometric figure representation of two-dimensional codes;

[0005] Printing or displaying of two-dimensional codes;

[0006] Deformation, dirt removal, and error correction;

[0007] Error correction decoding technology for image processing and restoring data information.

[0008] In rectangular encoding, the data module representing the smallest unit of data is square-shaped. By performing color image transformation (including three-dimensional transformation) on the number elements, the data information can be restored. If black and white data units are used, for an M-row and N-column data unit matrix, the maximum amount of information that can be accommodated is MN bits. With the rapid development of portable mobile devices equipped with high-resolution cameras, matrix two-dimensional codes have also rapidly spread and are widely used in various information transmission and automation control fields.

[0009] The medium of the matrix two-dimensional code is mainly static pictures, and its design purpose is mainly for short message transmission, and its data transmission capacity cannot meet the service requirements of higher data rates. Due to the popularization of modern dynamic color display and imaging devices, devices can generally effectively use multiple image frames to transmit more data, and at the same time effectively and accurately identify a variety of hue and color information. As an enhanced technology for the original matrix two-dimensional code, in the patent application with the publication number CN102750564A and the literature published by Tao Sunjie et al. in 2018 on the design of a data transmission system based on two-dimensional codes, it is proposed to use multiple two-dimensional code image frames in the time domain to improve the information capacity; the publication number CN109254955A discloses a method and system for one-way file ferry between isolated networks based on two-dimensional codes, and proposes to use fountain codes as error correction codes for two-dimensional code file transmission systems. However, none of the above existing technologies have designed a matrix two-dimensional code that can effectively and accurately identify a variety of color information in the overall frame structure, and the improvement of its performance is limited. Summary of the Invention

[0010] Object of the Invention: Aiming at the above problems, the object of the present invention is to provide an encoding method and a decoding method for a multi-frame matrix two-dimensional code, design an enhanced matrix two-dimensional code with a super-frame structure and multiple hues and multiple brightness levels, use a hue color reference unit to ensure that the receiving device can effectively and accurately identify a variety of color information, and at the same time cascade fountain codes and polar codes as error correction codes, which can provide good error correction and decoding capabilities for two-dimensional codes of various sizes.

[0011] Technical Solution: On the one hand, the present invention provides an encoding method for a multi-frame matrix two-dimensional code, including:

[0012] Convert the data characters to be transmitted into a bit stream to form a data information message;

[0013] Interleave the data information message by bits, select a polar code as the error correction coding method, and generate an error correction coding sequence;

[0014] Pack the error correction coding sequence according to the capacity of the super-frame and the data frame, and allocate it to the data frames within one or more super-frames; wherein the super-frame is synthesized by multiple image frames in chronological order, and each image frame is a reference frame or a data frame, the reference frame is used to provide reference information for automatic decoding, and the data frame is used to carry data information;

[0015] In the data frame, allocate the error correction coding sequence to the three hue channels of red, blue and green, map the error correction coding sequence into colors with different brightness levels according to different color brightnesses, then mix the primary colors of the three hue channels to form different colors, and then add a multi-color graphic mask to generate a multi-color matrix two-dimensional code data information unit; multiplex the data information unit with the geometric reference unit, the time positioning unit and the local control information unit on the image frame to generate a data frame;

[0016] Within the reference frame, through graphic mapping and graphic masking, the control information is converted into an overall control information unit, which is multiplexed with the geometric reference unit, time positioning unit, and hue color reference unit on the image frame to generate a reference frame;

[0017] Generate multiple data frames and multiple reference frames until all data information packets are mapped to the data frames;

[0018] Time-multiplex the multiple data frames and multiple reference frames to generate a superframe composed of multiple QR code image frames.

[0019] Furthermore, the process of bit-interleaving the data information packet and selecting the polar code as the error correction coding method to generate the error correction coding sequence includes:

[0020] Convert the data information packet of size B File bytes from bytes to bits, and divide it into N FT source code blocks, each with a size of B FData bits; where represents rounding up;

[0021] By performing block exclusive OR operations on multiple randomly selected source code blocks, continuously generate Luby coding blocks, each with a size of B FData bits;

[0022] Use the Polar code as the inner code, place N PENC Polar code coding blocks in each data frame, with the coding block length of N Polar bits and the coding rate of η Polar , and the information bits of each coding block are (B FData +L) bits. Add L-bit CRC check bits to each of the N PENC Luby coding blocks, and then perform Polar coding respectively to form a coding sequence with a total length of N PENC N Polar bits;

[0023] Interleave the coding sequence of N PENC N Polar bits, add the control information of the N Ctrl bit data frame to generate an error correction coding sequence of N PENC N Polar +N Ctrl bits, and send it to the data area of the data frame.

[0024] Furthermore, within the data frame and the reference frame, the geometric reference unit is used for the geometric positioning and tilt correction of the QR code;

[0025] The time positioning unit is used to receive frame sequence number information, and at the same time give the interval information between the previous and next frames, the start and end flags of the superframe, and identify whether the frame is a reference frame or a data frame.

[0026] Furthermore, the overall control information unit is used to provide necessary control information related to the superframe, including the number of image frames contained in a superframe, the refresh time of the image frame, and the geometric size of the QR code;

[0027] The hue color reference unit is used to provide image reference hue information and reference color brightness;

[0028] The local control information unit is used to store the local control information in the data frame.

[0029] On the other hand, the present invention provides a decoding method for a multi-frame matrix two-dimensional code, including the following steps:

[0030] Step 1, at the receiving end, store the received image of a superframe in the buffer, locate and extract the reference frame of the superframe from the buffer, use the geometric reference unit to locate the QR code, and identify the control information through the overall control information unit;

[0031] Step 2, in the reference frame, use the hue color reference unit to extract the hue reference information and the color brightness reference information;

[0032] Step 3, locate and extract the data frames of the superframe from the buffer, use the geometric reference unit to locate and remove the mask, perform light and dark level judgment on each hue channel of each data information unit using the hue reference information, and extract the data frame bit sequence after hard decision;

[0033] Step 4, according to the data frame bit sequence, perform error correction decoding using the fountain code;

[0034] Step 5, if the data information message in the image superframe cannot be recovered, repeat the above steps 1 - step 4 until the decoding is successful, or fail after reaching the maximum number of attempts, and the receiving end notifies the sending end of success or failure.

[0035] Furthermore, the process of performing error correction decoding using the fountain code according to the data frame bit sequence includes:

[0036] In the N PENC N Polar +N Ctrl bits detected and recovered by the data frame multi-channel, obtain the frame control information, and then through the deinterleaver, generate N PENC pieces of N Polar bit Polar coding blocks;

[0037] Take the fountain code as the outer code, and for N PENC pieces of NPolar The Polar - coded blocks of bits are respectively subjected to CA - SCL decoding. If the CRC check fails, all bits of the current coded block are discarded as erasure bits; if the CRC check passes, through de - interleaving, the recovered Luby - coded block is sent to the next stage for fountain - code decoding; where the size of each Luby - coded block is B FData bits;

[0038] The fountain decoder continuously accumulates Luby - coded blocks and attempts fountain - code decoding until the decoding is finally successful or fails after reaching the maximum number of attempts.

[0039] Advantageous effects: Compared with the prior art, the remarkable advantages of the present invention are:

[0040] The present invention defines a super - frame structure based on matrix - type two - dimensional code transmission. Using the super - frame structure can ensure the reliability of multiplexing multiple matrix - type two - dimensional codes in the time domain. Compared with single - frame two - dimensional codes, the information capacity is increased; a reference frame is added to the super - frame structure to provide geometric, hue, and color references for data reception, ensuring that the receiving device accurately recovers the information on each hue channel, and a higher information capacity can be provided; at the same time, based on the super - frame structure, polar codes are used as inner codes and fountain codes are used as outer codes for error - correction coding. Compared with the Reed - Solomon codes used in QR codes, the anti - pollution and anti - damage capabilities of images are further improved; applying the above - mentioned multi - frame two - dimensional code structure does not require the deployment of radio - frequency devices. Only ordinary optical color display and imaging devices are used at the sending and receiving ends, and a certain information transmission rate can be achieved; therefore, due to its flexibility and simplicity, it can be widely applied to point - to - point and broadcast communication scenarios. Brief Description of the Drawings

[0041] Figure 1 It is a flowchart of an encoding method for a multi - frame matrix - type two - dimensional code in an embodiment;

[0042] Figure 2 It is a schematic diagram of the structure of a super - frame in an embodiment;

[0043] Figure 3 It is a flowchart of a decoding method for a multi - frame matrix - type two - dimensional code in an embodiment;

[0044] Figure 4 It is a flowchart of error - correction code encoding and decoding in an embodiment. Detailed Embodiments

[0045] In order to make the objectives, technical solutions, and advantages of the present application more clear and understandable, the present application will be further described in detail below with reference to the accompanying drawings and embodiments.

[0046] Embodiment 1

[0047] A coding method for a multi-frame matrix two-dimensional code according to this embodiment, the flowchart is as shown in Figure 1 and includes:

[0048] Convert the data characters to be transmitted into a bit stream, and the whole forms a data information message;

[0049] Perform bit interleaving on the data information message, select polar code as the error correction coding method, and generate an error correction coding sequence;

[0050] Pack the error correction coding sequence according to the capacity of the super-frame and the data frame, and allocate it to the data frames within one or more super-frames; where the super-frame is synthesized by multiple image frames in chronological order, and each image frame is a reference frame or a data frame, the reference frame is used to provide reference information for automatic decoding, and the data frame is used to carry data information;

[0051] Within the data frame, allocate the error correction coding sequence to the red, blue, and green color channels. Map the error correction coding sequence into colors with different brightness levels according to different color brightnesses, then mix the primary colors of the three color channels to form different colors, and then add a multi-color graphic mask to generate a multi-color matrix two-dimensional code data information unit; Multiplex the data information unit with the geometric reference unit, time positioning unit, and local control information unit on the image frame to generate a data frame;

[0052] Within the reference frame, convert the control information into an overall control information unit through graphic mapping and graphic mask, and multiplex it with the geometric reference unit, time positioning unit, and hue color reference unit on the image frame to generate a reference frame;

[0053] Generate multiple data frames and multiple reference frames until all data information messages are completely mapped to the data frames;

[0054] Perform time multiplexing on multiple data frames and multiple reference frames to generate a super-frame composed of multiple two-dimensional code image frames.

[0055] The present invention defines a superframe structure based on the transmission of matrix two-dimensional codes. The superframe structure can ensure the reliability of multiplexing multiple matrix two-dimensional codes in the time domain. Compared with a single-frame two-dimensional code, it increases the information capacity. A reference frame is added to the superframe structure to provide geometric, hue, and color references for data reception, ensuring that the receiving device accurately recovers the information on each hue channel and can provide a higher information capacity. At the same time, based on the superframe structure, polar codes are applied as the inner code for error correction coding. Compared with the Reed-Solomon code used in QR codes, it further improves the anti-pollution and anti-damage capabilities of images. Finally, it should be pointed out that by applying the above multi-frame two-dimensional code structure, no radio frequency equipment needs to be deployed. Only ordinary optical color display and imaging equipment are used at the sending end and the receiving end, and a certain information transmission rate can be achieved. Therefore, due to its flexibility and simplicity, it can be widely applied to point-to-point and broadcast communication scenarios. For example, using a color display device with a frame rate of 24 frames per second, for a multi-hue and multi-lightness-level two-dimensional code superframe with a duration of 1 second, its information capacity can reach about 24 * 6 = 144 times that of a single-frame black-and-white two-dimensional code. Given that the information capacity of the version 40 QR code is about 3K bytes, the maximum capacity of the two-dimensional code superframe proposed above is about 0.4M bytes per second, which can carry a high-definition video stream equivalent to 1080P, i.e., 3500Kbps. If it is extended into a complex superframe in time and space to exploit the device potential, the information capacity can be further improved, and even multiple 4K high-definition image transmissions can be carried.

[0056] Further, the process of generating an error correction coding sequence by bit-interleaving the data information message and selecting polar codes as the error correction coding method includes:

[0057] Convert the data information message with a size of B File bytes from bytes to bits and divide it into N FT source code blocks, each with a size of B FData bits; where represents rounding up;

[0058] By performing block exclusive OR operations on multiple randomly selected source code blocks, continuously generate Luby coding blocks, each with a size of B FData bits;

[0059] Use Polar codes as the inner code and place N PENC Polar code coding blocks in each data frame. The coding block length is N Polar bits. Perform L-bit CRC checks on the N PENC Luby coding blocks respectively and then perform Polar coding. Among them, the information bit of each coding block is (B FData +L) bits, and the coding results in a length of N PENC NPolar Coded sequence of bits with a coding rate of η Polar =(B FData +L) / N Polar ;

[0060] Interleave the coded sequence of N PENC N Polar bits, add the control information of the N Ctrl -bit data frame to generate an error-correcting coded sequence of N PENC N Polar +N Ctrl bits and send it to the data area of the data frame.

[0061] Furthermore, synthesize multiple matrix two-dimensional code image frames into a superframe in chronological order. The sending device continuously displays the image frames within the superframe within a certain time period. As Figure 2 shown, a superframe has N d data frames (represented by the shaded rectangular boxes marked with "number" in Figure 2 ) and N r reference frames (represented by the white rectangular boxes marked with "reference" in Figure 2 ). The reference frame includes a geometric reference unit, a time positioning unit, an overall control information unit, and a hue color reference unit. The data frame includes a geometric reference unit, a time positioning unit, a local control information unit, and a data information unit. Within the data frame and the reference frame, the geometric reference unit is used for geometric positioning and skew correction of the QR code; the time positioning unit is used to receive frame sequence number information, and at the same time give the interval information between the front and rear frames, the start and end flags of the superframe, and identify whether the frame is a reference frame or a data frame. The overall control information unit is used to provide necessary control information related to the superframe, including the number of image frames contained in a superframe, the refresh time of the image frames, and the geometric size of the QR code; the hue color reference unit is used to provide image reference hue information and reference color brightness; the local control information unit is used to store the local control information within the data frame. The data information unit is used for this type of module to transmit information using the image color brightness. It has three hue channels of red, blue, and green, and the hue channels are independent of each other. All three hue channels of red, blue, and green can be encoded with different color brightnesses to send and receive information. The receiving end can accurately estimate and judge the received color brightness level according to the hue color reference unit without worrying about imaging problems such as color shift. For example: divide the red, blue, and green color brightnesses into four levels of dark, gradually dark, gradually bright, and bright (2 bits), then for a matrix unit, 2 * 3 = 6 bits of information can be transmitted.

[0062] The present invention is implemented by improving on the basis of the national standard of QR code (National Technical Committee for Information Technology Standardization. GB / T 18284-2000 Quick Response Matrix Code [S]. Beijing: Standards Press of China, 2001) and the international standard (International Organization for Standardization. ISO / IEC 18004:2015 Automatic identification International Organization for Standardization, 2015). Among them, the functional modules related to positioning, geometric processing, and black and white processing still follow the designs of the national standard and international standard of QR code, and the relevant functional graphics remain unchanged; at the same time, the mask function of the two-dimensional code mask also follows the national standard and international standard of QR code. The main modification of the present invention lies in the design of the reference frame and the design of the hue color reference unit in the data frame, and this part depends on re-designing the encoding area of the national standard and international standard of QR code. Here, the version 6 QR code in the national standard of QR code is taken as an example for illustration. Each image frame contains 41×41 modules. In this embodiment, three hue channels of red, green, and blue are used, and each hue channel carries 2-bit information, which is divided into four brightness levels: dark / fading dark / fading bright / bright. The RGB format is used to describe the color space, and the maximum brightness value of each hue channel is set to 255, and the minimum value is 0.

[0063] At the sending end, the image frame rate is 24 frames per second. In 1 second, there are 4 super frames, and each super frame has 6 image frames. In this embodiment, the reference frame and the data frame are multiplexed at a ratio of 1:5, where the first frame is the reference frame and the other 5 frames are data frames. Since the device is relatively stationary during code recognition, the accuracy of the hue color reference value can be guaranteed.

[0064] The implementation image of the reference frame corresponds to the grayscale images of the three different hue channels of red, green, and blue. In the reference frame, the hue color reference unit is placed in the original encoding area. After multiplexing with the geometric reference unit and the time positioning unit, a reference frame is formed. According to the national standard and international standard version 6 QR code of QR code, there are 1383 hue color reference units in total.

[0065] In the original encoding area of the reference frame, red / green / blue / white and red / green / blue / black color reference units are placed periodically. The brightness of each reference unit of red, green, and blue is (255, 0, 0), (0, 255, 0), (0, 0, 255) respectively, the brightness value of black is (0, 0, 0), and the brightness of white is (255, 255, 255). Without affecting the performance, it can also be configured as other three complementary hue channels (such as cyan, magenta, and yellow).

[0066] An implementation image of a data frame corresponds to grayscale images of three different hue channels of red, green, and blue. The functional units of the data frame remain in black and white. Each unit in the encoding area uses three hue channels, and each hue channel has four brightness levels: dark, fading, brightening, and bright. Different brightness levels are displayed as different grayscale values. There are a total of 64 color differences in the three channels. Each encoding area module carries 6-bit original information. According to the national and international standards of QR codes, the encoding area can carry a total of 1383 * 6 = 8298 bits.

[0067] Embodiment 2

[0068] A decoding method for a multi-frame matrix two-dimensional code according to this embodiment is shown in the flowchart as Figure 3 shown, and includes the following steps:

[0069] Step 1, store the received image of a superframe in the buffer at the receiving end, locate and extract the reference frame of the superframe from the buffer, locate the QR code using the geometric reference unit, and identify the control information through the overall control information unit;

[0070] Step 2, extract the hue reference information and color brightness reference information in the reference frame using the hue color reference unit;

[0071] Step 3, locate and extract the data frame of the superframe from the buffer, use the geometric reference unit to locate and remove the mask, perform a light and dark level judgment on each hue channel of each data information unit using the hue reference information, and extract the data frame bit sequence after hard decision;

[0072] Step 4, perform error correction decoding using the fountain code according to the data frame bit sequence;

[0073] Step 5, if the data information message in the image superframe cannot be restored, repeat the above steps 1 - step 4 until the decoding is successful or stop when the maximum number of attempts is reached, and the receiving end notifies the sending end of the success or failure of the reception.

[0074] In the decoding stage of the present invention, the fountain code is used as an outer code for error correction decoding. The data frames are continuously received for a period of time, and the received information is accumulated until the broadcast information can be finally restored, which can provide good error correction decoding capabilities for two-dimensional codes of various sizes; the receiving device uses the hue color reference unit of the reference frame to accurately estimate and judge the received color brightness. According to this information, effects such as color cast can be eliminated, providing conditions for the correct reception of multi-hue and multi-lightness data frames without worrying about imaging problems such as hue offset.

[0075] Furthermore, the process of performing error correction decoding using the fountain code according to the data frame bit sequence includes:

[0076] Among the N bits recovered by multi-channel detection of the data frame, frame control information is obtained, and then through a deinterleaver, N Polar-encoded blocks of N bits are generated; PENC N Polar +N Ctrl Using the fountain code as the outer code, each of the N Polar-encoded blocks of N bits is subjected to CA-SCL decoding. If the CRC check fails, all the bits of the current encoded block are discarded as erasure bits; if the CRC check passes, through deinterleaving, the recovered Luby-encoded block is sent to the next stage for fountain code decoding; where the size of each Luby-encoded block is B PENC N Polar bits;

[0077] The fountain decoder continuously accumulates Luby-encoded blocks and attempts fountain code decoding until the decoding is finally successful or the decoding fails after reaching the maximum number of attempts. Finally, the decoding result is notified to the sender. PENC N Polar In one example, in step 2, in the reference frame, the hue reference information and the color luminance reference information are extracted by using the hue color reference unit, and the lightness level judgment is performed on each hue channel of each data information unit by using the hue reference information. Taking the QR code national and international standard version 6 QR code as an example, there are 1383 hue color reference units. For the unit in the i-th row and j-th column, for each hue channel, the decision thresholds for the four brightness levels of dark / fading dark / fading bright / bright are determined. The decision threshold is determined according to the RGB values of its surrounding hue color reference units and remains unchanged within one superframe time. FData bits;

[0078] Similarly, in step 3, when performing the lightness level judgment on each hue channel of each data information unit by using the hue reference information, for the hue color reference unit in the i-th row and j-th column, for each hue channel, the luminance detection judgment is performed, and the decision threshold is determined according to the RGB values of its surrounding hue color reference units and remains unchanged within one superframe time. Each data frame can recover 1383 * 6 = 8298 bits. Assuming that the implementation efficiency of error correction decoding is η, the theoretical information rate of the above scheme is: 8298 × 20 × η ≈ 176η Kps.

[0079] The following is a general description of the specific implementation method of error correction coding. In a specific implementation case, a concatenated coding configuration method with an inner code of Polar code and an outer code of fountain code is used. Assuming that the size of the file to be transmitted is 1024 * 768 bits, as

[0080] shown, the process of error correction coding is as follows:

[0081] The following is a general description of the specific implementation method of error correction coding. In a specific implementation case, a concatenated coding configuration method with an inner code of Polar code and an outer code of fountain code is used. Assuming that the size of the file to be transmitted is 1024 * 768 bits, as Figure 4 shown, the process of error correction coding is as follows:

[0082] The file is divided into 1024 source blocks, each with a size of 768 bits. By performing exclusive-or operations on multiple randomly selected source code blocks, Luby coded blocks are continuously generated, and each Luby coded block has a size of 768 bits. Taking Polar codes as the inner code, 8 Polar code coded blocks are placed within a data frame, with a block length of 1024 bits and a coding rate of approximately 3 / 4, where the information bits are 768 bits. The 8 Luby coded blocks generated in the previous step are taken, 24-bit CRC check bits are added respectively, and then Polar coding is performed. After Polar coding is completed to form 8 * 1024 = 8192 coded bits, through bit interleaving (interleaver length 8192 bits), 106-bit local control information (all set to 0 in this example) is added, totaling 8292 bits, and sent to the data frame for image coding.

[0083] The process of error correction decoding is as follows:

[0084] Among the 8292 bits recovered by multi-channel detection in the data frame, frame sequence number information is obtained, and then through a deinterleaver (deinterleaver length 8192 bits), 8 Polar code coded blocks of 1024 bits are formed. CA-SCL decoding is performed on the 8 Polar code coded blocks of 1024 bits. If the CRC check fails, all bits of the current coded block are discarded as erasure bits; if the CRC check passes, the recovered Luby coded block is sent to the next-level fountain decoder. During this process, the block error rate is statistically ∈. The fountain decoder gradually accumulates Luby coded blocks and continuously attempts decoding until successful decoding finally occurs. According to theoretical analysis, approximately 1024(1 + ∈) coded blocks are required to recover the original file. The receiving end notifies the sending end of successful reception, or if it still cannot be correctly received after reaching the maximum number of attempts, it notifies the sending end of failed reception.

[0085] Assuming the block error rate ∈ = 0.05, the theoretical information rate is: Using a 41×41 QR code, it takes less than 15 seconds to transmit a data file of approximately 100 Kbyte. From the above example, it can be seen that although using a medium and small-scale version 6 QR matrix two-dimensional code, the encoding and decoding method of the present invention can still achieve a certain information transmission rate and can be used for the transmission of medium and small files.

Claims

1. A method for encoding a multi-frame matrix two-dimensional code, characterized in that: include: Convert the data characters to be transmitted into a bit stream to form a data information message; The data information message is bit interleaved, polar code is selected as the error correction coding method, and an error correction coding sequence is generated; Packing the error correction code sequence according to the capacity of the superframe and the data frame and distributing it to one or more data frames in the superframe; The superframe is synthesized from multiple image frames in time sequence, and each image frame is a reference frame or a data frame. The reference frame is used to provide reference information for automatic decoding, and the data frame is used to carry data information. In the data frame, the error correction code sequence is allocated to the three hue channels of red, blue and green, and the error correction code sequence is mapped into colors of different brightness according to different color brightness, and then the primary colors of the three hue channels are mixed to form different colors, and then a multi-color graphic mask is added to generate a multi-color matrix two-dimensional code data information unit; the data information unit is multiplexed with the geometric reference unit, the time positioning unit and the local control information unit on the image frame to generate a data frame; In the reference frame, the control information is converted into an overall control information unit through graphic mapping and graphic masking, and multiplexed with a geometric reference unit, a time positioning unit, and a hue and color reference unit on the image frame to generate a reference frame; The hue color reference unit is used to provide image hue reference information and color reference brightness; Generate multiple data frames and multiple reference frames until all data information messages are mapped to the data frames; Multiple data frames and multiple reference frames are time-multiplexed to generate a superframe consisting of multiple two-dimensional code image frames.

2. The method for encoding a multi-frame matrix two-dimensional code according to claim 1, characterized in that: The process of bit-interleaving the data information message and selecting the polar code as the error correction coding method to generate the error correction coding sequence includes: Set the size to B File The data information message of bytes is converted into bits and divided into N FT source code blocks, each block is of size B FData bits; Indicates rounding up; By performing block XOR operations on multiple randomly selected source code blocks, Luby code blocks are continuously generated. The size of each Luby code block is B. FData Bit; Use Polar code as inner code and place N in each data frame. PENC Polar code blocks, the length of the code block is N Polar bits, the coding rate is η Polar , the information bits of each coding block are (B FData +L) bit, N PENC Luby coded blocks are added with L CRC check bits, and then Polar coded respectively, forming a total length of N PENC N Polar A coded sequence of bits; N PENC N Polar The bit coding sequence is bit interleaved and N Ctrl bit data frame control information, generating N PENC N Polar +N Ctrl The error correction coding sequence of bits is sent to the data area of ​​the data frame.

3. The encoding method of a multi-frame matrix two-dimensional code according to claim 1, characterized in that: In the data frame and reference frame, the geometric reference unit is used for the geometric positioning and tilt correction of the QR code; The time positioning unit is used to receive frame sequence information, and at the same time provide the interval information of the previous and next frames, the start and end marks of the superframe, and identify whether the frame is a reference frame or a data frame.

4. The method for encoding a multi-frame matrix two-dimensional code according to claim 1, characterized in that: The overall control information unit is used to provide necessary control information related to the superframe, including the number of image frames contained in a superframe, the refresh time of the image frame, and the geometric size of the QR code; The local control information unit is used to store the local control information in the data frame.

5. A method for decoding a multi-frame matrix two-dimensional code, characterized in that: The following steps are involved: Step 1: at the receiving end, a received image of a superframe is stored in a buffer, a reference frame of the superframe is located and extracted from the buffer, the QR code is located using a geometric reference unit, and the control information is identified through an overall control information unit; The superframe is synthesized from multiple image frames in time sequence, and each image frame is a reference frame or a data frame. The reference frame is used to provide reference information for automatic decoding, and the data frame is used to carry data information. In the data frame, the error correction code sequence is allocated to the three hue channels of red, blue and green, and the error correction code sequence is mapped into colors of different brightness according to different color brightness, and then the primary colors of the three hue channels are mixed to form different colors, and then a multi-color graphic mask is added to generate a multi-color matrix two-dimensional code data information unit; the data information unit is multiplexed with the geometric reference unit, the time positioning unit and the local control information unit on the image frame to generate a data frame; In the reference frame, the control information is converted into an overall control information unit through graphic mapping and graphic masking, and multiplexed with a geometric reference unit, a time positioning unit, and a hue and color reference unit on the image frame to generate a reference frame; The hue color reference unit is used to provide image hue reference information and color reference brightness; Step 2, extracting hue reference information and color brightness reference information using a hue color reference unit in the reference frame; Step 3, locate and extract the data frame of the superframe from the buffer, use the geometric reference unit to locate and remove the mask, use the hue reference information to make a brightness level decision on each hue channel of each data information unit, and extract the data frame bit sequence after hard decision; Step 4, using fountain code to perform error correction decoding according to the data frame bit sequence; Step 5: If the data information message in the image superframe cannot be recovered, repeat the above steps 1 to 4 until the decoding is successful, or the maximum number of attempts is reached and the receiving end notifies the sending end of the reception success or failure.

6. A method for decoding a multi-frame matrix two-dimensional code according to claim 5, characterized in that: According to the data frame bit sequence, the process of error correction decoding using fountain code includes: In the data frame multi-channel detection, N PENC N Polar +N Ctrl bits, obtain frame control information, and then pass through the deinterleaver to generate N PENC N Polar Polar coded blocks of bits; Take the fountain code as the outer code, and PENC N Polar The Polar coded blocks of bits are decoded by CA-SCL respectively. If the CRC check fails, all bits of the current coded block are discarded as deleted bits. If the CRC check passes, the Luby coded block is deinterleaved and sent to the next level for fountain code decoding. The size of each Luby coded block is B. FData Bit; The fountain decoder accumulates Luby coded blocks and attempts fountain code decoding until the decoding succeeds or the maximum number of attempts is reached.

Citation Information

Patent Citations

  • Dynamic two-dimension code and decoding method thereof

    CN102750564A

  • A method and a system for isolating unidirectional file ferry between networks based on a two-dimensional code

    CN109254955A

  • Data reader, data reading method and data recorder

    CN102142077A

  • Method of encoding / decoding color QR code

    CN104899630A