Data cross-network one-way transmission method and system based on multi-source heterogeneous data fusion

By serializing, segmenting, compressing, and error-correcting multi-source heterogeneous data, and combining it with QR code image correction technology, the problems of data format compatibility and transmission stability in cross-network unidirectional transmission of multi-source heterogeneous data are solved, achieving efficient and reliable data transmission.

CN122437631APending Publication Date: 2026-07-21中交资产管理有限公司 +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
中交资产管理有限公司
Filing Date
2026-03-31
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

Existing technologies suffer from poor data format compatibility, high decoding failure rate, and insufficient transmission stability and reliability in cross-network unidirectional transmission of multi-source heterogeneous data. In particular, they are susceptible to ambient light interference and noise during optical transmission, making it difficult to guarantee the integrity and reliability of the data.

Method used

By serializing, segmenting, and compressing multi-source heterogeneous data, applying forward error correction coding, and using QR code encoding for data transmission, combined with ellipse fitting and regular grid partitioning for image correction, high-precision geometric correction and error correction decoding are achieved, ultimately restoring complete data.

Benefits of technology

It achieves standardized fusion of multi-source heterogeneous data, improves data adaptability and processing efficiency, enhances transmission stability and reliability, reduces decoding failure rate, and meets the security isolation requirements of key areas.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122437631A_ABST
    Figure CN122437631A_ABST
Patent Text Reader

Abstract

The application provides a data cross-network one-way transmission method and system based on multi-source heterogeneous data fusion, and relates to the technical field of data processing. The method comprises the following steps: obtaining to-be-transmitted data, performing serialization processing on the to-be-transmitted data to obtain serialized data; performing block division and compression processing on the serialized data to obtain a plurality of compressed data blocks; performing two-dimensional code encoding on each compressed data block respectively, and applying forward error correction coding to obtain two-dimensional code data blocks with error correction codes; and performing one-way cross-network transmission on the two-dimensional code data blocks with error correction codes. The application can realize high-reliability and high-precision geometric correction of data cross-network one-way transmission.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and in particular to a method and system for cross-network unidirectional data transmission based on multi-source heterogeneous data fusion. Background Technology

[0002] With the continuous improvement of information security levels, critical infrastructure sectors widely adopt physically isolated network architectures to prevent data leakage risks. However, business operations often require data exchange between different security domains, especially the increasingly urgent need for cross-network unidirectional transmission of multi-source heterogeneous data. In existing technologies, optical shutters or QR code optical transmission are commonly used to achieve data transmission under physical isolation. However, some existing technical solutions have the following drawbacks: For example, when faced with multi-source heterogeneous data from different business systems, using different data models and storage structures, the lack of a unified preprocessing and fusion mechanism leads to poor data format compatibility, making it difficult to directly adapt to unidirectional transmission channels. Some data require manual intervention or multiple conversions, resulting in low efficiency and a high risk of errors.

[0003] For example, in the optical one-way transmission process based on QR codes, the QR code image obtained by the receiving end often has severe geometric deformation due to changes in shooting angle, lens distortion, or transmission distance. Existing image correction methods are mostly based on simple perspective transformation, which makes it difficult to accurately restore the QR code structure under complex deformation, resulting in a high decoding failure rate and affecting the stability of transmission. The optical transmission link is susceptible to ambient light interference and noise. Existing solutions lack a block-level compression and forward error correction collaborative processing mechanism. Once some data is damaged, it is difficult to recover the complete information, which may not guarantee the integrity and reliability of data during cross-network transmission. Summary of the Invention

[0004] The technical problem to be solved by the present invention is to provide a method and system for cross-network unidirectional data transmission based on multi-source heterogeneous data fusion, which can realize highly reliable and high-precision geometrically corrected cross-network unidirectional data transmission.

[0005] To solve the above-mentioned technical problems, the technical solution of the present invention is as follows: Firstly, a method for cross-network unidirectional data transmission based on multi-source heterogeneous data fusion, the method comprising: Obtain the data to be transmitted, perform serialization processing on the data to be transmitted, and obtain serialized data; The serialized data is divided into blocks and compressed to obtain multiple compressed data blocks; each compressed data block is encoded into a QR code and forward error correction is applied to obtain a QR code data block with error correction code. The QR code data block with error correction code is transmitted unidirectionally across the network to obtain the optical carrier signal; the optical carrier signal is converted into image data, the image data is preprocessed and the region of interest is detected, and the image region of the QR code is extracted. Within the image area of ​​the QR code, the center points of three positioning patterns of the QR code are selected, and ellipse fitting is performed through the three center points. The fitted ellipse parameters are compared with the ellipse parameters corresponding to the standard QR code positioning patterns to obtain the comparison results. Based on the comparison results, a planar region for image correction is constructed, and the planar region is divided into regular grids. Based on the distribution characteristics of the distance deviation between the grid nodes and the ellipse boundary after division, the image correction parameters are obtained. Using image correction parameters, geometric correction is performed on the extracted QR code image region to obtain the corrected QR code image; the corrected QR code image is then decoded and forward error correction is performed to obtain multiple compressed data blocks; the multiple compressed data blocks are then reassembled to obtain the reassembled data; the reassembled data is then decompressed to obtain the complete transmission data.

[0006] Secondly, a cross-network unidirectional data transmission system based on multi-source heterogeneous data fusion includes: The acquisition module is used to acquire the data to be transmitted, perform serialization processing on the data to be transmitted, and obtain serialized data. The compression module is used to divide and compress serialized data into blocks to obtain multiple compressed data blocks; each compressed data block is encoded with a QR code and forward error correction coding is applied to obtain a QR code data block with error correction code; The extraction module is used to transmit QR code data blocks with error correction codes one-way across the network to obtain optical carrier signals; convert optical carrier signals into image data; preprocess the image data and detect regions of interest to extract the image region of the QR code; The calculation module is used to select the center points of three positioning patterns of the QR code within the image area of ​​the QR code, perform ellipse fitting through the three center points, compare the fitted ellipse parameters with the ellipse parameters corresponding to the standard QR code positioning pattern to obtain the comparison result; based on the comparison result, construct a planar region for image correction, divide the planar region into regular grids, and obtain the image correction parameters according to the distribution characteristics of the distance deviation between the grid nodes and the ellipse boundary after division. The correction module is used to perform geometric correction on the extracted QR code image region using image correction parameters to obtain a corrected QR code image; decode and perform forward error correction decoding on the corrected QR code image to obtain multiple compressed data blocks; reassemble the multiple compressed data blocks to obtain reassembled data; and decompress the reassembled data to obtain complete transmission data.

[0007] Thirdly, a computing device, comprising: One or more processors; A storage device for storing one or more programs that, when executed by one or more processors, cause the one or more processors to implement the method.

[0008] Fourthly, a computer-readable storage medium storing a program that, when executed by a processor, implements the method.

[0009] The above-described solution of the present invention has at least the following beneficial effects: By serializing the data to be transmitted, multi-source heterogeneous data from different business systems and using different data models can be converted into a unified byte stream format, eliminating format differences and heterogeneous barriers between data sources, realizing the standardized integration of multi-source data, and improving data adaptability and processing efficiency.

[0010] By segmenting, compressing, and forward error correction coding of serialized data, and combining recombination and decompression, not only is the amount of data transmitted reduced and the transmission efficiency improved, but the forward error correction mechanism also enhances the anti-interference capability of the data in the optical transmission link. Even if some data is damaged during transmission, the original compressed data block can be recovered through error correction codes, ensuring the integrity and reliability of the data.

[0011] By converting data into optical carrier signals for one-way cross-network transmission, the physically isolated optical channel effectively prevents network attacks and data leakage risks, meeting the stringent deployment requirements for security isolation in critical fields. By selecting the center point of the QR code positioning pattern for ellipse fitting and combining regular grid division and distance deviation distribution characteristic analysis to obtain image correction parameters, and then using these correction parameters for geometric correction, complex geometric deformations caused by factors such as shooting angle and lens distortion can be accurately compensated. Compared with traditional correction methods, this invention improves the correction accuracy of the QR code image area, reduces the decoding failure rate, and ensures transmission stability and success rate in complex optical transmission environments. Attached Figure Description

[0012] Figure 1 This is a flowchart illustrating a cross-network unidirectional data transmission method based on multi-source heterogeneous data fusion provided in an embodiment of the present invention.

[0013] Figure 2 This is a schematic diagram of a cross-network unidirectional data transmission system based on multi-source heterogeneous data fusion provided by an embodiment of the present invention. Detailed Implementation

[0014] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.

