Graph compression and transmission method and system suitable for resource restriction equipment

By detecting image features on resource-constrained devices and combining multiple compression algorithms, the problem of excessive memory occupation by decoders in the existing technology is solved, efficient image compression and transmission is achieved, and it is suitable for real-time display on resource-constrained devices.

CN120812291APending Publication Date: 2025-10-17NO 4 HOST TECHNOLOGY (CHENGDU) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510981517.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-16
Publication Date
2025-10-17

AI Technical Summary

Technical Problem

Existing image compression formats are difficult to deploy on resource-constrained devices, resulting in the decoder occupying too much memory, being unable to decode and display in real time, and lacking a common structure and end-to-end collaborative optimization capabilities.

Method used

It adopts a graphics compression method suitable for resource-constrained devices, determines the compression strategy through image feature detection, combines multiple compression strategies such as RLE, LZ4, QOI and zlib algorithms to generate headers and compressed data, supports different image features, and simplifies the decoding logic on the device side.

Benefits of technology

It achieves efficient image compression and transmission on resource-constrained devices, supports multiple compression strategy combinations, adapts to different image characteristics, unifies the compression protocol structure, facilitates expansion and device decoding, and is suitable for embedded real-time display.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120812291A_ABST
    Figure CN120812291A_ABST
Patent Text Reader

Abstract

The invention discloses a graph compression and transmission method and system suitable for resource restriction equipment, which can efficiently compress, transmit and restore to RGB888 for display under the condition that floating points, dynamic allocation or complex cache management are not needed and a standard decoder is not needed for the resource restriction equipment. Moreover, the method can support a plurality of compression strategy combinations (such as RLE + LZ4) through a protocol and adapt to different image features, and further, the method realizes a unified compression protocol structure and is convenient for expansion and equipment decoding; and the decoding logic at the equipment end is extremely simple, and the method is suitable for embedded real-time display.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of data transmission, and more particularly, to a graphic compression transmission method and system suitable for resource-limited devices. BACKGROUND

[0002] Existing image compression formats (JPEG, WebP, HEIC, etc.) are widely used in network image transmission. These standard formats rely on corresponding complex image decoders, which can effectively compress images and efficiently display in devices with sufficient computing resources. However, in resource-limited devices such as LED display screen controllers and lightweight MCUs, such decoders are difficult to deploy, occupying too much memory and possibly unable to decode and display in real time.

[0003] For example, although the WebP format has high compression rate, its decoder relies on a large amount of dynamic memory and floating point calculation, which is not suitable for embedded devices with low clock frequency and limited memory. In the scenario of limited Bluetooth communication bandwidth, directly transmitting RGB888 data results in too large volume and serious delay. Therefore, the existing technology has the following defects in the application scenario of "lightweight device image display":

[0004] 1. Unable to use high compression rate standard format;

[0005] 2. Custom compression format is difficult to extend and lacks a general structure;

[0006] 3. Low data transmission efficiency, lack of end-to-end collaborative optimization capability. SUMMARY

[0007] The present application overcomes the deficiency of the prior art that the decoder performance requirement is high when compressing and transmitting pictures, and provides a graphic compression and transmission method and system suitable for resource-limited devices, in order to solve the problems existing in the prior art.

[0008] To solve the above technical problems, one aspect of the present application provides a graphic compression method suitable for resource-limited devices:

[0009] A graphic compression method suitable for resource-limited devices, comprising the following steps:

[0010] S1 inputting an image and extracting image features for detection;

[0011] S2 determining a compression strategy according to the image feature detection result;

[0012] S3 compressing according to the compression strategy, and detecting the size of the compressed image;

[0013] S4 if the image after once compression meets the size requirement, execute S5, if the image after once compression does not meet the size requirement, carry out secondary compression;

[0014] S5 generates Header and compressed data.

[0015] The application can be efficiently compressed, transmitted and restored to RGB888 for display without having floating point, dynamic allocation or complex cache management for resource-limited devices, without having a standard decoder.

[0016] In the above steps, it is judged whether secondary compression is needed after preliminary compression, because small files do not need secondary compression and MCU decoding is faster.

[0017] Further technical solutions are that the S2 specifically includes the following steps:

[0018] S21 judges whether the color variety of the picture is low, if the color variety is lower than the average level, execute S211, if the color variety is higher than the average level, execute S221;

