A function-based equivalent transformation method before data compression

Through the function-based equivalent transformation method before data compression, using function libraries and Huffman coding, the problem of unstable data compression efficiency is solved, efficient compression of different types of files is achieved, and the compression ratio is significantly improved.

CN114039608BActive Publication Date: 2024-10-22JIANGXI XINGTENG TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111298397.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-04
Publication Date
2024-10-22
Estimated Expiration
2041-11-04

AI Technical Summary

Technical Problem

When existing data compression technology processes different types of files, due to changes in data correlation, the compression efficiency is unstable and it is difficult to effectively improve the compression ratio.

Method used

The function-based equivalent transformation method is used before data compression. By building a function library, sampling and encoding function values, performing function alignment and Huffman coding compression, the optimal function is selected for equivalent transformation to enhance data correlation.

Benefits of technology

Significantly improves the compression ratio of different types of files, and improves data compression efficiency by increasing data correlation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure BDA0003337492140000021
    Figure BDA0003337492140000021
  • Figure BDA0003337492140000031
    Figure BDA0003337492140000031
Patent Text Reader

Abstract

The invention discloses a function-based equivalent transformation method before data compression, comprising the following steps: constructing a function library; converting a source file into a binary string CS; sampling the functions in the function library, encoding the sampled values ​​to obtain a binary string C of equal length to the source file binary string CS; aligning CS and C by bit, and performing equivalent transformation on the source file binary string CS; compressing CD in a Huffman coding manner, and judging whether the function is a valid function by the compressed file length; performing equivalent transformation on the source file in turn with all the functions in the function library for the source file, selecting the optimal function, and using the equivalent transformation of the source file based on the optimal function as the final transformation result. Different function libraries are used for different types of files, thereby reconstructing the source file, increasing the relevance of data, and greatly improving the compression ratio.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to an equivalent transformation method before data compression, and in particular to a function-based equivalent transformation method before data compression. Background Art

[0002] Data compression refers to a technical method that reduces the amount of data to reduce storage space, improves its transmission, storage and processing efficiency, or reorganizes data according to a certain algorithm to reduce data redundancy and storage space without losing useful information. Data compression is divided into lossy compression and lossless compression. Lossless compression can be divided into compression methods based on statistical models and dictionary-based compression methods. Regardless of the method, it is based on the redundancy of information caused by the correlation between data. However, the same data combined in different ways will have a large change in its correlation, thus affecting its compression efficiency. Summary of the invention

[0003] Purpose of the invention: In view of the defects of the above-mentioned prior art, the present invention provides a function-based equivalent transformation method before data compression to increase the correlation of data and improve compression efficiency.

[0004] Technical solution: The function-based equivalent transformation method before data compression of the present invention comprises the following steps:

[0005] S1: Build function library;

[0006] S2: Convert the source file into a binary string CS;

[0007] S3: Sample the functions in the function library and encode the sampled values ​​to obtain a binary string C of the same length as the binary string CS of the source file;

[0008] S4: Align CS and C bit by bit, and perform equivalent transformation on the source file binary string CS;

[0009] S5: compress the CD using Huffman coding, and determine whether the function is a valid function based on the length of the compressed file;

[0010] S6: After performing equivalent transformation on the source file in turn using all functions in the function library for the source file, an optimal function is selected, and the equivalent transformation of the source file based on the optimal function is the final transformation result.

[0011] The function library in step S1 contains common elementary functions, and functions obtained by transforming elementary functions can also be obtained through big data. The function is described as F(x), and F(x) is a periodic function with a period of T. The sampling period of this function is t, and t satisfies that t is divisible by T.

[0012] Take out the periodic function F(x) from the function library, whose period is T. By sampling the periodic function F(x) with a period t, where t is an integer dividing T, encode its values ​​greater than or equal to 0 as "1" and its values ​​less than 0 as "0", and obtain a binary string C with the same length as the source file binary string CS.

[0013] Align CS and C bit by bit, take out the bits in CS corresponding to "1" in C in sequence to form a binary string C1, take out the bits in CS corresponding to "0" in C in sequence to form a binary string C0, connect C1 and C0 to get a binary string CD, at this time, the binary string CD is an equivalent transformation of the source file binary string CS.

[0014] Compare the compressed file length obtained by compressing CD in Huffman encoding mode to see if it is smaller than the compressed file length obtained by directly compressing the source file binary string CS in Huffman encoding mode, and determine whether the function F(x) is a valid function for the source file in the function library.

[0015] After performing equivalent transformations on the source file in turn with all valid functions in the function library for the source file, find out the valid function with the smallest compressed file length obtained by Huffman coding, and use it as the optimal function for all source files in the function library. The equivalent transformation of the source file based on the optimal function is the final transformation result.

