Method for converting file into recognizable color data matrix image

The color data matrix image is generated through the combination of bitstream and RGB arrangement and multi-process matrix operations, which solves the problems of small and slow storage capacity of traditional QR codes and realizes efficient data transmission.

CN120298513APending Publication Date: 2025-07-11LHASA JIAHUI TECH CO LTD
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202311572110.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-23
Publication Date
2025-07-11

AI Technical Summary

Technical Problem

The image single image generated under physical isolation conditions can have a small storage capacity and slow computing speed, which affects the data transmission rate.

Method used

The color value conversion is performed by combining bit streams and RGB arrangement, and the speed of bit stream color value images is improved through multi-process matrix operations to generate color data matrix images.

Benefits of technology

The information storage capacity is significantly improved at the same pixel size, and the encoding speed is 10 times faster, achieving stable, reliable and fast data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120298513A_ABST
    Figure CN120298513A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of information security, and discloses a method for converting a file into a recognizable color data matrix image, on one hand, color value conversion is carried out through a bit stream and RGB permutation and combination mode, the information amount capable of being embedded in a single image is far greater than the information amount contained in a recognizable color two-dimensional code under the same pixel, and the image quality is improved; and on the other hand, the speed of the bit flow color value image is improved based on a multi-process matrix operation mode, so that the overall file coding speed is improved, and possibility is created for realizing stable, reliable and rapid data transmission under a physical isolation condition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information security technology, and particularly relates to a method for converting a file into an identifiable color data matrix image. Background Art

[0002] The rapid development of information communication technology and Internet technology has changed our way of life and work, improving our work efficiency, but also bringing many security problems, such as network information leakage, viruses, etc. These problems seriously threaten the information security of enterprises and institutions. The traditional information security protection technology only detects and controls data transmission at the software level, and cannot meet the requirements of physical isolation between the classified network and the external insecure network.

[0003] Currently, for information transmission between completely physically isolated networks, there are already relatively effective solutions, such as using two-dimensional code technology and combining with a simulated human eye recognition device to transmit data between isolated networks. However, traditional identifiable image information carriers include black-and-white or color two-dimensional codes, which usually can only store limited information. The high-density information storage color image technology can store more data in the same area by encoding color information and removing redundant information, creating the possibility for rapid transmission of a large amount of data under physical isolation conditions.

[0004] For example, the invention patent with the publication number CN107169540A discloses an information transmission system, method and device. The patent first encodes each character in the information to be sent by a server to generate an information encoding set, and sends the information encoding set to a display terminal; then the display terminal, according to a pre-stored relationship table, displays the colors indicated by the color sequences corresponding to the information encodings in the information encoding set in a first color block matrix generated based on the information encoding set; then when a scanning terminal scans the first color block matrix, it generates a first information encoding set according to the relationship table and sends the first information encoding set to the server; finally, after the server determines that the first information encoding set matches the information encoding set, it sends the information to be sent to the scanning terminal, thereby facilitating the improvement of the reliability of information transmission.

[0005] By analyzing this prior art, it is found that the single-image storage capacity generated by it is small, and the operation speed of the entire image generation process is slow, seriously affecting the data transmission rate under physical isolation conditions. Summary of the Invention

[0006] To solve the problems and deficiencies existing in the above-mentioned prior art, the present invention proposes a method for converting a file into an identifiable color data matrix image. The present invention performs color value conversion through the combination of bit streams and RGB arrangements. The amount of information that can be embedded in a single image far exceeds the amount of information that can be accommodated by an identifiable color QR code with the same number of pixels. Then, based on the method of multi-process matrix operation, the speed of converting bit streams into color value images is increased, thereby improving the overall file encoding speed, creating the possibility for stable, reliable, and fast data transmission under physical isolation conditions.

[0007] To achieve the above-mentioned invention purpose, the technical solution of the present invention is as follows:

[0008] A method for converting a file into an identifiable color data matrix image, the method comprising the following steps:

[0009] S01. Read the binary data length of the file to be transmitted, and calculate the number of images that can be generated from the current file to be transmitted according to the length of the binary data and the length value row and width value col of the color image to be generated;

[0010] S02. Divide the binary data of the file to be transmitted into n bit streams with a length of row*col*3, and then perform matrix operations on the bit stream data with a length of row*col*3 respectively to convert it into a corresponding three-dimensional matrix M1 i (row, col, 3);

[0011] S03. Convert the detailed file information into bit stream data as the header information and then perform matrix operations to convert it into a three-dimensional matrix M2 i (2, col, 3);

[0012] S04. Perform row exclusive OR and column exclusive OR operations on the data matrix M1 i The obtained row and column exclusive OR values are concatenated and then converted into a three-dimensional matrix M3 i (2, col, 3), and the matrix M2 i 、M3 i and M1 i are concatenated in sequence. The concatenated data matrix is M4 i (row + 4, col, 3). The data matrix M4 i is stored as a vector graph, and finally a color image is formed.

[0013] Preferably, when n is a decimal, the binary data of the file to be transmitted is filled with data, and the filled data is bit(0). After filling the bit(0) data, the binary data length of the current file to be transmitted becomes L'.

[0014] Preferably, the calculation expression for calculating the number n of color images that can be generated from the currently to-be-transmitted file is n = L / (row * col * 3).

[0015] Preferably, the file detailed information includes the file name and size, the bit stream data of the i-th block of row * col * 3 in the current encoding, the number of filled bits (0), and the file reception time.

[0016] Preferably, when performing data filling, the number of filled bits (0) is a, a = (row * col * 3) - L % (row * col * 3), and L' = L + a.

[0017] Preferably, in the data matrix M4 i Before being stored as a vector graph, it further includes magnifying the data matrix M4 i According to a preset magnification factor.

[0018] Advantages of the present invention:

[0019] 1. The data matrix color image generated and converted by the present invention can store a much larger information capacity than traditional two-dimensional codes under the same pixel size, and the image generation speed is nearly 10 times faster than that of traditional two-dimensional codes. The encoding speed can reach 10 MB / s, which can greatly improve the data transmission rate under physical isolation conditions.

[0020] 2. The exclusive OR matrix calculation and verification method adopted by the present invention is not only faster than traditional two-dimensional codes in terms of encoding speed, but also can play a role in data error correction within a certain range. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The foregoing and following specific descriptions of the present invention become clearer when read in conjunction with the following drawings, in which:

[0022] Figure 1 is the flowchart of the method of the present invention;

[0023] Figure 2 is the color matrix image generated by the present invention;

[0024] Figure 3 is the schematic diagram of bit color value conversion of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0025] In order to enable those skilled in the art to better understand the technical solutions in the present invention, the technical solutions for achieving the object of the present invention will be further described below through specific embodiments. It should be noted that the technical solutions claimed by the present invention include but are not limited to the following embodiments. Based on the embodiments in the present invention, all other embodiments obtained by those skilled in the art without creative efforts shall fall within the protection scope of the present invention.

[0026] The rapid development of information and communication technology and Internet technology has changed our way of life and work, improved our work efficiency, but also brought many security problems, such as network information leakage, viruses, etc. These problems seriously threaten the information security of enterprises and institutions. The traditional information security protection technology only detects and controls data transmission at the software level and cannot meet the requirements of physical isolation between classified networks and external insecure networks. Physical isolation means that the internal network shall not be directly or indirectly connected to the public network to avoid the internal network information being attacked by hackers from the external network. The one-way transmission communication method of data communication between the two networks with physical isolation is more reliable and secure.