[0015] like Figure 1 As shown, embodiments of the present invention propose a cross-network unidirectional data transmission method based on multi-source heterogeneous data fusion, the method comprising the following steps: Step 1: Obtain the data to be transmitted, and perform serialization processing on the data to be transmitted to obtain serialized data; Step 2: Divide and compress the serialized data to obtain multiple compressed data blocks; encode each compressed data block into a QR code and apply forward error correction coding to obtain a QR code data block with error correction code. Step 3: Transmit the QR code data block with error correction code unidirectionally across the network to obtain the optical carrier signal; convert the optical carrier signal into image data, preprocess the image data and detect the region of interest to extract the image region of the QR code; Step 4: Within the image area of ​​the QR code, select the center points of the three positioning patterns of the QR code, perform ellipse fitting through the three center points, and compare the fitted ellipse parameters with the ellipse parameters corresponding to the standard QR code positioning pattern to obtain the comparison results; based on the comparison results, construct a planar region for image correction, divide the planar region into regular grids, and obtain the image correction parameters based on the distribution characteristics of the distance deviation between the grid nodes and the ellipse boundary after division. Step 5: Using image correction parameters, perform geometric correction on the extracted QR code image region to obtain the corrected QR code image; decode and perform forward error correction decoding on the corrected QR code image to obtain multiple compressed data blocks; reassemble the multiple compressed data blocks to obtain reassembled data; decompress the reassembled data to obtain complete transmission data.

[0016] In this embodiment of the invention, by serializing the data to be transmitted, multi-source heterogeneous data from different business systems and using different data models are converted into a unified byte stream format, eliminating format differences and heterogeneous barriers between data sources, realizing the standardized fusion of multi-source data, and improving data adaptability and processing efficiency.

[0017] By segmenting, compressing, and forward error correction coding of serialized data, and combining this with the reassembly and decompression operations at the receiving end, the amount of data transmitted is reduced and the transmission efficiency is improved. Furthermore, the forward error correction mechanism enhances the anti-interference capability of the data in the optical transmission link. Even if some data is damaged during transmission, the original compressed data block can be recovered through the error correction code, ensuring the integrity and reliability of the data.

[0018] By converting data into optical carrier signals for one-way cross-network transmission, the physically isolated optical channel effectively prevents network attacks and data leakage risks, meeting the stringent deployment requirements for security isolation in critical areas. By selecting the center point of the QR code positioning pattern for ellipse fitting and combining regular grid division and distance deviation distribution characteristic analysis to obtain image correction parameters, and then using these correction parameters for geometric correction, the complex geometric deformation caused by factors such as shooting angle and lens distortion is accurately compensated. Compared with traditional correction methods, this invention improves the correction accuracy of the QR code image area.

[0019] In a preferred embodiment of the present invention, step 1 above may include: Step 1.1: Receive data update events from multi-source heterogeneous databases. These multi-source heterogeneous databases refer to a collection of databases from different business scenarios, employing different data models, storage structures, and communication protocols. This includes various combinations of relational databases, non-relational databases, time-series databases, and file-based data sources. The databases differ in data format, field naming rules, timestamp precision, and encoding methods. Each data update event carries a data source identifier, change type, and timestamp information. Specifically, during system startup, a cross-network transmission pre-processing data monitoring program is initialized and started. This program establishes stable listening connections with various multi-source heterogeneous databases, continuously and in real-time receiving data update events generated by each database. The multi-source heterogeneous databases are those built for different business scenarios, employing different data models and storage structures. This is a collection of multiple databases that use communication protocols, specifically covering various types such as relational databases, non-relational databases, time-series databases, and file-based data sources. The format differences between different types of databases in practical applications are reflected in many aspects, such as data storage format, field naming rules, timestamp statistical precision, and data encoding methods. These differences directly lead to the inability to directly transmit and process data uniformly. Every data update event received by the monitoring program will fully carry the corresponding data source identifier, data change type, and timestamp information. The data source identifier is used to distinguish the business system and database type to which the data belongs, the data change type is used to mark the data's addition, modification, or deletion status, and the timestamp information is used to record the exact time when the data change occurred. Through the above information, the source, content, and timing of each data change are clearly defined.

[0020] Step 1.2: Based on the data source identifier in the data update event, extract the changed data segments matching the change type from the corresponding database, and aggregate the changed data segments in timestamp order to form an initial dataset to be transmitted. Specifically, this includes: after receiving the data update event, parsing the information within the update event; first, performing a matching search based on the data source identifier carried in the event to accurately locate the corresponding business database that generated the change, avoiding traversing and querying irrelevant databases; and then, combining the data change type marked in the event, performing a data search in the located database, filtering and extracting the data segments that completely match the change type. The system extracts the actual changed data segments rather than extracting the entire database, thereby reducing the generation and transmission overhead of redundant data. After extracting the changed data segments corresponding to multiple update events, it reads the timestamp information corresponding to each changed data segment and sorts and organizes all changed data segments in chronological order from earliest to latest. The scattered changed data segments are then orderly aggregated and integrated according to the time sequence rules. At the same time, invalid data segments with time sequence disorder, duplication and redundancy caused by network latency or database anomalies are removed, and finally an initial dataset to be transmitted is formed with a regular structure, continuous time sequence and no redundant information.

[0021] Step 1.3 involves format unification and field mapping of the initial dataset to be transmitted. Based on a pre-configured heterogeneous data mapping rule table, the field names, data types, and units of measurement of data from different sources are converted to a standard format to obtain structured data records. Specifically, addressing the issues of inconsistent formats and incompatible fields among the multi-source heterogeneous data in the initial dataset to be transmitted, the processing unit performs comprehensive format unification and field mapping. During this process, the pre-configured heterogeneous data mapping rule table is invoked. This rule table is formulated according to the unified standard for cross-network transmission and includes the corresponding relationships and specifications for various heterogeneous data conversions. The unified conversion standard set in the table converts each attribute of data from different sources one by one, converting custom field names from different business databases into standard field names, converting inconsistent data types into unified data types, converting differing units of measurement into standard units of measurement, and unifying the data encoding method and timestamp precision. Through the above standardization process, the format barriers, field differences, and measurement differences between multi-source heterogeneous data are eliminated, and the originally messy and inconsistent heterogeneous data is organized into structured data records with unified structure, standardized fields, and consistent format, so that data from various sources have a unified parsing standard and processing specification.

[0022] Step 1.4 involves serializing the structured data records. Following preset byte alignment rules and length identification strategies, the structured data records are converted into a continuous byte stream format to obtain serialized data. Specifically, after obtaining standardized structured data records, a professional serialization encoding operation is performed on these records. The serialization process strictly adheres to preset byte alignment rules and length identification strategies. Byte alignment rules standardize the arrangement of data in the byte stream, ensuring the regularity of data storage and retrieval, and avoiding data misalignment during parsing. The length identification strategy marks the length information of each segment of structured data in the byte stream, facilitating accurate identification during data splitting and recombination. Based on these rules and strategies, the originally structured, scattered data records are encapsulated and converted, removing format separators from the structured data and integrating the discrete data content into a continuous, uninterrupted byte stream format, ultimately generating serialized data suitable for transmission and processing. This serialized data eliminates the original format differences of multi-source heterogeneous data, and has a unified byte structure, clear length identifier and regular arrangement. It directly adapts to operations such as data segmentation, lossless compression and QR code encoding, and provides a standardized and universal data carrier for multi-source heterogeneous data to achieve one-way cross-network transmission through optical channels.

[0023] In this embodiment of the invention, by receiving data update events from multi-source heterogeneous databases with different business systems, data models, storage structures, and communication protocols, and carrying data source identifiers, change types, and timestamp information in the events, accurate perception and tracing of changes in multi-source heterogeneous data sources are achieved. This provides a reliable basis for targeted extraction of changed data and solves the problem of difficulty in unified monitoring and identification of data changes in a multi-source heterogeneous environment. By accurately extracting matching changed data segments based on data source identifiers and change types, and aggregating and sorting the changed data segments according to timestamp order, only the changed data content is transmitted instead of the full data, effectively reducing the amount of redundant data transmission, while ensuring the temporal consistency of data changes, avoiding data out-of-order and duplicate transmission, and improving the targeting and efficiency of data transmission.

[0024] By performing format unification and field mapping on the initial dataset to be transmitted, and based on a pre-configured heterogeneous data mapping rule table, the field names, data types, and units of measurement of data from different sources are converted into standard formats. This eliminates format differences and heterogeneous barriers between multiple heterogeneous data sources, achieving standardized fusion of multi-source data. By serializing and encoding structured data records, and converting them into a continuous byte stream format according to preset byte alignment rules and length identification strategies, structured data acquires the characteristics of efficient block segmentation, compression, and transmission, improving the compatibility and scalability of data processing, and solving the problem of inefficient encapsulation and parsing of structured data in cross-network transmission scenarios.

[0025] In a preferred embodiment of the present invention, step 2 above may include: Step 2.1, calculate the total byte length of the serialized data, specifically including: after obtaining the serialized data that has been standardized, directly perform overall byte statistics on the serialized data in the form of a byte stream; by traversing all the contents of the byte stream segment by segment, accurately accumulate and count the total number of bytes contained in the serialized data, and finally calculate the total byte length of the serialized data.

[0026] Step 2.2: According to the preset single-block data capacity limit, the serialized data is divided into several continuous data segments, and a block header information is encapsulated for each data segment. The block header information includes the sequence number of the corresponding segment and the total number of segments, forming an original data block with an identifier. Specifically, this includes: according to the calculated total byte length and combined with the preset single-block data capacity limit, the continuous serialized data is divided in an orderly and precise manner; the entire serialized data is divided into several continuous data segments of the required length, strictly ensuring that the capacity of each data segment is controlled within the preset upper limit, thereby fully adapting to the data carrying capacity requirements of QR code encoding; after the data segmentation is completed, a corresponding block header information is encapsulated for each independent data segment. The encapsulated block header information clearly includes the sequence number of the current data segment and the total number of all data segments; the sequence number clearly marks the transmission order of each segment in the overall data, and the total number of segments clarifies the scale of the overall data division, finally encapsulating an original data block with a unique identifier.