[0016] Beneficial effects: Compared with the prior art, the present invention has the following significant advantages: different function libraries are used for different types of files to reconstruct the source files, increase the relevance of data, and significantly improve the compression ratio. DETAILED DESCRIPTION

[0017] The technical solution of the present invention is further described below in conjunction with embodiments.

[0018] Construct a function library, which contains a function F(x)=cos(x) with a period of T=2π. Take the sampling period t=π, which obviously satisfies t to divide T.

[0019] The source file is a set of octal "5435107267143062", which is converted into a binary string CS = "101,100,011,101,001,000,111,010,110,111,001,100,011,000,110,010". (For easy identification, "," is inserted between every three binary strings. There is no "," in the actual processing. The following expressions also insert ",")

[0020] Take out the periodic function F(x)=cos(x) from the function library, whose period is T=2π. By sampling the periodic function F(x) with a period of t=π, the results are “+1,-1,+1,-1…” in sequence. Encode the values ​​greater than or equal to 0 as “1” and the values ​​less than 0 as “0”, and obtain a binary string C = “101,010,101,010,101,010,101,010,101,010,101,010,101,010,101,010” of the same length as the source file binary string CS.

[0021] Align CS and C bit by bit, take out the bits in CS corresponding to "1" in C in sequence to form a binary string C1="110010010111101010010101", take out the bits in CS corresponding to "0" in C in sequence to form a binary string C0="010111000100111010100100", connect C1 and C0 to get the binary string CD="1100100101111010100101010101010111000100111010100100", at this time the binary string CD is an equivalent transformation of the binary string CS of the source file.

[0022] Compress CS and CD respectively using Huffman coding:

[0023] The binary string structure before transformation is shown in the following table:

[0024] Table 1 Binary string structure table before transformation

[0025]

[0026]

[0027] The structure of the transformed binary string is shown in the following table:

[0028] Table 2 Binary string structure table before transformation

[0029] coding Occurrence Using Huffman coding 000 1 1011 001 010 6 11 011 100 3 01 101 2 100 110 1 1010 111 3 00

[0030] The compressed binary string of string CD = "110,010,010,111,101,010,010,101,010,111,000,100,111,010,100,100" is "1010,11,11,00,100,11,11,100,11,00,1011,01,00,11,01,01" (where "," is used to separate the compressed value of each octal number), with a length of 38 bits.

[0031] Since the length of the compressed file after the transformation, 38 bits, is smaller than the length of the compressed file before the transformation, 48 bits, the function F(x)=cos(x) is a valid function for the source file in the function library. And since there is only one function in the current function library, the function F(x)=cos(x) is the optimal function for the source file in the function library. The equivalent transformation of the source file based on the function F(x)=cos(x) is the final transformation result.

Claims

1. A function-based equivalent transformation method before data compression, characterized in that: The method comprises the following steps: S1: Build function library; S2: Convert the source file into a binary string CS; S3: Sample the functions in the function library and encode the sampled values ​​to obtain a binary string C of the same length as the binary string CS of the source file; S4: align CS and C bit by bit, and perform equivalent transformation on the binary string CS of the source file; specifically, align CS and C bit by bit, sequentially take out the bits in CS corresponding to "1" in C to form a binary string C1, sequentially take out the bits in CS corresponding to "0" in C to form a binary string C0, and connect C1 and C0 to obtain a binary string CD. At this time, the binary string CD is an equivalent transformation of the binary string CS of the source file; S5: compress the CD using Huffman coding, and determine whether the function is a valid function based on the length of the compressed file; S6: After performing equivalent transformation on the source file in turn using all functions in the function library for the source file, an optimal function is selected, and the equivalent transformation of the source file based on the optimal function is the final transformation result.

2. The method for equivalent transformation based on function before data compression according to claim 1, characterized in that The function library in step S1 is a set of periodic functions F(x) with a period of T.

3. The method for equivalent transformation based on function before data compression according to claim 1 is characterized in that The step S3 includes sampling the periodic function F(x) with a period t, where t is an integer dividing T, and encoding its value greater than or equal to 0 as "1" and its value less than 0 as "0".

4. The method for equivalent transformation based on function before data compression according to claim 1, characterized in that The criterion for determining the valid function in step S5 is: if the length of the compressed file obtained by compressing CD in Huffman encoding is smaller than the length of the compressed file obtained by directly compressing the source file binary string CS in Huffman encoding, then function F(x) is a valid function for the source file in the function library.

5. The method for equivalent transformation based on function before data compression according to claim 1, characterized in that The optimal function for the source file in step S6 is an effective function with the shortest compressed file length obtained by Huffman coding.