[go: up one dir, main page]

WO2023231265A1 - Lossless compression algorithm and apparatus based on embedded system picture, and computer device and storage medium - Google Patents

Lossless compression algorithm and apparatus based on embedded system picture, and computer device and storage medium Download PDF

Info

Publication number
WO2023231265A1
WO2023231265A1 PCT/CN2022/124312 CN2022124312W WO2023231265A1 WO 2023231265 A1 WO2023231265 A1 WO 2023231265A1 CN 2022124312 W CN2022124312 W CN 2022124312W WO 2023231265 A1 WO2023231265 A1 WO 2023231265A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
node
source
source data
compressed
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2022/124312
Other languages
French (fr)
Chinese (zh)
Inventor
田亚雷
龚文博
周勇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Woody Vapes Technology Co Ltd
Original Assignee
Shenzhen Woody Vapes Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Woody Vapes Technology Co Ltd filed Critical Shenzhen Woody Vapes Technology Co Ltd
Publication of WO2023231265A1 publication Critical patent/WO2023231265A1/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/48Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using compressed domain processing techniques other than decoding, e.g. modification of transform coefficients, variable length coding [VLC] data or run-length data

Definitions

  • the present application relates to the technical field of data compression algorithms, and in particular to a lossless compression algorithm, device, computer equipment and storage medium based on embedded system images.
  • tiny embedded systems it is often necessary to store a large amount of data, such as pictures displayed on TFT color screens and OLED screens. If these pictures are stored in the form of original files, they will occupy a large amount of ROM space in the system, and even require the use of additional memory chips. Increases the size and cost of the equipment.
  • algorithms such as dictionary, Huffman coding, and Lempel-Ziv also consume a large amount of system RAM when decoding, or there is a certain loss of data after compression.
  • the RAM capacity is generally very small, which is not enough to support the RAM required for decoding the above algorithm; if there is data loss, there will be certain defects when displayed on the display.
  • Embodiments of the present application provide a lossless compression algorithm, device, computer equipment and storage medium based on embedded system pictures, aiming to solve the technical problem that existing pictures occupy a large space for storage in the WeChat embedded system.
  • this application provides a lossless compression algorithm based on embedded system images, including the following steps:
  • node data If the node data appears in the source data, insert specific characters after the node data. If the node data is data that is not in the source data, no processing is performed to obtain the node identification data;
  • the statistical data is compressed and embedded into the source data together with the node identification data to obtain compressed storage data.
  • the step of counting the length and mark position of the compressible data in the source data includes the following steps:
  • Position marks are performed on the positions of all compressible data segments to obtain the mark positions.
  • the step of compressing the statistical data and embedding it into the source data together with the node identification data to obtain compressed storage data includes the following steps:
  • the local compressed data and the node replacement data are respectively inserted into corresponding mark positions of the source data.
  • the step of determining the data with the lowest frequency of occurrence in the source data or the data in the non-source data and marking it as node data also includes the step of performing modulo processing on the compressed image to obtain the source data.
  • embodiments of the present application provide a lossless compression device based on embedded system pictures, which includes the following units:
  • the node data determination unit is used to determine the data with the lowest frequency of occurrence in the source data or the data in non-source data, and mark it as node data;
  • Compressed data statistics unit used to count the data length and mark position of compressible data in source data
  • the node data processing unit is used to insert specific characters after the node data if the node data appears in the source data. If the node data is not data in the source data, no processing is performed to obtain the node identifier. data;
  • a source data compression unit is configured to compress the statistical data and embed it into the source data together with the node identification data to obtain compressed storage data.
  • the compressed data statistics unit includes:
  • the data length statistics unit is used to count data lengths where the number of adjacent identical data in the source data is greater than the set value to obtain the data length value
  • the position marking unit is used to mark the positions of all compressible data segments to obtain the mark positions.
  • the source data compression unit includes:
  • the compressed data replacement unit is used to replace compressible data with: node data + data length value + one bit of source data to obtain partially compressed data;
  • the node data replacement unit is used to replace data that is the same as node data with: node data + specific characters to obtain node replacement data;
  • a data embedding unit is configured to insert the local compressed data and the node replacement data into corresponding mark positions of the source data respectively.
  • the method further includes: a modulo unit, which is used to perform modulo processing on the compressed image to obtain source data.
  • inventions of the present application provide a computer device.
  • the computer device includes a memory and a processor.
  • a computer program is stored on the memory.
  • the processor executes the computer program, the above is implemented. Lossless compression algorithm based on embedded system images.
  • embodiments of the present application provide a computer-readable storage medium that stores a computer program.
  • the computer program When the computer program is executed by a processor, the computer program can realize the above-mentioned lossless processing based on embedded system pictures. Compression algorithm.
  • inventions of the present application provide a lossless compression algorithm, device, computer equipment and storage medium based on embedded system pictures.
  • the method includes: determining the data with the lowest frequency of occurrence in the source data or the non-lossless compression algorithm. Mark the data in the source data as node data; count the data length of the compressible data in the source data and mark the position to obtain statistical data; if the node data appears in the source data, insert it after the node data Specific characters, if the node data is non-source data, no processing is performed to obtain node identification data; the statistical data is compressed and embedded into the source data together with the node identification data to obtain compression Later stored data.
  • Figure 1 is the main flow chart of the lossless compression algorithm based on embedded system pictures provided by the embodiment of the present application;
  • Figure 2 is a sub-flow chart of a lossless compression algorithm based on embedded system images provided by an embodiment of the present application
  • Figure 3 is a sub-flow chart of the lossless compression algorithm based on embedded system pictures provided by the embodiment of the present application;
  • Figure 4 is a schematic diagram of a node matching device of a server provided by an embodiment of the present application.
  • Figure 5 is a schematic block diagram of a computer device provided by an embodiment of the present application.
  • Figure 1 is the main flow chart of the lossless compression algorithm based on embedded system pictures provided by the embodiment of the present application.
  • Figures 2 and 3 are schematic sub-flow diagrams.
  • the embedded system-based lossless compression algorithm of the embodiment of the present application is The lossless compression algorithm for system images is mainly used in image storage of micro-embedded systems and display products driven by micro-embedded systems. Specifically, implementing the lossless compression algorithm based on embedded system images includes the following steps:
  • Step S100 Perform modulo processing on the compressed image to obtain source data.
  • the storage of pictures is generally processed by modulo software to convert the pictures into ordinary data for storage.
  • Modulo processing is to convert the pixels of the picture into corresponding binary data, in the form of data. storage.
  • TFT color screens generally use RGB565 or RGB888. Each pixel of RGB565 occupies 2 bytes (16 bit), and each pixel of RGB888 occupies 3 bytes (24 bit).
  • a complete picture assuming a width of 80 pixels and a length of 160 pixels, will occupy 80*160*2 byte (i.e. 25K byte) or 80*160*3 byte (37.5 K byte), just one picture consumes a lot of ROM space.
  • Step S200 Determine the data with the lowest frequency of occurrence or the data that does not appear in the source data, and mark it as node data; after the image is subjected to modulo processing, it exists in the form of binary encoding. If the binary encoding of the same pixel is the same, select it. The data with the lowest frequency of occurrence is used as node data. Generally speaking, the data with the lowest frequency of occurrence does not need to be compressed and can be kept as is. Therefore, the data with the lowest frequency of occurrence is used as node data. This node data is used for subsequent compression algorithm processing. node identifier.
  • the node data since the function of the node data is to serve as a node identifier, other data that does not appear in the source data can also be used.
  • the node identifier needs to be distinguished and an identifier bit added. Will slightly increase the size of the compressed data.
  • the node data is marked as SKP, and data that does not appear in the source data is given priority. Only one SKP is needed. On the one hand, when decoding and searching for SKP, the number of searches is as small as possible; on the other hand, it prevents SKP from being used in SKP. It appears too many times in the source data. Inserting specific characters after SKP will increase the number of source data.
  • Step S300 Count the data length of the compressible data in the source data and mark the position to obtain statistical data; that is, determine which data segments need to be compressed according to the compression rules, and mark the position of the compressed data segment in the source data so that Subsequently, the compressed data is embedded in the corresponding location.
  • the step S300 of counting the length and mark position of the compressible data in the source data includes the following steps:
  • Step S301 Count the number of adjacent identical data in the source data that is greater than the data length of the set value to obtain the data length value; for example, if the set value is 5, then count the number of adjacent identical data in the source data greater than or equal to 5 data segments, that is, data segments that meet the above conditions, need to be compressed.
  • the above setting value can be determined according to the complexity of the source data. For source data with lower complexity, choose a smaller setting value, and vice versa, choose a larger setting value.
  • Step S302 Position mark the positions of all compressible data segments to obtain the mark positions.
  • the purpose of marking the location of the statistically compressed data segment is to make it easier to find the corresponding location for subsequent replacement of compressed data, and to quickly restore the compressed data to its original location during decoding.
  • Step S400 If the node data is the same as the source data, then if the node data appears in the source data, insert a specific character after the node data. If the node data is not data in the source data, no operation will be performed. Any processing to get node identification data. Since the node data is part of the source data, it needs to be identified during the compression and pressurization processes. The identification also exists in the data in the source data, not just the node identification. If the node identifier uses data that is not the same as the source data, then the node data bits will be replaced with the corresponding source data during compression and decoding.
  • Step S500 Compress the statistical data and embed it into the source data together with the node identification data to obtain compressed storage data.
  • the step S500 of compressing the statistical data and embedding it into the source data together with the node identification data to obtain compressed storage data includes the following steps:
  • Step S501 Replace the compressible data with: node data + data length value + one bit of source data to obtain partially compressed data; wherein, the node data bit identifies that subsequent data is compressed, and the data length value is described in detail Determines the data length of the compressed data, and one source data bit describes the original data type of the compressed segment, such as red.
  • adjacent identical data segments can be simplified into three-digit data combinations, greatly reducing the amount of data.
  • Step S502 Replace data that is the same as the node data with: node data + specific characters to obtain node replacement data; if the node data is the same data as the source data, then the specific characters after the node data can describe the existence of the source data. Data segments that are the same as node data need to be supplemented accordingly when unlocking. If the node data is not part of the source data, then the node data is directly replaced with the same data as the subsequent corresponding one-bit source data.
  • Step S503 Insert the local compressed data and the node replacement data into corresponding mark positions of the source data respectively.
  • the uncompressed data segments are still retained in the original order. After replacing the compressed data segments according to the above rules, the storage data can be generated again.
  • an embodiment of the present application provides a lossless compression device 100 based on embedded system pictures, which includes the following units:
  • the modulus unit 101 is used to perform modulo processing on the compressed image to obtain source data.
  • the node data determining unit 102 is used to determine the data with the lowest frequency of occurrence in the source data or the data in the non-source data, and mark it as node data;
  • the compressed data statistics unit 103 is used to count the data length and mark position of the compressible data in the source data
  • the compressed data statistics unit 103 includes:
  • the data length statistics unit 1031 is used to count the data length in the source data where the number of adjacent identical data is greater than the set value to obtain the data length value;
  • the position marking unit 1032 is used to mark the positions of all compressible data segments to obtain the mark positions.
  • the node data processing unit 104 is used to insert specific characters after the node data if the node data appears in the source data. If the node data is not data in the source data, no processing is performed to obtain the node. identification data;
  • the source data compression unit 105 is configured to compress the statistical data and embed it into the source data together with the node identification data to obtain compressed storage data.
  • the source data compression unit 105 includes:
  • the compressed data replacement unit 1051 is used to replace compressible data with: node data + data length value + one bit of source data to obtain partially compressed data;
  • the node data replacement unit 1052 is used to replace data that is the same as the node data with: node data + specific characters to obtain node replacement data;
  • the data embedding unit 1053 is configured to insert the local compressed data and the node replacement data into corresponding mark positions of the source data respectively.
  • An embodiment of the present application provides a computer device.
  • the computer device includes a memory and a processor.
  • a computer program is stored on the memory.
  • the processor executes the computer program, the above-mentioned steps are implemented.
  • the program instructions include:
  • Step S100 Perform modulo processing on the compressed image to obtain source data.
  • Step S200 Determine the data with the lowest frequency of occurrence or the data that does not appear in the source data, and mark it as node data.
  • Step S300 Count the data length of the compressible data in the source data and mark the position to obtain statistical data.
  • Step S400 If the node data is the same as the source data, then if the node data appears in the source data, insert a specific character after the node data. If the node data is not data in the source data, no operation will be performed. Any processing to get node identification data.
  • Step S500 Compress the statistical data and embed it into the source data together with the node identification data to obtain compressed storage data.
  • the computer device may be a terminal or a server, where the terminal may be an electronic device with communication functions such as a smartphone, a tablet computer, a notebook computer, a desktop computer, a personal digital assistant, a wearable device, etc.
  • the server can be an independent server or a server cluster composed of multiple servers.
  • the computer device 500 includes a processor 502, a memory, and a network interface 505 connected through a system bus 501, where the memory may include a non-volatile storage medium 503 and an internal memory 504.
  • the non-volatile storage medium 503 can store an operating system 5031 and a computer program 5032.
  • the computer program 5032 includes program instructions that, when executed, can cause the processor 502 to execute a lossless compression algorithm based on embedded system images.
  • the processor 502 is used to provide computing and control capabilities to support the operation of the entire computer device 500 .
  • the internal memory 504 provides an environment for the execution of the computer program 5032 in the non-volatile storage medium 503.
  • the computer program 5032 When executed by the processor 502, it can cause the processor 502 to execute a lossless compression algorithm based on embedded system images. .
  • the network interface 505 is used for network communication with other devices.
  • the structure shown in Figure 4 is only a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device 500 to which the solution of the present application is applied.
  • the specific computer device 500 may include more or fewer components than shown, some combinations of components, or a different arrangement of components.
  • Embodiments of the present application also provide a storage medium that stores a computer program.
  • the computer program includes program instructions. When executed by a processor, the program instructions can implement the above method.
  • the program instructions include the following steps:
  • Step S100 Perform modulo processing on the compressed image to obtain source data.
  • the storage of pictures is generally processed by modulo software to convert the pictures into ordinary data for storage.
  • Modulo processing is to convert the pixels of the picture into corresponding binary data, in the form of data. storage.
  • TFT color screens generally use RGB565 or RGB888. Each pixel of RGB565 occupies 2 bytes (16 bit), and each pixel of RGB888 occupies 3 bytes (24 bit).
  • a complete picture assuming a width of 80 pixels and a length of 160 pixels, will occupy 80*160*2 byte (i.e. 25K byte) or 80*160*3 byte (37.5 K byte), just one picture consumes a lot of ROM space.
  • Step S200 Determine the data with the lowest frequency of occurrence or the data that does not appear in the source data, and mark it as node data; after the image is subjected to modulo processing, it exists in the form of binary encoding. If the binary encoding of the same pixel is the same, select it. The data with the lowest frequency of occurrence is used as node data. Generally speaking, the data with the lowest frequency of occurrence does not need to be compressed and can be kept as is. Therefore, the data with the lowest frequency of occurrence is used as node data. This node data is used for subsequent compression algorithm processing. node identifier.
  • the node data since the function of the node data is to serve as a node identifier, other data that does not appear in the source data can also be used.
  • the node identifier needs to be distinguished and an identifier bit added. Will slightly increase the size of the compressed data.
  • the node data is marked as SKP, and data that does not appear in the source data is given priority. Only one SKP is needed. On the one hand, when decoding and searching for SKP, the number of searches is as small as possible. On the other hand, it prevents SKP from being used in the source data. There are too many occurrences in the data. Inserting specific characters after SKP will increase the source data.
  • Step S300 Count the data length of the compressible data in the source data and mark the position to obtain statistical data; that is, determine which data segments need to be compressed according to the compression rules, and mark the position of the compressed data segment in the source data so that Subsequently, the compressed data is embedded in the corresponding location.
  • the step S300 of counting the length and mark position of the compressible data in the source data includes the following steps:
  • Step S301 Count the number of adjacent identical data in the source data that is greater than the data length of the set value to obtain the data length value; for example, if the set value is 5, then count the number of adjacent identical data in the source data greater than or equal to 5 data segments, that is, data segments that meet the above conditions, need to be compressed.
  • the above setting value can be determined according to the complexity of the source data. For source data with lower complexity, choose a smaller setting value, and vice versa, choose a larger setting value.
  • Step S302 Position mark the positions of all compressible data segments to obtain the mark positions.
  • the purpose of marking the location of the statistically compressed data segment is to make it easier to find the corresponding location for subsequent replacement of compressed data, and to quickly restore the compressed data to its original location during decoding.
  • Step S400 If the node data is the same as the source data, then if the node data appears in the source data, insert a specific character after the node data. If the node data is not data in the source data, no operation will be performed. Any processing to obtain the node identification data; since the node data is part of the source data, it needs to be identified during the compression and pressurization process. The identification also exists in the data in the source data, rather than simply the node identification. If the node identifier uses data that is not the same as the source data, then the node data bits will be replaced with the corresponding source data during compression and decoding.
  • Step S500 Compress the statistical data and embed it into the source data together with the node identification data to obtain compressed storage data.
  • the step S500 of compressing the statistical data and embedding it into the source data together with the node identification data to obtain compressed storage data includes the following steps:
  • Step S501 Replace the compressible data with: node data + data length value + one bit of source data to obtain partially compressed data; wherein, the node data bit identifies that subsequent data is compressed, and the data length value is described in detail Determines the data length of the compressed data, and one source data bit describes the original data type of the compressed segment, such as red.
  • adjacent identical data segments can be simplified into three-digit data combinations, greatly reducing the amount of data.
  • Step S502 Replace data that is the same as the node data with: node data + specific characters to obtain node replacement data; if the node data is the same data as the source data, then the specific characters after the node data can describe the existence of the source data. Data segments that are the same as node data need to be supplemented accordingly when unlocking. If the node data is not part of the source data, then the node data is directly replaced with the same data as the subsequent corresponding one-bit source data.
  • Step S503 Insert the local compressed data and the node replacement data into corresponding mark positions of the source data respectively.
  • the uncompressed data segments are still retained in the original order. After replacing the compressed data segments according to the above rules, the storage data can be generated again.
  • embodiments of the present application provide a lossless compression algorithm, device, computer equipment and storage medium based on embedded system pictures. By clustering the data of the pictures, multiple adjacent images can be processed. The same data is replaced with data in a set format, which greatly compresses the size of the data. For micro-embedded systems, no external storage is needed, which not only saves costs but also reduces the size of the equipment.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)
  • Compression Of Band Width Or Redundancy In Fax (AREA)