[0027] Step 2.3 involves performing lossless compression on each of the identified original data blocks to obtain multiple compressed data blocks. Specifically, this includes sequentially performing lossless compression on each encapsulated and identified original data block. This lossless compression effectively reduces the size of the original data block while completely preserving all original data content and without losing any data information, thereby reducing the storage size of the original data block and the space occupied during transmission. Through lossless compression, the transmission pressure of data in the optical unidirectional transmission link is reduced, effectively mitigating the impact of ambient light interference and noise on the transmission process. At the same time, the compression process reduces the amount of data that the QR code needs to carry, avoiding the problem of complex QR code encoding structure and increased recognition difficulty due to excessive data size, thus improving the efficiency and stability of cross-network data transmission overall.

[0028] Step 2.4 converts each compressed data block into a binary bit stream, maps it to a QR code matrix module according to the QR code encoding standard, and generates an initial QR code image. Specifically, this includes: after compression, converting the format of each compressed data block to accurately convert the byte stream of compressed data into a continuous binary bit stream; mapping each bit in the binary bit stream to the QR code matrix module according to a predetermined and compatible QR code encoding standard; filling each corresponding module of the QR code matrix according to the numerical logic of the bit stream, completing the initial conversion from digital data to optical image, and generating an initial QR code image that only carries compressed data information.

[0029] Step 2.5: Perform forward error correction coding on the data region in the initial QR code image to generate corresponding error correction codewords. Fill the error correction codewords into the error correction region of the QR code matrix to obtain a QR code data block with error correction code. Specifically, this includes: after generating the initial QR code image, performing forward error correction coding on the data region in the initial QR code image that carries the actual transmitted data. The specific implementation process is as follows: Constructing the original data polynomial: Traverse all the original data units within the data region one by one, assuming the data units are sequentially... Position weight variables This means that, following the order of the data units, the value of the first data unit is multiplied by the zero power of its place value, the value of the second data unit is multiplied by the first power of its place value, the value of the third data unit is multiplied by the second power of its place value, and so on, until the last data unit is processed. The products obtained from the operations on all data units are then summed and combined to form the complete original data polynomial, as shown in the formula: .

[0030] Determine a fixed generator polynomial, and based on the preset QR code error correction level, determine the corresponding maximum number of error correction symbols. This allows us to determine the fixed degree of the generator polynomial; the generator polynomial is formed by multiplying consecutive linear polynomials term by term, and we have a finite field primitive element as... Specifically, the process involves subtracting the zeroth power from the bit weight, multiplying by the first power of the bit weight minus the original element, multiplying by the second power of the bit weight minus the original element, and then continuously multiplying by twice the number of error correction symbols minus the first power of the bit weight minus the original element. After multiplying all the terms of the linear polynomials and expanding and combining them, a fixed generator polynomial that perfectly matches the error correction level is obtained. The formula is: , For positional weight variables, This represents the maximum number of error correction symbols.

[0031] The polynomial shift multiplication operation is performed by multiplying the original data polynomial by a polynomial whose bit weights are twice the power of the error correction symbol number. Specifically, this operation involves adding twice the error correction symbol number to the bit weight exponent of each term in the original data polynomial, thus shifting the entire original data polynomial to the left. After the shift, a space equal to the length of twice the error correction symbol number is reserved at the end of the original data polynomial. This space is specifically used to store the generated error correction codeword. The shift operation formula is as follows: , For positional weight variables, This represents the maximum number of error correction symbols.

[0032] The core operation of polynomial division is performed. The shifted polynomial is used as the dividend, and the pre-defined generator polynomial is used as the divisor. The specific steps are as follows: Take the highest-degree term of the dividend and the highest-degree term of the divisor. Divide the coefficient of the highest-degree term of the dividend by the coefficient of the highest-degree term of the divisor to obtain the first term of the quotient. Next, multiply the first term of the quotient by each term of the divisor, and expand the product of each term. Then, subtract the above product from the shifted dividend polynomial term by term to obtain the first-level intermediate remainder polynomial. Next, using the first-level intermediate remainder polynomial as the new dividend, repeat the operations of dividing the highest-degree terms, multiplying the quotient by the divisor, and subtracting the polynomial term by term to obtain the next-level intermediate remainder polynomial. This process continues until the degree of the highest-degree term in the final remainder polynomial is less than the degree of the highest-degree term in the generator polynomial. The remainder polynomial at this point is the final result. The polynomial division formula is: In the formula: For quotient polynomial, It is the final remainder polynomial, and satisfies the degree. <Number of times .

[0033] Extract the error correction codewords, read all the coefficients of the final remainder polynomial, and let the remainder polynomial be... All coefficients are arranged and combined sequentially according to their position weight indices from low to high to form a continuous codeword sequence. This sequence is the error correction codeword that perfectly matches the original data. The error correction codeword generated through standardized mathematical operations has stable error correction and verification capabilities. It can effectively resist damage to the data module caused by external factors such as ambient light interference and image noise during optical transmission, and specifically make up for the shortcomings of the existing optical transmission scheme in terms of anti-interference capability.

[0034] Filling the error correction area strictly follows the structural specifications of the QR code matrix. The extracted error correction codewords are enumerated one by one in sequence and filled into the pre-divided dedicated error correction area in the QR code matrix in a neat and accurate manner. This ensures that the error correction codewords and the original transmission data are stored separately and do not interfere with each other. The final QR code matrix contains both the original transmission data and the error correction verification data, forming a complete QR code data block with error correction codes.

[0035] In this embodiment of the invention, the total byte length of the serialized data is calculated, and it is divided into continuous data segments according to a preset single-block data capacity limit. At the same time, each segment is encapsulated with block header information containing the sequence number and the total number of segments to form an identified original data block. This not only realizes the modular splitting of large data volumes, avoiding transmission and processing bottlenecks caused by excessively large single data entries, but also ensures the order and traceability of each data segment through the block header sequence number identification. By performing lossless compression on each identified original data block, the physical volume of the data block is reduced without losing any data information, reducing the amount of data transmitted in the optical transmission link, improving transmission efficiency and bandwidth utilization, and ensuring data integrity.

[0036] By converting compressed data blocks into binary bit streams and mapping them to QR code matrix modules according to QR code encoding standards to generate initial QR code images, the conversion of digital data into optically recognizable patterns is realized. This adapts to the physically isolated optical channels for one-way cross-network transmission, laying the foundation for cross-network transmission of non-electronic signals of data. By performing forward error correction coding on the data area of ​​the initial QR code image, corresponding error correction codewords are generated and filled into the error correction area of ​​the QR code matrix, constructing QR code data blocks with error correction codes. This enhances the ability of QR code data to resist interference such as light interference and image distortion during optical transmission. It can also recover the original data through error correction codewords when some data modules are damaged, further ensuring the reliability and success rate of cross-network transmission.

[0037] In a preferred embodiment of the present invention, step 3 above may include: Step 3.1: Render the QR code data block with error correction code into a visible light pattern to form an optical carrier signal. Specifically, this includes: immediately after generating the QR code data block with error correction code, performing visible light rendering processing on the QR code data block to convert the digital QR code data block into a visible light pattern that can be transmitted through an optical channel, thereby forming an optical carrier signal to meet the unidirectional cross-network transmission requirements under physically isolated networks. The specific rendering process involves converting each matrix module carrying the original compressed data and error correction codewords in the QR code data block into a visible light pattern according to the module distribution pattern of the QR code matrix. The brightness and darkness display states are controlled, with black modules in the QR code matrix rendered as low-brightness visible light and white modules rendered as high-brightness visible light. This ensures that the contrast between light and dark in each module is clearly distinguishable. During the rendering process, the original structure of the QR code matrix is ​​strictly maintained, and the module distribution of the data area and error correction area is not changed. This ensures that the rendered visible light pattern completely carries all the information in the QR code data block. At the same time, the brightness range of the visible light is controlled to avoid problems such as signal blurring and recognition difficulties during the capture process due to excessively high or low brightness. Ultimately, an optical carrier signal with uniform brightness, clear contrast, and complete information is formed.

[0038] Step 3.2, capturing the optical carrier signal and converting the captured light signal into digital image data, specifically includes: after generating the optical carrier signal, accurately capturing the visible light pattern using a preset light signal capture device, ensuring that the distance and angle between the device and the visible light pattern remain stable during the capture process, avoiding incomplete capture or distortion of the light signal due to capture angle deviation, excessive distance or proximity, and immediately performing analog-to-digital conversion processing on the captured optical carrier signal to convert the analog light signal into digital image data that can be processed. The specific conversion process is as follows: The intensity of the captured light signal is acquired, and the intensity value of each light signal is quantized. The calculation method is to divide the acquired light signal intensity value by a preset maximum light signal intensity value to obtain a ratio between 0 and 1. This ratio is then multiplied by 255 to obtain a pixel grayscale value between 0 and 255. High-brightness light signals correspond to higher grayscale values ​​close to 255, while low-brightness light signals correspond to lower grayscale values ​​close to 0. Through the above quantization calculation, each light signal intensity is converted into a corresponding pixel grayscale value. Then, according to the order of light signal acquisition, all pixel grayscale values ​​are arranged in rows and columns to form complete digital image data. This ensures that the digital image data completely restores the QR code information in the optical carrier signal, while also guaranteeing the image's clarity and integrity.