[0027] At present, for the information transmission between completely physically isolated networks, there are already relatively effective solutions, such as using two-dimensional code technology and combining with analog human eye recognition devices to transmit data between isolated networks. However, traditional recognizable image information carriers, including black-and-white or color two-dimensional codes, usually can only store limited information. The high-density information storage color image technology can store more data in the same area by encoding color information and removing redundant information, creating the possibility of quickly transmitting a large amount of data under physical isolation conditions.

[0028] Based on this, the embodiments of the present invention propose a method for converting a file into a recognizable color data matrix image. On the one hand, the present invention performs color value conversion through the combination of bit stream and RGB arrangement. The amount of information that can be embedded in a single image far exceeds the amount of information that can be accommodated by a recognizable color two-dimensional code with the same number of pixels. On the other hand, based on the multi-process matrix operation method, the speed of converting the bit stream into a color value image is increased, thereby improving the overall file encoding speed, creating the possibility of realizing stable, reliable and fast data transmission under physical isolation conditions.

[0029] First of all, it should be noted that when data transmission is performed in a physically isolated network, two networks A and B are usually set up first, which are physically isolated through a unidirectional isolation channel and have different security levels. Then, an encoding device and a display device are set up in the sending host system connected to network A, and a decoding device and an image acquisition device are set up in the receiving host system connected to network B. When data transmission is performed, the encoding device encodes the data transmitted by network A received by the encoding host system, generates corresponding image data, and then sends the image to the display device for display. Then, the image acquisition device in the receiving host system is used to identify the image data received on the display device, and transmits it to the decoding device. Finally, the decoding device decodes the image to obtain the relevant data contained in the image, and finally realizes the transmission of data in a physically isolated network. The method for converting a file to a recognizable color data matrix image proposed by the present invention is a file encoding process performed in the sending host system, which will eventually generate a color image recognizable by the receiving host system. After the decoding device performs a specified decoding operation on the color image, the information data contained in the image can be obtained.

[0030] This embodiment discloses a method for converting a file into a recognizable color data matrix image. Figure 1 , the method mainly comprises the following steps:

[0031] S01. First, the length value of the color image to be generated is set to row, and the width value is set to col in the encoding device. Then, the encoding device reads the length L of the binary data of the file to be transmitted, and calculates the number n of color images that can be generated by the current file to be transmitted according to the values ​​of L, row and col through the following calculation expression;

[0032] n=L / (row*col*3).

[0033] In some embodiments, the encoding device usually needs to verify the integrity of the file before reading the binary information of the file to prevent incomplete data when later transcoding to generate a color image. The specific verification method is as follows:

[0034] The integrity of the file is determined by calculating in real time whether the size of the incoming file is growing: if the file is growing, the file size at the current moment is repeatedly compared with the size of the file at the previous moment until the two sizes are consistent, and then the integrity check is exited. In other words, when the file is repeatedly tested, if the file size does not change within the specified time range (the range is very small, between 0.1s-1s), it proves that the tested file has no problems and is a complete file.

[0035] After completing the file integrity check, for extremely large files such as several gigabytes, loading them into memory all at once and performing transcoding calculations may cause memory overflow. Therefore, large files need to be split into small files before encoding. That is, after completing the file integrity check, read the binary information of the file and store it in the computer memory in slices. The slice size can be customized. By default, the present invention uses a 1GB method for slicing operations, which can accurately control the amount of data loaded into the computer memory each time.

[0036] In some embodiments, generally, the length L of the binary data of a file is not exactly a multiple of row*col*3. That is to say, the finally calculated number of images n is not a positive integer but a decimal. Therefore, when the calculation result n is a decimal, it means that the last generated image is an incomplete image. So we need to fill the file with data to make the length of the binary data of the file to be transmitted satisfy that the filled length is a multiple of row*col*3. The filled data is bit(0). Then the number of bit(0) to be filled, a, is (row*col*3)-mod(L, (row*col*3)). After filling the bit(0) data, the binary length of the current file to be transmitted becomes L’ = L + a. At this time, the number of color images that the file to be transmitted can generate, n = L’ / (row*col*3).