Abstract

Provided in the present application are a lossless compression algorithm and apparatus based on an embedded system picture, and a computer device and a storage medium. The algorithm comprises: determining the least frequent data in source data or data in non-source data, and marking the data as node data; compiling statistics on a data length of compressible data in the source data and marking a position, so as to obtain statistical data; if the node data appears in the source data, inserting a specific character after the node data, and if the node data is the data in the non-source data, not performing any processing so as to obtain node identification data; and compressing the statistical data, and then embedding the compressed statistical data together with the node identification data into the source data, so as to obtain compressed storage data. In the present invention, clustering processing is performed on data of pictures, and the same adjacent data appearing repeatedly is replaced with data in a set format, such that the size of the data is greatly compressed; and no external storage is required for a miniature embedded system, which saves on costs and also reduces the size of a device.

Description

基于嵌入式系统图片的无损压缩算法、装置、计算机设备及存储介质Lossless compression algorithm, device, computer equipment and storage medium based on embedded system images 技术领域Technical field

本申请涉及数据压缩算法技术领域,尤其涉及一种基于嵌入式系统图片的无损压缩算法、装置、计算机设备及存储介质。The present application relates to the technical field of data compression algorithms, and in particular to a lossless compression algorithm, device, computer equipment and storage medium based on embedded system images.

