A data transmission method, device, system and storage medium
By storing the pixel values of multiple QR code images into bits of each pixel of the RGB image and generating a new RGB image, the problem of low transmission efficiency of existing QR code images is solved, and more efficient data transmission is achieved.
Patent Information
- Application Number
- CN202510014007.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-03
- Publication Date
- 2025-06-17
- Estimated Expiration
- 2045-01-03
AI Technical Summary
The existing QR code image transmission methods have low transmission efficiency, especially when transmitting from VGA interfaces, the frame rate and resolution limit the amount of information transmission.
By storing the pixel values of multiple QR code images into bits of each pixel of the RGB image, and generating a new RGB image using the three primary color pixel byte values in the RGB image, simultaneous transmission of multiple groups of QR code images is achieved.
It improves data transmission speed and transmission efficiency, solves the problem of low QR code image transmission efficiency, and achieves a higher amount of information transmission.
Smart Images

Figure CN119402602B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data transmission, and in particular, to a data transmission method, apparatus, system, and storage medium. Background Art
[0002] The existing methods for transmitting images through an interface mainly include the QR code method. Specifically, the sending end converts data into a QR code image, and the receiving end parses the QR code image into data.
[0003] However, the transmission efficiency of the traditional QR code transmission method is relatively low. For example, if the frame rate of transmitting an image through a VGA interface is 60 Hz, that is, 60 QR code images can be transmitted per second. Taking an image with a resolution of 1280*720 as an example, the maximum amount of information contained in the QR code is about 3 KB, that is, the maximum amount that can be transmitted per second is only about 180 KB. Summary of the Invention
[0004] The present invention provides a data transmission method, apparatus, system, and storage medium to solve the problem of relatively low transmission efficiency of QR code images.
[0005] In a first aspect, the present invention provides a data transmission method applied to a data sending device, including:
[0006] Obtain the first pixel values of multiple QR code images to be transmitted, and store the first pixel values of the multiple QR code images to be transmitted in an RGB storage area, where the RGB storage area includes an R byte storage area, a G byte storage area, and a B byte storage area;
[0007] Determine the first pixel value groups in each byte storage area, and generate each primary color pixel byte value in the RGB image by using the first pixel value groups, where the first pixel value groups include the first pixel values of multiple different QR code images to be transmitted;
[0008] Generate an RGB image by using the primary color pixel byte values, and send the RGB image.
[0009] In a second aspect, the present invention provides a data transmission method applied to a data receiving device, including:
[0010] Receive an RGB image, where the RGB image is sent by a data sending device through the data transmission method described in the first aspect above;
[0011] Obtain a QR code image by parsing the RGB image.
[0012] In a third aspect, the present invention provides a data transmission apparatus applied to a data sending device, including:
[0013] A storage module, configured to obtain first pixel values of a plurality of two-dimensional code images to be transmitted, and store the first pixel values of the plurality of two-dimensional code images to be transmitted into an RGB storage area, where the RGB storage area includes an R byte storage area, a G byte storage area, and a B byte storage area;
[0014] A pixel byte generation module, configured to determine a group of first pixel values in each byte storage area, and generate each primary color pixel byte value in the RGB image by using the group of first pixel values, where the group of first pixel values includes first pixel values of a plurality of different two-dimensional code images to be transmitted;
[0015] An image generation module, configured to generate an RGB image by using the primary color pixel byte values, and send the RGB image.
[0016] In a fourth aspect, the present invention provides a data transmission device, which is applied to a data receiving device and includes:
[0017] A receiving module, configured to receive an RGB image, where the RGB image is sent by a data sending device through the data transmission method described in the first aspect above;
[0018] An image analysis module, configured to obtain a two-dimensional code image by analyzing the RGB image.
[0019] In a fifth aspect, the present invention provides a data transmission system, which includes a data receiving device and a data sending device;
[0020] Both the data receiving device and the data sending device include: at least one processor, and a memory communicatively connected to the at least one processor;
[0021] Wherein, the memory of the data sending device stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor, so that the at least one processor can execute the steps performed by the data sending device in the data transmission method described in the first aspect above;
[0022] The memory of the data receiving device stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor, so that the at least one processor can execute the steps performed by the data receiving device in the data transmission method described in the second aspect above.
[0023] In a sixth aspect, the present invention provides a computer-readable storage medium, which stores computer instructions for causing a processor to implement the data transmission method in the first aspect above when executed, and / or implement the data transmission method in the second aspect above.
[0024] The data transmission solution provided by the present invention for data sending devices and data receiving devices. The data sending device makes full use of the characteristics of multiple bits per pixel in the RGB image, stores the pixel values in multiple QR code images into the bit positions of each pixel in the RGB image, so that the receiving device can regenerate multiple QR code images by reading the analog signal of the RGB image, realizing the simultaneous transmission of multiple groups of QR code images, increasing the data transmission speed and improving the transmission efficiency, and solving the problem of low transmission efficiency of QR code images.
[0025] It should be understood that the content described in this part is not intended to identify the key or important features of the present invention, nor to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. Brief Description of the Drawings
[0026] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0027] Figure 1 is a flowchart of a data transmission method provided in Embodiment 1 of the present invention;
[0028] Figure 2 is a schematic structural diagram of an RGB storage area provided in Embodiment 1 of the present invention;
[0029] Figure 3 is a flowchart of a data transmission method provided in Embodiment 2 of the present invention;
[0030] Figure 4 is a schematic diagram of serial number area division provided in Embodiment 2 of the present invention;
[0031] Figure 5 is a flowchart of a data transmission method provided in Embodiment 3 of the present invention;
[0032] Figure 6 is a flowchart of a data transmission method provided in Embodiment 4 of the present invention;
[0033] Figure 7 is a schematic structural diagram of a data transmission device provided in Embodiment 5 of the present invention;
[0034] Figure 8 is a schematic structural diagram of a data transmission device provided in Embodiment 6 of the present invention;
[0035] Figure 9 It is a schematic structural diagram of a data transmission system provided by Embodiment 7 of the present invention. Detailed implementation manners
[0036] In order to enable those skilled in the art to better understand the solution of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0037] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to be used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In the description of the present invention, unless otherwise specified, "a plurality of" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally represents an "or" relationship between the associated objects before and after. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products, or devices.
[0038] VGA (Video Graphics Array) is a video transmission standard, which has advantages such as high resolution, fast display rate, and rich colors. It transmits video analog signals, including red, green, and blue analog signals as well as synchronization signals (horizontal and vertical signals). The VGA display outputs RGB primary color signals. Currently, the VGA interface can be used to transmit images.
[0039] Embodiment 1
[0040] Figure 1FIG. 0 is a flowchart of a data transmission method provided in Embodiment 1 of the present invention. This embodiment is applicable to the case of transmitting a two-dimensional code image through a VGA interface. The method can be executed by a data transmission device, which can be implemented in the form of hardware and / or software. The data transmission device can be configured in a data sending device, and the data sending device can be composed of one or more physical entities.
[0041] As Figure 1 shown, the data transmission method provided in Embodiment 1 of the present invention specifically includes the following steps:
[0042] S101. Obtain the first pixel values of multiple two-dimensional code images to be transmitted, and store the first pixel values of the multiple two-dimensional code images to be transmitted in an RGB storage area, where the RGB storage area includes an R byte storage area, a G byte storage area, and a B byte storage area.
[0043] Specifically, after the application generates data, the data can be segmented first, and the offset value of each segment of data in the total data can be added before each segment of data. Then, the segmented data is used to generate a binary two-dimensional code, and the number of pixels of the two-dimensional code should not exceed the size of the two-dimensional code area of the VGA interface resolution. Adding the offset here is to enable the data receiving device to sort and recombine the segmented data into the total data according to the offset after receiving the segmented data. A two-dimensional code image is usually a binary (only two colors, black and white) image, and the pixel value of each pixel in the two-dimensional code image requires 1 bit (bit) to represent, which can be specifically represented as 0 or 1. In this embodiment, the (first) pixel values of multiple two-dimensional code images to be transmitted can be stored in the RGB storage area, where the RGB storage area can include an R (red) byte storage area, a G (green) byte storage area, and a B (blue) byte storage area. Each byte storage area can include multiple bit storage areas, and each bit storage area can store the first pixel value of the two-dimensional code image to be transmitted. Therefore, each byte storage area can store the first pixel values of multiple different two-dimensional code images to be transmitted. For example, each byte storage area can contain 8 bit storage areas, and each bit storage area can store at least one first pixel value of the two-dimensional code image to be transmitted.
[0044] S102. Determine the first pixel value group in each byte storage area, and generate each primary color pixel byte value in the RGB image by using the first pixel value group, where the first pixel value group contains the first pixel values of multiple different two-dimensional code images to be transmitted.
[0045] In this embodiment, a first pixel value group may be determined first. For example, 8 first pixel values form a first pixel value group, and then the first pixel value group in the R byte storage area, the G byte storage area, and the B byte storage area is used to generate the pixel byte values of the three primary colors in the RGB image. Among them, the pixel byte values of the three primary colors include the pixel values of the red, blue, and green color channels.
[0046] Exemplarily, taking an image in RGB888 format as an example, each pixel point in this image may contain 3 bytes of data (i.e., 24 bit bits), and this data is the pixel byte value of the three primary colors. Each of the R channel, G channel, and B channel occupies one byte (one byte is 8 bit bits). Each pixel byte value of the three primary colors contains the first pixel values stored in the R byte storage area, the G byte storage area, and the B byte storage area. An RGB888 format image can store the pixel values of n * 24 QR code images to be transmitted.
[0047] S103. Generate an RGB image by using the pixel byte values of the three primary colors, and send the RGB image.
[0048] In this embodiment, an RGB image can be generated by using the pixel byte values of the three primary colors. When the RGB image is transmitted through a VGA interface, it can be first converted into a VGA analog signal through a DAC (digital-to-analog conversion chip), and then transmitted to the receiving device.
[0049] The technical solution of the embodiment of the present invention makes full use of the characteristic that each pixel in the RGB image has multiple bit bits, stores the pixel values in multiple QR code images into the bit bits in each pixel of the RGB image, so that the receiving device can regenerate multiple QR code images by reading the analog signal of the RGB image, realizing the simultaneous transmission of multiple groups of QR code images, increasing the data transmission speed, improving the transmission efficiency, and solving the problem of low efficiency in transmitting QR code images through the VGA interface.
[0050] Optionally, in each of the bit storage areas included in the R byte storage area, the G byte storage area, and the B byte storage area, there are included: a preset high-bit storage area and a preset anti-interference bit storage area; different first pixel values of the QR code images to be transmitted are stored in the preset high-bit storage area, and the same first pixel values of the QR code images to be transmitted are stored in the preset anti-interference bit storage area.
[0051] Specifically, during the transmission of analog signals, signal deviations may occur due to increased noise and interference, resulting in different pixel values before and after transmission. Usually, the low bit positions are most affected. The voltage range of the analog signals in the RGB channels of the VGA standard is typically between 0 and 0.714V. The resolution of 8 bits is 2.8mV. To improve reliability, a high-bit storage area and an anti-interference bit storage area can be preset. The first pixel values of different QR code images to be transmitted are stored in the preset high-bit storage area, and the first pixel values of the same QR code image to be transmitted are stored in the preset anti-interference bit storage area. Among them, the pixels in the preset high positions of each pixel byte in the RGB image are stored in the preset high-bit storage area, and the pixels in the preset low positions of each pixel byte in the RGB image are stored in the preset anti-interference bit storage area. This setting can solve the problem of low accuracy in the transmission of low-bit data caused by signal deviations due to interference.
[0052] Exemplarily, Figure 2 is a schematic structural diagram of an RGB storage area. As Figure 2 shown, if each of the R byte storage area, G byte storage area, and B byte storage area contains 8 bit storage areas, 3 consecutive bit storage areas (R1 to R3, G1 to G3, and B1 to B3) can be the preset high-bit storage area, and 5 consecutive bit storage areas (R4 to R8, G4 to G8, and B4 to B8) can be the preset anti-interference bit storage area. Since the first pixel values of the QR code image to be transmitted are stored the same in the preset anti-interference bit storage area, in multiple preset anti-interference bit storage areas, the pixel values of each bit correspond to the same. For example, in the preset anti-interference bit storage area, the value of the first bit can all be 1, or all be 0. At this time, the RGB storage area can be regarded as a storage area for 12 QR code images. Among them, in this example, the data of the high 3 bits in the RGB image are stored in the preset high-bit storage area, and the data of the low 5 bits in the RGB image are stored in the preset anti-interference bit storage area.
[0053] Exemplarily, the data sending device can store the first pixel values of multiple QR code images to be transmitted into the 8 bit storage areas respectively included in the R byte storage area, G byte storage area, and B byte storage area through the R channel, G channel, and B channel respectively. In the R byte storage area, G byte storage area, and B byte storage area, the first pixel values of different QR code images can be stored in 3 consecutive high-bit storage areas, and the first pixel values of the same QR code image can be stored in 5 consecutive low-bit storage areas.
[0054] Embodiment 2
[0055] Figure 3The figure is a flowchart of a data transmission method provided in the second embodiment of the present invention. The technical solution of the embodiment of the present invention is further optimized on the basis of the above optional technical solutions, and a specific method for transmitting data through a VGA interface is given.
[0056] Optionally, before generating the RGB image using the tricolor pixel byte values, it further includes: storing the pixel values of the serial number identifier of the to-be-transmitted two-dimensional code image in the R byte storage area and the G byte storage area, and storing the pixel values of the check value of the serial number identifier in the B byte storage area, where the R byte storage area, the G byte storage area, and the B byte storage area each include a plurality of bit storage areas, and the serial number identifier is used to identify whether the first pixel value of the to-be-transmitted two-dimensional code image in the bit storage area corresponding to the serial number has been updated; wherein, generating the RGB image using the tricolor pixel byte values includes: generating a target area image in the RGB image using the red pixel byte value, the green pixel byte value, and the blue pixel byte value in the tricolor pixel byte values; generating a serial number area image in the RGB image corresponding to the pixel values of the serial number identifier stored in the R byte storage area and the G byte storage area, and the pixel values of the check value in the B byte storage area; and generating the RGB image by combining the target area image and the serial number area image. The advantage of this setting is that by setting aside a certain area in the RGB image to represent the serial number of whether the two-dimensional code image has been updated, the data receiving device can quickly determine whether the received two-dimensional code image has been updated each time.
[0057] As Figure 3 shown, a data transmission method provided in the second embodiment of the present invention specifically includes the following steps:
[0058] S201. Obtain the first pixel values of multiple to-be-transmitted two-dimensional code images, and store the first pixel values of the multiple to-be-transmitted two-dimensional code images in an RGB storage area, where the RGB storage area includes an R byte storage area, a G byte storage area, and a B byte storage area, and each of the bit storage areas included in the R byte storage area, the G byte storage area, and the B byte storage area includes: a preset high-bit storage area and a preset anti-interference bit storage area; different first pixel values of the to-be-transmitted two-dimensional code images are stored in the preset high-bit storage area, and the same first pixel values of the to-be-transmitted two-dimensional code images are stored in the preset anti-interference bit storage area.
[0059] S202. Determine the first pixel value group in each byte storage area, and generate each tricolor pixel byte value in the RGB image using the first pixel value group.
[0060] S203. Store the pixel values of the serial number identifier of the to-be-transmitted QR code image in the R byte storage area and the G byte storage area, and store the pixel values of the checksum of the serial number identifier in the B byte storage area. Among them, the R byte storage area, the G byte storage area, and the B byte storage area all contain multiple bit storage areas, and the serial number identifier is used to identify whether the first pixel value of the to-be-transmitted QR code image in the bit storage area corresponding to the serial number has been updated.
[0061] Specifically, usually the vertical synchronization signal (VSYNC) in the VGA signal can solve the image synchronization problem between the sending end and the receiving end, ensure that the receiving end receives a complete frame of QR code image each time, and prevent the problem of cross or end-to-end connection between pictures. However, the receiving end still needs to determine the change information of the image. If it cannot be determined, the receiving end can only continuously parse the QR code image and then judge whether there is a change according to the parsing result. However, the algorithm for parsing the QR code has a certain complexity, and continuously parsing the QR code image will occupy a large part of the CPU resources. To solve the above problems, the pixel values of the serial number identifier of the to-be-transmitted QR code image can be stored in the R byte storage area and the G byte storage area, and the pixel values of the checksum of the serial number identifier can be stored in the B byte storage area.
[0062] S204. Generate the target area image in the RGB image by using the red pixel byte value, the green pixel byte value, and the blue pixel byte value in the tricolor pixel byte values.
[0063] Specifically, the red pixel byte value, the green pixel byte value, and the blue pixel byte value in the tricolor pixel byte values can be used to generate the pixel values in the R channel, the G channel, and the B channel in the RGB image respectively, so as to obtain the target area image.
[0064] S205. Generate the serial number area image in the RGB image according to the pixel values of the serial number identifier stored in the R byte storage area and the G byte storage area, and the pixel values of the checksum in the B byte storage area.
[0065] Specifically, to avoid the problem of low data transmission accuracy of the low-order bits of the serial number identifier and the check value, the bit storage areas included in the R byte storage area and the G byte storage area for storing the pixel values of the serial number identifier, and the B byte storage area for storing the pixel values of the check value each include a preset high-order bit storage area and a preset anti-interference bit storage area. Exemplarily, if each of the R byte storage area, the G byte storage area, and the B byte storage area includes 8 bit storage areas, 3 consecutive bit storage areas (R6 to R8, G6 to G8, and B6 to B8) can be the preset high-order bit storage area, and 5 consecutive bit storage areas (R1 to R5, G1 to G5, and B1 to B5) can be the preset anti-interference bit storage area. The same counting pixel values can be stored in the preset anti-interference bit storage areas of the R byte storage area and the G byte storage area, and the same check pixel value can be stored in the preset anti-interference bit storage area of the B byte storage area. At this time, the R byte storage area and the G byte storage area can each be regarded as 4 bit storage areas for storing the pixel values of the serial number identifier, and the B byte storage area can be regarded as 4 bit storage areas for storing the pixel values of the check value. That is, the R byte storage area can be used to store the corresponding pixel values of the high-order bits of the serial number count in the serial number identifier, such as the pixel values corresponding to the high four bits, and the G byte storage area can be used to store the pixel values corresponding to the low-order bits of the serial number count in the serial number identifier, such as the pixel values corresponding to the low four bits. Each time the QR code image to be transmitted is updated, the serial number count will change, such as incrementing by 1. The B byte storage area can be used to store the pixel values corresponding to the four-bit check value. The data receiving device can use this check value to verify the serial number count. Exemplarily, the same counting pixel value in the preset anti-interference bit storage area of the R byte storage area is the pixel value corresponding to the last serial number count in the high-order serial number count. The same counting pixel value in the preset anti-interference bit storage area of the G byte storage area is the pixel value corresponding to the last serial number count in the low-order serial number count. The same check pixel value in the preset anti-interference bit storage area of the B byte storage area is the pixel value corresponding to the last bit in the bits of the check value.
[0066] Figure 4 It is a schematic diagram of the serial number area division. The number of pixels in the horizontal direction of the RGB image is usually greater than that in the vertical direction, and the QR code image is generally square. Therefore, as Figure 4As shown, the extra image part in the horizontal direction can be determined as the serial number area image, and this area is divided into multiple blocks. For example, if the preset anti-interference bit storage areas included in the R-byte storage area, G-byte storage area, and B-byte storage area store the low four-bit pixel values of each byte in the RGB image, that is, the preset anti-interference bit storage area stores the first pixel values of 4 identical QR code images to be transmitted, the serial number area image can be divided into 12 blocks, and each block represents the serial number area of a bit storage area in the RGB storage area. The image area containing the pixel values of the QR code image is determined as the target area image (i.e., Figure 4 the QR code area in
[0067] S206. Generate the RGB image by combining the target area image and the serial number area image.
[0068] The data transmission method provided by the embodiments of the present invention indicates the serial number of whether the QR code image is updated by delimiting a certain area in the RGB image, enabling the data receiving device to quickly determine whether there is an update for each received QR code image.
[0069] Embodiment III
[0070] Figure 5 FIG. is a flowchart of a data transmission method provided by Embodiment III of the present invention. This embodiment is applicable to the case of transmitting a QR code image through a VGA interface. This method can be executed by a data transmission device, which can be implemented in the form of hardware and / or software. The data transmission device can be configured in a data receiving device, and the data receiving device can be composed of one or more physical entities.
[0071] As Figure 5 shown, the data transmission method provided by Embodiment III of the present invention specifically includes the following steps:
[0072] S301. Receive an RGB image, where the RGB image is sent by a data sending device through the data transmission method described in the above embodiments.
[0073] S302. Obtain a QR code image by parsing the RGB image.
[0074] In this embodiment, the data receiving device can receive the RGB image sent by the data sending device through the data transmission method described in the above embodiments, and convert the analog signal into multiple groups of RGB images through an ADC (analog-to-digital conversion chip). The data receiving device can obtain the pixel values in the R channel, G channel, and B channel respectively by parsing the RGB image, so as to obtain n * 24 QR code images.
[0075] The technical solution of the embodiment of the present invention makes full use of the characteristics of multiple bits of each pixel in the RGB image. By reading the analog signal of the RGB image and regenerating multiple two-dimensional code images, it realizes the simultaneous transmission of multiple groups of two-dimensional code images, increases the data transmission speed, improves the transmission efficiency, and solves the problem of low efficiency in transmitting two-dimensional code images through the VGA interface.
[0076] Embodiment 4
[0077] Figure 6 It is a flowchart of a data transmission method provided by the fourth embodiment of the present invention. The technical solution of the embodiment of the present invention is further optimized on the basis of the above-mentioned optional technical solutions, and a specific method for receiving data through the VGA interface is given.
[0078] Optionally, the RGB image includes anti-interference pixels; wherein, the obtaining of the two-dimensional code image by parsing the RGB image includes: parsing the anti-interference pixels to obtain anti-interference pixel values, where the anti-interference pixel values are pixel values stored in the preset anti-interference bit storage areas of the R-byte storage area, G-byte storage area, and B-byte storage area in the data sending device; when the anti-interference pixel value is greater than or equal to a first preset value, converting the anti-interference pixel value into a first target pixel value, and when the anti-interference pixel value is less than the first preset value, converting the anti-interference pixel value into a second target pixel value; parsing the pixel values in the RGB image except the anti-interference pixel values to obtain third target pixel values; generating multiple two-dimensional code images by using the third target pixel values and the first target pixel values; or generating multiple two-dimensional code images by using the third target pixel values and the second target pixel values. The advantage of such a setting is that by comparing the size relationship between the anti-interference pixel value and the preset value, the data receiving device can quickly determine the original pixel value sent by the data sending device, ensuring the accuracy of the two-dimensional code image transmission.
[0079] Optionally, the RGB image includes a serial number area image; the obtaining of the two-dimensional code image by parsing the RGB image includes: using the blue pixel byte value in the serial number area image for verification, and after the verification passes, determining the updated three-primary-color pixel byte values in the target area image of the RGB image by parsing the red pixel byte value and the green pixel byte value in the serial number area image; obtaining the two-dimensional code image by parsing the pixel values corresponding to the updated three-primary-color pixel byte values. The advantage of such a setting is that the data receiving device can quickly determine whether the current two-dimensional code image is the updated two-dimensional code image by parsing the serial number identifier of the serial number area image, with small calculation and short time consumption, reducing the parsing amount of the two-dimensional code image, reducing the CPU occupancy, improving the transmission efficiency, and the verification of the verification value further ensures the reliability of the transmission.
[0080] Such asFigure 6 As shown in Figure 6 , a data transmission method provided by the fourth embodiment of the present invention specifically includes the following steps:
[0081] S401. Receive an RGB image, where the RGB image includes anti-interference pixels and a serial number area image.
[0082] S402. Use the blue pixel byte value in the serial number area image for verification. After the verification passes, determine the updated primary color pixel byte values in the target area image of the RGB image by parsing the red pixel byte value and the green pixel byte value in the serial number area image.
[0083] Specifically, the receiving device can use exclusive OR operation to verify the blue pixel byte value in the B channel of the serial number area image, that is, the verification value. After the verification passes, determine the updated pixel values in the R channel, G channel, and B channel of the target area image of the RGB image by parsing the red pixel byte value and the green pixel byte value in the serial number area image, that is, the serial number identifiers in the R channel and G channel. If the verification fails, the RGB image of this channel can be directly discarded. If there are no updated pixel values in the target area image of the R channel, G channel, or B channel, the RGB image of this channel can be directly discarded without further parsing. Among them, the maximum countable value corresponding to the red pixel byte value and the green pixel byte value in the serial number area image can be 255, and after reaching the maximum value, it can continue to count from 0. There are various ways to verify the blue pixel byte value in the serial number area image. For example, each bit value in the blue pixel byte value is the exclusive OR operation value of the corresponding bits of the red pixel byte value and the green pixel byte value.
[0084] Among them, the preset area of the serial number area image can include multiple identical pixel values (i.e., serial number identifiers). The data receiving device can determine the serial number identifier actually sent by the data sending device by determining the mode or average value of the pixel values in this preset area, effectively solving the problem of inaccurate serial number identifiers caused by image pixel position offset or jitter during transmission.
[0085] S403. Obtain a two-dimensional code image by parsing the pixel values corresponding to the updated primary color pixel byte values.
[0086] Specifically, the data receiving device can parse the updated primary color pixel byte values in the RGB image to obtain the updated two-dimensional code image.
[0087] S404. Parse the anti-interference pixels to obtain anti-interference pixel values, where the anti-interference pixel values are the pixel values stored in the preset anti-interference bit storage areas of the R byte storage area, G byte storage area, and B byte storage area in the data sending device.
[0088] S405. When the anti-interference pixel value is greater than or equal to the first preset value, convert the anti-interference pixel value into a first target pixel value; when the anti-interference pixel value is less than the first preset value, convert the anti-interference pixel value into a second target pixel value.
[0089] Specifically, when there is no signal interference, the anti-interference pixel value in the RGB image should be a multi-bit value composed of the same numerical values, such as 11111 or 00000. However, due to the existence of interference, it may actually not be just one of 11111 or 00000.
[0090] Select the first preset value as the comparison benchmark, so that the data receiving device can eliminate the interference on the anti-interference pixel value during the transmission process. Among them, the value of the first preset value is not limited and can be determined according to the number of bits of the anti-interference pixel value. Exemplarily, if the anti-interference pixel value is a 5-bit value, it can be judged in the following way: when the anti-interference pixel value is greater than or equal to 10000, convert the interference pixel value into 11111; when it is less than 10000, convert the interference pixel value into 00000.
[0091] S406. Analyze the pixel values in the RGB image except the anti-interference pixel value to obtain a third target pixel value.
[0092] Specifically, the pixel values in the RGB image except the anti-interference pixel value are the pixel values stored in the preset high-bit storage areas of the R-byte storage area, G-byte storage area, and B-byte storage area in the data sending device.
[0093] S407. Generate multiple two-dimensional code images by using the third target pixel value and the first target pixel value; or generate multiple two-dimensional code images by using the third target pixel value and the second target pixel value.
[0094] Specifically, when the anti-interference pixel value is greater than or equal to the first preset value, multiple two-dimensional code images can be generated by integrating the third target pixel value and the first target pixel value. When the anti-interference pixel value is less than the first preset value, multiple two-dimensional code images can be generated by integrating the third target pixel value and the second target pixel value.
[0095] The data transmission method provided by the embodiments of the present invention can quickly determine whether the current two-dimensional code image is an updated two-dimensional code image by parsing the serial number identifier of the serial number area image, with small calculation and short time consumption, reducing the parsing amount of the two-dimensional code image, reducing the CPU occupancy, improving the transmission efficiency, and the verification of the verification value further ensures the reliability of the transmission. By comparing the size relationship between the anti-interference pixel value and the preset value, the data receiving device can quickly determine the original pixel value sent by the data sending device, ensuring the accuracy of the two-dimensional code image transmission.
[0096] Example 5
[0097] Figure 7 The following is a schematic structural diagram of a data transmission device provided in Example 5 of the present invention. As Figure 7 shown, this device is applied to a data sending device, and the device includes a storage module 501, a pixel byte generation module 502, and an image generation module 503, where:
[0098] The storage module is used to obtain the first pixel values of multiple two-dimensional code images to be transmitted, and store the first pixel values of the multiple two-dimensional code images to be transmitted in the RGB storage area, where the RGB storage area includes an R byte storage area, a G byte storage area, and a B byte storage area;
[0099] The pixel byte generation module is used to determine the first pixel value group in each byte storage area, and generate each primary color pixel byte value in the RGB image by using the first pixel value group, where the first pixel value group contains the first pixel values of multiple different two-dimensional code images to be transmitted;
[0100] The image generation module is used to generate an RGB image by using the primary color pixel byte values, and send the RGB image.
[0101] The data transmission device provided in the embodiment of the present invention makes full use of the characteristics of multiple bits of each pixel in the RGB image, stores the pixel values in multiple two-dimensional code images in the bit positions of each pixel in the RGB image, so that the receiving device can regenerate multiple two-dimensional code images by reading the analog signal of the RGB image, realizes the simultaneous transmission of multiple groups of two-dimensional code images, increases the data transmission speed, improves the transmission efficiency, and solves the problem of low efficiency in transmitting two-dimensional code images through the VGA interface.
[0102] Optionally, in each bit storage area included in the R byte storage area, the G byte storage area, and the B byte storage area, there are included: a preset high-bit storage area and a preset anti-interference bit storage area; the first pixel values of different two-dimensional code images to be transmitted are stored in the preset high-bit storage area, and the first pixel values of the same two-dimensional code image to be transmitted are stored in the preset anti-interference bit storage area.
[0103] Optionally, the device further includes:
[0104] An identification and verification value storage module, configured to store pixel values of the serial number identification of the to-be-transmitted two-dimensional code image in the R-byte storage area and the G-byte storage area, and store pixel values of the verification value of the serial number identification in the B-byte storage area before generating an RGB image by using the three-primary-color pixel byte values. Wherein, the R-byte storage area, the G-byte storage area, and the B-byte storage area each include a plurality of bit storage areas, and the serial number identification is used to identify whether the first pixel value of the to-be-transmitted two-dimensional code image in the bit storage area corresponding to the serial number has been updated.
[0105] Optionally, the image generation module includes:
[0106] A target area image generation unit, configured to generate a target area image in the RGB image by using the red pixel byte value, the green pixel byte value, and the blue pixel byte value in the three-primary-color pixel byte values;
[0107] A serial number area image generation unit, configured to correspondingly generate a serial number area image in the RGB image by using the pixel values of the serial number identification stored in the R-byte storage area and the G-byte storage area, and the pixel values of the verification value in the B-byte storage area;
[0108] An RGB image generation unit, configured to generate the RGB image by combining the target area image and the serial number area image.
[0109] The data transmission device provided by the embodiments of the present invention can execute the data transmission method provided by any embodiment of the present invention, and has corresponding functional modules and beneficial effects for executing the method.
[0110] Embodiment Six
[0111] Figure 8 It is a schematic structural diagram of a data transmission device provided by Embodiment Six of the present invention. As Figure 8 shown, this device is applied to a data receiving device, and this device includes a receiving module 601 and an image parsing module 602, wherein:
[0112] The receiving module is configured to receive an RGB image, where the RGB image is sent by a data sending device through the data transmission method described in the above embodiments;
[0113] The image parsing module is configured to obtain a two-dimensional code image by parsing the RGB image.
[0114] The data transmission device provided by the embodiment of the present invention makes full use of the characteristics of multiple bits of each pixel in the RGB image. By reading the analog signal of the RGB image and regenerating multiple two-dimensional code images, it realizes the simultaneous transmission of multiple groups of two-dimensional code images, increases the data transmission speed, improves the transmission efficiency, and solves the problem of low efficiency in transmitting two-dimensional code images through the VGA interface.
[0115] Optionally, the RGB image includes anti-interference pixels;
[0116] Among them, the image parsing module includes:
[0117] The first parsing unit is used to parse the anti-interference pixels to obtain anti-interference pixel values, where the anti-interference pixel values are the pixel values stored in the preset anti-interference bit storage areas of the R-byte storage area, G-byte storage area, and B-byte storage area in the data sending device;
[0118] The judgment unit is used to convert the anti-interference pixel value into a first target pixel value when the anti-interference pixel value is greater than or equal to a first preset value, and convert the anti-interference pixel value into a second target pixel value when the anti-interference pixel value is less than the first preset value;
[0119] The second parsing unit is used to parse the pixel values in the RGB image except the anti-interference pixel values to obtain third target pixel values;
[0120] The two-dimensional code image generation unit is used to generate multiple two-dimensional code images by using the third target pixel values and the first target pixel values; or generate multiple two-dimensional code images by using the third target pixel values and the second target pixel values.
[0121] Optionally, the RGB image includes a serial number area image;
[0122] Among them, the image parsing module includes:
[0123] The update determination unit is used to perform verification by using the blue pixel byte value in the serial number area image, and after the verification passes, determine the updated three-primary-color pixel byte values in the target area image of the RGB image by parsing the red pixel byte value and the green pixel byte value in the serial number area image;
[0124] The third parsing unit is used to obtain a two-dimensional code image by parsing the pixel values corresponding to the updated three-primary-color pixel byte values.
[0125] Embodiment Seven
[0126] Figure 9The structural schematic diagram of a data transmission system that can be used to implement the embodiments of the present invention is shown. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or claimed herein.
[0127] As Figure 9 shown, the data transmission system 70 may include a data receiving device 701 and a data sending device 702. The data receiving device 701 includes at least one processor 703 and a memory 704 communicatively connected to the at least one processor 703. The data sending device 702 includes at least one processor 705 and a memory 706 communicatively connected to the at least one processor 705. The memory may be a read-only memory (ROM) and a random access memory (RAM), etc. Among them, the memory stores computer programs executable by the at least one processor. The processor may execute various appropriate actions and processes according to the computer programs stored in the read-only memory (ROM) or the computer programs loaded from the storage unit into the random access memory (RAM).
[0128] The memory of the data sending device stores a computer program executable by the at least one processor. The computer program is executed by the at least one processor so that the at least one processor can execute the data transmission method applied to the data sending device described above. The memory of the data receiving device stores a computer program executable by the at least one processor. The computer program is executed by the at least one processor so that the at least one processor can execute the data transmission method applied to the data receiving device described above.
[0129] In the RAM, various programs and data required for the operation of the data receiving device or the data sending device may also be stored. The processor, ROM, and RAM are connected to each other through a bus. The input / output (I / O) interface is also connected to the bus. Multiple components in the data receiving device or the data sending device are connected to the I / O interface, including: an input unit, such as a keyboard, a mouse, etc.; an output unit, such as various types of displays, speakers, etc.; a storage unit, such as a disk, an optical disc, etc.; and a communication unit, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit allows the data receiving device or the data sending device to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0130] The processor can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the processor include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The processor executes the various methods and processes described above, such as the data transmission method.
[0131] In some embodiments, the data transmission method can be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as a storage unit. In some embodiments, part or all of the computer program can be loaded and / or installed onto the data receiving device or the data sending device via the ROM and / or the communication unit. When the computer program is loaded into the RAM and executed by the processor, one or more steps of the data transmission method described above can be executed. Alternatively, in other embodiments, the processor can be configured to execute the data transmission method by any other suitable means (e.g., by means of firmware).
[0132] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuitry, integrated circuit systems, field-programmable gate arrays (FPGA), application-specific integrated circuits (ASIC), application-specific standard products (ASSP), systems-on-chip (SOC), complex programmable logic devices (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special-purpose or general-purpose programmable processor, and can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit the data and instructions to the storage system, the at least one input device, and the at least one output device.
[0133] The computer program for implementing the method of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to the processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer program is executed by the processor, the functions / operations specified in the flowchart and / or block diagram are implemented. The computer program can be executed entirely on the machine, partially on the machine, as a stand-alone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0134] The computer device provided above can be used to execute the data transmission method provided in any of the above embodiments, and has corresponding functions and beneficial effects.
[0135] Embodiment VIII
[0136] In the context of the present invention, a computer-readable storage medium may be a tangible medium, and the computer-executable instructions are used to execute a data transmission method applied to a data sending device and / or a data transmission method applied to a data receiving device when executed by a computer processor. The data transmission method applied to the data sending device includes:
[0137] Obtain the first pixel values of a plurality of two-dimensional code images to be transmitted, and store the first pixel values of the plurality of two-dimensional code images to be transmitted in an RGB storage area, where the RGB storage area includes an R-byte storage area, a G-byte storage area, and a B-byte storage area;
[0138] Determine the first pixel value groups in each byte storage area, and generate each primary color pixel byte value in the RGB image by using the first pixel value groups, where the first pixel value groups contain the first pixel values of a plurality of different two-dimensional code images to be transmitted;
[0139] Generate an RGB image by using the primary color pixel byte values, and send the RGB image.
[0140] The data transmission method applied to the data receiving device includes:
[0141] Receive an RGB image, where the RGB image is sent by a data sending device through the data transmission method described in the above embodiments;
[0142] Obtain a two-dimensional code image by parsing the RGB image.
[0143] In the context of the present invention, a computer-readable storage medium may be a tangible medium, which may contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0144] The computer device provided above can be used to execute the data transmission method provided in any of the above embodiments, and has corresponding functions and beneficial effects.
[0145] It should be noted that in the embodiments of the above data transmission device, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, the specific names of the functional units are only for the convenience of mutual distinction and do not limit the protection scope of the present invention.
[0146] Note that the above is only a preferred embodiment of the present invention and the technical principles applied. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described here, and various obvious changes, re-adjustments and substitutions can be made by those skilled in the art without departing from the protection scope of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments. Without departing from the concept of the present invention, more other equivalent embodiments can be included, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A data transmission method, applied to a data sending device, characterized in that: include: Acquire first pixel values of multiple two-dimensional code images to be transmitted, and store the first pixel values of the multiple two-dimensional code images to be transmitted into an RGB storage area, wherein the RGB storage area includes an R byte storage area, a G byte storage area, and a B byte storage area; Determine a first pixel value group in each byte storage area, and use the first pixel value group to generate each three-primary color pixel byte value in the RGB image, wherein the first pixel value group includes first pixel values of a plurality of different two-dimensional code images to be transmitted; Generate an RGB image using the three primary color pixel byte values, and send the RGB image; Before generating the RGB image using the three primary color pixel byte values, the method further includes: The R byte storage area and the G byte storage area are used to store the pixel value of the serial number identification of the two-dimensional code image to be transmitted, and the B byte storage area is used to store the pixel value of the check value of the serial number identification, wherein the R byte storage area, the G byte storage area and the B byte storage area each include a plurality of bit storage areas, and the serial number identification is used to identify whether the first pixel value of the two-dimensional code image to be transmitted in the bit storage area corresponding to the serial number is updated; The step of generating an RGB image using the three primary color pixel byte values includes: Generate a target area image in an RGB image using a red pixel byte value, a green pixel byte value, and a blue pixel byte value in the three primary color pixel byte values; Generate a serial number region image in the RGB image correspondingly using the pixel values of the serial number identifiers stored in the R byte storage area and the G byte storage area, and the pixel value of the check value in the B byte storage area; The RGB image is generated by merging the target area image and the serial number area image.
2. The method according to claim 1, characterized in that The bit storage areas contained in the R byte storage area, the G byte storage area and the B byte storage area respectively include: a preset high bit storage area and a preset anti-interference bit storage area; the preset high bit storage area stores different first pixel values of the two-dimensional code images to be transmitted, and the preset anti-interference bit storage area stores the same first pixel value of the two-dimensional code image to be transmitted.
3. A data transmission method, applied to a data receiving device, characterized in that: include: Receiving an RGB image, wherein the RGB image is sent by a data sending device through the data transmission method according to any one of claims 1 to 2; A two-dimensional code image is obtained by parsing the RGB image.
4. The method according to claim 3, characterized in that The RGB image contains anti-interference pixels; wherein obtaining a two-dimensional code image by parsing the RGB image includes: Parsing the anti-interference pixel to obtain an anti-interference pixel value, wherein the anti-interference pixel value is a pixel value stored in a preset anti-interference bit storage area of each of an R byte storage area, a G byte storage area, and a B byte storage area in a data sending device; When the anti-interference pixel value is greater than or equal to a first preset value, the anti-interference pixel value is converted to a first target pixel value; when the anti-interference pixel value is less than the first preset value, the anti-interference pixel value is converted to a second target pixel value; Analyzing pixel values in the RGB image except the anti-interference pixel value to obtain a third target pixel value; A plurality of two-dimensional code images are generated by using the third target pixel value and the first target pixel value; or a plurality of two-dimensional code images are generated by using the third target pixel value and the second target pixel value.
5. The method according to claim 3, characterized in that: The RGB image includes a serial number area image; and obtaining a two-dimensional code image by parsing the RGB image includes: Using the blue pixel byte value in the sequence number area image to perform verification, and after the verification passes, determining the updated three primary color pixel byte values in the target area image of the RGB image by parsing the red pixel byte value and the green pixel byte value in the sequence number area image; The two-dimensional code image is obtained by parsing the pixel values corresponding to the updated three primary color pixel byte values.
6. A data transmission device, applied to a data sending device, comprising: A storage module, used for acquiring first pixel values of a plurality of two-dimensional code images to be transmitted, and storing the first pixel values of the plurality of two-dimensional code images to be transmitted into an RGB storage area, wherein the RGB storage area includes an R byte storage area, a G byte storage area, and a B byte storage area; A pixel byte generation module, used to determine a first pixel value group in each byte storage area, and use the first pixel value group to generate each three-primary color pixel byte value in the RGB image, wherein the first pixel value group includes first pixel values of multiple different two-dimensional code images to be transmitted; An image generation module, used for generating an RGB image using the three primary color pixel byte values, and sending the RGB image; The device also includes: An identification and check value storage module, used for storing the pixel value of the serial number identification of the two-dimensional code image to be transmitted using the R byte storage area and the G byte storage area, and storing the pixel value of the check value of the serial number identification using the B byte storage area before generating the RGB image using the three primary color pixel byte values, wherein the R byte storage area, the G byte storage area and the B byte storage area each include a plurality of bit storage areas, and the serial number identification is used to identify whether the first pixel value of the two-dimensional code image to be transmitted in the bit storage area corresponding to the serial number is updated; The image generation module comprises: A target area image generating unit, configured to generate a target area image in an RGB image by using a red pixel byte value, a green pixel byte value and a blue pixel byte value in the three primary color pixel byte values; A serial number area image generating unit, used to generate a serial number area image in the RGB image correspondingly using the pixel values of the serial number identifiers stored in the R byte storage area and the G byte storage area, and the pixel values of the check values in the B byte storage area; The RGB image generating unit is used to generate the RGB image by merging the target area image and the serial number area image.
7. A data transmission device, applied to a data receiving device, comprising: A receiving module, used for receiving an RGB image, wherein the RGB image is sent by a data sending device through the data transmission method according to any one of claims 1 to 2; The image analysis module is used to obtain a two-dimensional code image by analyzing the RGB image.
8. A data transmission system, characterized in that: The data transmission system includes a data receiving device and a data sending device; The data receiving device and the data sending device both include: at least one processor, and a memory communicatively connected to the at least one processor; The memory of the data sending device stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the steps performed by the data sending device in the data transmission method according to any one of claims 1 to 2; The memory of the data receiving device stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the steps performed by the data receiving device in the data transmission method described in any one of claims 3 to 5.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the data transmission method described in any one of claims 1-2 and / or the data transmission method described in any one of claims 3-5 when executed.
Citation Information
Patent Citations
Method for realizing color two-dimensional code
CN106485305A