[0019] S211: judge whether there is a large area of the same color region, if there is, execute S212, if not, adopt RLE and LZ4 combined compression strategy;

[0020] S212, judge whether the same color value region is continuous, if yes, adopt RLE compression strategy, if not, adopt QOI compression strategy;

[0021] S221: judge whether the image has local repeated patterns, if yes, adopt QOI and LZ4 combined compression strategy, if not, execute S222;

[0022] S222: judge whether the image details are rich, if rich, adopt QOI and LZ4 combined compression strategy, if not, adopt QOI compression strategy.

[0023] Further technical solutions are that the S4 carries out secondary compression specifically by adopting zlib compression strategy.

[0024] Further, the format of the generated compressed data is: [Header Byte][Payload Data…].

[0025] The Header Byte is used to indicate the compression method of the image resource.

[0026] The Payload Data is the specific image resource.

[0027] Further, the step of determining whether the image has a local repeating pattern in S221 includes the following steps:

[0028] Divide the image into small blocks.

[0029] Generate the color mean and hash value of each small block.

[0030] Compare the Hamming distance between the blocks to evaluate the similarity.

[0031] Further, the step of determining whether the image has a local repeating pattern in S222 includes the following steps:

[0032] Combine the image entropy and local variance to determine.

[0033] The application also provides a graphic compression transmission method suitable for resource-limited devices, including the following steps:

[0034] S01 The uploading device performs the graphic compression method according to any one of claims 1-5, and transmits the processed image data, compression chain and Header data to the transmission device.

[0035] S02 Connect the transmission device and the receiving device, and the receiving device sends an image data request to the transmission device.

[0036] S03 The transmission device transmits the image data, compression chain and Header data to the receiving device.

[0037] S04 The receiving device reads the compression algorithm supported by the display device, and if the image data compression algorithm is supported, the processed image data, compression chain and Header data are transmitted; if the compression algorithm is not supported, S05 is performed.

[0038] S05 The receiving device decompresses the image data, compression chain and Header data, re-compresses the decompressed data according to the compression method supported by the display device, and sends the newly compressed image data and decoding data to the display device.

[0039] Further, the following steps are performed after S05

[0040] S06 display device in receiving image data, compression chain and Header data, according to the compression chain decompression, display device in receiving image data and decoding data, the image data is decompressed and displayed.

[0041] The above method can not only realize the transmission of images between different terminals, but also support the uploading of image compression results to the server and directly used for device transparent display, avoiding repeated compression and decompression.

[0042] The application also provides a graphic compression transmission system suitable for resource limited devices, comprising a transmission device, a receiving device, and a uploading device.

[0043] The transmission device is used for reading the compression algorithm supported by the receiving device, and executing the compression method according to the reading result, and transmitting the Header and compressed data to the receiving device or generating the Header and uncompressed original RGB888 data, and combining the Header and RGB888 data and transmitting to the receiving device.

[0044] The receiving device is used for receiving the Header and compressed data or the Header and RGB888 data, decompressing the compressed data and converting into RGB888 data after receiving the Header and compressed data.

[0045] Further, the graphic compression transmission system further comprises an uploading device.

[0046] The uploading device is used for compressing the image data according to the compression chain, and transmitting the compression data result and the compression chain and Header data to the transmission device.

[0047] Compared with the prior art, the application has at least the following beneficial effects: for resource limited devices, without floating point, dynamic allocation or complex cache management, without standard decoder, the image can be compressed, transmitted and restored to RGB888 for display efficiently. Moreover, the method can support multiple compression strategy combinations (such as RLE+LZ4) through protocol, adapt to different image features, further, the application realizes unified compression protocol structure, which is convenient for extension and device decoding; the decoding logic is extremely simple at the device end, which is suitable for embedded real-time display. BRIEF DESCRIPTION OF DRAWINGS

[0048] Figure 1 It is a whole flowchart of the embodiment one of the application.

[0049] Figure 2 It is a flowchart of the step S2 of the embodiment one of the application.

[0050] Figure 3 It is a flowchart of the embodiment two of the application. DETAILED DESCRIPTION

[0051] In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and should not be used to limit the present application.

[0052] Embodiment one

[0053] A graphic compression method suitable for resource-limited devices, referring to Figure 1 、 Figure 2 The method comprises the following steps:

[0054] S1 inputting an image and extracting image features for detection;

[0055] For example, the image features are pixel features such as color types, area repetition, etc.