背景技术Background technique

在微小的嵌入式系统中,往往需要存储大量的数据,例如TFT彩屏、OLED屏显示的图片,这些图片如果以原始文件的方式存储,会占用系统大量的ROM空间,甚至需要额外使用存储芯片,增加了设备的体积及成本。此外,字典、霍夫曼编码、Lempel-Ziv等算法解码时也需要耗费大量的系统RAM,或者压缩后数据有一定的损失。对微小的嵌入式系统来说RAM容量一般是非常小的,不足以支撑上述算法解码时所需RAM;如果数据存在损失,在显示屏上显示时也会存在一定的缺陷。In tiny embedded systems, it is often necessary to store a large amount of data, such as pictures displayed on TFT color screens and OLED screens. If these pictures are stored in the form of original files, they will occupy a large amount of ROM space in the system, and even require the use of additional memory chips. Increases the size and cost of the equipment. In addition, algorithms such as dictionary, Huffman coding, and Lempel-Ziv also consume a large amount of system RAM when decoding, or there is a certain loss of data after compression. For tiny embedded systems, the RAM capacity is generally very small, which is not enough to support the RAM required for decoding the above algorithm; if there is data loss, there will be certain defects when displayed on the display.

发明内容Contents of the invention

本申请的实施例提供了一种基于嵌入式系统图片的无损压缩算法、装置、计算机设备及存储介质,旨在解决现有图片在微信嵌入式系统中存储占用空间较大的技术问题。Embodiments of the present application provide a lossless compression algorithm, device, computer equipment and storage medium based on embedded system pictures, aiming to solve the technical problem that existing pictures occupy a large space for storage in the WeChat embedded system.

为达到上述目的,本申请所提出的技术方案为:In order to achieve the above objectives, the technical solutions proposed in this application are:

第一方面,本申请提供了一种基于嵌入式系统图片的无损压缩算法,包括以下步骤:In the first aspect, this application provides a lossless compression algorithm based on embedded system images, including the following steps:

确定源数据中出现频率最低的数据或非源数据中的数据,将其标记为节点数据;Determine the data with the lowest frequency of occurrence in the source data or the data in non-source data, and mark it as node data;

统计源数据中可压缩数据的数据长度并标记位置,以得到统计数据;Count the data length of the compressible data in the source data and mark the location to obtain statistical data;

若所述节点数据出现于源数据,则在所述节点数据后插入特定字符,若所述节点数据为非源数据中的数据,则不作任何处理,以得到节点标识数据;If the node data appears in the source data, insert specific characters after the node data. If the node data is data that is not in the source data, no processing is performed to obtain the node identification data;

将所述统计数据压缩后与所述节点标识数据一并嵌入到源数据中以获得压缩后的存储数据。The statistical data is compressed and embedded into the source data together with the node identification data to obtain compressed storage data.

其中,所述统计源数据中可压缩数据的长度及标记位置的步骤包括以下步骤:Wherein, the step of counting the length and mark position of the compressible data in the source data includes the following steps:

统计源数据中相邻相同数据个数大于设定数值的数据长度,以得到数据长度值;Count the data length where the number of adjacent identical data in the source data is greater than the set value to obtain the data length value;

在所有可压缩数据段的位置进行位置标记,以得到标记位置。Position marks are performed on the positions of all compressible data segments to obtain the mark positions.

其中,所述将所述统计数据压缩后与所述节点标识数据一并嵌入到源数据中以获得压缩后的存储数据的步骤包括以下步骤:Wherein, the step of compressing the statistical data and embedding it into the source data together with the node identification data to obtain compressed storage data includes the following steps:

将可压缩数据替换为:节点数据+数据长度值+一位源数据,以得到局部压缩数据;Replace the compressible data with: node data + data length value + one bit of source data to obtain partially compressed data;

将与节点数据相同的数据替换为:节点数据+特定字符,以得到节点替换数据;Replace data that is the same as node data with: node data + specific characters to get node replacement data;

将所述局部压缩数据和所述节点替换数据分别插入到所述源数据的对应标记位置。The local compressed data and the node replacement data are respectively inserted into corresponding mark positions of the source data.

其中,所述确定源数据中出现频率最低的数据或非源数据中的数据,将其标记为节点数据的步骤之前还包括对被压缩的图片进行取模处理,以得到源数据的步骤。The step of determining the data with the lowest frequency of occurrence in the source data or the data in the non-source data and marking it as node data also includes the step of performing modulo processing on the compressed image to obtain the source data.

第二方面,本申请的实施例提供了一种基于嵌入式系统图片的无损压缩装置,其包括以下单元:In the second aspect, embodiments of the present application provide a lossless compression device based on embedded system pictures, which includes the following units:

节点数据确定单元,用于确定源数据中出现频率最低的数据或非源数据中的数据,将其标记为节点数据;The node data determination unit is used to determine the data with the lowest frequency of occurrence in the source data or the data in non-source data, and mark it as node data;

压缩数据统计单元,用于统计源数据中可压缩数据的数据长度及标记位置;Compressed data statistics unit, used to count the data length and mark position of compressible data in source data;

节点数据处理单元,用于若所述节点数据出现于源数据,则在所述节点数据后插入特定字符,若所述节点数据为非源数据中的数据,则不作任何处理,以得到节点标识数据;The node data processing unit is used to insert specific characters after the node data if the node data appears in the source data. If the node data is not data in the source data, no processing is performed to obtain the node identifier. data;

源数据压缩单元,用于将所述统计数据压缩后与所述节点标识数据一并嵌入到源数据中以获得压缩后的存储数据。A source data compression unit is configured to compress the statistical data and embed it into the source data together with the node identification data to obtain compressed storage data.

其中,所述压缩数据统计单元包括:Wherein, the compressed data statistics unit includes:

数据长度统计单元,用于统计源数据中相邻相同数据个数大于设定数值 的数据长度,以得到数据长度值;The data length statistics unit is used to count data lengths where the number of adjacent identical data in the source data is greater than the set value to obtain the data length value;

位置标记单元,用于在所有可压缩数据段的位置进行位置标记,以得到标记位置。The position marking unit is used to mark the positions of all compressible data segments to obtain the mark positions.

其中,所述源数据压缩单元包括:Wherein, the source data compression unit includes:

压缩数据替换单元,用于将可压缩数据替换为:节点数据+数据长度值+一位源数据,以得到局部压缩数据;The compressed data replacement unit is used to replace compressible data with: node data + data length value + one bit of source data to obtain partially compressed data;

节点数据替换单元,用于将与节点数据相同的数据替换为:节点数据+特定字符,以得到节点替换数据;The node data replacement unit is used to replace data that is the same as node data with: node data + specific characters to obtain node replacement data;

数据嵌入单元,用于将所述局部压缩数据和所述节点替换数据分别插入到所述源数据的对应标记位置。A data embedding unit is configured to insert the local compressed data and the node replacement data into corresponding mark positions of the source data respectively.

其中,还包括:取模单元,所述取模单元用于对被压缩的图片进行取模处理,以得到源数据。The method further includes: a modulo unit, which is used to perform modulo processing on the compressed image to obtain source data.

第三方面,本申请的实施例提供了一种计算机设备,所述计算机设备包括存储器及处理器,所述存储器上存储有计算机程序,所述处理器执行所述计算机程序时实现如上所述的基于嵌入式系统图片的无损压缩算法。In a third aspect, embodiments of the present application provide a computer device. The computer device includes a memory and a processor. A computer program is stored on the memory. When the processor executes the computer program, the above is implemented. Lossless compression algorithm based on embedded system images.

第四方面,本申请的实施例提供了一种计算机可读存储介质,所述存储介质存储有计算机程序,所述计算机程序被处理器执行时可实现如上所述的基于嵌入式系统图片的无损压缩算法。In the fourth aspect, embodiments of the present application provide a computer-readable storage medium that stores a computer program. When the computer program is executed by a processor, the computer program can realize the above-mentioned lossless processing based on embedded system pictures. Compression algorithm.

与现有技术相比,本申请的实施例提供了一种基于嵌入式系统图片的无损压缩算法、装置、计算机设备及存储介质,所述方法包括:确定源数据中出现频率最低的数据或非源数据中的数据,将其标记为节点数据;统计源数据中可压缩数据的数据长度并标记位置,以得到统计数据;若所述节点数据出现于源数据,则在所述节点数据后插入特定字符,若所述节点数据为非源数据中的数据,则不作任何处理,以得到节点标识数据;将所述统计数据压缩后与所述节点标识数据一并嵌入到源数据中以获得压缩后的存储数据。其通过将图片的数据进行聚类处理,对于相邻出现多次相同的数据采用设定格式数据替换,大大压缩了数据的大小,对于微型嵌入系统而言,无需外接存储,既节省了成本也降低了设备体积。Compared with the existing technology, embodiments of the present application provide a lossless compression algorithm, device, computer equipment and storage medium based on embedded system pictures. The method includes: determining the data with the lowest frequency of occurrence in the source data or the non-lossless compression algorithm. Mark the data in the source data as node data; count the data length of the compressible data in the source data and mark the position to obtain statistical data; if the node data appears in the source data, insert it after the node data Specific characters, if the node data is non-source data, no processing is performed to obtain node identification data; the statistical data is compressed and embedded into the source data together with the node identification data to obtain compression Later stored data. By clustering the image data, the same data that appears multiple times adjacent to each other is replaced with data in a set format, which greatly compresses the size of the data. For micro-embedded systems, no external storage is required, which not only saves costs but also Reduced equipment size.

附图说明Description of the drawings

为了更清楚地说明本申请实施例技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are some embodiments of the present application, which are of great significance to this field. Ordinary technicians can also obtain other drawings based on these drawings without exerting creative work.

图1为本申请实施例提供的基于嵌入式系统图片的无损压缩算法的主流程图;Figure 1 is the main flow chart of the lossless compression algorithm based on embedded system pictures provided by the embodiment of the present application;

