Binary data query dictionary type reversible compression method
Through the dictionary-based compression method, binary data is processed and replaced in segments, which solves the problem of low compression rate in the prior art, and realizes more efficient data compression, which is suitable for processing, transmission and storage of large binary data.
Patent Information
- Application Number
- CN202210132509.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-13
- Publication Date
- 2025-04-18
AI Technical Summary
The compression rate of existing binary data reversibility compression technology is low, which limits the development of the computer and electronic information industries.
The dictionary-looking compression method is used to process the binary data in segments and replace the corresponding data in the dictionary to improve the compression rate.
The compression rate of binary data is significantly improved, allowing large or super-large binary data to be reversibly compressed to very small, and improving the efficiency of data processing, transmission and storage.
Smart Images

Figure HSB0000210413410000011 
Figure HSB0000210413410000012
Abstract
Description
Technical Field
[0001] The present invention is a binary data dictionary-based reversible compression method, which overcomes the problem that the low compression rate of binary data reversible compression technology restricts the development of computer and electronic information industry. It reversibly compresses binary data by dictionary-based method, which greatly improves the compression rate; after data compression, it can be repeatedly compressed, so that any large or super large binary data can be reversibly compressed to a very small size, thereby achieving the purpose of better processing, transmission and storage of data. Technical Background
[0002] At present, the slow development of reversible compression technology has seriously restricted the development of the computer and electronic information industry. Summary of the invention
[0003] In order to better reversibly compress binary data, the present invention creates a compression method for reversibly compressing binary data, which effectively improves the compression rate of binary data.
[0004] Any binary data can be regarded as a collection of data segments composed of two elements, 0 and 1; for a row of data such as 11010011100011110000, it is segmented and processed. For the same type of continuous or single elements, it is regarded as a block, such as 11, 0, 1, 00, 111, 000, 1111, 0000, and two adjacent blocks are regarded as a data segment, such as 110, 100, 111000, 11110000; if the number of blocks of the entire data is an odd number, an element different from the first element is added to the end of the data (or another element different from the first element is added before the first element), so that all blocks can form a data segment. There are two types of data segments, data segments headed by 1 and data segments headed by 0. For any data to be processed, there is only one type of data segment after segmentation, which is headed by 1 or 0. It is well known that 1 bit of binary has only 2 data 0 and 1, 2 bits have 4 data, and n bits have 2 to the power of n data. See the attached figure Figure 1 :
[0006] A data segment is composed of two adjacent blocks of continuous or single elements. For example, a data segment with the first digit being 1, 1 plus one digit gives 10 and 11, 10 plus one digit gives 100 and 101. Since 101 does not meet the requirements of a data segment, it is represented by 10; 11 plus one digit gives 110 and 111, and so on for all data segments. See attached figure Figure 2 :
[0008] Due to the attached Figure 1 The number of data is greater than that of the attached data when the number of digits is the same. Figure 2 The number of data, with the attached Figure 1 The data is used instead of the attached Figure 2 Theoretically, data can be compressed, and after multiple iterations, it can be compressed infinitely. So in theory, very large data can be compressed to a very small size.
[0009] According to data statistics, for the data to be compressed, the rule is that the smaller the data segment bit number, the more data there is, and the larger the data segment bit number, the smaller the data number, the lower the lossless compression rate; for example, for data segments headed by 1, the number of data segments 10 in the data to be compressed is the largest, followed by the number of data segments 100 and 110, and the number of data segments 1000, 1100, 1110 and so on. Such data is the most difficult to compress. At this time, the data to be compressed is no longer divided by data segments, but divided by equal bits, such as 8 bits, 12 bits or 16 bits, and then all the data of equal bits are sorted one by one with the data with more consecutive elements of the same type in front to form Table 1, and then the order is reversed to form Table 2, and then the data in Table 1 and Table 2 are matched one by one to form a dictionary (such as Table 1 for 4-bit data: 1111, 0000, 1110, 0001, 0111, 1000, 1100, 0011, 1101, 0010, 0110, 1001, 1011, 01 00, 1010, 0101; Table 2: 0101, 1010, 0100, 1011, 1001, 0110, 0010, 1101, 0011, 1100, 1000, 0111, 0001, 1110, 0000, 1111), and then use the dictionary lookup method to replace the data to be compressed with the data in Table 2 in the dictionary with the data in Table 1 in the dictionary; or divide Table 1 into 4, 6 or more tables in order according to needs, and except for the first table, the order of the remaining tables will be reversed (or not reversed) and Make the data of the remaining tables correspond to the data of the first table one by one to form a dictionary (for example, table 1 with 4-bit data: 1111, 0000, 1110, 0001, 0111, 1000, 1100, 0011, 1101, 0010, 0110, 1001, 1011, 0100, 1010, 0101; divided into 4 tables A: 1111, 0000, 1110, 0001, table B: 0111, 1000, 1100, 0011, table C: 1101, 0010, 0110, 1001 , Table D: 1011, 0100, 1010, 0101), and then use the dictionary lookup method to replace the data to be compressed with the data in Table B, C, and D in the dictionary with the data in Table A in the dictionary, and add the serial number used to distinguish Table B, C, and D before the data (because the data in Table A are all well-compressed data, this can maximize the proportion of well-compressed data and perform better compression); so that the data to be compressed breaks the rule that the smaller the number of data segments, the more, and the larger the number of data segments, the fewer, and then perform lossless compression on the replaced data. After multiple iterations, large data can be compressed to a very small size. Because the dictionary is fixed, only the compression method and the number of dictionary bits need to be recorded, so the space occupied by the record is very small.
[0010] Data decompression is the process of reversing the compression method and dictionary and compressed data. BRIEF DESCRIPTION OF THE DRAWINGS Figure 1 It is a binary data data expansion diagram. Figure 2 It is the data expansion diagram of the data segment (the "0" part is omitted because the principle of the "1" part is the same as that of the data segment). DETAILED DESCRIPTION
[0011] Count the data {101001101000110011101010011010101010101010}, there are 8 results of 10, 2 results of 100 and 110, and 1 result of 1000, 1100, and 1110; the dictionary uses 8 bits, Table 2 is {10101010, … 01101010, … 10100110, … 11101010, … 10001100, …}, and the corresponding Table 1 is {000000000, … 00111111, … 01011110, … 01110111, … 11100110}, and the actual data is changed to {0101111011100110011101110011111100000000}. Continue to compress the data with the first bit as 0, and finally add a 1, so the data has 1 01, 2 0111, 1 0011, 1 01111, 1 00111, 1 00111111, and 1 000000001. Replace 0111 with 1, replace 000000001 with 011, replace 00111111 with 010, replace 00111111 with 001, replace 0001 with 0011, 00001 with 0111, and replace 00111 with 00000. Record the replacement data and the first bit data of the data, and the data is compressed to {0010000110001000001010011}. The data is then compressed multiple times to make the data have more smaller segments with more bits and fewer larger segments with less bits. The corresponding data is then replaced by looking up the dictionary, and the resulting data is compressed again. Multiple cycles of iteration will make the data very small, thereby achieving the purpose of data compression.
[0012] Data decompression is to reverse the compression process through the dictionary and record process and the compression result, so it will not be explained in detail.
[0013] The above is a detailed description of the present invention. It should be noted that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
Claims
1. A binary data dictionary-based reversible compression method, characterized in that: The compressed data is regarded as data represented by equal number of bits, and then all the data with equal number of bits are sorted one by one with data with more consecutive elements of the same kind in front to form Table 1, and then the order is reversed to form Table 2, and then the data in Table 1 and Table 2 are matched one by one to form a dictionary, and then the dictionary search method is used to replace the data to be compressed with the data in Table 2 in the dictionary for the data in Table 1 in the dictionary, and then the replaced data is losslessly compressed; or Table 1 is divided into 4, 6 or more tables in order, and the data in the remaining tables can be matched one by one with the data in the first table to form a dictionary, and then the dictionary search method is used to replace the data to be compressed with the data in the remaining tables in the dictionary for the data in the first table in the dictionary and a serial number used to distinguish the tables is added in front, and then the replaced data is losslessly compressed. After multiple iterations, large data can be compressed to a small size. Because the dictionary is fixed, we only need to record the compression method and the number of bits of the dictionary, so the space occupied by the record is very small.
2. A decompression method; characterized in that: The decompression of the file is to reverse the compression process in right 1 through the dictionary and records in right 1 and the compressed data.