[0039] Step 3.3: Preprocess the digital image data to obtain a preprocessed image. Specifically, this includes: Since the digital image data is easily affected by ambient light interference and noise during optical transmission, the captured and converted digital image data often has problems such as noise, uneven illumination, and image blurring, which affect the accuracy of QR code positioning pattern recognition and region extraction. Therefore, it is necessary to perform comprehensive preprocessing operations on the digital image data to make up for the defects of poor image quality and high recognition difficulty in the existing technology.

[0040] The algorithm iterates through each pixel in the digital image data. Centered on the current pixel, it selects eight neighboring pixels and calculates the sum of their grayscale values. This sum is then divided by 8 to obtain the average grayscale value of the neighboring pixels. This average grayscale value replaces the current pixel's grayscale value. This averaging method effectively filters out random noise in the image, preventing noise interference with pattern recognition. The algorithm then calculates the sum of grayscale values ​​for all pixels in the entire digital image and divides it by the total number of pixels to obtain the average grayscale value. For pixels with grayscale values ​​higher than the average, the average grayscale value is subtracted from the current pixel's grayscale value, multiplied by a preset attenuation coefficient, and then added back to the average grayscale value to reduce its grayscale value. For pixels with gray values ​​lower than the average gray value, the gray value of that pixel is subtracted from the average gray value, multiplied by a preset enhancement coefficient, and then added back to the gray value of that pixel to increase its gray value. This calculation and adjustment makes the overall illumination of the image uniform, avoiding local overexposure or underexposure. The gray value difference between each pixel and its neighboring pixels is calculated. For pixels with small differences, the gray value of that pixel is multiplied by a preset enhancement coefficient to widen the gray value difference with neighboring pixels, improving the contrast and edge sharpness of the image. This ensures that the module boundaries and positioning pattern outlines of the QR code are clearer, providing a good image foundation for positioning pattern recognition. After completing the above three preprocessing steps, a preprocessed image with uniform illumination, noise reduction, and clear edges is obtained.

[0041] Step 3.4 involves performing region of interest (ROI) detection on the preprocessed image to identify the feature contours of the QR code positioning pattern and determine the coordinates of the QR code in the image. Specifically, this includes: After preprocessing, ROI detection is performed on the preprocessed image. The core objective is to accurately identify the QR code positioning pattern from a complex image background, determine the specific coordinates of the QR code, avoid interference from irrelevant background information, and improve the efficiency and targeting of image processing. The entire area of ​​the preprocessed image is scanned to identify regions that match the features of the QR code positioning pattern. The QR code positioning pattern consists of alternating black and white square modules, characterized by a black module at the center, surrounded by white modules, and then another black module on the outermost layer. By scanning the edge contours of the image, the edge density of each region is calculated, and regions with edge densities matching the positioning pattern features are selected. The approximate range of the three positioning patterns is initially determined. Precise contour extraction is then performed on the three initially selected positioning pattern regions. The edge pixels of each region are traversed, and the coordinates of each edge pixel are recorded. These coordinates are connected sequentially to form the feature contour of the positioning pattern, ensuring the contour is complete and unbroken, while removing burrs and invalid pixels from the contour edges.

[0042] For each positioning pattern's feature contour, find the coordinates of its four vertices, calculate the average of each vertex's coordinates, and obtain the coordinates of the center point of the positioning pattern. The coordinates of the center points of the three positioning patterns are the core positioning reference points of the QR code. Then, based on the coordinates of the three center points, calculate the boundary coordinates of the QR code. Specifically, find the four values ​​among the three center points with the smallest, largest, smallest, and largest x and y coordinates, and use them as the left boundary x and right boundary x, bottom boundary y, and top boundary y coordinates of the QR code, respectively. The rectangular range formed by these four values ​​is the coordinate position of the QR code in the image.

[0043] Step 3.5: Based on the coordinates of the QR code in the image, crop the image region containing the complete QR code information from the preprocessed image to obtain the QR code image region. Specifically, after determining the coordinates of the QR code in the image, perform a precise cropping operation on the preprocessed image according to the rectangular range corresponding to the coordinates. The core purpose is to remove irrelevant background areas, focus on the core information area of ​​the QR code, reduce the amount of data processed for image correction and decoding, improve processing efficiency, and ensure that the cropped image contains complete QR code information. Based on the QR code boundary coordinates determined in the previous step, define the cropping range, namely the rectangular area between the left and right horizontal coordinates and the lower and upper vertical coordinates, which completely covers three... The image is pre-processed by cropping the rectangular area containing the positioning pattern, QR code data area, and error correction area, ensuring no QR code-related information is missed. The process involves traversing all pixels within the rectangular area and extracting them in their original row and column order to form a new image. During cropping, the grayscale values ​​of the pixels are strictly maintained to preserve image clarity and the distribution pattern of the QR code modules. Simultaneously, all background pixels outside the rectangular area are removed. After cropping, the newly generated image undergoes integrity verification to check if it contains the three complete positioning patterns, the complete data area, and the error correction area. If any are missing, the cropping coordinates are readjusted, and cropping is repeated until an image area containing complete QR code information is obtained, ultimately yielding the QR code image area.

[0044] In this embodiment of the invention, by rendering the QR code data block with error correction code as a visible light pattern to form an optical carrier signal, the conversion of digital data to non-electronic optical signals is realized. Relying on the physically isolated visible light transmission channel, the electronic pathways for network attacks and data leakage are blocked, meeting the high security isolation requirements of critical fields for cross-network data transmission. By capturing the optical carrier signal and converting it into digital image data, the analog-to-digital conversion from optical signals to computationally processable digital signals is completed, providing a data foundation that can be directly processed by the computer system for image preprocessing, QR code area extraction and decoding operations, and ensuring the resolvability of data after cross-network transmission.

[0045] By preprocessing digital image data, noise interference, uneven lighting, and blurring distortion in the image are effectively removed, improving image clarity and contrast and optimizing image quality. By performing region of interest detection on the preprocessed image, the feature contours of the QR code positioning pattern are identified and its coordinate position is determined, quickly and accurately locating the QR code area from a complex background and avoiding interference from irrelevant background information. By cropping an image region containing complete QR code information from the preprocessed image based on the QR code's coordinate position, the focus on the core data area is achieved.

[0046] In a preferred embodiment of the present invention, step 4 above may include: Step 4.1: Within the image area of ​​the QR code, three positioning patterns are identified by scanning edge contour features, and the boundary range of each positioning pattern is determined. Specifically, this includes: scanning the edge contours of the QR code image area row by row and column by column, focusing on identifying areas with QR code positioning pattern features. The positioning pattern of the QR code is a fixed black and white alternating square structure, characterized by a black module at the center, surrounded by a ring of white modules, and then another ring of black modules on the outermost layer. During the scanning process, the edge contours of the positioning pattern are captured by abrupt changes in pixel grayscale values ​​from low grayscale values ​​of the black modules to high grayscale values ​​of the white modules, or vice versa. During the scanning process, the coordinates of each edge pixel are recorded. When a continuous cluster of edge pixels that conforms to the positioning pattern features is scanned, the area is initially determined to be a candidate area for the positioning pattern. The candidate regions were then screened to remove pseudo-positioning pattern regions caused by residual noise or blurred edges, ultimately determining three complete positioning patterns. After determining the three positioning patterns, the boundary range of each positioning pattern was further determined: all edge pixels of each positioning pattern were traversed, and the maximum, minimum, maximum, and minimum values ​​of the horizontal and vertical coordinates of these edge pixels were recorded. The minimum and maximum horizontal coordinates constitute the left and right boundaries of the positioning pattern, and the minimum and maximum vertical coordinates constitute the upper and lower boundaries of the positioning pattern. The rectangular area defined by these four values ​​is the boundary range of each positioning pattern.

[0047] Step 4.2: Based on the boundary range of each positioning pattern, calculate the geometric center of its internal pixels and record the coordinates of the geometric center as the center point of the positioning pattern. Specifically, this includes: for each positioning pattern, traversing all internal pixels within its boundary range, recording the horizontal and vertical coordinates of each internal pixel one by one, ensuring that no pixel within the boundary range is missed, and removing edge pixels on the boundary, retaining only the valid pixels inside the positioning pattern. Summing the horizontal coordinates of all recorded internal pixels to obtain the total horizontal coordinates; then summing the vertical coordinates of all internal pixels to obtain the total vertical coordinates. Counting the total number of pixels inside the positioning pattern, i.e., the number of valid internal pixels, the horizontal coordinate of the geometric center is calculated: the sum of the horizontal coordinates is divided by the total number of internal pixels, and the average value is the horizontal coordinate of the geometric center; the vertical coordinate of the geometric center is calculated: the sum of the vertical coordinates is divided by the total number of internal pixels, and the average value is the vertical coordinate of the geometric center. Combining the calculated horizontal and vertical coordinates of the geometric center to form the center point coordinates of the positioning pattern, and recording the center point coordinates of the three positioning patterns one by one to ensure accurate coordinate recording.