图2为本申请实施例提供的基于嵌入式系统图片的无损压缩算法的子流程图;Figure 2 is a sub-flow chart of a lossless compression algorithm based on embedded system images provided by an embodiment of the present application;

图3为本申请实施例提供的基于嵌入式系统图片的无损压缩算法的子流程图;Figure 3 is a sub-flow chart of the lossless compression algorithm based on embedded system pictures provided by the embodiment of the present application;

图4为本申请实施例提供的服务器的节点匹配装置的示意性简图;以及Figure 4 is a schematic diagram of a node matching device of a server provided by an embodiment of the present application; and

图5为本申请实施例提供的计算机设备的示意性框图。Figure 5 is a schematic block diagram of a computer device provided by an embodiment of the present application.

具体实施方式Detailed ways

下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of this application.

应当理解,当在本说明书和所附权利要求书中使用时,术语“包括”和“包含”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。It should be understood that, when used in this specification and the appended claims, the terms "comprises" and "comprises" indicate the presence of described features, integers, steps, operations, elements and/or components but do not exclude the presence of one or The presence or addition of multiple other features, integers, steps, operations, elements, components and/or collections thereof.

还应当理解,在此本申请说明书中所使用的术语仅仅是出于描述特定实施例的目的而并不意在限制本申请。如在本申请说明书和所附权利要求书中所使用的那样,除非上下文清楚地指明其它情况,否则单数形式的“一”、“一个”及“该”意在包括复数形式。It should also be understood that the terminology used in the specification of the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this specification and the appended claims, the singular forms "a", "an" and "the" are intended to include the plural forms unless the context clearly dictates otherwise.

还应当进一步理解,在本申请说明书和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合, 并且包括这些组合。It will be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items. .

请参阅附图1至图3,附图1为本申请实施例提供的基于嵌入式系统图片的无损压缩算法的主流程图,图2和图3为子流程示意图,本申请实施例的基于嵌入式系统图片的无损压缩算法主要应用于微型嵌入式体统的图片存储及微型嵌入式系统驱动的显示屏类产品。具体的,实现该基于嵌入式系统图片的无损压缩算法包括以下步骤:Please refer to the accompanying drawings 1 to 3. Figure 1 is the main flow chart of the lossless compression algorithm based on embedded system pictures provided by the embodiment of the present application. Figures 2 and 3 are schematic sub-flow diagrams. The embedded system-based lossless compression algorithm of the embodiment of the present application is The lossless compression algorithm for system images is mainly used in image storage of micro-embedded systems and display products driven by micro-embedded systems. Specifically, implementing the lossless compression algorithm based on embedded system images includes the following steps:

步骤S100、对被压缩的图片进行取模处理,以得到源数据。在嵌入式单片机系统中,图片的存储一般会通过取模软件进行取模处理,将图片转换成普通的数据进行存储,取模处理是将图片的像素点转换成对应的二进制数据,以数据形式存储。例如,TFT彩屏一般采用RGB565或者RGB888的方式,其中,RGB565每个像素点的占用的空间为2byte(16bit),RGB888每个像素点的占用的空间为3byte(24bit)。在无压缩的情况下,一张完整的图片,假设宽为80像素点长为160像素点,则占用的空间为80*160*2 byte(即25K byte)或者80*160*3 byte(37.5K byte),仅仅一张图片就消耗了很多ROM空间。Step S100: Perform modulo processing on the compressed image to obtain source data. In the embedded microcontroller system, the storage of pictures is generally processed by modulo software to convert the pictures into ordinary data for storage. Modulo processing is to convert the pixels of the picture into corresponding binary data, in the form of data. storage. For example, TFT color screens generally use RGB565 or RGB888. Each pixel of RGB565 occupies 2 bytes (16 bit), and each pixel of RGB888 occupies 3 bytes (24 bit). In the absence of compression, a complete picture, assuming a width of 80 pixels and a length of 160 pixels, will occupy 80*160*2 byte (i.e. 25K byte) or 80*160*3 byte (37.5 K byte), just one picture consumes a lot of ROM space.

需要说明的是,对于纯色图片或仅仅只有两种颜色的图片,则无需进行以下压缩算法处理。若图片是单色,用0或者1来表示即可,不需要ROM空间存储。若图片只有两种颜色,用0表示一种颜色,1表示另外一种颜色,此时一个像素点的只需要1bit来表示,即原来需要16bit来表示的数据,现在只要1bit了,压缩率为(16-1)/16≈93%。若图片中具有的颜色超过两种,则继续进行以下算法处理:It should be noted that for solid-color images or images with only two colors, there is no need to perform the following compression algorithm. If the picture is monochrome, it can be represented by 0 or 1, and no ROM space is required for storage. If the picture has only two colors, use 0 to represent one color and 1 to represent the other color. At this time, one pixel only needs 1 bit to represent, that is, the data that originally required 16 bits to represent now only needs 1 bit, and the compression rate is (16-1)/16≈93%. If there are more than two colors in the picture, continue with the following algorithm processing:

步骤S200、确定源数据中出现频率最低的数据或未出现的数据,将其标记为节点数据;图片在进行取模处理后,以二进制编码形式存在,相同像素点的二进制编码相同,则选取其中出现频率最低的数据作为节点数据,一般而言,出现频率最低的数据不需要进行压缩处理,保持原状即可,因此将出现频率最低的数据作为节点数据,该节点数据用于后续压缩算法处理时的节点标识。于其他实施例中,由于节点数据的功能是作为节点标识,因此也可以采用其他未在源数据中出现的数据,此时在后续压缩处理时,需要对该节点标识进行区别,增加标识位,会略微增大压缩数据的大小。其中,将节点数据标记为SKP,优先选择源数据中未出现的数据,只需要到一个SKP即可, 一方面在解码查找时SKP时,尽可能查找的次数少;另一方面,防止SKP在源数据中出现的次数太多,在SKP后插入特定字符反而将源数据变多了。Step S200: Determine the data with the lowest frequency of occurrence or the data that does not appear in the source data, and mark it as node data; after the image is subjected to modulo processing, it exists in the form of binary encoding. If the binary encoding of the same pixel is the same, select it. The data with the lowest frequency of occurrence is used as node data. Generally speaking, the data with the lowest frequency of occurrence does not need to be compressed and can be kept as is. Therefore, the data with the lowest frequency of occurrence is used as node data. This node data is used for subsequent compression algorithm processing. node identifier. In other embodiments, since the function of the node data is to serve as a node identifier, other data that does not appear in the source data can also be used. In this case, during subsequent compression processing, the node identifier needs to be distinguished and an identifier bit added. Will slightly increase the size of the compressed data. Among them, the node data is marked as SKP, and data that does not appear in the source data is given priority. Only one SKP is needed. On the one hand, when decoding and searching for SKP, the number of searches is as small as possible; on the other hand, it prevents SKP from being used in SKP. It appears too many times in the source data. Inserting specific characters after SKP will increase the number of source data.

步骤S300、统计源数据中可压缩数据的数据长度并标记位置,以得到统计数据;也即根据压缩规则确定哪些数据段需要被压缩,同时需要标记被压缩数据段在源数据中的位置,以便后续将压缩数据嵌入对应位置。通过该步骤的筛选,防止相同数据太小,而在后续数据压缩替换时反而将源数据增多,无法达到压缩的目的。Step S300: Count the data length of the compressible data in the source data and mark the position to obtain statistical data; that is, determine which data segments need to be compressed according to the compression rules, and mark the position of the compressed data segment in the source data so that Subsequently, the compressed data is embedded in the corresponding location. Through the screening in this step, the same data is prevented from being too small, which will increase the source data during subsequent data compression and replacement, and the purpose of compression cannot be achieved.

具体的,请再次参阅图2,所述统计源数据中可压缩数据的长度及标记位置的步骤S300包括以下步骤:Specifically, please refer to Figure 2 again. The step S300 of counting the length and mark position of the compressible data in the source data includes the following steps:

步骤S301、统计源数据中相邻相同数据个数大于设定数值的数据长度,以得到数据长度值;例如,设定数值为5,那么则统计源数据中相邻数据相同个数大于或等于5的数据段,也即符合上述条件的数据段是需要被压缩处理的。上述设定数值可以根据源数据的复杂程度而定,对于复杂程度较低的源数据,选择设定数值较小,反之,则选择较大。Step S301: Count the number of adjacent identical data in the source data that is greater than the data length of the set value to obtain the data length value; for example, if the set value is 5, then count the number of adjacent identical data in the source data greater than or equal to 5 data segments, that is, data segments that meet the above conditions, need to be compressed. The above setting value can be determined according to the complexity of the source data. For source data with lower complexity, choose a smaller setting value, and vice versa, choose a larger setting value.

步骤S302、在所有可压缩数据段的位置进行位置标记,以得到标记位置。标记统计过可以压缩数据段的位置的目的是为了后续压缩数据替换容易找到对应的位置,也方便在解码时,可以快速的将压缩数据还原至原本位置。Step S302: Position mark the positions of all compressible data segments to obtain the mark positions. The purpose of marking the location of the statistically compressed data segment is to make it easier to find the corresponding location for subsequent replacement of compressed data, and to quickly restore the compressed data to its original location during decoding.

步骤S400、若所述节点数据与源数据相同,则若所述节点数据出现于源数据,则在所述节点数据后插入特定字符,若所述节点数据为非源数据中的数据,则不作任何处理,以得到节点标识数据。由于节点数据为源数据的一部分,在压缩和加压过程中,均需要进行标识,标识在数据在源数据中也是存在的,而不是单纯的节点标识。若节点标识采用非源数据相同的数据,那么压缩和解码时,会将节点数据位替换成对应的源数据。Step S400: If the node data is the same as the source data, then if the node data appears in the source data, insert a specific character after the node data. If the node data is not data in the source data, no operation will be performed. Any processing to get node identification data. Since the node data is part of the source data, it needs to be identified during the compression and pressurization processes. The identification also exists in the data in the source data, not just the node identification. If the node identifier uses data that is not the same as the source data, then the node data bits will be replaced with the corresponding source data during compression and decoding.