[0056] S2 determining a compression strategy according to the image feature detection result;

[0057] For example, the compression strategy comprises [QOI→LZ4], [RLE→LZ4→Zlib], etc.

[0058] In a preferred embodiment, the S2 specifically comprises the following steps:

[0059] S21 determining whether the color types of the image are less, if the color types are lower than the average level, executing S211; if the color types are higher than the average level, executing S221;

[0060] The color types can be limited according to the use requirements, in the embodiment, when the color types are greater than or equal to 256, it is determined that the color types are more, and when the color types are lower than 256, it is determined that the color types are less;

[0061] S211: determining whether there is a large-area same-color region, if there is, executing S212; if there is not, adopting a combined compression strategy of RLE and LZ4;

[0062] In the embodiment, the determination of the large-area same-color region adopts the Flood Fill algorithm, the principle of which is: starting from a pixel, recording all the adjacent pixels with the same color. The pixel can be understood as the center of a nine-square grid, then determining whether the color of the edge of the nine-square grid is the same as that of the center point. If the colors are the same, continuing to spread from the adjacent pixel until the boundary or the color is different, and finally finding a piece of “interrelated” same-color region.

[0063] The determination of large areas of the same color can be limited according to usage requirements. In this embodiment, it is calculated based on the pixel ratio, that is, when the ratio of the connected area of ​​a certain color to the entire image is greater than 20%, it is determined to be a large area.

[0064] S212, determining whether the regions with the same color value are continuous, if so, adopting the RLE compression strategy; if not, adopting the QOI compression strategy;

[0065] After determining the large area of ​​the same color, we then determine whether the same color value is continuous. The reason for this is that the calculation of continuity does not include diagonals and verticals, while the Flood Fill algorithm includes diagonals (i.e., the four corners of the nine-square grid).

[0066] Color blocks are horizontally or vertically continuous: use RLE compression;

[0067] Large area but not horizontally continuous: use QOI compression;

[0068] Since the RLE principle is to compress line by line according to the scan line, the same diagonal color does not affect the compression effect of each RLE line.

[0069] S221: Determine whether the image has a local repeating pattern. If so, adopt the QOI and LZ4 combined compression strategy; if not, execute S222;

[0070] In this embodiment, determining whether the image has a local repeated pattern in S221 includes the following steps:

[0071] Divide the image into small blocks;

[0072] Generate the color mean and hash value for each small block;

[0073] Compare the Hamming distances between blocks to evaluate similarity.

[0074] For example, the image is divided into 4×4 blocks, and the color mean and hash value are generated for each block. The Hamming distance between blocks is then compared to assess similarity. If the proportion of similar blocks is greater than 40%, it is determined that a local repeating pattern exists.

[0075] Specifically, it includes the following steps

[0076] Step 1: Divide the image into 4×4 blocks, that is, each image is divided into only a limited number of regions to facilitate fast calculation and analysis;

[0077] Step 2: Average the RGB pixels within the small block to obtain the dominant color signature for that block. This dominant color value is used to generate a hash value, Hi. Generate the average of 16 RGB pixels and hash values, H0 to H15. This hash is not used for encryption, but rather to determine visual similarity.

[0078] Step three: for any two blocks i, j in the 16 image blocks, calculate the Hamming distance d(i, j) between their hash values (H_i, H_j)

[0079] d(i, j) = HammingDistance(H_i, H_j);

[0080] Get C(16, 2) = 120 d(i, j), set the Hamming distance less than 3 when considering two blocks similar, through double loop to 120 pairs of small blocks.

[0081] Step four: if the total number of blocks is N, and the total number of similar block pairs is M, if M / C(N,2)>40%, then the image has a repeating pattern. Then there are C(16,2)=120 pairs of image blocks in the 16 image blocks, and the number of similar pairs is M; if M / 120>40% (i.e. more than 48 pairs of image blocks are considered similar), it is considered that the image has obvious local repeating pattern.

[0082] In this embodiment, the final statistics found that there are 52 pairs of small blocks with Hamming distance less than 3, so the ratio of similar block pairs is:

[0083] M / 120 = 52 / 120 ≈ 43%;

[0084] Since it is greater than 40%, it is determined that the image has a local repeating pattern.

[0085] S222: determine whether the image details are rich, if rich, use QOI and LZ4 combined compression strategy; if not rich, use QOI compression strategy.

[0086] The S222 of determining whether the image details are rich specifically includes the following steps:

[0087] Combined with image entropy and local variance.

[0088] Combined with image entropy and local variance, image entropy reflects the overall complexity, and local variance reflects the density of detail change area. If the entropy value is greater than 6.0 and the high variance area is greater than 40%, it is determined that the details are rich.

[0089] Exemplary, including the following steps:

[0090] Step one: calculate the image entropy H, the image gray value i,

[0091] In this embodiment, the gray scale histogram of the whole image is counted to obtain the probability p0~p255 of each gray scale value, and the information amount corresponding to each probability is calculated , the total entropy H of the whole image is obtained by adding all the gray value information.

[0092] ;

[0093] where p_i is the probability of i;

[0094] Take the result H = 6.8 in this embodiment as an example.

[0095] Step two: divide the image into 4x4 small blocks, and the pixel gray value in each block is x_i, the total number of pixels is n, and the average value is μ. Calculate the local variance of the 16 blocks:

[0096] ;

[0097] In this embodiment, σ² is greater than the set threshold 500, and it is considered to be a high variance region. The high variance region proportion is calculated.

[0098] Take the result in this embodiment as an example, where σ² of 10 small blocks is >500, and the high variance region proportion is:

[0099] 10 / 16 = 62.5%;

[0100] Step three: combined comparison, if H > 6.0 and the high variance region proportion > 40%, it is considered to be rich in details, otherwise it is considered to be not rich.

[0101] In this embodiment, H > 6.0 and the high variance region proportion > 40%, it is considered to be rich in details.

[0102] S3 compresses according to the compression strategy, and detects the size of the compressed image;

[0103] S4 if the image after one compression meets the size requirement, execute S5, if the image after one compression does not meet the size requirement, perform secondary compression;

[0104] In a preferred embodiment, the secondary compression in S4 specifically adopts a zlib compression strategy.

[0105] S5 generates Header and compressed data.

[0106] In a preferred embodiment, the format of the compressed data is: [Header Byte][PayloadData...];

[0107] Where Header Byte is used to indicate the compression method of the image resource:

[0108] Where Payload Data is a specific image resource.

[0109] For example, the data structure of the Header Byte is: [1 bit: whether zlib] [3 bits: reserved / extension bits] [4 bits: compression chain type ID].

[0110] [1 bit: whether zlib] is represented by 1 bit, and the subsequent data also refers to the above representation method.

[0111] Embodiment Two

[0112] A graphics compression transmission method suitable for resource-limited devices, see Figure 3 , comprising the following steps:

[0113] In this embodiment, a server, a terminal 1, a terminal 2, and a display device are included, wherein the terminal 1 is an upload device, the terminal 2 is an acceptance device, and the server is a transmission device.

[0114] S01 The upload device performs the graphics compression method according to any one of claims 1-5, and transmits the processed image data, compression chain, and Header data to the transmission device.

[0115] S02 Connect the transmission device and the receiving device, and the receiving device sends an image data request to the transmission device.

[0116] S03 The transmission device transmits the image data, compression chain, and Header data to the receiving device.

[0117] S04 The receiving device reads the compression algorithm supported by the display device, and if the image data compression algorithm is supported, the processed image data, compression chain, and Header data are transmitted; if the compression algorithm is not supported, S05 is performed.

[0118] S05 The receiving device decompresses the image data, compression chain, and Header data, re-compresses the decompressed data according to the compression method supported by the display device, and sends the newly compressed image data and decoding data to the display device.

[0119] S06 When the display device receives the image data, compression chain, and Header data, it decompresses according to the compression chain, and when it receives the image data and decoding data, it decompresses and displays the image data.

[0120] Embodiment Three

[0121] A graphics compression transmission system suitable for resource-limited devices, characterized in that it comprises a transmission device and a receiving device.

[0122] The transmission device is used to read the compression algorithm supported by the receiving device, and execute the compression method according to the reading result, and transmit the Header and the compressed data to the receiving device or generate the Header and the original RGB888 data without compression, and transmit the Header and the RGB888 data to the receiving device.

[0123] The receiving device is used to receive the Header and the compressed data or the Header and the RGB888 data, decompress the compressed data and convert into the RGB888 data after receiving the Header and the compressed data.

[0124] The preferred embodiment is that the graphic compression transmission system further comprises an uploading device.

[0125] The uploading device is used to compress the image data according to the compression chain, and transmit the compression data result and the compression chain and the Header data to the transmission device.

