A non-standard data standardization transmission method based on machine-readable code
By adopting a non-standard data standardization transmission method based on machine-readable codes, the problem of transmission and integration of non-standard data in video private networks and industry information systems has been solved, achieving efficient and reliable data transmission and management, and improving decoding performance and data recoverability.
Patent Information
- Application Number
- CN202511342133.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-19
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2045-09-19
AI Technical Summary
Existing technologies cannot efficiently and reliably transmit and integrate non-standardized data, resulting in insufficient protocol compatibility, fragmented data links, complex management, and limited decoding performance, making it difficult to meet the requirements of high-reliability transmission and traceability.
A non-standard data standardization transmission method based on machine-readable codes is adopted. Structured data is generated through field mapping, and dynamic QR code encoding is performed using an anti-interference machine-readable code generation method. The QR code generation is optimized by combining format information error correction success rate modeling and encoding area error correction success rate modeling. In the decoding stage, the Transformer model is used for high-precision recovery.
It has enabled stable transmission and integration of non-standard data in the existing private network, improved decoding performance and data recoverability, solved the decoding failure problem during transmission, and enhanced the management and linkage capabilities of data in the platform.
Smart Images

Figure CN120911505B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of coding technology, and in particular to a method for standardizing the transmission of non-standard data based on machine-readable codes. Background Technology
[0002] In video conferencing networks and industry information systems, standardized protocols such as GA / T1400 have been widely used for the transmission of structured data such as video and images. However, with the large-scale deployment of new terminals such as drones, smart electronic fences, and non-standard sensing devices, a large amount of non-standard data has been generated. This type of non-standard data is usually outside the scope of existing protocol fields and cannot be directly transmitted and integrated through existing private networks, thus causing a series of problems: First, insufficient protocol compatibility. The fields of standard protocols such as GA / T1400 are fixed and have limited scalability, making it unable to flexibly support non-standard data. If new fields need to be added, the business system, front-end equipment, and receiving platform must be upgraded simultaneously, resulting in high costs and long cycles. Second, fragmented data transmission paths. Existing methods often rely on establishing independent API interfaces or FTP. The transmission of non-standard data through the channel and the secondary connection at the platform end result in fragmented data links, increased management complexity, and the consumption of dedicated network bandwidth and security equipment resources. Third, the transmission process is susceptible to interference. When embedding non-standard data into dedicated network video streams or images, traditional low-redundancy QR codes or text watermarks are limited by error correction capabilities and printing and encoding quality. During scanning, compression, screenshotting, and transmission, format information errors or data codeword loss are prone to occur, leading to decoding failure. Fourth, decoding performance is limited by the theoretical error correction limit. Existing QR code decoding generally relies on the Reed-Solomon algorithm, whose fault tolerance is limited by the upper limit of the error correction level. Under sudden errors or complex background interference, the decoding success rate drops significantly, making it difficult to meet the requirements of high reliability transmission and traceability of critical data. Summary of the Invention
[0003] This invention aims to address the technical problem in video conferencing networks and industry information systems where non-standardized data cannot be efficiently and reliably transmitted and integrated using the existing GA / T1400 protocol. It proposes a method for standardized transmission of non-standard data based on machine-readable codes. This method, without modifying the existing GA / T1400 protocol or network structure, maps the raw data generated by non-standardized devices to generate structured data to be encoded, and uses an anti-interference machine-readable code generation method for dynamic QR code encoding. In the QR code generation stage, it introduces format information error correction success rate modeling and encoding region error correction success rate modeling to quantitatively evaluate the fault tolerance capabilities of the structural information area and the payload area, and combines dynamic version numbers, error correction, etc. The selection mechanism of level and mask mode achieves joint optimization, thereby improving structural robustness and data recoverability; the generated QR code image is embedded in the ImageType field defined in the GA / T1400 protocol and transmitted to the receiving end through a private network; in the decoding stage, a Transformer-based model is adopted to expand the effective data module area into a one-dimensional bit sequence in a serpentine order, and noise enhancement strategies simulating flip errors and burst errors are introduced during the training process, so that the decoding capability breaks through the error correction limit of the traditional Reed-Solomon algorithm, thus enabling high-precision recovery of structured data even in complex interference environments, and achieving seamless integration with the standard interface of the data processing platform.
[0004] This invention provides a method for standardizing the transmission of non-standard data based on machine-readable codes, the method comprising the following steps:
[0005] Step S1: Obtain the raw data generated by non-standardized equipment, perform field mapping on the raw data, and generate structured data to be encoded;
[0006] Step S2: Construct an interference-resistant machine-readable code generation method. This method performs dynamic QR code encoding on the structured data to be encoded, generating a QR code image. The construction method is as follows: Based on the QR code version number selection and mask mode perturbation mechanism defined in ISO / IEC 18004, Reed-Solomon error correction coding is used to generate redundant codewords for the structured data to be encoded; (15,5)BCH format information encoding technology is used for redundancy protection; a format information error correction success rate modeling method is introduced for quantitative evaluation; and an error correction success rate modeling method for the encoding region is introduced for analysis and prediction; thus, the interference-resistant machine-readable code generation method is constructed.
[0007] Step S3: Embed the QR code image into the ImageType field defined in the GA / T1400 protocol to construct the QR code image message data;
[0008] Step S4: The QR code image message data is identified and decoded using the Transformer model and converted into structured data;
[0009] Step S5: Map structured data to the data processing platform, parse and map fields through the platform's standard data interface, and write the data into the database for unified storage. Simultaneously, automatically trigger corresponding processing logic and preset schemes based on the data content (including recording illegal activities, updating drone flight mission status, and changing electronic fence alert status) to ensure that non-standard data can be uniformly managed, scheduled in real time, and queried retrospectively within the platform.
[0010] Furthermore, in step S2, the process of performing dynamic QR code encoding on the structured data to be encoded using an anti-interference machine-readable code generation method to generate a QR code image specifically includes the following steps:
[0011] Step S21: Based on the total length and semantic category of the structured data to be encoded, determine the encoding capacity and redundancy level, dynamically select the QR code version number and error correction level, and obtain the encoding configuration parameters;
[0012] Step S22: Based on the encoding configuration parameters, the structured data to be encoded is divided into data codewords by 8 bits; based on the data codewords, error correction codewords are generated by Reed-Solomon encoding to form the initial codeword sequence;
[0013] Step S23: Construct the format information code according to the encoding configuration parameters;
[0014] Step S24: Perform mask perturbation processing on the initial codeword sequence to generate candidate pattern structures. For each candidate pattern structure under a mask mode, perform scoring to generate scoring results. Select the optimal mask mode based on the scoring results, determine its corresponding mask mode number, and generate the perturbed codeword sequence.
[0015] Step S25: Construct a QR code matrix and embed the format information code into the format information region of the QR code matrix; embed the perturbed codeword sequence into the encoding region of the QR code matrix to construct an initial QR code image; during the construction process, the error tolerance capability of the format information region under the condition of dislocation is evaluated by the format information error correction success rate modeling method, and the format information evaluation result is generated; the recoverability capability of the encoding region under the condition of dislocation is evaluated by the encoding region error correction success rate modeling method, and the encoding region evaluation result is generated; based on the format information evaluation result and the encoding region evaluation result, the structural robustness and decoding success rate of the initial QR code image under different error correction levels and masking modes are jointly optimized, and finally, a QR code image is generated.
[0016] Furthermore, in step S4, the process of recognizing and decoding the QR code image message data using the Transformer model and converting it into structured data specifically includes the following steps:
[0017] Step S41: Perform image preprocessing on the QR code image message data, including grayscale conversion, binarization, distortion correction and geometric positioning, to obtain the corrected QR code matrix;
[0018] Step S42: Remove the functional graphic area from the corrected QR code matrix and retain the valid data module area;
[0019] Step S43: Preset the serpentine scan order, and perform linear expansion on the effective data module area according to the serpentine scan order to convert it into a one-dimensional bit sequence;
[0020] Step S44: Train a Transformer model based on a one-dimensional bit sequence. During the training phase of the Transformer model, a noise enhancement strategy is introduced. By injecting simulated flip errors and simulated burst errors into the one-dimensional bit sequence, the decoding accuracy is optimized, resulting in a trained Transformer model. Plaintext results are generated based on the trained Transformer model. The plaintext results are parsed, and field mapping and verification are performed according to the business protocol format to generate structured data. The above methods achieve robust decoding that exceeds the theoretical error correction limit of Reed-Solomon.
[0021] By adopting the above solution, the beneficial effects achieved by the present invention are as follows:
[0022] First, this invention enables the efficient embedding of raw data generated by non-standard devices into the ImageType field defined in the GA / T1400 protocol through field mapping and dynamic QR code encoding, without modifying the existing GA / T1400 protocol and network architecture. This allows for direct data transmission within the existing private network. Second, by modeling the success rate of format information error correction and the success rate of encoding region error correction, this invention precisely quantifies and optimizes the fault tolerance performance of the structural information area and the payload area during the QR code generation stage. This achieves a combined improvement in the structural robustness and data recoverability of the QR code, solving the decoding failure problem caused by interference during transmission, compression, and screenshotting in existing methods. This ensures that non-standard data can reliably and stably enter the data processing system.
[0023] Secondly, this invention improves the decoding performance of QR codes in complex application environments. By combining an adaptive selection mechanism of dynamic version number, error correction level, and mask mode, the QR code achieves an optimal balance between redundancy allocation and effective payload capacity, enabling it to maintain a high decoding success rate even in scenarios with low signal-to-noise ratio, partial occlusion, and local contamination. Simultaneously, by introducing a Transformer-based model in the decoding stage and using a snake-like scanning method to expand the effective data module area into a one-dimensional bit sequence, and by incorporating noise enhancement strategies that simulate flip errors and burst errors during the training stage, the theoretical error correction limit of the traditional Reed-Solomon algorithm is effectively broken. This results in a significantly higher actual decoding success rate in typical video private network scenarios compared to existing solutions.
[0024] Finally, this invention enhances the integration and linkage capabilities of non-standard data within the data processing platform. The structured data recovered through Transformer decoding can be directly mapped to the standard interfaces and business fields of the data processing platform, enabling automatic data entry, business logic triggering, event contingency plan execution, and associated storage and retrieval with video and image data. This integrated data processing link solves the problem of secondary parsing and manual connection of non-standard data in existing technologies, enabling unified management, real-time scheduling, and retrospective querying of non-standard data and standard data such as video and images within the platform. This provides efficient, stable, and scalable technical support for event retrospective and cross-system data sharing. Attached Figure Description
[0025] Figure 1 A flowchart illustrating a non-standard data standardization transmission method based on machine-readable code provided by the present invention;
[0026] Figure 2 This is a comparison chart of the success rates of different decoding methods in Embodiments 4 and 5 of the present invention.
[0027] Figure 2 In the diagram, the horizontal axis represents the total number of error bits, the vertical axis represents the decoding success rate, the blue line represents RS decoding (baseline), and the orange line represents Transformer decoding. Detailed Implementation
[0028] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0029] Example 1, according to Figure 1This invention provides a method for standardizing the transmission of non-standard data based on machine-readable codes, the method comprising the following steps:
[0030] Step S1: Data Acquisition and Mapping: Acquire raw data from non-standardized devices (including but not limited to drones, electronic fences, intelligent sensing terminals, and other online acquisition systems); the raw data includes mandatory fields (such as acquisition time, device ID, image type) and non-mandatory fields (IPv6 address, checkpoint lane number, monitoring direction) defined in the GA / T1400 protocol, as well as non-standard fields not defined in the protocol (such as drone flight mission number, electronic fence defense level); perform field mapping on the raw data to generate structured data to be encoded; this step can process both standard fields of the GA / T1400 protocol and non-standard fields outside the protocol, especially non-mandatory fields rejected by some view libraries;
[0031] Step S2: QR code generation: Construct an interference-resistant machine-readable code generation method. Perform dynamic QR code encoding on the structured data to be encoded using the interference-resistant machine-readable code generation method (QR code is only a representation here; machine-readable code forms may include one-dimensional machine-readable code forms and other types of two-dimensional machine-readable code forms, all uniformly represented by QR code), and generate QR code images. The interference-resistant machine-readable code generation method is constructed by combining various error correction and modeling methods based on the QR code version number selection and mask mode perturbation mechanism defined in ISO / IEC 18004. Specifically, Reed-Solomon error correction coding technology is used to generate redundant codewords for structured data to be encoded, thereby enhancing the data region's recovery capability in the presence of random errors. (15,5)BCH format information coding technology is used to redundantly protect the format information containing error correction levels and mask mode numbers, ensuring that the format information region can still be correctly decoded even with bit errors. Simultaneously, a format information decoding success rate modeling mechanism based on error distribution probability analysis is introduced to quantitatively evaluate the fault tolerance performance of the format information under different error bit allocation conditions. Furthermore, an encoding region decoding success rate modeling mechanism is introduced to analyze and predict the recoverability of data and redundant codewords under a given number of bit errors. Through the combined construction of these technologies, an anti-interference machine-readable code generation method is obtained that is optimized at both the format information and encoding region levels, thereby significantly improving the overall structural robustness and decoding success rate of QR codes.
[0032] Step S3: Protocol Embedding: Embed the QR code image into the ImageType field defined in the GA / T1400 protocol to construct QR code image message data; ImageType includes, but is not limited to, scene image and violation composite image. Machine-readable code image can be stored as an independent image in the corresponding ImageType storage location or embedded in the image data contained in the ImageType for transmission;
[0033] Step S4: Decoding and Recognition: The QR code image message data is recognized and decoded using the Transformer model and converted into structured data;
[0034] Step S5: Data Fusion: Map structured data to the data processing platform, parse and map fields through the platform's standard data interface, and write the data into the database for unified storage. Simultaneously, automatically trigger corresponding processing logic and preset schemes based on the data content (including recording illegal activities, updating drone flight mission status, and changing electronic fence alert status) to ensure that non-standard data can be uniformly managed, scheduled in real time, and queried retrospectively within the platform.
[0035] Example 2, based on Example 1, in this example, step S2, the process of performing dynamic QR code encoding on the structured data to be encoded using an anti-interference machine-readable code generation method to generate a QR code image, specifically includes the following steps:
[0036] Step S21: Based on the total length and semantic category of the structured data to be encoded, determine the encoding capacity and redundancy level, dynamically select the QR code version number and error correction level, and obtain the encoding configuration parameters. The QR code version number is selected from V1 to V40 as specified in the ISO / IEC 18004 standard. The error correction level includes L level, M level, Q level and H level, with the redundancy ratio increasing sequentially to improve the subsequent anti-interference capability and error recovery capability.
[0037] Step S22: Based on the encoding configuration parameters, the structured data to be encoded is divided into data codewords by 8 bits; based on the data codewords, error correction codewords are generated by Reed-Solomon encoding to form the initial codeword sequence;
[0038] Step S23: Construct a format information code based on the encoding configuration parameters; specifically, the error correction level and mask mode number in the encoding configuration parameters (to be added after the scoring selection in the subsequent step S24) are used as format information fields, and the two are combined into 5-bit original format information; the 5-bit original format information is encoded using (15,5)BCH to generate a 15-bit redundancy protected format information code.
[0039] Step S24: Perform mask perturbation processing on the initial codeword sequence using the eight masking modes defined by the ISO / IEC 18004 standard to generate candidate pattern structures. Score the candidate pattern structures under each masking mode to generate a score result. Select the optimal masking mode based on the score result, determine its corresponding masking mode number, and generate the perturbated codeword sequence.
[0040] Eight masking modes:
[0041] Mode 0:
[0042] ;
[0043] in, Represents the mask function in matrix coordinates The value at that location (which can be understood as a determination of "whether it is a mask / whether it is flipped"); This represents the modulo / remainder operation;
[0044] The row number and column number are flipped when the sum is even.
[0045] Mode 1:
[0046] ;
[0047] The row number is flipped when it is even.
[0048] Mode 2:
[0049] ;
[0050] The column number is flipped when it is divisible by 3.
[0051] Mode 3:
[0052] ;
[0053] The row number and column number are flipped if the sum is divisible by 3.
[0054] Mode 4:
[0055] ;
[0056] The column number is flipped when the sum of the row number divided by 2 and the column number divided by 3 is even.
[0057] Mode 5:
[0058] ;
[0059] Multiply the row number and column number, take the remainder when divided by 2, and then take the remainder when divided by 3. If the sum is 0, flip the product.
[0060] Mode 6:
[0061] ;
[0062] Multiply the row number and column number, sum the results by taking the remainders of 2 and 3, then take the remainder of 2 again. If the result is 0, flip the product.
[0063] Mode 7:
[0064] ;
[0065] The sum of the row number and column number is taken as remainder when divided by 2, then added to the product of the row and column numbers, which is taken as remainder when divided by 3. The result is then taken as remainder when divided by 2. When the result is 0, the result is flipped.
[0066] Patterns 0–3: Based on row and column parity and divisibility rules;
[0067] Patterns 4–7: Based on row and column partitioning, row and column product, and combined remainder;
[0068] The eight modes are mutually exclusive, and only the candidate QR code with the lowest penalty score is retained from the generated candidate QR codes.
[0069] Candidate pattern scoring:
[0070] For each group of candidate drawing structures, penalty scores are calculated one by one according to the scoring criteria of ISO / IEC 18004. The scoring criteria include:
[0071] Consecutive color blocks penalty: When a consecutive segment of the same color with a length of ≥5 appears in a row or column, a basic penalty is applied and increases with the length.
[0072] 2×2 Same Color Block Penalty: If there is a 2×2 block consisting entirely of dark and light color blocks, the penalty score will be increased;
[0073] Specific pattern penalty: When there is an arrangement of similar inverted color patterns and there are ≥4 consecutive light-colored modules on both sides, a higher penalty score is added;
[0074] Dark module ratio penalty: If the ratio of the total number of dark modules to the total number of modules deviates from 50% or more within a certain range, the corresponding penalty points will be increased.
[0075] Step S25: Construct a QR code matrix according to the QR code module arrangement specifications and functional graphic layout requirements in the ISO / IEC 18004 standard, embedding the format information code into the format information area of the QR code matrix; embed the perturbed codeword sequence into the encoding area of the QR code matrix to construct the initial QR code image; during the construction process, evaluate the fault tolerance capability of the format information area under the condition of fault existence using the format information error correction success rate modeling method, and generate the format information evaluation result; evaluate the recoverability of the encoding area under the condition of fault existence using the encoding area error correction success rate modeling method, and generate the encoding area evaluation result; based on the format information evaluation result and the encoding area evaluation result, jointly optimize the structural robustness and decoding success rate of the initial QR code image under different error correction levels and mask modes, and finally generate the QR code image;
[0076] The formula for calculating the success rate of format information error correction is:
[0077] ;
[0078] in, This indicates the total number of error bits, representing the total number of error bits generated during transmission, printing, scanning, etc., by the two copies of the format information (each a 15-bit BCH code). This indicates the success rate of format information error correction. Indicates the number of errors in the first copy. In the format information area, the number of errors in the first 15-bit copy is usually located in the functional pattern position near the upper left and upper right locators of the QR code matrix. Indicates the number of errors in the second copy. In the format information area, the number of errors that occurred in the second 15-bit copy is located at the function pattern position adjacent to the upper left locator and the lower left locator. This indicates an error allocation constraint, which stipulates that the sum of the number of error bits in the two replicas must equal the total number of errors; The error correction condition is indicated. BCH(15,5) encoding can correct up to 3 errors. As long as any copy satisfies the error bit ≤ 3, the copy can be used by the decoder to correctly recover the format information. This represents the set of non-negative integer pairs, which assigns combinations to all possible erroneous bits. This represents the number of incorrect assignments that meet the conditions. This represents the total number of all possible incorrect assignments;
[0079] A modeling method for format information error correction success rate: During QR code generation, the format information area stores the error correction level and mask mode number, and exists in different positions in two identical 15-bit BCH encoding formats. Since bit errors may occur during transmission, printing, or scanning, a modeling method is introduced to calculate the probability that at least one copy of the format information can be correctly decoded given a total number of error bits. This method first allocates the total number of error bits among the two copies in all possible ways, and then judges whether each allocation can guarantee that at least one copy is correctly recovered based on the error correction capability of BCH(15,5) encoding (a single copy can correct up to 3 errors). The ratio of all allocations that meet the conditions to all possible allocations is counted, which yields the format information error correction success rate under that error condition. This result can be used to evaluate the anti-interference capability of the format information part under different mask modes and error correction levels, providing a basis for subsequent robustness optimization of the overall QR code structure.
[0080] The formula for calculating the success rate of error correction in the coding region is:
[0081] ;
[0082] in, The error bit count represents the total number of error bits in the encoded region (including data codewords and error correction codewords) caused by printing defects, contamination, or scanning noise. This indicates the success rate of error correction in the encoded area, i.e., when errors exist within the QR code encoded area... The probability of successfully recovering the original data using the Reed-Solomon error correction algorithm when there are 1 bit errors; This represents the total number of bits in the encoding area, i.e., the total number of bits in the QR code encoding area that can be used to store data and error correction information, excluding the functional graphics, format information and version information areas; This represents the total number of error distribution combinations, i.e., from... Select from bits The number of all possible combinations where an error occurs at each position is used as the normalized denominator of the probability; This represents the number of error correction codewords, i.e., the number of redundant codewords allocated during Reed-Solomon encoding; Indicates the maximum number of codewords that can be corrected; Indicates the number of error codewords; This represents the number of combinations of incorrectly selected codewords, i.e., the total number of codewords. Select The number of combinations that can be used as error codewords; Represents the counting variable according to the inclusion-exclusion principle. This indicates alternating signs, which is the alternation of positive and negative signs in the inclusion-exclusion principle, ensuring that duplicate calculations are eliminated; This indicates the number of codewords selected that have not been covered, i.e., from the inclusion-exclusion principle. Select from error codes The number of combinations of ; This represents the number of combinations of bits that were misallocated.
[0083] A modeling method for error correction success rate in the encoding region: The QR code encoding region consists of data codewords and error correction codewords, used to store business data and redundant information, and uses Reed-Solomon encoding to achieve error detection and recovery. When a certain number of bit errors exist in the encoding region, a modeling method based on Reed-Solomon error correction characteristics is introduced to calculate the probability that the region can be successfully recovered with a given number of error bits. This method first determines the total number of bits and codewords in the encoding region, and determines the number of redundant codewords and the maximum number of correctable codewords based on the error correction level. Then, it calculates all possible error distributions, and based on this, enumerates the number of erroneous codewords and their bit distribution within the codewords, using the inclusion-exclusion principle to exclude duplicate counting, thus obtaining the total number of distributions that can be successfully corrected. Finally, the ratio of this number to the total number of all possible error distributions is calculated, yielding the error correction success rate of the encoding region. This result can be used to predict the recoverability of the encoding region under different error correction levels and masking modes during the QR code generation stage, thereby combining with the evaluation results of the format information section to optimize the overall decoding success rate and anti-interference performance of the QR code.
[0084] Modeling the success rate of format information error correction → ensuring reliable decoding of the "structural header" information of QR codes;
[0085] Modeling the success rate of error correction in the coding region → ensuring reliable recovery of the "payload" information of the QR code;
[0086] Combining the two approaches—selecting the optimal masking mode and error correction level during the generation phase—optimizes both structural robustness and data reliability simultaneously.
[0087] Example 3, based on Example 1, in this example, step S2, the process of performing dynamic QR code encoding on the structured data to be encoded to generate a QR code image, specifically includes the following steps:
[0088] Step R1: Based on the total length and semantic category of the structured data to be encoded, determine the encoding capacity and redundancy level, dynamically select the QR code version number and error correction level, and obtain the encoding configuration parameters;
[0089] Step R2: Based on the encoding configuration parameters, the structured data to be encoded is divided into data codewords of 8 bits each; based on the data codewords, Reed-Solomon encoding is used to generate error correction codewords, forming the initial codeword sequence;
[0090] Step R3: Construct the format information code based on the encoding configuration parameters;
[0091] Step R4: Apply mask perturbation processing to the initial codeword sequence using the eight masking patterns defined by the ISO / IEC 18004 standard to generate candidate pattern structures. For each candidate pattern structure under a masking pattern, score the results and generate a score. Select the optimal masking pattern based on the score, determine its corresponding masking pattern number, and generate the perturbed codeword sequence.
[0092] Step R5: Construct a QR code matrix according to the QR code module arrangement specifications and functional graphic layout requirements in the ISO / IEC 18004 standard, embed the format information code into the format information area of the QR code matrix, and embed the perturbed codeword sequence into the encoding area of the QR code matrix to construct a QR code image.
[0093] Example 4, according to Figure 2 This embodiment is based on Embodiment 2. In this embodiment, step S4, which involves recognizing and decoding the QR code image message data using the Transformer model and converting it into structured data, specifically includes the following steps:
[0094] Step S41: Perform image preprocessing on the QR code image message data, including grayscale conversion, binarization, distortion correction and geometric positioning, to obtain the corrected QR code matrix;
[0095] Step S42: According to the module arrangement rules of ISO / IEC 18004 standard, remove the functional graphic area from the correction QR code matrix, including the locator, calibration symbol, timing pattern, format information area and version information area, and retain the valid data module area, that is, the matrix area that stores data codewords and error correction codewords.
[0096] Step S43: Preset the serpentine scan order, and perform linear expansion on the effective data module area according to the serpentine scan order to convert it into a one-dimensional bit sequence;
[0097] Step S44: Train a Transformer model based on a one-dimensional bit sequence. During the training phase of the Transformer model, a noise enhancement strategy is introduced. By injecting simulated flip errors and simulated burst errors into the one-dimensional bit sequence, the decoding accuracy is optimized, resulting in a trained Transformer model. Plaintext results are generated based on the trained Transformer model. The plaintext results are parsed, and field mapping and verification are performed according to the business protocol format to generate structured data. The above methods achieve robust decoding that exceeds the theoretical error correction limit of Reed-Solomon.
[0098] Simulated flip error: Randomly select a number of bits in a one-dimensional bit sequence according to a preset ratio and flip their values to simulate random point noise interference;
[0099] Simulate sudden errors: Randomly select a continuous region in a one-dimensional bit sequence and simultaneously flip all bit values within that region to simulate errors caused by localized occlusion, stains, or blurring.
[0100] Example 5, according to Figure 2 This embodiment is based on Embodiment 2. In this embodiment, step S4, the process of recognizing and decoding the QR code image message data and converting it into structured data, specifically includes the following steps:
[0101] Step E1: Perform image preprocessing on the QR code image message data, including grayscale conversion, binarization, distortion correction, and geometric localization, to obtain the corrected QR code matrix;
[0102] Step E2: According to the module arrangement rules of ISO / IEC 18004 standard, remove the functional graphic area from the correction QR code matrix, including the locator, calibration symbol, timing pattern, format information area and version information area, and retain the valid data module area, that is, the matrix area that stores data codewords and error correction codewords.
[0103] Step E3: Preset the serpentine scan order, and perform linear expansion on the valid data module area according to the serpentine scan order to convert it into a one-dimensional bit sequence;
[0104] Step E4: Divide the one-dimensional bit sequence into data codewords and error correction codewords by bytes. Use the Reed-Solomon error correction algorithm conforming to the ISO / IEC 18004 standard to detect and correct errors in the codewords. Recover the original data under the condition that the number of errors does not exceed the correctable range of the set error correction level. Parse the business protocol format and map the fields of the recovered data to generate structured data and achieve robust decoding under the error correction limit conditions of Reed-Solomon theory.
[0105] The present invention and its embodiments have been described above. This description is not restrictive. The accompanying drawings are only one embodiment of the present invention, and the actual structure is not limited thereto. In short, if a person skilled in the art is inspired by this description and designs a similar structure and embodiment without departing from the spirit of the present invention, such design should fall within the protection scope of the present invention.
Claims
1. A method for standardizing the transmission of non-standard data based on machine-readable codes, characterized in that: The method includes the following steps: Step S1: Obtain structured data to be encoded and establish a data processing platform; Step S2: Construct an interference-resistant machine-readable code generation method, process the structured data to be encoded using the interference-resistant machine-readable code generation method, and generate a QR code image; Step S3: Process the QR code image using the GA / T1400 protocol to obtain the QR code image message data; Step S4: Decode the QR code image message data using the Transformer model and convert it into structured data; Step S5: Input the structured data into the data processing platform, perform data parsing and field mapping through the standard data interface of the data processing platform, and perform unified management, real-time scheduling and backtracking query; The process of generating a QR code image using an interference-resistant, machine-readable code generation method includes the following steps: Step S21: Obtain the encoding configuration parameters based on the total length and semantic category of the structured data to be encoded; Step S22: Based on the encoding configuration parameters, the structured data to be encoded is divided into data codewords by 8 bits; based on the data codewords, error correction codewords are generated by Reed-Solomon error correction coding to form an initial codeword sequence; Step S23: Construct the format information code according to the encoding configuration parameters; Step S24: Perform mask perturbation processing on the initial codeword sequence to generate candidate pattern structures. For each candidate pattern structure under a mask mode, perform scoring to generate scoring results, select the optimal mask mode, and generate the perturbated codeword sequence. Step S25: Construct a QR code matrix and embed the format information code into the format information area of the QR code matrix; embed the perturbed codeword sequence into the encoding area of the QR code matrix to construct an initial QR code image; during the construction of the initial QR code image, a dual-region evaluation method is introduced to jointly optimize the initial QR code image, and finally a QR code image is generated.
2. The method for standardized transmission of non-standard data based on machine-readable code according to claim 1, characterized in that: The method for generating machine-readable codes resistant to interference is constructed as follows: Based on the QR code version number selection and mask mode perturbation mechanism defined in ISO / IEC 18004, Reed-Solomon error correction coding is used to generate redundant codewords for the structured data to be encoded; (15,5)BCH format information encoding technology is used for redundancy protection; a format information error correction success rate modeling method is introduced for quantitative evaluation; an error correction success rate modeling method for the encoding region is introduced for analysis and prediction; and the method for generating machine-readable codes resistant to interference is thus constructed.
3. The method for standardized transmission of non-standard data based on machine-readable code according to claim 1, characterized in that: The process of optimizing the initial QR code image using the dual-region evaluation method is as follows: during the initial QR code image construction process, the error tolerance capability of the format information region is evaluated using the format information error correction success rate modeling method, and the format information evaluation result is generated; the recoverability of the coding region is evaluated using the coding region error correction success rate modeling method, and the coding region evaluation result is generated. Based on the evaluation results of format information and the evaluation results of coding region, the structural robustness and decoding success rate of the initial QR code image are jointly optimized to generate a QR code image.
4. The method for standardized transmission of non-standard data based on machine-readable code according to claim 1, characterized in that: Step S4 specifically includes the following steps: Step S41: Perform image preprocessing on the QR code image message data to obtain the corrected QR code matrix; Step S42: Remove the functional graphic area from the correction QR code matrix and retain the valid data module area; Step S43: Perform a linear expansion on the valid data module area to convert it into a one-dimensional bit sequence; Step S44: Train a Transformer model based on a one-dimensional bit sequence. Introduce a noise enhancement strategy during the training phase of the Transformer model to optimize the decoding accuracy and obtain the trained Transformer model. Generate plaintext results based on the trained Transformer model, parse the plaintext results, perform field mapping and verification, and generate structured data.
5. The method for standardized transmission of non-standard data based on machine-readable code according to claim 4, characterized in that: The noise enhancement strategy optimizes the decoding accuracy by injecting simulated flip errors and simulated burst errors into a one-dimensional bit sequence.
Citation Information
Patent Citations
CCQR (Colorful Coded Quick Response) code encoding method and decoding method
CN103310251A
Hybrid two-dimensional barcode and hybrid two-dimensional barcode generator
CN113557530A