步骤S500、将所述统计数据压缩后与所述节点标识数据一并嵌入到源数据中以获得压缩后的存储数据。Step S500: Compress the statistical data and embed it into the source data together with the node identification data to obtain compressed storage data.

其中,所述将所述统计数据压缩后与所述节点标识数据一并嵌入到源数据中以获得压缩后的存储数据的步骤S500包括以下步骤:The step S500 of compressing the statistical data and embedding it into the source data together with the node identification data to obtain compressed storage data includes the following steps:

步骤S501、将可压缩数据替换为:节点数据+数据长度值+一位源数据,以得到局部压缩数据;其中,节点数据位标识后续数据是被压缩处理的,而 数据长度值,则具体描述了该压缩数据的数据长度,一位源数据位则是描述该压缩段的原数据类型,例如为红色等。通过该步骤处理后,可将相邻相同的数据段简化为三位数据组合的数据,大大降低了数据量。Step S501: Replace the compressible data with: node data + data length value + one bit of source data to obtain partially compressed data; wherein, the node data bit identifies that subsequent data is compressed, and the data length value is described in detail Determines the data length of the compressed data, and one source data bit describes the original data type of the compressed segment, such as red. After processing through this step, adjacent identical data segments can be simplified into three-digit data combinations, greatly reducing the amount of data.

步骤S502、将与节点数据相同的数据替换为:节点数据+特定字符,以得到节点替换数据;若节点数据是与源数据相同的数据,那么通过节点数据后的特定字符可以描述源数据中存在于节点数据相同的数据段,在解锁时需要对应补充。若节点数据不是源数据的一部分,那么那么直接将节点数据为替换为后续对应的一位源数据相同的数据。Step S502: Replace data that is the same as the node data with: node data + specific characters to obtain node replacement data; if the node data is the same data as the source data, then the specific characters after the node data can describe the existence of the source data. Data segments that are the same as node data need to be supplemented accordingly when unlocking. If the node data is not part of the source data, then the node data is directly replaced with the same data as the subsequent corresponding one-bit source data.

步骤S503、将所述局部压缩数据和所述节点替换数据分别插入到所述源数据的对应标记位置。对于未被压缩的数据段仍按照原有先后顺序保留,将压缩的数据段按照上述规则替换后,再次生成存储数据即可。Step S503: Insert the local compressed data and the node replacement data into corresponding mark positions of the source data respectively. The uncompressed data segments are still retained in the original order. After replacing the compressed data segments according to the above rules, the storage data can be generated again.

请参阅附图4,本申请的实施例提供了一种基于嵌入式系统图片的无损压缩装置100,其包括以下单元:Referring to Figure 4, an embodiment of the present application provides a lossless compression device 100 based on embedded system pictures, which includes the following units:

取模单元101,所述取模单元用于对被压缩的图片进行取模处理,以得到源数据。The modulus unit 101 is used to perform modulo processing on the compressed image to obtain source data.

节点数据确定单元102,用于确定源数据中出现频率最低的数据或非源数据中的数据,将其标记为节点数据;The node data determining unit 102 is used to determine the data with the lowest frequency of occurrence in the source data or the data in the non-source data, and mark it as node data;

压缩数据统计单元103,用于统计源数据中可压缩数据的数据长度及标记位置;The compressed data statistics unit 103 is used to count the data length and mark position of the compressible data in the source data;

其中,所述压缩数据统计单元103包括:Wherein, the compressed data statistics unit 103 includes:

数据长度统计单元1031,用于统计源数据中相邻相同数据个数大于设定数值的数据长度,以得到数据长度值;The data length statistics unit 1031 is used to count the data length in the source data where the number of adjacent identical data is greater than the set value to obtain the data length value;

位置标记单元1032,用于在所有可压缩数据段的位置进行位置标记,以得到标记位置。The position marking unit 1032 is used to mark the positions of all compressible data segments to obtain the mark positions.

节点数据处理单元104,用于若所述节点数据出现于源数据,则在所述节点数据后插入特定字符,若所述节点数据为非源数据中的数据,则不作任何处理,以得到节点标识数据;The node data processing unit 104 is used to insert specific characters after the node data if the node data appears in the source data. If the node data is not data in the source data, no processing is performed to obtain the node. identification data;

源数据压缩单元105,用于将所述统计数据压缩后与所述节点标识数据一并嵌入到源数据中以获得压缩后的存储数据。The source data compression unit 105 is configured to compress the statistical data and embed it into the source data together with the node identification data to obtain compressed storage data.

其中,所述源数据压缩单元105包括:Wherein, the source data compression unit 105 includes:

压缩数据替换单元1051,用于将可压缩数据替换为:节点数据+数据长度值+一位源数据,以得到局部压缩数据;The compressed data replacement unit 1051 is used to replace compressible data with: node data + data length value + one bit of source data to obtain partially compressed data;

节点数据替换单元1052,用于将与节点数据相同的数据替换为:节点数据+特定字符,以得到节点替换数据;The node data replacement unit 1052 is used to replace data that is the same as the node data with: node data + specific characters to obtain node replacement data;

数据嵌入单元1053,用于将所述局部压缩数据和所述节点替换数据分别插入到所述源数据的对应标记位置。The data embedding unit 1053 is configured to insert the local compressed data and the node replacement data into corresponding mark positions of the source data respectively.

请参阅附图5,本申请的实施例提供了一种计算机设备,所述计算机设备包括存储器及处理器,所述存储器上存储有计算机程序,所述处理器执行所述计算机程序时实现上述的方法。该程序指令包括:Please refer to Figure 5. An embodiment of the present application provides a computer device. The computer device includes a memory and a processor. A computer program is stored on the memory. When the processor executes the computer program, the above-mentioned steps are implemented. method. The program instructions include:

步骤S100、对被压缩的图片进行取模处理,以得到源数据。Step S100: Perform modulo processing on the compressed image to obtain source data.

步骤S200、确定源数据中出现频率最低的数据或未出现的数据,将其标记为节点数据。Step S200: Determine the data with the lowest frequency of occurrence or the data that does not appear in the source data, and mark it as node data.

步骤S300、统计源数据中可压缩数据的数据长度并标记位置,以得到统计数据。Step S300: Count the data length of the compressible data in the source data and mark the position to obtain statistical data.

步骤S400、若所述节点数据与源数据相同,则若所述节点数据出现于源数据,则在所述节点数据后插入特定字符,若所述节点数据为非源数据中的数据,则不作任何处理,以得到节点标识数据。Step S400: If the node data is the same as the source data, then if the node data appears in the source data, insert a specific character after the node data. If the node data is not data in the source data, no operation will be performed. Any processing to get node identification data.

步骤S500、将所述统计数据压缩后与所述节点标识数据一并嵌入到源数据中以获得压缩后的存储数据。Step S500: Compress the statistical data and embed it into the source data together with the node identification data to obtain compressed storage data.

该计算机设备可以是终端,也可以是服务器,其中,终端可以是智能手机、平板电脑、笔记本电脑、台式电脑、个人数字助理和穿戴式设备等具有通信功能的电子设备。服务器可以是独立的服务器,也可以是多个服务器组成的服务器集群。The computer device may be a terminal or a server, where the terminal may be an electronic device with communication functions such as a smartphone, a tablet computer, a notebook computer, a desktop computer, a personal digital assistant, a wearable device, etc. The server can be an independent server or a server cluster composed of multiple servers.

该计算机设备500包括通过系统总线501连接的处理器502、存储器和网络接口505,其中,存储器可以包括非易失性存储介质503和内存储器504。The computer device 500 includes a processor 502, a memory, and a network interface 505 connected through a system bus 501, where the memory may include a non-volatile storage medium 503 and an internal memory 504.

该非易失性存储介质503可存储操作系统5031和计算机程序5032。该计算机程序5032包括程序指令,该程序指令被执行时,可使得处理器502执行一种基于嵌入式系统图片的无损压缩算法。The non-volatile storage medium 503 can store an operating system 5031 and a computer program 5032. The computer program 5032 includes program instructions that, when executed, can cause the processor 502 to execute a lossless compression algorithm based on embedded system images.

该处理器502用于提供计算和控制能力,以支撑整个计算机设备500的运行。The processor 502 is used to provide computing and control capabilities to support the operation of the entire computer device 500 .

该内存储器504为非易失性存储介质503中的计算机程序5032的运行提供环境,该计算机程序5032被处理器502执行时,可使得处理器502执行一种基于嵌入式系统图片的无损压缩算法。The internal memory 504 provides an environment for the execution of the computer program 5032 in the non-volatile storage medium 503. When the computer program 5032 is executed by the processor 502, it can cause the processor 502 to execute a lossless compression algorithm based on embedded system images. .

该网络接口505用于与其它设备进行网络通信。本领域技术人员可以理解,图4中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备500的限定,具体的计算机设备500可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。The network interface 505 is used for network communication with other devices. Those skilled in the art can understand that the structure shown in Figure 4 is only a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device 500 to which the solution of the present application is applied. The specific computer device 500 may include more or fewer components than shown, some combinations of components, or a different arrangement of components.

本申请的实施例还提供了一种存储介质,所述存储介质存储有计算机程序,所述计算机程序包括程序指令,所述程序指令当被处理器执行时可实现上述的方法。该程序指令包括以下步骤:Embodiments of the present application also provide a storage medium that stores a computer program. The computer program includes program instructions. When executed by a processor, the program instructions can implement the above method. The program instructions include the following steps:

步骤S100、对被压缩的图片进行取模处理,以得到源数据。在嵌入式单片机系统中,图片的存储一般会通过取模软件进行取模处理,将图片转换成普通的数据进行存储,取模处理是将图片的像素点转换成对应的二进制数据,以数据形式存储。例如,TFT彩屏一般采用RGB565或者RGB888的方式,其中,RGB565每个像素点的占用的空间为2byte(16bit),RGB888每个像素点的占用的空间为3byte(24bit)。在无压缩的情况下,一张完整的图片,假设宽为80像素点长为160像素点,则占用的空间为80*160*2 byte(即25K byte)或者80*160*3 byte(37.5K byte),仅仅一张图片就消耗了很多ROM空间。Step S100: Perform modulo processing on the compressed image to obtain source data. In the embedded microcontroller system, the storage of pictures is generally processed by modulo software to convert the pictures into ordinary data for storage. Modulo processing is to convert the pixels of the picture into corresponding binary data, in the form of data. storage. For example, TFT color screens generally use RGB565 or RGB888. Each pixel of RGB565 occupies 2 bytes (16 bit), and each pixel of RGB888 occupies 3 bytes (24 bit). In the absence of compression, a complete picture, assuming a width of 80 pixels and a length of 160 pixels, will occupy 80*160*2 byte (i.e. 25K byte) or 80*160*3 byte (37.5 K byte), just one picture consumes a lot of ROM space.

需要说明的是,对于出色图片或仅仅只有两种颜色的图片,则无需进行以下压缩算法处理。若图片是单色,用0或者1来表示即可,不需要ROM空间存储。若图片只有两种颜色,用0表示一种颜色,1表示另外一种颜色,此时一个像素点的只需要1bit来表示,即原来需要16bit来表示的数据,现在只要1bit了,压缩率为(16-1)/16≈93%。若图片中具有的颜色超过两种,则继续进行以下算法处理:It should be noted that for excellent pictures or pictures with only two colors, there is no need to perform the following compression algorithm. If the picture is monochrome, it can be represented by 0 or 1, and no ROM space is required for storage. If the picture has only two colors, use 0 to represent one color and 1 to represent the other color. At this time, one pixel only needs 1 bit to represent, that is, the data that originally required 16 bits to represent now only needs 1 bit, and the compression rate is (16-1)/16≈93%. If there are more than two colors in the picture, continue with the following algorithm processing:

步骤S200、确定源数据中出现频率最低的数据或未出现的数据,将其标记为节点数据;图片在进行取模处理后,以二进制编码形式存在,相同像素 点的二进制编码相同,则选取其中出现频率最低的数据作为节点数据,一般而言,出现频率最低的数据不需要进行压缩处理,保持原状即可,因此将出现频率最低的数据作为节点数据,该节点数据用于后续压缩算法处理时的节点标识。于其他实施例中,由于节点数据的功能是作为节点标识,因此也可以采用其他未在源数据中出现的数据,此时在后续压缩处理时,需要对该节点标识进行区别,增加标识位,会略微增大压缩数据的大小。其中,将节点数据标记为SKP,优先选择源数据中未出现的数据,只需要到一个SKP即可,一方面在解码查找时SKP时,尽可能查找的次数少另一方面,防止SKP在源数据中出现的次数太多,在SKP后插入特定字符反而将源数据变多了Step S200: Determine the data with the lowest frequency of occurrence or the data that does not appear in the source data, and mark it as node data; after the image is subjected to modulo processing, it exists in the form of binary encoding. If the binary encoding of the same pixel is the same, select it. The data with the lowest frequency of occurrence is used as node data. Generally speaking, the data with the lowest frequency of occurrence does not need to be compressed and can be kept as is. Therefore, the data with the lowest frequency of occurrence is used as node data. This node data is used for subsequent compression algorithm processing. node identifier. In other embodiments, since the function of the node data is to serve as a node identifier, other data that does not appear in the source data can also be used. In this case, during subsequent compression processing, the node identifier needs to be distinguished and an identifier bit added. Will slightly increase the size of the compressed data. Among them, the node data is marked as SKP, and data that does not appear in the source data is given priority. Only one SKP is needed. On the one hand, when decoding and searching for SKP, the number of searches is as small as possible. On the other hand, it prevents SKP from being used in the source data. There are too many occurrences in the data. Inserting specific characters after SKP will increase the source data.

步骤S300、统计源数据中可压缩数据的数据长度并标记位置,以得到统计数据;也即根据压缩规则确定哪些数据段需要被压缩,同时需要标记被压缩数据段在源数据中的位置,以便后续将压缩数据嵌入对应位置。通过该步骤的筛选,防止相同数据太小,而在后续数据压缩替换时反而将源数据增多,无法达到压缩的目的。Step S300: Count the data length of the compressible data in the source data and mark the position to obtain statistical data; that is, determine which data segments need to be compressed according to the compression rules, and mark the position of the compressed data segment in the source data so that Subsequently, the compressed data is embedded in the corresponding location. Through the screening in this step, the same data is prevented from being too small, which will increase the source data during subsequent data compression and replacement, and the purpose of compression cannot be achieved.

具体的,请再次参阅图2,所述统计源数据中可压缩数据的长度及标记位置的步骤S300包括以下步骤:Specifically, please refer to Figure 2 again. The step S300 of counting the length and mark position of the compressible data in the source data includes the following steps:

步骤S301、统计源数据中相邻相同数据个数大于设定数值的数据长度,以得到数据长度值;例如,设定数值为5,那么则统计源数据中相邻数据相同个数大于或等于5的数据段,也即符合上述条件的数据段是需要被压缩处理的。上述设定数值可以根据源数据的复杂程度而定,对于复杂程度较低的源数据,选择设定数值较小,反之,则选择较大。Step S301: Count the number of adjacent identical data in the source data that is greater than the data length of the set value to obtain the data length value; for example, if the set value is 5, then count the number of adjacent identical data in the source data greater than or equal to 5 data segments, that is, data segments that meet the above conditions, need to be compressed. The above setting value can be determined according to the complexity of the source data. For source data with lower complexity, choose a smaller setting value, and vice versa, choose a larger setting value.

步骤S302、在所有可压缩数据段的位置进行位置标记,以得到标记位置。标记统计过可以压缩数据段的位置的目的是为了后续压缩数据替换容易找到对应的位置,也方便在解码时,可以快速的将压缩数据还原至原本位置。Step S302: Position mark the positions of all compressible data segments to obtain the mark positions. The purpose of marking the location of the statistically compressed data segment is to make it easier to find the corresponding location for subsequent replacement of compressed data, and to quickly restore the compressed data to its original location during decoding.

步骤S400、若所述节点数据与源数据相同,则若所述节点数据出现于源数据,则在所述节点数据后插入特定字符,若所述节点数据为非源数据中的数据,则不作任何处理,以得到节点标识数据;由于节点数据为源数据的一部分,在压缩和加压过程中,均需要进行标识,标识在数据在源数据中也是存在的,而不是单纯的节点标识。若节点标识采用非源数据相同的数据,那 么压缩和解码时,会将节点数据位替换成对应的源数据。Step S400: If the node data is the same as the source data, then if the node data appears in the source data, insert a specific character after the node data. If the node data is not data in the source data, no operation will be performed. Any processing to obtain the node identification data; since the node data is part of the source data, it needs to be identified during the compression and pressurization process. The identification also exists in the data in the source data, rather than simply the node identification. If the node identifier uses data that is not the same as the source data, then the node data bits will be replaced with the corresponding source data during compression and decoding.

步骤S500、将所述统计数据压缩后与所述节点标识数据一并嵌入到源数据中以获得压缩后的存储数据。Step S500: Compress the statistical data and embed it into the source data together with the node identification data to obtain compressed storage data.

其中,所述将所述统计数据压缩后与所述节点标识数据一并嵌入到源数据中以获得压缩后的存储数据的步骤S500包括以下步骤:The step S500 of compressing the statistical data and embedding it into the source data together with the node identification data to obtain compressed storage data includes the following steps:

步骤S501、将可压缩数据替换为:节点数据+数据长度值+一位源数据,以得到局部压缩数据;其中,节点数据位标识后续数据是被压缩处理的,而数据长度值,则具体描述了该压缩数据的数据长度,一位源数据位则是描述该压缩段的原数据类型,例如为红色等。通过该步骤处理后,可将相邻相同的数据段简化为三位数据组合的数据,大大降低了数据量。Step S501: Replace the compressible data with: node data + data length value + one bit of source data to obtain partially compressed data; wherein, the node data bit identifies that subsequent data is compressed, and the data length value is described in detail Determines the data length of the compressed data, and one source data bit describes the original data type of the compressed segment, such as red. After processing through this step, adjacent identical data segments can be simplified into three-digit data combinations, greatly reducing the amount of data.

步骤S502、将与节点数据相同的数据替换为:节点数据+特定字符,以得到节点替换数据;若节点数据是与源数据相同的数据,那么通过节点数据后的特定字符可以描述源数据中存在于节点数据相同的数据段,在解锁时需要对应补充。若节点数据不是源数据的一部分,那么那么直接将节点数据为替换为后续对应的一位源数据相同的数据。Step S502: Replace data that is the same as the node data with: node data + specific characters to obtain node replacement data; if the node data is the same data as the source data, then the specific characters after the node data can describe the existence of the source data. Data segments that are the same as node data need to be supplemented accordingly when unlocking. If the node data is not part of the source data, then the node data is directly replaced with the same data as the subsequent corresponding one-bit source data.

步骤S503、将所述局部压缩数据和所述节点替换数据分别插入到所述源数据的对应标记位置。对于未被压缩的数据段仍按照原有先后顺序保留,将压缩的数据段按照上述规则替换后,再次生成存储数据即可。Step S503: Insert the local compressed data and the node replacement data into corresponding mark positions of the source data respectively. The uncompressed data segments are still retained in the original order. After replacing the compressed data segments according to the above rules, the storage data can be generated again.

与现有技术相比,本申请的实施例提供了一种基于嵌入式系统图片的无损压缩算法、装置、计算机设备及存储介质,其通过将图片的数据进行聚类处理,对于相邻出现多次相同的数据采用设定格式数据替换,大大压缩了数据的大小,对于微型嵌入系统而言,无需外接存储,既节省了成本也降低了设备体积。Compared with the existing technology, embodiments of the present application provide a lossless compression algorithm, device, computer equipment and storage medium based on embedded system pictures. By clustering the data of the pictures, multiple adjacent images can be processed. The same data is replaced with data in a set format, which greatly compresses the size of the data. For micro-embedded systems, no external storage is needed, which not only saves costs but also reduces the size of the equipment.