[0048] Step 4.3: Construct a spatial plane using the three recorded center points and calculate the fitted ellipse on the spatial plane; extract the geometric parameters of the fitted ellipse, including the length of the major axis, the length of the minor axis, and the rotation angle relative to the horizontal axis. Specifically, this involves using the coordinates of the center points of the three positioning patterns as three reference points of the spatial plane to construct a complete spatial plane. This spatial plane is parallel to the image area of ​​the QR code, accurately covering the core area of ​​the QR code, ensuring that the ellipse fitting reflects the overall deformation of the QR code. Subsequently, on this spatial plane, collect all valid pixels around the three positioning patterns. These pixels reflect the actual deformation state of the positioning patterns and are used as sample points for ellipse fitting. The least squares method is used for ellipse fitting. The specific calculation process is as follows: first, a preset ellipse equation is established, and the coordinates of all sample points are substituted into the preset ellipse equation. ,in, Let x be the x-coordinate of the sample points fitted to the ellipse. Let be the ordinate of the sample points fitted to the ellipse. The coefficients of the quadratic term on the horizontal axis control the scaling and curvature of the ellipse in the horizontal direction. The coefficients of the quadratic term on the ordinate control the scaling and curvature of the ellipse in the vertical direction. The coefficient of the first-order term on the abscissa controls the overall horizontal translation of the ellipse. The coefficient of the first-order term on the ordinate controls the overall vertical translation of the ellipse. The constant term helps determine the overall position of the ellipse in the image plane. The distance from each sample point to the preset ellipse is calculated. Then, by adjusting the parameters of the ellipse equation, the sum of the distances from all sample points to the ellipse is minimized. The resulting ellipse is the fitted ellipse, which accurately fits the actual deformation contour of the positioning pattern. After the fitted ellipse is generated, its core geometric parameters are extracted, including the length of the major axis, the length of the minor axis, and the rotation angle relative to the horizontal axis. The extraction and calculation process for each parameter is as follows: Major axis length: Traverse all pixels on the fitted ellipse, calculate the straight-line distance between any two pixels, and record the maximum value among all distances. This maximum value is the major axis length of the fitted ellipse. Minor axis length: Similarly, iterate through all pixels on the fitted ellipse, calculate the straight-line distance between any two pixels, and record the minimum value among all distances. This minimum value is the minor axis length of the fitted ellipse. Rotation angle relative to the horizontal axis: Locate the two endpoints of the major axis of the fitted ellipse, record their coordinates, calculate the difference between the x-coordinates and y-coordinates of the two endpoints, divide the difference in y-coordinates by the difference in x-coordinates, and the resulting ratio is the tangent of the major axis relative to the horizontal axis. Then, calculate the rotation angle of the major axis relative to the horizontal axis using the arctangent. This angle reflects the degree of rotational deformation of the QR code. Record the three extracted geometric parameters one by one to form the set of geometric parameters for the fitted ellipse.

[0049] Step 4.4: Obtain the standard ellipse parameters corresponding to the positioning pattern in the pre-stored standard QR code model. Specifically, this includes: To achieve accurate comparison between the fitted ellipse and the standard state, it is necessary to obtain the standard ellipse parameters corresponding to the positioning pattern in the pre-stored standard QR code reference image. These standard parameters are pre-calculated and stored based on the standard QR code positioning pattern without any deformation. The pre-stored standard QR code reference image is called. This standard QR code reference image is consistent with the specifications of the currently transmitted QR code, including the size, structure, and distribution of the positioning pattern, which are all completely matched to ensure the adaptability of the standard parameters. In the standard QR code reference image, the positioning pattern is a square structure without any geometric deformation. Ellipse fitting is performed on this standard positioning pattern. The fitting method is completely consistent with the fitting method in step 4.3 to obtain the standard ellipse. Then, following the method of extracting geometric parameters in step 4.3, the major axis length, minor axis length, and rotation angle relative to the horizontal axis of this standard ellipse are extracted. These three parameters are the standard ellipse parameters. Since the standard QR code has no deformation, the major axis length and minor axis length of its standard ellipse are equal, and the rotation angle is 0 degrees.

[0050] Step 4.5: Perform a difference calculation between the geometric parameters of the fitted ellipse and the parameters of the standard ellipse to obtain a parameter difference set including the scaling factor and angular rotation deviation. Use this parameter difference set as the comparison result. Specifically, this includes: after obtaining the geometric parameters of the fitted ellipse and the standard ellipse, quantifying the difference between them through difference calculation to obtain a parameter difference set including the scaling factor and angular rotation deviation. This comparison result accurately reflects the degree and direction of deformation of the QR code image. Next, calculate the scaling factor, which reflects the degree of scaling deformation of the QR code image. The calculation process consists of two steps: dividing the length of the major axis of the fitted ellipse by the length of the major axis of the standard ellipse to obtain the major axis scaling ratio; and dividing the length of the minor axis of the fitted ellipse by the length of the minor axis of the standard ellipse to obtain the minor axis scaling ratio. The scaling factor is calculated by adding the scaling ratios of the major and minor axes and then dividing by 2. A scaling factor greater than 1 indicates that the actual QR code image is magnified relative to the standard image; a scaling factor less than 1 indicates that the actual QR code image is shrunk relative to the standard image; a scaling factor equal to 1 indicates no scaling distortion. The angular rotation deviation is then calculated, reflecting the degree and direction of rotational distortion of the QR code image. The calculation process is as follows: subtract the rotation angle of the standard ellipse relative to the horizontal axis from the rotation angle of the fitted ellipse relative to the horizontal axis. The difference is the angular rotation deviation. A positive difference indicates that the actual QR code image rotates clockwise relative to the standard image; a negative difference indicates that the actual QR code image rotates counterclockwise relative to the standard image; a difference of 0 indicates no rotational distortion. Finally, the calculated scaling factor and angular rotation deviation are integrated to form a parameter difference set, which is used as the final result of this comparison.

[0051] In this embodiment of the invention, by scanning the edge contour features within the QR code image area to identify three positioning patterns and determine their boundary range, and then calculating the geometric center of the pixels inside the positioning pattern as the center point based on the boundary range, the core positioning reference point of the QR code is accurately locked, avoiding interference from blurred edges or local deformation of the positioning pattern on the extraction of the center point; by using the center points of the three positioning patterns to construct a spatial plane and fit an ellipse, geometric parameters such as the length of the major axis, the length of the minor axis, and the rotation angle relative to the horizontal axis are extracted, and the complex geometric deformation of the QR code caused by factors such as shooting angle and lens distortion is transformed into a quantifiable elliptical model, realizing the abstraction and modeling of the overall deformation characteristics of the QR code.

[0052] By obtaining the standard ellipse parameters corresponding to the positioning pattern in the pre-stored standard QR code model, and performing difference calculation between the geometric parameters of the fitted ellipse and the standard ellipse parameters, a set of parameter differences including the scale factor and angle rotation deviation is obtained. This accurately quantifies the degree and direction of deformation of the actual QR code image relative to the standard model, improving the accuracy and objectivity of deformation compensation.

[0053] In a preferred embodiment of the present invention, step 4 above may include: Step 4.6: Determine the image deformation boundary based on the geometric parameters of the fitted ellipse, and construct a planar region covering the QR code image area for image correction. Specifically, this includes: after extracting the geometric parameters of the fitted ellipse, accurately determining the deformation boundary of the QR code image based on the major axis length, minor axis length, and rotation angle of the fitted ellipse, and then constructing an image correction planar region covering the entire QR code image area. Combined with the geometric parameters of the fitted ellipse, analyze the overall deformation range of the QR code. Based on the edge of the fitted ellipse, expand the range outwards by a preset proportion. The expansion proportion is preset according to the size and degree of deformation of the QR code, ensuring that the expanded range completely covers all deformed parts within the QR code image area. To avoid expanding the area too much and including irrelevant background pixels, the image deformation boundary is determined based on the expanded area: using the center point of the fitted ellipse as a reference, and combining the lengths of the major and minor axes, the maximum, minimum, maximum, and minimum values ​​of the x-coordinate, y-coordinate, and g-coordinate of the deformation boundary are calculated. The minimum x-coordinate is equal to the x-coordinate of the fitted ellipse center point minus half the length of the major axis and then minus the expanded width. The maximum x-coordinate is equal to the x-coordinate of the fitted ellipse center point plus half the length of the major axis and then plus the expanded width. The minimum and maximum y-coordinates are calculated using the same method. The rectangular area defined by these four values ​​is the image deformation boundary. Based on this deformation boundary, a planar region for image correction is constructed.