[0037] In the present invention, a color data matrix image has row rows and col columns, so there can be row*col color blocks. And a color block can contain 2 3 possibilities, that is, 8 colors. So the number of binary digits (i.e., length) that a single code can accommodate is row*col*3.

[0038] Step S02. After step S01, the encoding device starts to perform matrix operations to generate a three-dimensional data matrix M1 i , since matrix operations are all CPU-intensive operations, the present invention uses multiple processes for operation acceleration. Compared with a single process, the operation efficiency of multiple processes is related to the number of multiple processes used. The specific matrix operation method is as follows: divide the bit stream data of the file to be transmitted read into n bit streams with a length of row*col*3, and then perform matrix operations on the n bit streams of row*col*3 data respectively to convert them into corresponding three-dimensional data matrices M1 i (row, col, 3), where i represents the i-th bit stream data after segmentation.

[0039] Here, it should be noted that if the length of the bit-stream data of the file to be transmitted is not filled, it is the original L. If data filling is performed, the data stream length becomes L'. Also, if no data filling is done, the number n of the segmented bit streams is the same as the number of color images that can be generated calculated in step S01. If data filling is performed, then the number n of the segments is the same as the number of images that can be generated after data filling.

[0040] In the present invention, it should also be noted that row also represents the number of rows of the generated color data matrix image, and col also represents the number of columns of the generated color data matrix image. Therefore, the matrix operation method is to convert the bit-stream information of length row * col * 3 into a three-dimensional matrix, where the x, y, and z of the three-dimensional matrix are row, col, and 3 respectively.

[0041] Step S03. The encoding device converts the file detailed information including the file name and size, the bit-stream data of the i-th block row * col * 3 currently encoded, the number a of bits (0) filled in the file, the file reception time, etc. into bit-stream data as the packet header information and then performs matrix operation to convert it into a three-dimensional data matrix M2 i (2, col, 3).

[0042] In the present invention, the file reception time can be understood as the time when the sending-end host system receives the file data transmitted by Network A.

[0043] Step S04. The encoding device performs row exclusive OR calculation and column exclusive OR calculation on the three-dimensional data matrix M1 i and splices the obtained row and column exclusive OR values and then performs matrix operation to convert it into a three-dimensional data matrix M3 i (2, col, 3), and then splices the matrices in the order of M2 i , M3 i , M1 i to finally form a three-dimensional data matrix M4 i (row + 4, col, 3). The matrix M4 i is used as the matrix data of the finally generated image, and then this matrix is stored as a vector image through opencv to complete the overall encoding operation of the file, and finally generate a color image, which will finally be played and displayed through the display device in the sending-end system.

[0044] In some embodiments, in order to achieve a recognizable effect, it is necessary to perform matrix magnification on all color blocks in the image. Therefore, according to the three-dimensional data matrix M4 i(row + 4, col, 3) performs the magnification operation on rows and columns. The predefined magnification factor of the present invention is 7, and the finally generated image data matrix is (7 * (row + 4), 7 * col, 3).

[0045] In the present invention, the generation of a color image performs color value conversion by the arrangement and combination of bitstreams and RGB (Table 1). Refer to the attached Figure 2 As shown, the bitstream 000001010100110101011 is converted into the corresponding image as black + blue + green + red + yellow + purple + cyan + white. The complete color data matrix image is as Figure 3 shown. In addition, the present invention improves the speed of the bitstream-to-color value image based on matrix operations, thereby improving the overall encoding speed, and the encoding speed reaches 10 MB / s. For example, assume that the color data matrix image created by the present invention is full-screen displayed on a screen with a size of 2560 * 1440, and is correctly captured and decoded by the decoding device on the intranet side. The present invention defines the size of a single color block of the image as 7 * 7 pixels, and the color value information within the range of 7 * 7 pixels is the same. On the premise of being recognizable, it can be calculated that this image contains a total of 2560 / 7 = 365 columns and 1440 / 7 = 205 rows, with a total of 365 * 205 = 74825 color blocks. Since a single color block represents 3-bit data, the maximum amount of information that can be accommodated in a single color data matrix image generated by the present invention is 74825 * 3 / 8 / 1024 = 27.4 KB, where 8 represents bit to Byte, and 1024 is Byte to KB. Therefore, the color data matrix image generated by the present invention far exceeds the amount of information that can be accommodated by a recognizable color QR code with the same number of pixels (less than 1 KB), creating the possibility for stable, reliable, and fast data transmission under physical isolation conditions.