上述内容,仅为本申请的较佳实施例,并非用于限制本申请的实施方案,本领域普通技术人员根据本申请的主要构思和精神,可以十分方便地进行相应的变通或修改,故本申请的保护范围应以权利要求书所要求的保护范围为准。The above content is only a preferred embodiment of the present application and is not intended to limit the implementation of the present application. Those of ordinary skill in the art can easily make corresponding modifications or modifications according to the main concept and spirit of the present application. Therefore, the present application The scope of protection applied for shall be subject to the scope of protection required by the claims.

Claims (20)

一种基于嵌入式系统图片的无损压缩算法,其中,包括以下步骤:A lossless compression algorithm based on embedded system images, which includes the following steps: 确定源数据中出现频率最低的数据或非源数据中的数据,将其标记为节点数据;Determine the data with the lowest frequency of occurrence in the source data or the data in non-source data, and mark it as node data; 统计源数据中可压缩数据的数据长度并标记位置,以得到统计数据;Count the data length of the compressible data in the source data and mark the location to obtain statistical data; 若所述节点数据出现于源数据,则在所述节点数据后插入特定字符,若所述节点数据为非源数据中的数据,则不作任何处理,以得到节点标识数据;If the node data appears in the source data, insert specific characters after the node data. If the node data is data that is not in the source data, no processing is performed to obtain the node identification data; 将所述统计数据压缩后与所述节点标识数据一并嵌入到源数据中以获得压缩后的存储数据。The statistical data is compressed and embedded into the source data together with the node identification data to obtain compressed storage data. 如权利要求1所述的基于嵌入式系统图片的无损压缩算法,其中,所述统计源数据中可压缩数据的长度及标记位置,以得到统计数据的步骤包括以下步骤:The lossless compression algorithm based on embedded system pictures as claimed in claim 1, wherein the step of counting the length and mark position of the compressible data in the source data to obtain the statistical data includes the following steps: 统计源数据中相邻相同数据个数大于设定数值的数据长度,以得到数据长度值;Count the data length where the number of adjacent identical data in the source data is greater than the set value to obtain the data length value; 在所有可压缩数据段的位置进行位置标记,以得到标记位置。Position marks are performed on the positions of all compressible data segments to obtain the mark positions. 如权利要求1所述的基于嵌入式系统图片的无损压缩算法,其中,所述将所述统计数据压缩后与所述节点标识数据一并嵌入到源数据中以获得压缩后的存储数据的步骤包括以下步骤:The lossless compression algorithm based on embedded system pictures according to claim 1, wherein the step of compressing the statistical data and embedding it into the source data together with the node identification data to obtain compressed storage data Includes the following steps: 将可压缩数据替换为:节点数据+数据长度值+一位源数据,以得到局部压缩数据;Replace the compressible data with: node data + data length value + one bit of source data to obtain partially compressed data; 将与节点数据相同的数据替换为:节点数据+特定字符,以得到节点替换数据;Replace data that is the same as node data with: node data + specific characters to get node replacement data; 将所述局部压缩数据和所述节点替换数据分别插入到所述源数据的对应标记位置。The local compressed data and the node replacement data are respectively inserted into corresponding mark positions of the source data. 如权利要求1所述的基于嵌入式系统图片的无损压缩算法,其中,所述确定源数据中出现频率最低的数据或非源数据中的数据,将其标记为节点数据的步骤之前还包括对被压缩的图片进行取模处理,以得到源数据的步骤。The lossless compression algorithm based on embedded system pictures according to claim 1, wherein the step of determining the data with the lowest frequency of occurrence in the source data or the data in the non-source data and marking it as node data also includes: The compressed image is subjected to modulo processing to obtain the source data. 如权利要求2所述的基于嵌入式系统图片的无损压缩算法,其中,所 述确定源数据中出现频率最低的数据或非源数据中的数据,将其标记为节点数据的步骤之前还包括对被压缩的图片进行取模处理,以得到源数据的步骤。The lossless compression algorithm based on embedded system pictures according to claim 2, wherein the step of determining the data with the lowest frequency of occurrence in the source data or the data in the non-source data and marking it as node data also includes: The compressed image is subjected to modulo processing to obtain the source data. 一种基于嵌入式系统图片的无损压缩装置,其中,包括以下单元:A lossless compression device based on embedded system pictures, which includes the following units: 节点数据确定单元,用于确定源数据中出现频率最低的数据或非源数据中的数据,将其标记为节点数据;The node data determination unit is used to determine the data with the lowest frequency of occurrence in the source data or the data in non-source data, and mark it as node data; 压缩数据统计单元,用于统计源数据中可压缩数据的数据长度及标记位置;Compressed data statistics unit, used to count the data length and mark position of compressible data in source data; 节点数据处理单元,用于若所述节点数据出现于源数据,则在所述节点数据后插入特定字符,若所述节点数据为非源数据中的数据,则不作任何处理,以得到节点标识数据;The node data processing unit is used to insert specific characters after the node data if the node data appears in the source data. If the node data is not data in the source data, no processing is performed to obtain the node identifier. data; 源数据压缩单元,用于将所述统计数据压缩后与所述节点标识数据一并嵌入到源数据中以获得压缩后的存储数据。A source data compression unit is configured to compress the statistical data and embed it into the source data together with the node identification data to obtain compressed storage data. 如权利要求6所述的基于嵌入式系统图片的无损压缩装置,其中,所述压缩数据统计单元包括:The lossless compression device based on embedded system pictures as claimed in claim 6, wherein the compressed data statistics unit includes: 数据长度统计单元,用于统计源数据中相邻相同数据个数大于设定数值的数据长度,以得到数据长度值;The data length statistics unit is used to count data lengths where the number of adjacent identical data in the source data is greater than the set value to obtain the data length value; 位置标记单元,用于在所有可压缩数据段的位置进行位置标记,以得到标记位置。The position marking unit is used to mark the positions of all compressible data segments to obtain the mark positions. 如权利要求6所述的基于嵌入式系统图片的无损压缩装置,其中,所述源数据压缩单元包括:The lossless compression device based on embedded system pictures according to claim 6, wherein the source data compression unit includes: 压缩数据替换单元,用于将可压缩数据替换为:节点数据+数据长度值+一位源数据,以得到局部压缩数据;The compressed data replacement unit is used to replace compressible data with: node data + data length value + one bit of source data to obtain partially compressed data; 节点数据替换单元,用于将与节点数据相同的数据替换为:节点数据+特定字符,以得到节点替换数据;The node data replacement unit is used to replace data that is the same as node data with: node data + specific characters to obtain node replacement data; 数据嵌入单元,用于将所述局部压缩数据和所述节点替换数据分别插入到所述源数据的对应标记位置。A data embedding unit is configured to insert the local compressed data and the node replacement data into corresponding mark positions of the source data respectively. 根据权利要求6所述的基于嵌入式系统图片的无损压缩装置,其中,还包括:取模单元,所述取模单元用于对被压缩的图片进行取模处理,以得到源数据。The lossless compression device based on embedded system pictures according to claim 6, further comprising: a modulo taking unit, the modulo taking unit is used to perform modulo processing on the compressed pictures to obtain source data. 根据权利要求7所述的基于嵌入式系统图片的无损压缩装置,其中,还包括:取模单元,所述取模单元用于对被压缩的图片进行取模处理,以得到源数据。The lossless compression device based on embedded system pictures according to claim 7, further comprising: a modulo taking unit, the modulo taking unit is used to perform modulo processing on the compressed pictures to obtain source data. 根据权利要求8所述的基于嵌入式系统图片的无损压缩装置,其中,还包括:取模单元,所述取模单元用于对被压缩的图片进行取模处理,以得到源数据。The lossless compression device based on embedded system pictures according to claim 8, further comprising: a modulo taking unit, the modulo taking unit is used to perform modulo processing on the compressed pictures to obtain source data. 一种计算机设备,其中,所述计算机设备包括存储器及处理器,所述存储器上存储有计算机程序,所述处理器执行所述计算机程序时实现以下步骤:A computer device, wherein the computer device includes a memory and a processor, a computer program is stored on the memory, and the following steps are implemented when the processor executes the computer program: 确定源数据中出现频率最低的数据或非源数据中的数据,将其标记为节点数据;Determine the data with the lowest frequency of occurrence in the source data or the data in non-source data, and mark it as node data; 统计源数据中可压缩数据的数据长度并标记位置,以得到统计数据;Count the data length of the compressible data in the source data and mark the location to obtain statistical data; 若所述节点数据出现于源数据,则在所述节点数据后插入特定字符,若所述节点数据为非源数据中的数据,则不作任何处理,以得到节点标识数据;If the node data appears in the source data, insert specific characters after the node data. If the node data is data that is not in the source data, no processing is performed to obtain the node identification data; 将所述统计数据压缩后与所述节点标识数据一并嵌入到源数据中以获得压缩后的存储数据。The statistical data is compressed and embedded into the source data together with the node identification data to obtain compressed storage data. 根据权利要求12所述的计算机设备,其中,所述统计源数据中可压缩数据的长度及标记位置,以得到统计数据的步骤包括以下步骤:The computer device according to claim 12, wherein the step of counting the length and mark position of the compressible data in the source data to obtain the statistical data includes the following steps: 统计源数据中相邻相同数据个数大于设定数值的数据长度,以得到数据长度值;Count the data length where the number of adjacent identical data in the source data is greater than the set value to obtain the data length value; 在所有可压缩数据段的位置进行位置标记,以得到标记位置。Position marks are performed on the positions of all compressible data segments to obtain the mark positions. 根据权利要求12所述的计算机设备,其中,所述将所述统计数据压缩后与所述节点标识数据一并嵌入到源数据中以获得压缩后的存储数据的步骤包括以下步骤:The computer device according to claim 12, wherein the step of embedding the compressed statistical data into the source data together with the node identification data to obtain compressed storage data includes the following steps: 将可压缩数据替换为:节点数据+数据长度值+一位源数据,以得到局部压缩数据;Replace the compressible data with: node data + data length value + one bit of source data to obtain partially compressed data; 将与节点数据相同的数据替换为:节点数据+特定字符,以得到节点替换数据;Replace data that is the same as node data with: node data + specific characters to get node replacement data; 将所述局部压缩数据和所述节点替换数据分别插入到所述源数据的对应 标记位置。The local compressed data and the node replacement data are respectively inserted into corresponding mark positions of the source data. 根据权利要求12所述的计算机设备,其中,所述确定源数据中出现频率最低的数据或非源数据中的数据,将其标记为节点数据的步骤之前还包括对被压缩的图片进行取模处理,以得到源数据的步骤。The computer device according to claim 12, wherein the step of determining the data with the lowest frequency of occurrence in the source data or the data in the non-source data and marking it as node data further includes taking a modulo of the compressed picture. Steps to process to obtain source data. 根据权利要求13所述的计算机设备,其中,所述确定源数据中出现频率最低的数据或非源数据中的数据,将其标记为节点数据的步骤之前还包括对被压缩的图片进行取模处理,以得到源数据的步骤。The computer device according to claim 13, wherein the step of determining the data with the lowest frequency of occurrence in the source data or the data in the non-source data and marking it as node data further includes taking a modulus of the compressed picture. Steps to process to obtain source data. 一种计算机可读存储介质,其中,所述存储介质存储有计算机程序,所述计算机程序被处理器执行时可实现以下步骤:A computer-readable storage medium, wherein the storage medium stores a computer program. When the computer program is executed by a processor, the following steps can be implemented: 确定源数据中出现频率最低的数据或非源数据中的数据,将其标记为节点数据;Determine the data with the lowest frequency of occurrence in the source data or the data in non-source data, and mark it as node data; 统计源数据中可压缩数据的数据长度并标记位置,以得到统计数据;Count the data length of the compressible data in the source data and mark the location to obtain statistical data; 若所述节点数据出现于源数据,则在所述节点数据后插入特定字符,若所述节点数据为非源数据中的数据,则不作任何处理,以得到节点标识数据;If the node data appears in the source data, insert specific characters after the node data. If the node data is data that is not in the source data, no processing is performed to obtain the node identification data; 将所述统计数据压缩后与所述节点标识数据一并嵌入到源数据中以获得压缩后的存储数据。The statistical data is compressed and embedded into the source data together with the node identification data to obtain compressed storage data. 根据权利要求17所述的计算机可读存储介质,其中,所述统计源数据中可压缩数据的长度及标记位置,以得到统计数据的步骤包括以下步骤:The computer-readable storage medium according to claim 17, wherein the step of counting the length and mark position of the compressible data in the source data to obtain the statistical data includes the following steps: 统计源数据中相邻相同数据个数大于设定数值的数据长度,以得到数据长度值;Count the data length where the number of adjacent identical data in the source data is greater than the set value to obtain the data length value; 在所有可压缩数据段的位置进行位置标记,以得到标记位置。Position marks are performed on the positions of all compressible data segments to obtain the mark positions. 根据权利要求17所述的计算机可读存储介质,其中,所述将所述统计数据压缩后与所述节点标识数据一并嵌入到源数据中以获得压缩后的存储数据的步骤包括以下步骤:The computer-readable storage medium according to claim 17, wherein the step of compressing the statistical data and embedding it into source data together with the node identification data to obtain compressed storage data includes the following steps: 将可压缩数据替换为:节点数据+数据长度值+一位源数据,以得到局部压缩数据;Replace the compressible data with: node data + data length value + one bit of source data to obtain partially compressed data; 将与节点数据相同的数据替换为:节点数据+特定字符,以得到节点替换数据;Replace data that is the same as node data with: node data + specific characters to get node replacement data; 将所述局部压缩数据和所述节点替换数据分别插入到所述源数据的对应 标记位置。The local compressed data and the node replacement data are respectively inserted into corresponding mark positions of the source data. 根据权利要求17所述的计算机可读存储介质,其中,所述确定源数据中出现频率最低的数据或非源数据中的数据,将其标记为节点数据的步骤之前还包括对被压缩的图片进行取模处理,以得到源数据的步骤。The computer-readable storage medium according to claim 17, wherein the step of determining the data with the lowest frequency of occurrence in the source data or the data in the non-source data and marking it as node data further includes: Perform modulo processing to obtain source data.
PCT/CN2022/124312 2022-05-30 2022-10-10 Lossless compression algorithm and apparatus based on embedded system picture, and computer device and storage medium Ceased WO2023231265A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210598889.2 2022-05-30
CN202210598889.2A CN115002465A (en) 2022-05-30 2022-05-30 Lossless compression algorithm, device, computer equipment and storage medium based on embedded system pictures

