An encoding automatic error correction control method
Patent Information
- Application Number
- CN202310735350.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-20
- Publication Date
- 2026-09-08
- Estimated Expiration
- 2043-06-20
AI Technical Summary
传统二维码技术信息识读时会出现整个图案被涂污或大面积缺损导致出现难以识别出整体的信息,这个缺点能被不法分子利用,导致市面上的货品窜货,为企业和消费者带来损失
[0049] 1) This invention employs a two-layer information encoding and decoding protection method using DET reconstruction and LDPC (Low Density Parity Check) encoding and decoding. It leverages the self-correcting capabilities of the DET and LDPC algorithms to achieve self-correction of the code array during transmission. By using two-dimensional parity checking, it addresses issues such as channel noise during transmission, filtering out correct code stream information from a large amount of data, thus realizing the self-correcting capability of the encoding during information propagation.
Smart Images

Figure CN116720538B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of information anti-counterfeiting technology, specifically to an automatic code error correction control method. Background Technology
[0002] Faced with a vast market system, especially online and offline sales, the authenticity of products is difficult to verify. Counterfeiting and fake products are rampant and difficult for many companies to control. Companies urgently need a low-cost, easy-to-operate solution for control. To address counterfeiting, cross-selling, and other "illegal trade" activities, serial identification is being implemented. The market needs to assign a special identity to each product, which is the currently popular "one item, one code." "One item, one code" protects brands from harm throughout the entire supply chain. Using images to achieve product traceability, "one item, one code" packaging has been launched. "One item, one code" is equivalent to the product's ID. Consumers can trace the product's origin and learn about its production information by scanning the image. Printed images suffer from defects such as omissions, offsets, dot gain, and ink splatter during the printing process. Furthermore, the reading equipment is often affected by factors such as lighting and camera shake, resulting in significant error problems. Commercially available printed patterns struggle to achieve full-coverage embedding, blind reading, and pseudo-random information hiding effects. Information embedding cannot match the size of the carrier image. Repeated image dot matrix arrangements can cause moiré patterns. Traditional QR code technology sometimes results in the entire pattern being smeared or missing in large areas, making it difficult to identify the whole information. This shortcoming can be exploited by criminals, leading to the cross-selling of goods in the market and causing losses to businesses and consumers.
[0003] The prior art CN102509200A discloses a fault-tolerant and error-correcting method for parsing barcode identifiers of warehouse materials, characterized by the following steps:
[0004] Step 1: Collect barcode data of stored materials on-site. The barcode data of stored materials is collected using a handheld barcode data collector. The collected data is then downloaded and transmitted to a computer terminal with network connectivity.
[0005] Step 2: Load the materials that have completed data collection onto trucks for transportation;
[0006] Step 3: The existing ERP program verifies the barcode data collected in Step 1. Verification involves comparing the collected barcode information with preset barcode information rules. If the barcode information conforms to the preset rules, the embedding module is not invoked; otherwise, the embedding module is invoked, the collected barcode is identified as an error, and Step 4 is executed. The embedding module, designed according to the technical content of this solution, includes a fault-tolerant pool database module, an error code retrieval and distribution module, an objective fault-tolerant program module, and a subjective error correction program module.
[0007] The error code retrieval module is connected to the objective error tolerance module, the subjective error correction module, and the error tolerance pool database module respectively. It determines whether to activate the error tolerance module or the error correction module based on the error code retrieval result.
[0008] Step 4: Invoke the embedded module to perform fault-tolerant and error-correcting processing on the information identified as erroneous in Step 3. The specific steps of the fault-tolerant and error-correcting processing are as follows:
[0009] A. The error code retrieval and routing module is invoked. This module searches and compares the error code string with the values of the record fields in the fault tolerance pool database module. If no record matching the error code is found in the fault tolerance pool, the code is considered a genuine error code that occurred during barcode acquisition, i.e., an "objective error code." If a record matching the error code is found in the fault tolerance pool, the code is considered a replacement code that was subjectively referenced during previous fault tolerance operations, i.e., a "subjective error code."
[0010] When the error code retrieval module detects an objective error code, this module will redirect the traffic to the objective error tolerance module and execute step B; when the error code retrieval module detects a subjective error code, this module will redirect the traffic to the subjective error correction module and execute step C.
[0011] B. When it is determined to be an objective error code, the objective fault tolerance program module is called. The objective fault tolerance program module performs fuzzy correction on the error code part based on the residual part of the error code and other information. Then, it submits the error code to the inventory database to find the inventory code number with the same information attributes, randomly selects one of them as the replacement code number, and writes the replacement details of the subjectively selected code number into the fault tolerance pool database module to complete the fault tolerance replacement function.
[0012] C. When a subjective error code is identified, the subjective error correction module is invoked. The subjective error correction module randomly extracts another code number from the inventory product records with the same information attributes in the fault tolerance pool database module to replace the code number occupied by the fault tolerance, so that the previously occupied code number is restored to the normal state and enters the outbound sales process. This completes one subjective error code iteration.
[0013] D. After multiple iterations of error correction, the probability of the original error code that was first corrected being used for subjective error code iteration increases. When the code number corresponding to the original error code is obtained in a certain iteration, because the physical item with this code number has already left the warehouse during the first error correction replacement, it will never be collected by the barcode again. Therefore, it will never be activated from the error correction pool database module by the subjective error correction module. This code number is the true code number corresponding to the original error code, and the error correction process is completed.
[0014] Existing technologies achieve error correction by reading barcode data and judging it with an embedded module. Summary of the Invention
[0015] The technical problem solved by this invention is to overcome the problems existing in the prior art and provide a new automatic error correction control method for encoding.
[0016] The objective of this invention is achieved through the following technical solution:
[0017] A method for automatic code error correction control is disclosed, the method comprising the following steps:
[0018] S1: Input encrypted information to form a binary code stream;
[0019] S2: Reassemble the binary code stream using DET;
[0020] S3: Error correction processing of the reassembled binary code stream using LDPC;
[0021] S4: Rotate and position the code array;
[0022] S5: Generate Meta code and embed it into the carrier image;
[0023] S6: Obtain plaintext information
[0024] Preferably, step S1 involves preprocessing the expedited information of the anti-counterfeiting mark, website address, serial number, text, and trademark to obtain a binary code stream.
[0025] Preferably, step S2 includes the following steps:
[0026] S21: Define the determinant matrix;
[0027] S22: The acquired binary code stream is divided into groups. Each group of binary code streams is multiplied by its own formula and modulo 2 processed before being reassembled to obtain a new binary code stream.
[0028] S23: To obtain two-dimensional data, the new binary code stream is serialized and parallelized. Parity checks are performed on each row and column of the two-dimensional data to obtain the check code of the two-dimensional matrix. The obtained check code data is then concatenated with the outer layer of the two-dimensional data.
[0029] Preferably, step S3 involves performing certain operations on the verification matrix to obtain a generator matrix, which is used to process the matrix after step S23, and the codewords are multiplied by the generator matrix and then recombined.
[0030] Preferably, step S4 includes:
[0031] S41: Utilize rotational positioning to solve the problem that code array information cannot match the size of the carrier image during information implantation;
[0032] S42: The positioning information identifier defined by the code length after adding rotation positioning and the size of the original image to be generated are used to determine the positioning points available for subsequent decoding through horizontal and vertical data streams, and the original code array is continuously pseudo-randomly interleaved to form a two-dimensional matrix.
[0033] Preferably, step S4 further includes
[0034] S43: Combine different styles of QR code arrays to form a large code array.
[0035] Preferably, step S5 includes:
[0036] S51: Based on the desired location of the embedded carrier image, perform digital image processing on the carrier image to determine the embedding location, and define the location where the Meta code can be embedded based on the current location of the carrier image.
[0037] Preferably, step S5 further includes:
[0038] S52: Print the image, and perform partial cropping and corresponding preprocessing on the image to ensure the reliability and stability of the operation;
[0039] S53: Record all decodeable information in the captured pattern through digital image processing, and perform rotation correction on the original pattern based on the corresponding data and calculations to ensure the smooth progress of subsequent code array recognition;
[0040] S54: Based on the information point radius detected by digital image processing and the relationship between the information point radius and the distance between adjacent information points, the pattern is numerically eroded and expanded; the cropped pattern is reduced accordingly to facilitate subsequent analysis of the code matrix;
[0041] S55: Processing and recognizing positioning information to determine whether the required angle has been reached, and performing more precise rotation correction;
[0042] S55: The acquired information code array is processed for de-positioning information, and then the rotary positioning information is detected. If it can be detected, serial-to-parallel swapping can be performed for further processing. If it cannot be detected, pseudo-random interleaving is performed once, and the loop continues until rotary positioning information is detected or the upper limit is reached.
[0043] S56: Exchange the code array after step S55 into a one-dimensional binary code stream and remove the information code for rotation positioning.
[0044] S57: Multiply the determinant corresponding to the DET recombination and perform a modulo-2 operation to complete the decryption.
[0045] Preferably, step S56 is performed by BF decoding of LDPC.
[0046] Preferably, the preprocessing method in step S52 is as follows:
[0047] This invention first records relevant information to form a binary code stream, then reassembles the binary code stream using DET, and then processes the reassembled binary code stream using LDPC to form a code array. Finally, it is located, generates a Meta code, and embeds it into a carrier image to obtain plaintext information.
[0048] Compared with existing technologies, it has the following beneficial effects:
[0049] 1) This invention employs a two-layer information encoding and decoding protection method using DET reconstruction and LDPC (Low Density Parity Check) encoding and decoding. It leverages the self-correcting capabilities of the DET and LDPC algorithms to achieve self-correction of the code array during transmission. By using two-dimensional parity checking, it addresses issues such as channel noise during transmission, filtering out correct code stream information from a large amount of data, thus realizing the self-correcting capability of the encoding during information propagation.
[0050] 2) By using four steps—rotational positioning, periodic positioning, code array splicing, and embedding into the carrier image—the function of embedding a single code array into an encrypted image is achieved. This solves the problem that regular code arrays are easily observed by criminals, resulting in large-area damage and contamination, which in turn damages the code array. By adding rotational information, the problem of accurate positioning of the code array when it is read is solved. Attached Figure Description
[0051] Figure 1 This is a flowchart illustrating an automatic error correction control method for encoding according to the present invention;
[0052] Figure 2 This is a detailed flowchart of an automatic error correction control method for encoding according to the present invention;
[0053] Figure 3 This is a Tanner diagram corresponding to the LDPC code verification matrix in the automatic error correction control method of the present invention. Detailed Implementation
[0054] To clearly illustrate the technical features of this solution, the invention will be described in detail below through specific implementation methods and in conjunction with the accompanying drawings.
[0055] Many specific details are set forth in the following description in order to provide a full understanding of this application. However, this application may also be implemented in other ways different from those described herein. Therefore, the scope of protection of this application is not limited to the specific embodiments disclosed below.
[0056] Furthermore, it should be understood in the description of this application that the terms "center," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," "axial," "radial," and "circumferential," etc., indicating orientation or positional relationships based on the orientation or positional relationships shown in the accompanying drawings, are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation on this application. In addition, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, "a plurality of" means two or more, unless otherwise explicitly specified.
[0057] In this application, unless otherwise expressly specified and limited, the terms "installation," "connection," "linking," and "fixing," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection, an electrical connection, or a communication connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. Those skilled in the art can understand the specific meaning of the above terms in this application according to the specific circumstances.
[0058] In this application, unless otherwise expressly specified and limited, the "above" or "below" of the second feature can mean that the first and second features are in direct contact, or that the first and second features are in indirect contact through an intermediate medium. In the description of this specification, references to terms such as "an embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described can be combined in any suitable manner in one or more embodiments or examples.
[0059] Example 1
[0060] like Figure 1 As shown, an automatic error correction control method for codes is disclosed. This method includes the following steps:
[0061] S1: Input encrypted information to form a binary code stream;
[0062] S2: Reassemble the binary code stream using DET;
[0063] S3: Error correction processing of the reassembled binary code stream using LDPC;
[0064] S4: Rotate and position the code array;
[0065] S5: Generate Meta code and embed it into the carrier image;
[0066] S6: Obtain plaintext information.
[0067] In this embodiment, encrypted information such as anti-counterfeiting labels, URLs, serial numbers, text, and trademarks are preprocessed to obtain a binary code stream. The desired embedded carrier image information is then acquired. This step converts plaintext information into binary information, completing the information transformation.
[0068] In this embodiment, step S2 may specifically include the following steps:
[0069] S21: Define the determinant matrix;
[0070] S22: The acquired binary bitstream is divided into groups. Each group of binary bitstreams is multiplied by its own formula, modulo 2 processed, and then reassembled to obtain a new binary bitstream. In digital communication, data is usually transmitted in binary form, and the bitstream refers to the number of binary bits transmitted per unit time.
[0071] S23: To obtain two-dimensional data, the new binary code stream is serialized and parallelized. Parity checks are performed on each row and column of the two-dimensional data to obtain the check code of the two-dimensional matrix. The obtained check code data is then concatenated with the outer layer of the two-dimensional data.
[0072] The corresponding determinant matrix is defined, and the acquired binary code stream is grouped accordingly. Each group of binary code streams is multiplied by the defined determinant, modulo 2 processed, and then reassembled to obtain a new binary code stream. This step achieves the first layer of encryption and protection of computer information. The acquired binary code stream is then subjected to serial-to-parallel swapping to obtain two-dimensional data. Parity checks are performed on each row and column of the two-dimensional data to obtain the checksum of the two-dimensional matrix. The obtained checksum data is then concatenated with the outer layer of the two-dimensional data. This step of the invention enables the Meta code to have a first-stage self-correcting capability. When certain codeword errors occur during transmission or verification, the data can be calibrated using check bits to ensure data reliability.
[0073] In step S3, the generator matrix is obtained through Tanner graph operations using the parity-check matrix, or by using the parity-check matrix itself. The matrix obtained after the two-dimensional VIII even check is then processed, and the codewords are multiplied by the generator matrix and recombine. This step of the invention utilizes the properties of the LDPC algorithm to address the issue of a code array being heavily damaged or incomplete. By leveraging the algorithm's properties, the entire hidden information can be deduced from just a few bits of information. This achieves a second layer of encryption for the code array and addresses the initial problem of deciphering the entire encrypted information from just a few bits of information when the code array is heavily damaged or incomplete. This ensures that the Meta code has stronger self-correcting capabilities and codeword security.
[0074] This product can maintain its identification and traceability functions even when the "information code" is largely obscured, and it also has anti-counterfeiting effects. The information hiding anti-counterfeiting method based on self-correcting coding is a halftone dot image based on the smallest ink dot, which can be well hidden in the carrier image without affecting image quality and has a certain degree of anti-copying capability. To copy or reproduce a texture image, a high-precision copying device is required, and then the captured image needs to be scaled down to match the original. Figure 1Printing or printing at the same size is common, but during copying or related processing, the spatial characteristics of tiny information recording carriers—ink dots—can be lost completely or partially, causing information loss or damage. Halftone dot matrix images achieve the advantages of large information recording capacity, good hiding effect, and the ability to cover the entire printed material. This solves problems such as missing prints, offsets, dot gain, and ink splatter, as well as the significant error problems often caused by factors such as lighting and camera shake in reading devices. This technology can be effectively applied to copyright protection of printed materials, preventing counterfeiting and infringement, improving information value-added services, and achieving self-correcting encoding. By using two layers of information encoding and decoding protection—DET recombination and LDPC (Low Density Parity Check)—the self-correcting capabilities of the DET and LDPC algorithms are utilized to achieve self-correcting functionality of the code array during transmission. The two-dimensional parity check method is used to process the code stream information during transmission to combat channel noise and other problems, filtering out correct code stream information from a large amount of data, thus achieving self-correcting capability during information transmission. By employing four steps—rotational positioning (to facilitate the decryption of pseudo-random interleaving; rotational positioning involves adding automatically defined binary information of a specified length, which can be set to 9, to better identify the information source during subsequent decryption of pseudo-random interleaving), periodic positioning, code array splicing, and embedding into the carrier image—the function of embedding a single code array into an encrypted image is achieved. This solves the problem that regular code arrays are easily observed by criminals, leading to large-scale damage and smearing, thus destroying the code array. By adding rotational information, the problem of accurate positioning of the code array during reading is solved, ultimately achieving encoding error correction.
[0075] Example 2
[0076] A method for automatic code error correction control is disclosed, the method comprising the following steps:
[0077] S1: Input encrypted information to form a binary code stream;
[0078] S2: Reassemble the binary code stream using DET;
[0079] S3: Error correction processing of the reassembled binary code stream using LDPC;
[0080] S4: Rotate and position the code array;
[0081] S5: Generate Meta code and embed it into the carrier image;
[0082] S6: Obtain plaintext information.
[0083] The difference between this embodiment and Embodiment 1 is that step S4 includes:
[0084] S41: Utilize rotational positioning to solve the problem that code array information cannot match the size of the carrier image during information implantation;
[0085] S42: The positioning information identifier defined by the code length after adding rotation positioning and the size of the original image to be generated are used to determine the positioning points available for subsequent decoding through horizontal and vertical data streams, and the original code array is continuously pseudo-randomly interleaved to form a two-dimensional matrix.
[0086] The addition of 9-bit binary information facilitates better identification of the information source during subsequent pseudo-random interleaving de-interleaving. The first layer utilizes rotational positioning to address the issue of the code array information not matching the size of the carrier image during information embedding.
[0087] One-dimensional data is transformed into a two-dimensional matrix through serial-to-parallel switching. The corresponding positioning information identifier and the size of the original image to be generated are defined based on the code length after adding rotation information. The positioning points available for subsequent decoding are determined through horizontal and vertical data flows. The original code array is continuously pseudo-randomly interleaved. This invention solves the problem of how to embed the code array into the carrier image through a periodic positioning method. By embedding positioning points, the code array information is accurately located during the information decoding process, eliminating interference from the text and image information embedded in the carrier image. Based on the code arrays generated by different pseudo-random interleavings, different styles of code arrays are combined to form a large code array. This code array has a chaotic appearance, making it impossible for outsiders to discover patterns or identify it. This code array splicing method solves the problem that regular code array information is easily identified by criminals, causing large-area defacement and damage to the code array, resulting in the loss of code array information and harming consumer rights. It also solves the problem of moiré patterns appearing on printing due to the repetitive arrangement of regular code arrays. By continuously splicing different matrices obtained through pseudo-random interleaving, a basic large matrix is obtained, which has significant chaos compared to a matrix without pseudo-random interleaving, thus better ensuring information security.
[0088] To better observe the effect of pseudo-random interleaving, a code cloud map corresponding to the Meta code can be obtained by simulating the Meta code based on the above code array and then combining it on a larger scale. Because it has a corresponding decoding function, the pseudo-random information points can be further increased in disorder by rotating the angle, thus creating a stronger contrast with the original pattern. Based on the desired embedding location in the carrier image, digital image processing is performed on the carrier image to determine the embedding location. The position of the Meta code can then be defined based on the current position of the carrier image. This step solves the problem of embedding large code array information into the carrier image. Commercially available printed patterns struggle to achieve full-coverage embedding effects, blind reading capabilities, and pseudo-random information hiding effects.
[0089] Example 3
[0090] A method for automatic code error correction control is disclosed, the method comprising the following steps:
[0091] S1: Input encrypted information to form a binary code stream;
[0092] S2: Reassemble the binary code stream using DET;
[0093] S3: Error correction processing of the reassembled binary code stream using LDPC;
[0094] S4: Rotate and position the code array;
[0095] S5: Generate Meta code and embed it into the carrier image;
[0096] S6: Obtain plaintext information.
[0097] The difference between this embodiment and the above embodiments is that:
[0098] Step S5 includes:
[0099] S51: Based on the desired embedding location in the carrier image, perform digital image processing on the carrier image to determine the embedding location, and define the embedding location of the Meta code based on the current position of the carrier image.
[0100] S52: The image is printed, and partial cropping and preprocessing are performed to ensure the reliability and stability of the operation. The operation here refers to rotation correction, the purpose of which is to make the ink dots appear more circular, facilitating subsequent circle detection. The preprocessing in this step involves separating the image into RGB colors, binarizing each color separately, and then merging them. This clearly reveals the ink dots. It also includes preliminary circular erosion and dilation of the entire image to make each ink dot more approximately circular. The preprocessing steps are: first, color separation and binarization of the image; then merging; and finally, erosion and dilation.
[0101] S53: Record all decodeable information in the captured pattern through digital image processing, and perform rotation correction on the original pattern based on the corresponding data and calculations to ensure the smooth progress of subsequent code array recognition;
[0102] S54: Based on the information point radius detected by digital image processing and the relationship between the information point radius and the distance between adjacent information points, the pattern is numerically eroded and expanded; the cropped pattern is reduced accordingly to facilitate subsequent analysis of the code matrix;
[0103] S55: Processing and recognizing positioning information to determine whether the required angle has been reached, and performing more precise rotation correction;
[0104] S55: The acquired information code array is processed for de-positioning information, and then the rotary positioning information is detected. If it can be detected, serial-to-parallel swapping can be performed for further processing. If it cannot be detected, pseudo-random interleaving is performed once, and the loop continues until rotary positioning information is detected or the upper limit is reached.
[0105] S56: Exchange the code array after step S55 into a one-dimensional binary code stream and remove the information code for rotation positioning.
[0106] S57: Multiply the determinant corresponding to the DET recombination and perform a modulo-2 operation to complete the decryption.
[0107] Meta code decoding is essentially the reverse process of its encoding algorithm. The decoding scheme is the inverse of the decoding process. The specific algorithm steps are as follows:
[0108] Image cropping and preprocessing: Before printing, images are partially cropped and preprocessed to ensure reliable and stable operation. This addresses errors caused by lighting conditions and camera shake during printing, which can affect image reading by the printing equipment.
[0109] Preliminary rotation correction: During image acquisition, there is a possibility of rotational shift in the code matrix center. Digital image processing records all decodeable information from the captured pattern. Based on this data, rotation correction is performed on the original pattern to ensure smooth subsequent code matrix recognition. This addresses defects in the code matrix after printing, such as missing prints, offsets, dot gain, and ink splatter.
[0110] Image reduction: Image cropping may involve factors such as image magnification. Based on the information point radius detected by digital image processing and the relationship between the information point radius and the distance between adjacent information points, the pattern is numerically eroded and dilated. The cropped pattern is then reduced accordingly to facilitate the subsequent analysis of the code matrix.
[0111] Secondary rotation correction: Since the initial rotation check angle can only ensure that the pattern represented by the code array data is perpendicular to the visual platform, but there may still be an angular offset of multiples of 90 degrees, the required angle is determined by processing and recognizing the positioning information. This allows for more precise rotation correction, enabling direct progress to the next step of deperiodic positioning.
[0112] Deperiodic positioning: Deperiodic positioning of the detectable unit code array is performed using rotational positioning information. First, the acquired information code array is processed to remove positioning information, then rotational positioning information is detected. If it can be detected, serial-to-parallel swapping can be performed for further processing. If it cannot be detected, a de-pseudo-random interleaving is performed, and the process is repeated until rotational positioning information is detected or the upper limit is reached.
[0113] De-rotation positioning: After detecting the correct rotation information, remove the information from the end of the code array.
[0114] Decoding the Meta code: The code array after de-periodic positioning is converted into a one-dimensional binary code stream by parallel swapping, and the information code for rotation positioning is removed. After decoding using the LDPC BF decoding scheme, the check code for two-dimensional Vickers parity is removed to obtain a new binary code stream.
[0115] Decryption of the bitstream: After removing the checksum, multiply the result by the determinant corresponding to the previously reconstructed DET data and perform a modulo-2 operation to complete the decryption. This yields the plaintext information.
[0116] LDPC (Low Density Parity Check) codes, first proposed by Robert Gallager of MIT in his 1963 doctoral dissertation, are a class of linear block codes with sparse parity-check matrices. Their code rates can be arbitrarily constructed, and their performance approaches the Shannon limit, offering great flexibility and applicability to almost all channels. In 1981, Tanner proposed the concept of using a graphical model to describe codewords. The Tanner graph, also known as a bipartite graph, uses the parity-check matrix H... m×n This represents a linear block code of length n with m row vectors. It forms a graph T consisting of two sets of nodes: nodes with n-1 codeword bits form variable nodes, and nodes with m-1 check equations form check nodes. There are no direct edges connecting the two sets; each edge connects a check node and a variable node. In the Tanner graph, the degree of a node is defined as the number of edges connected to it. For regular LDPC codes, all variable nodes in the corresponding Tanner graph have the same degree, equal to the column weight H, and all check nodes have the same degree, equal to the row weight H.
[0117] An LDPC code with a fixed number of "1"s in each row and column is a regular code, satisfying the following:
[0118] Hc T =0
[0119] In the formula: H is the parity check matrix; c is the encoded codeword.
[0120] A low-density parity check code of length n corresponds to a sparse parity check matrix Hm×n, which can be represented by H(n,p,q). That is, in Hm×n, each row has q "1"s and each column has p "1"s. Compared with m and n, p and q are very small. This is the low-density characteristic of a sparse parity check matrix.
[0121] Encoding principle of LDPC code
[0122] There are two main encoding schemes for regular LDPC codes: the encoding scheme based on the parity check matrix H and the encoding scheme based on the generator matrix G.
[0123] Based on the direct encoding scheme using the generator matrix G: Let the parity-check matrix H of the LDPC code be divided into two parts:
[0124] H = [H1, H2]
[0125] In the formula: the size of H1 is m×k; the size of H2 is m×m.
[0126] calculate:
[0127] W=(H2 -1 ×H1) T
[0128] The matrix operations are performed in GF. The resulting matrix W is a dense quasi-cyclic structure matrix. The generating matrix can be obtained from the dense quasi-cyclic structure matrix W:
[0129] G = [I, W]
[0130] In the formula: I is a k×k identity matrix.
[0131] After obtaining the generator matrix G, multiply the original codeword x by it to obtain the encoded codeword c:
[0132] c = x × G
[0133] The multiplication here must satisfy the multiplication rule of a finite field.
[0134] This paper adopts the direct encoding scheme of generator matrix. Based on the constructed parity check matrix (i.e., Tanner graph), the generator matrix is obtained, and the original codeword is multiplied by the generator matrix to complete the encryption.
[0135] Decoding principle of LDPC code
[0136] There are two common schemes for LDPC decoding: the Belief Propagation (BP) algorithm and the Bit Flip (BF) algorithm. The BF algorithm is a hard decision algorithm for codewords under the assumption of erroneous bits. It is simple to implement, can significantly shorten the computation time, and has a greater advantage when the number of codewords is small. Considering the characteristic of multi-segment processing during encoding and decoding, this paper adopts the BF scheme for LDPC decoding.
[0137] Based on the predefined parity-check matrix (i.e., the Tanner graph) Hm×n, the length of the original codeword after multiplication with the generator matrix is n. Let the received codeword be r, then:
[0138] r = [r1, r2, r3, ... r n ]
[0139] Then there exists an S such that:
[0140] S = [S1, S2, S3, ... S m ]
[0141] according to:
[0142] S=rH T
[0143] In the formula: H is the parity check matrix.
[0144] Let the parity-check matrix have m syndromes S, where S1 is equal to the value obtained by multiplying the first row of the parity-check matrix Hm×n by r and performing a GF calculation. If there are no bit errors, according to the Tanner graph principle, the syndrome S should be 0. Therefore, the following holds:
[0145] The adjoint equations S1 to Sm are calculated using GF(2).
[0146] Obviously, the above embodiments are merely examples to clearly illustrate the technical solutions of the present invention, and are not intended to limit the implementation of the present invention. Those skilled in the art can make other variations or modifications based on the above description. It is neither necessary nor possible to exhaustively describe all embodiments here. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the claims of the present invention.
Claims
1. An automatic error correction control method for codes, characterized in that, The method includes the following steps: S1: Input encrypted information to form a binary code stream; S2: Reassemble the binary code stream using DET; S3: Error correction processing of the reassembled binary code stream using LDPC; S4: Rotate and position the code array; S5: Generate Meta code and embed it into the carrier image; S6: Obtain plaintext information; Step S2 includes the following steps: S21: Define the determinant matrix; S22: The acquired binary code stream is divided into groups. Each group of binary code streams is multiplied by its own formula and modulo 2 processed before being reassembled to obtain a new binary code stream. S23: To obtain two-dimensional data, the new binary code stream is serialized and parallelized. Parity checks are performed on each row and column of the two-dimensional data to obtain the check code of the two-dimensional matrix. The obtained check code data is then concatenated with the outer layer of the two-dimensional data. Step S4 includes: S41: Utilize rotational positioning to solve the problem that code array information cannot match the size of the carrier image during information implantation; S42: The positioning information identifier defined by the code length after rotation positioning and the size of the original image to be generated are added. The positioning points available for subsequent decoding are determined by the horizontal and vertical data streams. The original code array is continuously pseudo-randomly interleaved to form the two-dimensional matrix.
2. The automatic error correction control method for encoding according to claim 1, characterized in that, Step S1 involves preprocessing the expedited information of anti-counterfeiting labels, website addresses, serial numbers, text, and trademarks to obtain a binary code stream.
3. The automatic error correction control method for encoding according to claim 1, characterized in that, Step S3 involves performing operations on the verification matrix to obtain a generator matrix, which is then used to process the matrix after step S23. The codewords are then multiplied by the generator matrix and recombined.
4. The automatic error correction control method for encoding according to claim 1, characterized in that, Step S4 also includes S43: Combine different styles of QR code arrays to form a large code array.
5. The automatic error correction control method for encoding according to claim 1, characterized in that, Step S5 includes: S51: Based on the desired location of the embedded carrier image, perform digital image processing on the carrier image to determine the embedding location, and define the location where the Meta code can be embedded based on the current location of the carrier image.
6. The automatic error correction control method for encoding according to claim 5, characterized in that, Step S5 further includes: S52: Print the image, and perform partial cropping and corresponding preprocessing on the image to ensure the reliability and stability of the operation; S53: Record all decodeable information in the captured pattern through digital image processing, and perform rotation correction on the original pattern based on the corresponding data and calculations to ensure the smooth progress of subsequent code array recognition; S54: Based on the information point radius detected by digital image processing and the relationship between the information point radius and the distance between adjacent information points, the pattern is numerically eroded and expanded; the cropped pattern is reduced accordingly to facilitate subsequent analysis of the code matrix; S55: Processing and recognizing positioning information to determine whether the required angle has been reached, and performing more precise rotation correction; S55: The acquired information code array is processed for de-positioning information, and then the rotary positioning information is detected. If it can be detected, serial-to-parallel swapping is performed for further processing. If it cannot be detected, pseudo-random interleaving is performed once, and the loop continues until rotary positioning information is detected or the upper limit is reached. S56: Exchange the code array after step S55 into a one-dimensional binary code stream and remove the information code for rotation positioning. S57: Multiply the determinant corresponding to the DET recombination and perform a modulo-2 operation to complete the decryption.
7. The automatic error correction control method for encoding according to claim 6, characterized in that, Step S56 involves decoding using LDPC's BF decoding.
8. The automatic error correction control method for encoding according to claim 7, characterized in that, The preprocessing method in step S52 is to first perform color binarization on the image, then synthesize it, and finally perform erosion and dilation.
Citation Information
Patent Citations
Error tolerance and correction method for analysis of bar code identifiers of storage materials
CN102509200A
Method and apparatus for low-density parity check encoding
CN101199123A
Two-dimensional code formed 72-bit matrix code error-correctable coding and decoding method
CN106326956A