[0054] Step 4.7: Construct a regular grid structure within the planar region, dividing the planar region into several rows and columns of grid units. Determine the intersection points of each grid unit as grid nodes. Specifically, this includes: Based on the size of the image-corrected planar region, preset the number of rows and columns of the grid division. The number of rows and columns is set according to the size and deformation complexity of the QR code; the more complex the deformation, the more rows and columns are needed to ensure that the grid units are small enough to accurately capture local deformation differences. Calculate the size of each grid unit: divide the width of the image-corrected planar region by the preset number of columns to obtain the width of each grid unit; divide the height of the image-corrected planar region by the preset number of rows to obtain the size of each grid unit. The height of the grid cells is determined to ensure that all grid cells are of uniform size, forming a regular grid structure. According to the calculated grid cell size, the image correction plane area is divided into several rows and columns of grid cells. During the division process, the distribution law of the regular grid is strictly followed to ensure that there is no overlap or gap between grid cells, and the entire image correction plane area is completely covered. The intersection point of each grid cell is determined as a grid node: all grid cells are traversed, and the coordinates of the four vertices of each grid cell are recorded. These vertices are the intersection points of the grid cells, which are the grid nodes. The horizontal and vertical coordinates of each grid node are recorded one by one to ensure that the coordinates of all grid nodes are recorded accurately.

[0055] Step 4.8: Calculate the actual distance from each grid node to the boundary of the fitted ellipse and compare it with the theoretical distance at the corresponding position in the standard QR code model to obtain the distance deviation of each grid node. Specifically, this includes: after determining all grid nodes, calculating the actual distance from each grid node to the boundary of the fitted ellipse one by one, and then comparing it with the theoretical distance at the corresponding position in the standard QR code reference image to obtain the distance deviation of each grid node. The degree of local deformation is quantified by the local deviation. The actual distance from each grid node to the boundary of the fitted ellipse is calculated as follows: for each grid node, traverse all pixels on the boundary of the fitted ellipse and calculate the straight-line distance between the grid node and each pixel on the ellipse boundary. The calculation method is as follows: subtract the abscissa of the ellipse boundary pixel from the abscissa of the grid node to obtain the abscissa difference, and multiply the abscissa difference by itself to obtain the square of the abscissa difference; subtract the ordinate of the ellipse boundary pixel from the ordinate of the grid node to obtain the ordinate difference, and multiply the ordinate difference by itself to obtain the square of the ordinate difference; add the two squared values, and take the square root of the sum to obtain the distance between the grid node and the ellipse boundary. The straight-line distance between boundary pixels is calculated. After traversal, the minimum value among all straight-line distances is selected as the actual distance from the grid node to the boundary of the fitted ellipse. The theoretical distance of the corresponding position in the standard QR code reference image is obtained: the position corresponding to the coordinates of the current grid node in the standard QR code reference image is found by aligning the center point of the positioning pattern of the standard QR code reference image with the center point of the fitted ellipse, scaling them according to the same ratio, and determining the position of the corresponding grid node in the standard image. The straight-line distance from the corresponding position to the boundary of the standard ellipse is calculated using the same method as calculating the actual distance, which is the theoretical distance. The distance deviation of each grid node is calculated: the actual distance of the grid node is subtracted from the corresponding theoretical distance, and the difference is the distance deviation. If the difference is positive, it means that the grid node is further away from the ellipse boundary relative to the standard position, and there is outward deformation. If the difference is negative, it means that the grid node is closer to the ellipse boundary relative to the standard position, and there is inward deformation. If the difference is 0, it means that the grid node has no local deformation. The degree of deformation of each local position is accurately quantified by the distance deviation.

[0056] Step 4.9 involves performing spatial distribution statistics on the distance deviations of all grid nodes, analyzing the changing trends of deviation values ​​within the planar region, and establishing a distance deviation distribution model. Specifically, this includes: classifying and statistically analyzing the distance deviations of all grid nodes: dividing the distance deviations into several intervals according to the magnitude of the deviation value, counting the number of grid nodes in each interval, and recording the coordinates of the grid node corresponding to each deviation value; clarifying the distribution location of different deviation values ​​within the image correction planar region; and analyzing the spatial changing trends of the deviation values: analyzing the changes in the deviation values ​​of grid nodes row by row and column by column from the center to the edge of the image correction planar region, and statistically analyzing the patterns of increase or decrease in deviation values, such as whether there is a trend of gradually increasing deviation values ​​from the center to the edge, or a concentration of positive or negative values ​​in a certain area. The model records areas with severe and slight deformation, and establishes a distance deviation distribution model by combining the distribution and trend of deviation values. The coordinates of grid nodes are used as independent variables, and the distance deviation value is used as the dependent variable. Through statistical analysis, the correlation between deviation values ​​and coordinate positions is constructed, clarifying the deviation patterns at different coordinate positions. This model clearly reflects the local deformation distribution within the entire image correction plane area, accurately describing the degree and direction of deformation for each grid node. This ensures that the correction parameter calculations specifically compensate for the deformation of each local area. The established distance deviation distribution model is then validated to check whether it accurately fits the deviation values ​​of all grid nodes. If there are nodes with large deviations, the model parameters are readjusted until the model accurately reflects the spatial distribution pattern of the deviation.

[0057] Step 4.10: Based on the distance deviation distribution model, calculate the image correction parameters containing pixel mapping relationships or geometric transformation coefficients. Specifically, this includes: analyzing the deformation type and degree of each grid node according to the distance deviation distribution model, and determining the direction and magnitude of adjustment required for each grid node: for grid nodes with positive distance deviations, adjustment is required towards the elliptical boundary, with the adjustment magnitude equal to the absolute value of the deviation; for grid nodes with negative distance deviations, adjustment is required away from the elliptical boundary, with the adjustment magnitude equal to the absolute value of the deviation; for grid nodes with no deviation, no adjustment is required. The process involves calculating pixel mapping relationships: using the coordinates of the corresponding grid node in the standard QR code reference image as the target coordinates and the coordinates of the current grid node as the original coordinates, a mapping relationship is established between the original and target coordinates. Specifically, the horizontal coordinate adjustment is obtained by subtracting the horizontal coordinate of the original coordinates from the horizontal coordinate of the target coordinates; the vertical coordinate adjustment is obtained by subtracting the vertical coordinate of the original coordinates from the vertical coordinate of the target coordinates. The original coordinates, target coordinates, and adjustment amounts of each grid node are recorded accordingly, forming a complete pixel mapping relationship. Through this mapping relationship, each pixel in the deformed image can be accurately mapped to the standard position. Simultaneously, the geometric transformation coefficients are calculated: combining the overall deformation such as scaling and rotation reflected by the distance deviation distribution model, geometric transformation coefficients are calculated, including scaling coefficients, rotation coefficients, and translation coefficients.

[0058] The scaling factor is calculated by dividing the length of the major axis of the standard ellipse by the length of the major axis of the fitted ellipse to obtain the overall scaling factor. Then, the scaling factor of each grid node is fine-tuned by combining the local deviation value. The rotation factor is calculated by calculating the coefficient of the rotation matrix based on the angular rotation deviation, which is used to compensate for the rotational deformation of the QR code. The translation factor is calculated by subtracting the coordinates of the center point of the fitted ellipse from the coordinates of the center point of the standard ellipse to obtain the translation amount, which is used to compensate for the translational deformation of the QR code. The pixel mapping relationship and geometric transformation coefficients obtained by solving are integrated to form a complete image correction parameter, ensuring that the parameter accurately adapts to the overall and local deformation of the QR code.

[0059] In this embodiment of the invention, the image deformation boundary is determined based on the geometric parameters of the fitted ellipse, and a correction plane region covering the entire QR code image area is constructed. This precisely defines the effective range of image correction, avoiding both the ineffective computational overhead caused by an excessively large correction area and the problem of missing deformation areas due to an excessively small correction area. This ensures that the correction operation fully covers the deformation area of ​​the QR code, providing a reasonable spatial range for accurate correction.

[0060] By constructing a regular grid structure within the correction plane region, the plane is divided into several rows and columns of grid units, and the intersection points of the grid units are used as grid nodes. This achieves a fine division of the correction region, decomposing the overall geometric deformation of the QR code into the local deviation of each grid node. This breaks through the limitation of insufficient accuracy in traditional overall correction and improves the fineness and targeting of image correction. By calculating the actual distance from each grid node to the boundary of the fitted ellipse and comparing it with the theoretical distance of the corresponding position in the standard QR code model, the precise distance deviation of each grid node is obtained. This achieves point-by-point quantitative analysis of the local deformation of the QR code, avoiding the local correction deviation caused by only estimating the overall deformation in traditional correction.

[0061] Spatial distribution statistics of distance deviations for all grid nodes are performed, the spatial variation trend of deviation values ​​is analyzed, and a distance deviation distribution model is established to uncover the spatial distribution pattern of deviations. This clearly presents the overall trend and local characteristics of QR code deformation, solving the problem of inaccurate calculation of correction parameters caused by dispersed and irregular deviations. Based on the distance deviation distribution model, image correction parameters containing pixel mapping relationships or geometric transformation coefficients are calculated to ensure that the correction parameters accurately match the actual deformation characteristics of the QR code. These parameters can be used to perform targeted geometric correction on the QR code image, effectively compensating for complex deformations caused by shooting angle, lens distortion, etc., and improving correction accuracy.