Publications (1)

Publication Number Publication Date
WO2023231265A1 true WO2023231265A1 (en) 2023-12-07

Family

ID=83028878

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/124312 Ceased WO2023231265A1 (en) 2022-05-30 2022-10-10 Lossless compression algorithm and apparatus based on embedded system picture, and computer device and storage medium

Country Status (2)

Country Link
CN (1) CN115002465A (en)
WO (1) WO2023231265A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115002465A (en) * 2022-05-30 2022-09-02 深圳市吉迩科技有限公司 Lossless compression algorithm, device, computer equipment and storage medium based on embedded system pictures
CN115145496B (en) * 2022-09-05 2023-01-06 中国汽车技术研究中心有限公司 Simulation result data processing method, device and storage medium
CN116958287A (en) * 2023-08-08 2023-10-27 深圳市吉迩科技有限公司 Multi-stage compression method, device, equipment and storage medium for picture data

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5604495A (en) * 1994-04-22 1997-02-18 Seta Co., Ltd. Data compression method and system
US6075470A (en) * 1998-02-26 2000-06-13 Research In Motion Limited Block-wise adaptive statistical data compressor
CN108322220A (en) * 2018-02-08 2018-07-24 华为技术有限公司 Decoding method, device and coding/decoding apparatus
WO2022062537A1 (en) * 2020-09-27 2022-03-31 苏州浪潮智能科技有限公司 Data compression method and apparatus, and computer-readable storage medium
CN115002465A (en) * 2022-05-30 2022-09-02 深圳市吉迩科技有限公司 Lossless compression algorithm, device, computer equipment and storage medium based on embedded system pictures

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101272442B (en) * 2007-03-21 2010-05-26 杭州波导软件有限公司 Digital image nondestructive compression method and device, resolution method and image encoder
KR101289933B1 (en) * 2011-12-30 2013-07-25 김광삼 Image compression Apparatus and method using Bit Flag Run-Length Encoding
CN103124350B (en) * 2012-12-24 2016-01-20 东软集团股份有限公司 Based on method for compressing image and the device of RLE
CN103258030B (en) * 2013-05-09 2016-04-13 西安电子科技大学 Based on the mobile device memory compression methods that dictionary and brigade commander are encoded
CN103346800B (en) * 2013-07-08 2016-10-05 沈阳东软医疗系统有限公司 A kind of data compression method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5604495A (en) * 1994-04-22 1997-02-18 Seta Co., Ltd. Data compression method and system
US6075470A (en) * 1998-02-26 2000-06-13 Research In Motion Limited Block-wise adaptive statistical data compressor
CN108322220A (en) * 2018-02-08 2018-07-24 华为技术有限公司 Decoding method, device and coding/decoding apparatus
WO2022062537A1 (en) * 2020-09-27 2022-03-31 苏州浪潮智能科技有限公司 Data compression method and apparatus, and computer-readable storage medium
CN115002465A (en) * 2022-05-30 2022-09-02 深圳市吉迩科技有限公司 Lossless compression algorithm, device, computer equipment and storage medium based on embedded system pictures

Also Published As

Publication number Publication date
CN115002465A (en) 2022-09-02

Similar Documents

Publication Publication Date Title
WO2023231265A1 (en) Lossless compression algorithm and apparatus based on embedded system picture, and computer device and storage medium
US7907069B2 (en) Fast compression method for scientific data
US7538695B2 (en) System and method for deflate processing within a compression engine
WO2022252488A1 (en) Image compression method and apparatus, electronic device, and readable storage medium
CN111131828B (en) An image compression method, device, electronic device and storage medium
TW201838410A (en) Picture file processing method, device, and storage medium
JP2544883B2 (en) Run length coding method and apparatus
CN1407510A (en) Cartoon image compression method
US20130148740A1 (en) Method and apparatus for processing partial video frame data
CN100367316C (en) Window free frame memory compression
JP2012519327A (en) RDP bitmap hash acceleration using SIMD instructions
JP2003244446A (en) Image processing apparatus and image processing method
CN112968706B (en) Data compression method, FPGA chip and FPGA online upgrading method
CN101653004A (en) Decoder for selectively decoding predetermined data units from an encoded bitstream
CN108377394B (en) Image data reading method of video encoder, computer device and computer-readable storage medium
US20160133232A1 (en) Image processing method and display apparatus
CN107147914A (en) An embedded system, a monochrome bitmap compression method, and a host computer
CN113613289B (en) Bluetooth data transmission method, system and communication equipment
CN101160574A (en) Image processing system and method with tag-based communication protocol
CN104394410B (en) Image data compression method, decompression method, transmission method and device
CN116309889A (en) Image compression method, device, computer equipment and storage medium
US12346308B2 (en) Data compression method and apparatus
US20080025620A1 (en) Data compression apparatus and data compressing program storage medium
CN112449191A (en) Method for compressing a plurality of images, method and apparatus for decompressing an image
US7346220B2 (en) Method and apparatus for reducing the bandwidth required to transmit image data

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22944573

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 22944573

Country of ref document: EP

Kind code of ref document: A1