[0126] Although the present application has been described with reference to explanatory examples of the present application, it is to be understood that many other modifications and implementations can be devised by those skilled in the art without departing from the principles and spirit of the application disclosed herein. More particularly, various modifications and improvements can be made to the components of the subject combination layout and / or the layout within the scope of the application disclosed herein. In addition to the modifications and improvements to the components and / or the layout, other uses will also be apparent to those skilled in the art.

Claims

1. A graphics compression method suitable for resource-constrained devices, characterized in that: The following steps are involved: S1 inputs the image and extracts image features for detection; S2 determines the compression strategy based on the image feature detection results; S3 compresses the image according to the compression strategy and performs size detection on the compressed image; If the image meets the size requirement after the first compression in step S4, then step S5 is executed. If the image does not meet the size requirement after the first compression, then a second compression is performed. S5 generates the header and compressed data.

2. A graphics compression method suitable for resource-constrained devices as claimed in claim 1, characterized in that: The S2 specifically includes the following steps: S21 determines whether the color variety of the image is small. If the color variety is lower than the average level, execute S211; if the color variety is higher than the average level, execute S221; S211: Determine whether there is a large area of ​​the same color. If so, execute S212; if not, adopt the RLE and LZ4 combined compression strategy; S212: Determine whether the regions with the same color value are continuous. If so, adopt the RLE compression strategy; if not, adopt the QOI compression strategy; S221: Determine whether the image has a local repeating pattern. If so, adopt the QOI and LZ4 combined compression strategy; if not, execute S222; S222: Determine whether the image details are rich. If so, adopt the QOI and LZ4 combined compression strategy; if not, adopt the QOI compression strategy.

3. The method for compressing graphics suitable for resource-constrained devices according to claim 1, wherein: The secondary compression in S4 adopts the zlib compression strategy.

4. The method for compressing graphics suitable for resource-constrained devices according to claim 1, wherein: The format of generating compressed data is: [Header Byte][Payload Data...]; The Header Byte is used to indicate the compression method of the image resource: Payload Data is the specific image resource.

5. The method for compressing graphics suitable for resource-constrained devices according to claim 2, wherein: Determining whether the image has a local repeated pattern in S221 includes the following steps: Divide the image into small blocks; Generate the color mean and hash value for each small block; Compare the Hamming distances between blocks to evaluate similarity.

6. The method for compressing graphics suitable for resource-constrained devices according to claim 2, wherein: The determination of whether the image details are rich in S222 specifically includes the following steps: Combining image entropy and local variance for judgment.

7. A method for graphics compression transmission suitable for resource-constrained devices, characterized in that: The following steps are involved: S01: the uploading device executes the graphic compression method according to any one of claims 1 to 5, and transmits the processed image data, compression chain and header data to the transmission device; S02 connects the transmission device and the receiving device, and the receiving device sends an image data request to the transmission device; S03 transmission device transmits image data, compression chain and Header data to receiving device; S04: The receiving device reads the compression algorithm supported by the display device. If the image data compression algorithm is supported, the processed image data, compression chain, and header data are transmitted. If the compression algorithm is not supported, S05 is executed. S05 The receiving device decompresses the image data, the compression chain and the header data, recompresses the decompressed data according to the compression method supported by the display device, and sends the newly compressed image data and the decoded data to the display device.

8. The method for compressing and transmitting graphics suitable for resource-constrained devices according to claim 7, wherein: Perform the following steps after S05 S06: When the display device receives the image data, the compression chain and the header data, it decompresses the image data according to the compression chain. When the display device receives the image data and the decoded data, it decompresses the image data and displays it.

9. A graphics compression transmission system suitable for resource-constrained devices, characterized in that: Including transmission equipment and receiving equipment; The transmission device is used to read the compression algorithm supported by the receiving device, execute the compression method according to the reading result, and transmit the header and compressed data to the receiving device or generate the header and uncompressed original RGB888 data, and transmit the header and RGB888 data together to the receiving device; The receiving device is used to receive the header and compressed data or the header and RGB888 data, and after receiving the header and compressed data, decompress the compressed data and convert it into RGB888 data.

10. The graphics compression transmission system applicable to resource-constrained devices according to claim 9, characterized in that: Also includes, uploading equipment; The uploading device is used to compress the image data according to the compression chain, and transmit the compressed data result, the compression chain and the Header data to the transmission device.