[0062] In a preferred embodiment of the present invention, step 5 above may include: Step 5.1: Perform geometric transformation correction on the QR code image region using the image correction parameters to obtain the corrected QR code image. Specifically, this includes: calling the calculated image correction parameters, including pixel mapping relationships and geometric transformation coefficients, scaling coefficients, rotation coefficients, and translation coefficients, to ensure that all parameters are complete and accurate, providing a reliable basis for geometric transformation correction.

[0063] Overall deformation compensation: Based on the scaling, rotation, and translation coefficients in the geometric transformation coefficients, the entire QR code image area is adjusted. For scaling, the x and y coordinates of each pixel within the QR code image area are multiplied by the scaling coefficient to obtain the scaled pixel coordinates. For rotation, the x coordinate of each pixel is multiplied by the cosine value of the rotation coefficient, and the y coordinate is multiplied by the sine value of the rotation coefficient to obtain the rotated x coordinate. The x coordinate is then multiplied by the sine value of the rotation coefficient and added to the y coordinate multiplied by the cosine value of the rotation coefficient to obtain the rotated y coordinate. For translation, the x coordinate of the rotated and scaled pixel is added to the x-coordinate of the translation coefficient, and the y coordinate of the rotated and scaled pixel is added to the y-coordinate of the translation coefficient to complete the overall deformation compensation.

[0064] Local deformation compensation: Based on pixel mapping relationships, precise adjustments are made to the local regions corresponding to each grid node. For each pixel, its target coordinates in the pixel mapping relationship are found. The original coordinates are subtracted from the target coordinates to obtain the adjustment amount for that pixel. The horizontal coordinate of the original pixel is added to the horizontal coordinate adjustment amount, and the vertical coordinate is added to the vertical coordinate adjustment amount to achieve precise compensation for local deformation, ensuring that the deformation of each local region is specifically corrected. During the correction process, the module integrity of the data area and error correction area in the QR code image is strictly maintained, without changing the original data information. At the same time, it is ensured that the edges of the corrected QR code image are clear, the modules are regular, and the structure is consistent with the standard QR code reference pattern. After correction, a regular, clear, and deformation-free corrected QR code image is obtained.

[0065] Step 5.2: Decode the corrected QR code image to restore the binary bitstream, and use forward error correction codewords for error correction verification to recover the compressed data block with identification. Specifically, this includes: Decoding the corrected QR code image: Scan the corrected QR code image row by row and column by column, identify the brightness state of each matrix module, convert black modules to 1 and white modules to 0, and concatenate the values ​​of all modules sequentially according to the mapping order during QR code encoding to restore a continuous binary bitstream. This ensures that the binary bitstream can completely reflect the compressed data block information, retaining only the core bitstream carrying the data. Error correction verification is performed using forward error correction codewords. The specific calculation process is as follows: Extract the error correction codewords contained in the binary bitstream. The codeword is used to extract the original compressed data portion from the bitstream. This original compressed data portion is then processed using the inverse operation of forward error correction coding to obtain a check remainder. This check remainder is compared with the extracted error correction codeword, and the difference is calculated. If the difference is 0, the original compressed data is undamaged, and the corresponding compressed data block of the binary bitstream is directly retained. If the difference is not 0, the original compressed data is damaged. The error correction codeword is subtracted from the check remainder to obtain a correction value for the damaged data. This correction value is then filled into the damaged position of the original compressed data to complete the data repair. After error correction and verification, the repaired binary bitstream is converted into the corresponding compressed data format, and the identification information contained in the data is extracted. Finally, the compressed data block with the identification is recovered.

[0066] Step 5.3: Read the block header information of each compressed data block, extract the sequence number, and sort and concatenate multiple compressed data blocks according to the sequence number to obtain the reconstructed data. Specifically, this includes: reading the block header information of each compressed data block one by one. The block header information contains the sequence number of the current data block and the total number of all data blocks. During the reading process, ensure that the sequence number of each data block is accurately extracted to avoid sorting disorder due to incorrect sequence number reading. Sort all compressed data blocks: first count the total number of extracted sequence numbers and compare it with the total number in the block header information. If the numbers are the same, it means that all data blocks have been completely restored without any missing data; if the numbers are different, it means that there are missing data blocks. If a data block is missing, return to step 5.2 for decoding and error correction verification until all data blocks are recovered. After confirming the quantity is correct, sort all compressed data blocks according to their sequence numbers from 1 to the total number, ensuring that each data block is in its original transmission order and preventing data blocks from being out of order or reversed. After sorting, concatenate all the sorted compressed data blocks: using the compressed data content of the first data block as the starting point, concatenate the compressed data content of each data block after the first one. During the concatenation process, strictly preserve the compressed data content of each data block, without adding any redundant data or omitting any data fragments, ensuring that the concatenated data stream is continuous and complete. After concatenation, the reconstructed data is obtained.

[0067] Step 5.4: Perform lossless decompression on the recombined data to obtain serialized data, and restore the serialized data to complete transmission data. Specifically, this includes: determining a lossless decompression algorithm that corresponds exactly to the lossless compression algorithm used in Step 2.3, ensuring accurate restoration of the original data without loss of any information during decompression. Then, perform segment-by-segment decompression on the recombined data: traverse the complete compressed data stream after recombination, identify redundant information and encoding identifiers in the compressed data, and perform restoration calculations on the redundant information according to the rules of the lossless decompression algorithm. Specifically, according to the encoding rules during compression, reverse the conversion of the compressed encoded data into original data units, replace the encoding with the original data unit corresponding to each encoding identifier, and simultaneously split and restore the duplicate data units merged during compression, gradually restoring continuous serialized data to ensure that the decompressed serialized data is completely consistent with the generated serialized data in terms of format and content. After obtaining the serialized data through decompression, perform restoration processing on the serialized data, converting the byte stream serialized data into the original multi-source heterogeneous data format: according to the reverse serialization encoding... The process involves reading the byte alignment and length identifiers from the serialized data. Based on the length identifier, the continuous byte stream is split into multiple structured data records. Then, according to a preset heterogeneous data mapping rule table, the standard format of the structured data records is reverse-converted to the format of each original data source, including the reverse conversion of field names, data types, and units of measurement. Simultaneously, the structured data records are restored to the structure of the initial dataset to be transmitted, according to the timestamp order. After restoration, the complete transmission data is subjected to integrity verification: checking whether the restored data contains all the content of the original data to be transmitted, whether there is any missing data, errors, or format abnormalities, and comparing the attributes of the restored data with those of the original data to be transmitted to ensure complete consistency. After the verification passes, the complete transmission data is finally obtained.

[0068] In this embodiment of the invention, image correction parameters are used to perform geometric transformation correction on the QR code image area, which accurately compensates for problems such as perspective distortion and angle offset in the image, resulting in a regular and clear corrected QR code image. This effectively improves the QR code decoding success rate, avoids decoding failure due to image distortion, and ensures the normal parsing of cross-network transmitted data.

[0069] Decoding the corrected QR code image and combining it with forward error correction codewords to complete error correction verification can automatically repair erroneous data and restore the identified compressed data blocks when local data interference or loss occurs during transmission, further improving the fault tolerance and integrity of data transmission and ensuring the accuracy of data recovery. By reading the block header information of the compressed data blocks, multiple data blocks are ordered and spliced ​​according to the sequence number, ensuring that data fragments are accurately reassembled according to the original splitting order, avoiding data disorder or parsing failure caused by data disorder, and ensuring that the data reconstruction logic is rigorous and the results are reliable.

[0070] The system performs lossless decompression on the recombined data and restores it to complete transmission data. It recovers standardized multi-source heterogeneous fused data without losing any original information, and completely restores the original data content before cross-network transmission, realizing secure, complete, and efficient one-way cross-network transmission and restoration of multi-source heterogeneous data.

[0071] like Figure 2 As shown, embodiments of the present invention also provide a cross-network unidirectional data transmission system based on multi-source heterogeneous data fusion, comprising: The acquisition module is used to acquire the data to be transmitted, perform serialization processing on the data to be transmitted, and obtain serialized data. The compression module is used to divide and compress serialized data into blocks to obtain multiple compressed data blocks; each compressed data block is encoded with a QR code and forward error correction coding is applied to obtain a QR code data block with error correction code; The extraction module is used to transmit QR code data blocks with error correction codes one-way across the network to obtain optical carrier signals; convert optical carrier signals into image data; preprocess the image data and detect regions of interest to extract the image region of the QR code; The calculation module is used to select the center points of three positioning patterns of the QR code within the image area of ​​the QR code, perform ellipse fitting through the three center points, compare the fitted ellipse parameters with the ellipse parameters corresponding to the standard QR code positioning pattern to obtain the comparison result; based on the comparison result, construct a planar region for image correction, divide the planar region into regular grids, and obtain the image correction parameters according to the distribution characteristics of the distance deviation between the grid nodes and the ellipse boundary after division. The correction module is used to perform geometric correction on the extracted QR code image region using image correction parameters to obtain a corrected QR code image; decode and perform forward error correction decoding on the corrected QR code image to obtain multiple compressed data blocks; reassemble the multiple compressed data blocks to obtain reassembled data; and decompress the reassembled data to obtain complete transmission data.