[0046] In the present invention, the rows and columns of the image are related to the resolution of the display screen, and the rows and columns directly affect the maximum amount of information that can be accommodated in a single color data matrix image finally generated. Therefore, the amount of information that can be accommodated in a single image generated by the present invention is directly related to the resolution of the display screen at the encoding end.

[0047] Table 1 Correspondence between bitstream information and color values

[0048] Bitstream information Color 000 Black 001 Blue 010 Green 100 Red 110 Yellow 101 Purple 011 Cyan 111 White

[0049] The above are only the preferred embodiments of the present invention, and do not constitute any form of obstruction to the present invention. Any simple modification or equivalent change made to the above embodiments based on the technical essence of the present invention falls within the protection scope of the present invention.

Claims

1. A method for converting a file into a recognizable color data matrix image, characterized in that, It includes the following steps: S01. Read the binary data length of the file to be transmitted. According to the length of the binary data and the length value row and width value col of the color image to be generated, calculate the number of images that can be generated from the current file to be transmitted; S02. Split the binary data of the file to be transmitted into n bit streams each with a length of row * col * 3, and then perform matrix operations on the bit stream data with a length of row * col * 3 respectively to convert it into a corresponding three-dimensional matrix M1 i (row, col, 3); S03. Convert the file detailed information into bit-stream data as the header information and then perform matrix operations to convert it into a three-dimensional matrix M2 i (2, col, 3); S04. For the data matrix M1 i Perform row XOR and column XOR operations, and splice the obtained row and column XOR values and then convert them into a three-dimensional matrix M3 i (2, col, 3), and splice the matrix M2 in sequence i 、M3 i and M1 i , and the spliced data matrix is M4 i (row + 4, col, 3), store the data matrix M4 i as a vector graph, and finally form a color image.

2. The method for converting a document into a recognizable color data matrix image according to claim 1, characterized in that, When n is a decimal number, perform data padding on the binary data of the file to be transmitted. The padded data is bit(0). After padding the bit(0) data, the binary data length of the current file to be transmitted becomes L'.

3. A method for converting a document into a recognizable color data matrix image according to claim 1, characterized in that, The calculation expression for calculating the number n of color images that can be generated from the current file to be transmitted is n = L / (row * col * 3).

4. A method for converting a document into a recognizable color data matrix image according to claim 1, characterized in that, The detailed file information includes the file name and size, the i-th block bit stream data of the current encoding, the number of bits(0) filled in the file, and the file reception time.

5. A method for converting a document into an identifiable color data matrix image according to claim 2, characterized in that, When performing data padding, the number of bits(0) filled is a, and a = (row * col * 3) - mod(L, (row * col * 3)).

6. A method for converting a document into a recognizable color data matrix image according to claim 1, characterized in that Before storing the data matrix M4 i as a vector graph, it further includes magnifying the data matrix M4 i by a preset magnification factor.

Citation Information

Patent Citations

  • Information transmission system, method and apparatus

    CN107169540A

  • Matrix type two-dimensional code, generation and decoding methods and equipment thereof

    CN109978111A

  • Android malicious code detection method based on deep learning

    CN112182577A

  • Image encryption method based on center rule and three-dimensional bit plane

    CN114362918A

  • Industrial control network data transmission method based on color two-dimensional code and two-dimensional code

    CN114430327A