[0072] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A method for one-way cross-network data transmission based on multi-source heterogeneous data fusion, characterized in that, The method includes: Step 1: Obtain the data to be transmitted, and perform serialization processing on the data to be transmitted to obtain serialized data; Step 2: Divide and compress the serialized data to obtain multiple compressed data blocks; encode each compressed data block into a QR code and apply forward error correction coding to obtain a QR code data block with error correction code. Step 3: Transmit the QR code data block with error correction code unidirectionally across the network to obtain the optical carrier signal; convert the optical carrier signal into image data, preprocess the image data and detect the region of interest to extract the image region of the QR code; Step 4: Within the image area of ​​the QR code, select the center points of the three positioning patterns of the QR code, perform ellipse fitting through the three center points, and compare the fitted ellipse parameters with the ellipse parameters corresponding to the standard QR code positioning pattern to obtain the comparison results; based on the comparison results, construct a planar region for image correction, divide the planar region into regular grids, and obtain the image correction parameters based on the distribution characteristics of the distance deviation between the grid nodes and the ellipse boundary after division. Step 5: Using image correction parameters, perform geometric correction on the extracted QR code image region to obtain the corrected QR code image; decode and perform forward error correction decoding on the corrected QR code image to obtain multiple compressed data blocks; reassemble the multiple compressed data blocks to obtain reassembled data; decompress the reassembled data to obtain complete transmission data.

2. The cross-network unidirectional data transmission method based on multi-source heterogeneous data fusion according to claim 1, characterized in that, Step 1: Obtain the data to be transmitted, and perform serialization processing on the data to be transmitted to obtain serialized data, including: Receive data update events from multi-source heterogeneous databases; the multi-source heterogeneous databases refer to a collection of multiple databases from different business systems, using different data models, storage structures, or communication protocols, including various combinations of relational databases, non-relational databases, time-series databases, and file-based data sources, and the databases differ in data format, field naming rules, timestamp precision, and encoding methods; the data update event carries data source identifier, change type, and timestamp information; Based on the data source identifier in the data update event, the changed data segments that match the change type are extracted from the corresponding database, and the changed data segments are aggregated in timestamp order to form an initial dataset to be transmitted. The initial dataset to be transmitted is formatted and mapped by the pre-configured heterogeneous data mapping rule table. The field names, data types and units of measurement of data from different sources are converted into standard formats to obtain structured data records. The structured data record is serialized and encoded according to a preset byte alignment rule and length identification strategy, converting the structured data record into a continuous byte stream format to obtain serialized data.

3. The cross-network unidirectional data transmission method based on multi-source heterogeneous data fusion according to claim 2, characterized in that, Step 2: Divide and compress the serialized data to obtain multiple compressed data blocks; Each compressed data block is encoded into a QR code and forward error correction coding is applied to obtain a QR code data block with error correction code, including: Calculate the total byte length of the serialized data; According to the preset upper limit of single block data capacity, the serialized data is cut into several continuous data segments, and block header information is encapsulated for each data segment. The block header information includes the sequence number of the corresponding segment and the total number of segments, forming an original data block with an identifier. Perform lossless compression on each of the original data blocks with the identifier to obtain multiple compressed data blocks; Each compressed data block is converted into a binary bit stream, mapped to a QR code matrix module according to the QR code encoding standard, and an initial QR code image is generated. Forward error correction coding is performed on the data region in the initial QR code image to generate corresponding error correction codewords. The error correction codewords are then filled into the error correction region of the QR code matrix to obtain a QR code data block with error correction code.

4. The cross-network unidirectional data transmission method based on multi-source heterogeneous data fusion according to claim 3, characterized in that, Step 3: Transmit the QR code data block with error correction code unidirectionally across the network to obtain the optical carrier signal; The optical carrier signal is converted into image data, the image data is preprocessed and a region of interest is detected, and the image region of the QR code is extracted, including: The QR code data block with error correction code is rendered into a visible light pattern to form an optical carrier signal; The optical carrier signal is captured, and the captured light signal is converted into digital image data; The digital image data is preprocessed to obtain a preprocessed image; Region of interest detection is performed on the preprocessed image to identify the feature contours of the QR code positioning pattern and determine the coordinate position of the QR code in the image; Based on the coordinates of the QR code in the image, the image region containing the complete QR code information is cropped from the preprocessed image to obtain the QR code image region.

5. The cross-network unidirectional data transmission method based on multi-source heterogeneous data fusion according to claim 4, characterized in that, Step 4: Within the QR code image area, select the center points of the three positioning patterns of the QR code. Perform ellipse fitting through the three center points, and compare the fitted ellipse parameters with the ellipse parameters corresponding to the standard QR code positioning pattern to obtain the comparison results, including: Within the image area of ​​the QR code, three positioning patterns are identified by scanning the edge contour features, and the boundary range of each positioning pattern is determined. Based on the boundary range of each positioning pattern, calculate the geometric center of its internal pixels, and record the coordinate value of the geometric center as the center point of the positioning pattern. A spatial plane is constructed using the three recorded center points, and the fitted ellipse on the spatial plane is calculated; the geometric parameters of the fitted ellipse are extracted, including the length of the major axis, the length of the minor axis, and the rotation angle relative to the horizontal axis. Obtain the standard ellipse parameters corresponding to the positioning pattern in the pre-stored standard QR code model; The geometric parameters of the fitted ellipse are compared with those of the standard ellipse to obtain a set of parameter differences, including the scale factor and angular rotation deviation. This set of parameter differences is used as the comparison result.

6. The cross-network unidirectional data transmission method based on multi-source heterogeneous data fusion according to claim 5, characterized in that, Based on the comparison results, a planar region for image correction is constructed. This planar region is then divided into a regular grid. Based on the distribution characteristics of the distance deviation between the grid nodes and the elliptical boundary, image correction parameters are obtained, including: The image deformation boundary is determined based on the geometric parameters of the fitted ellipse, and a planar region covering the QR code image area is constructed for image correction. A regular grid structure is constructed within the planar region, dividing the planar region into several rows and several columns of grid cells, and the intersection of each grid cell is determined as a grid node; Calculate the actual distance from each grid node to the boundary of the fitted ellipse, and compare it with the theoretical distance at the corresponding position in the standard QR code model to obtain the distance deviation of each grid node; Spatial distribution statistics of distance deviations for all grid nodes are performed, the trend of deviation values ​​in the planar region is analyzed, and a distance deviation distribution model is established. Based on the distance deviation distribution model, image correction parameters containing pixel mapping relationships or geometric transformation coefficients are calculated.

7. The cross-network unidirectional data transmission method based on multi-source heterogeneous data fusion according to claim 6, characterized in that, Step 5: Using image correction parameters, perform geometric correction on the extracted QR code image region to obtain the corrected QR code image; decode and perform forward error correction decoding on the corrected QR code image to obtain multiple compressed data blocks. Multiple compressed data blocks are reassembled to obtain the reassembled data; The recombined data is decompressed to obtain the complete transmitted data, including: The image correction parameters are used to perform geometric transformation correction on the QR code image region to obtain the corrected QR code image. The corrected QR code image is decoded to restore the binary bit stream, and forward error correction codewords are used for error correction verification to recover the compressed data block with the identifier. Read the block header information of each compressed data block, extract the sequence number, and sort and concatenate multiple compressed data blocks according to the sequence number to obtain the recombined data; Perform corresponding lossless decompression operations on the recombined data to obtain serialized data, and then restore the serialized data to complete transmission data.

8. A cross-network unidirectional data transmission system based on multi-source heterogeneous data fusion, wherein the system implements the method as described in any one of claims 1 to 7, characterized in that, include: The acquisition module is used to acquire the data to be transmitted, perform serialization processing on the data to be transmitted, and obtain serialized data. The compression module is used to divide and compress serialized data into blocks, resulting in multiple compressed data blocks. Each compressed data block is encoded with a QR code and forward error correction is applied to obtain a QR code data block with error correction code. The extraction module is used to transmit QR code data blocks with error correction codes one-way across the network to obtain optical carrier signals; convert optical carrier signals into image data; preprocess the image data and detect regions of interest to extract the image region of the QR code; The calculation module is used to select the center points of the three positioning patterns of the QR code within the image area of ​​the QR code, perform ellipse fitting through the three center points, and compare the fitted ellipse parameters with the ellipse parameters corresponding to the standard QR code positioning pattern to obtain the comparison results. Based on the comparison results, a planar region for image correction is constructed. The planar region is divided into regular grids. Based on the distribution characteristics of the distance deviation between the grid nodes and the elliptical boundary after division, the image correction parameters are obtained. The correction module is used to perform geometric correction on the extracted QR code image region using image correction parameters to obtain a corrected QR code image; decode and perform forward error correction decoding on the corrected QR code image to obtain multiple compressed data blocks; reassemble the multiple compressed data blocks to obtain reassembled data; and decompress the reassembled data to obtain complete transmission data.

9. A computing device, characterized in that, include: One or more processors; A storage device for storing one or more programs, which, when executed by one or more processors, cause the one or more processors to implement the method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a program that, when executed by a processor, implements the method as described in any one of claims 1 to 7.