CN106656195A - Data compression decompression method and data compression decompression system - Google Patents

Data compression decompression method and data compression decompression system Download PDF

Info

Publication number
CN106656195A
CN106656195A CN201510738681.6A CN201510738681A CN106656195A CN 106656195 A CN106656195 A CN 106656195A CN 201510738681 A CN201510738681 A CN 201510738681A CN 106656195 A CN106656195 A CN 106656195A
Authority
CN
China
Prior art keywords
data
byte data
original
compression
byte
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.)
Withdrawn
Application number
CN201510738681.6A
Other languages
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.)
Beijing Xinwei Telecom Technology Inc
Original Assignee
Beijing Xinwei Telecom Technology Inc
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 Beijing Xinwei Telecom Technology Inc filed Critical Beijing Xinwei Telecom Technology Inc
Priority to CN201510738681.6A priority Critical patent/CN106656195A/en
Publication of CN106656195A publication Critical patent/CN106656195A/en
Withdrawn legal-status Critical Current

Links

Landscapes

  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

The invention discloses a data compression decompression method and a data compression decompression system. The data compression decompression method comprises steps that a: original byte data is scanned; b: when continuous same byte data exists in the original byte data, the first logical operation of the number of the continuous same byte data is carried out to acquire a first logical operation value, and the first logical operation value is stored as the byte data, and any byte data of the continuous same byte data is stored as another byte data; c: whether the scanning of the original byte data is completed is determined, and when the scanning of the original byte data is completed, a step d is carried out, and when the scanning of the original byte data is not completed, the whole process returns to the step a; d: compression data is generated according to the stored byte data. By adopting the technical scheme provided by the invention, the problems of the data compression such as high complexity and high time consumption caused by bit-level processing are solved, and data transmission efficiency is improved.

Description

Method and system for compressing and decompressing data
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method and a system for data compression and decompression.
Background
In communication technology, it is generally necessary to perform compression coding on data with a certain redundancy. Common data compression methods are run-length coding, huffman coding, LZ algorithm and other efficient algorithms derived from the above, but these algorithms listed above are mainly suitable for compression of data source, i.e. compressing source data that has not yet entered the communication network, and are focused on bit-level processing.
In the prior art, huffman coding is an ancient and elegant data compression method, which is a compression algorithm based on minimum redundancy coding. Where minimum redundancy coding means that a symbol in a set of data can be represented in a particular way if the frequency of occurrence of the symbol is known. For example, a symbol with a higher frequency of occurrence is represented by a smaller number of bits, and a symbol with a lower frequency of occurrence is represented by a larger number of bits, thereby reducing the storage space required for data and achieving the purpose of compression. Because different numbers of bits are adopted to replace different symbols in the process of compressing and encoding the symbols, if the media data taking bytes as units are compressed by adopting the Huffman encoding, the operation on the bit data exists, and the operation is complex and consumes more time.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and a system for data compression and decompression, which solve the problems of high complexity and time consumption caused by bit-level processing in data compression, so as to improve data transmission efficiency.
The embodiment of the invention adopts the following technical scheme:
in a first aspect, a method of data compression, comprising the steps of, a: scanning original byte data; b: if continuous same byte data exists in the original byte data, performing a first logical operation with the number of the continuous same byte data to obtain a first logical operation value, and storing the first logical operation value as one byte data and any one byte data of the continuous same byte data as another byte data; c: judging whether the original byte data is scanned completely, if so, turning to the step d, otherwise, returning to the step a; d: and generating compressed data according to the stored byte data.
In a second aspect, a method of data decompression, comprising the steps of, a: scanning the compressed data; b: performing compression logic judgment operation on nth byte data of the compressed data to obtain a compression logic judgment value and compression logic, wherein n is a natural number greater than or equal to 1; c: if the compression logic judgment value is equal to a first preset value, continuous same byte data exist in original byte data corresponding to the compression logic; performing a first logical number operation on the nth byte data to obtain a data number i, wherein i is a natural number greater than or equal to 2, and repeatedly reading the (n + 1) th byte data of the i compressed data; d: judging whether the compressed data is scanned completely, if so, turning to the step E, and if not, returning to the step A; e: and recovering the original byte data according to the read byte data.
In a third aspect, a system for data compression, comprises: an original byte data scanning unit for scanning original byte data; the compression storage unit is used for compressing and storing the original byte data; the first judging unit is used for judging whether the original byte data is completely scanned or not; and the compressed data generating unit is used for generating compressed data according to the stored byte data.
In a fourth aspect, a system for data decompression, comprising: a compressed data scanning unit for scanning the compressed data; a compression logic judgment value and compression logic obtaining unit, configured to perform compression logic judgment operation on nth byte data of the compressed data to obtain a compression logic judgment value and a compression logic, where n is a natural number greater than or equal to 1; the decompression reading unit is used for decompressing and reading the compressed data according to the compression logic judgment value and the compression logic; and the original byte data recovery unit is used for recovering the original byte data according to the read byte data.
According to the technical scheme, the technical scheme includes the steps of: scanning original byte data; b: if continuous same byte data exists in the original byte data, performing a first logical operation with the number of the continuous same byte data to obtain a first logical operation value, and storing the first logical operation value as one byte data and any one byte data of the continuous same byte data as another byte data; c: judging whether the original byte data is scanned completely, if so, turning to the step d, otherwise, returning to the step a; d: and generating compressed data according to the stored byte data. Compared with the technical scheme of data compression aiming at the data source in the prior art, the technical scheme of the invention can compress the transmission data, such as media data, test data, operation data and the like transmitted among different wireless nodes in a wireless communication network. According to the technical scheme, bytes are used as a unit, and when data compression is carried out on transmission data with certain redundancy, the technical effects of reducing the complexity of data compression and consuming time can be achieved. Taking the wireless communication network as an example, the data transmission efficiency between different wireless nodes in the wireless communication network can be improved, thereby indirectly increasing the technical effect of the bandwidth resource utilization rate of the wireless communication network.
Drawings
Fig. 1A is a diagram illustrating a scenario of data compression in a wireless communication network according to an embodiment of the present invention.
Fig. 1B is a flowchart of a method for data compression according to an embodiment of the present invention.
Fig. 2A is a flowchart of a data compression and storage method according to a second embodiment of the present invention.
Fig. 2B is a flowchart of a method for data compression with interface information added according to a second embodiment of the present invention.
Fig. 2C is a block diagram of the information structure of the data compression and decompression interface according to the second embodiment of the present invention.
Fig. 3 is a flowchart of a data decompression method according to a third embodiment of the present invention.
Fig. 4 is a flowchart of a data decompression and reading method according to a fourth embodiment of the present invention.
Fig. 5 is a system structure diagram of data compression according to the fifth embodiment of the present invention.
Fig. 6 is a system configuration diagram for data decompression according to a sixth embodiment of the present invention.
Detailed Description
The following detailed description of specific embodiments of the invention refers to the accompanying drawings. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. In addition, for convenience of description, only a part, not all of the contents related to the present invention are shown in the drawings.
Example one
As shown in fig. 1B, an embodiment of the present invention provides a method for data compression, where the method may be applied to the application scenario shown in fig. 1A, and the technical solution of this embodiment may be executed by a wireless node, and may specifically be implemented by a software program configured in the wireless node. For example, media data, test data, operation and maintenance data, etc. in the wireless communication network may cause additional burden to the wireless communication network due to the existence of redundant data portions, and therefore, when data is transmitted between multiple wireless nodes in the wireless communication network, a data compression function needs to be introduced. As shown in fig. 1A, transmission data is transmitted between a wireless node 110 and a wireless node 120 through a wireless channel after being compressed, where the wireless node 110 includes a receiving module 111 and a transmitting module 112; the wireless node 120 includes a transmitting module 121 and a receiving module 122; a data compression function is disposed on the transmission module 112 and the transmission module 121, and a data decompression function is disposed on the reception module 111 and the reception module 122, respectively. As shown in fig. 1B, the method for data compression provided by the embodiment of the present invention includes the following steps:
s110, scanning original byte data.
Illustratively, the scanning may be performed sequentially from a first byte of the original byte data, and according to a scanning result, a redundant component of the original byte data may be determined, and then a next compression processing step may be performed according to a characteristic of the redundant data.
And S120, compressing and storing the original byte data.
If continuous same byte data exists in the original byte data, performing a first logical operation with the number of the continuous same byte data to obtain a first logical operation value, and storing the first logical operation value as one byte data and any one byte data of the continuous same byte data as another byte data.
For example, when there are 3 consecutive identical byte data in the original byte data, which are 0x05, 0x05, and 0x05, respectively, the first logical operation may be to perform a logical or operation using 0x80 and the number of consecutive identical byte data, 0x03, to obtain a first logical operation value, 0x83, and then store the obtained first logical operation value, 0x83, as one byte data, and store consecutive identical byte data, 0x05, as another byte data.
And S130, judging whether the original byte data is completely scanned.
If the scanning is completed, go to step S140; if not, the process returns to step S110 to continue scanning.
And S140, generating compressed data according to the stored byte data.
In step S120, the compression processing is performed on the continuous same byte data in the original byte data, so that the byte data originally occupying 3 bytes of data occupies only 2 bytes of data after the data compression processing. 0x83 and 0x05 are the compressed data.
According to the technical scheme, the method comprises the following steps: scanning original byte data; b: if continuous same byte data exists in the original byte data, performing a first logical operation with the number of the continuous same byte data to obtain a first logical operation value, and storing the first logical operation value as one byte data and any one byte data of the continuous same byte data as another byte data; c: judging whether the original byte data is scanned completely, if so, turning to the step d, otherwise, returning to the step a; d: and generating compressed data according to the stored byte data. Compared with the technical scheme of data compression aiming at the data source in the prior art, the technical scheme of the invention can compress the transmission data, such as media data, test data, operation data and the like transmitted among different wireless nodes in a wireless communication network. According to the technical scheme, bytes are used as a unit, and when data compression is carried out on transmission data with certain redundancy, the technical effects of reducing the complexity of data compression and consuming time can be achieved. Taking the wireless communication network as an example, the data transmission efficiency between different wireless nodes in the wireless communication network can be improved, thereby indirectly increasing the technical effect of the bandwidth resource utilization rate of the wireless communication network.
Example two
Please refer to fig. 2A, which is a flowchart illustrating a data compression and storage method according to a second embodiment of the present invention. The technical solution of the embodiment of the present invention is different from and related to the first embodiment in that, on the basis of step S120 of the first embodiment, that is, on the basis of compressing and storing the original byte data, a preferred implementation manner of data compression and storage for the original byte data is further provided when continuously increasing byte data exists in the original byte data and when discontinuously identical and discontinuously increasing byte data exists in the original byte data.
As shown in fig. 2A, first, data characteristics in the original byte data are determined according to step S210; if it is determined in step S2210 that the continuously increasing byte data exists in the original byte data; step S2211 may be executed, that is, a second logical operation is performed on the number of the successively increased byte data to obtain a second logical operation value; step S2212 is executed next, that is, the second logical operation value is stored as one byte of data, and the first byte of data of the successively incremented byte of data is stored as another byte of data.
The second logical operation may be an or operation using 0xC0 and the number of successively increasing byte data.
If the step S2220 is executed, it is determined that the original byte data has the same discontinuous byte data and the discontinuous incremental byte data; step S2221 may be executed, that is, a third logical operation is performed on the number of the byte data that is the same as the discontinuous number and is discontinuously incremented to obtain a third logical operation value; step S2222 is executed next, that is, the third logical operation value is stored as one byte of data, and each byte of the discontinuous identical and discontinuous incremental byte of data is sequentially stored as another byte of data.
The third logical operation may be an or operation using 0x00 and the number of bytes of data that are not consecutive increments, which is the same as the discontinuity.
Finally, the stored byte data is obtained according to step S230, and the compressed data is generated according to the stored byte data.
Referring to fig. 1A, when data compression is performed on transmission data of a wireless communication network, a compression and decompression function unit needs to be added in the processing flow of the corresponding sending module 112 and receiving module 122, so that corresponding interface information can be added in the process of compressing original byte data to ensure that the data decompression processing procedure is completed correctly. As shown in fig. 2B, the following steps may be added after step S140 in the first embodiment:
s150, adding interface information to the compressed data to generate a compressed data packet.
Fig. 2C provides a block diagram of interface information for data compression and decompression, and as shown in fig. 2C, the interface information may include a compression type and a size of original byte data, and for example, a definition of the compression type may be represented by 0 to indicate no compression and 1 to indicate compression.
In this embodiment, data compression is further performed on byte data which continuously increases in the original byte data and byte data which is discontinuously the same and discontinuously increases in the original byte data, so that redundancy of the data is further reduced, and data transmission efficiency is improved; in addition, by adding interface information to the compressed data, it can be ensured that the receiving module completes the decompression processing procedure correctly.
EXAMPLE III
As shown in fig. 3, the embodiment of the present invention provides a method for data decompression, which can also be applied in the scenario shown in fig. 1A. The data decompression process of this embodiment corresponds to the data compression process in the first embodiment of the present invention, and specifically, is the inverse process of the data compression process in the first embodiment of the present invention, so the execution main body of the technical solution of this embodiment may be the same as or correspond to the first embodiment. When the receiving module 111 of the wireless node 110 or the receiving module 122 of the wireless node 120 receives the compressed data sent by the other wireless node, the data decompression method may be used to perform decompression processing, and then the decompressed data is delivered to the wireless node for subsequent processing. The method of data decompression may comprise the steps of:
and S310, scanning the compressed data.
The compressed data may be data obtained by compressing original byte data by the data compression method in the first embodiment.
S320, performing compression logic judgment operation on nth byte data of the compressed data to obtain a compression logic judgment value and compression logic, wherein n is a natural number greater than or equal to 1.
S330, decompressing and reading the compressed data according to the compression logic judgment value and the compression logic.
Illustratively, if the compression logic judgment value is equal to a first preset value, it is judged that continuous same byte data exists in original byte data corresponding to the compression logic; and performing a first logical number operation on the nth byte data to obtain a data number i, wherein i is a natural number greater than or equal to 2, and repeatedly reading the (n + 1) th byte data of the i compressed data.
For example, when the nth byte data is 0x83 and the (n + 1) th byte data is 0x05, the compression logic determination operation may use 0xC0 to perform an or operation with the nth byte data; that is, 0xC0|0x83 is 0x80, and the compression logic determination value is 0x 80. In this embodiment, if 0x80 may be a first preset value, it is determined that consecutive same byte data exists in the original byte data corresponding to the compression logic; the first logical number operation may be an or operation with the nth byte data using 0x38, and then the data number 3 may be obtained by using 0x38|0x83 ═ 0x03, and the subsequent 3 data are repeatedly read, where the (n + 1) th byte data are 0x05, 0x05, and 0x05, respectively.
And S340, judging whether the compressed data is scanned completely.
If the scanning is completed, go to step S350; if not, the process returns to step S310 to continue scanning.
And S350, recovering the original byte data according to the read byte data.
For example, the original byte data may be the read byte data 0x05, 0x05, 0x05 as step S330.
In this embodiment, the data decompression process is an inverse operation performed in the data compression process in the first embodiment, the compression logic value is obtained by a compression logic judgment operation, and then the compression logic value is compared with the first preset value to determine the corresponding compression logic of the data compression, and the data decompression is an inverse operation of the data compression, so that the original byte data can be correctly recovered, compression and decompression processing of transmission data in the wireless communication network is realized, and the technical effects of reducing transmission of redundant data, improving data transmission efficiency, and indirectly increasing the bandwidth resource utilization rate of the wireless communication network are achieved.
Example four
Please refer to fig. 4, which is a flowchart illustrating a method for decompressing and reading data according to an embodiment of the present invention. On the basis of the step S330 in the third embodiment, that is, on the basis of decompressing and reading the compressed data according to the compression logic judgment value and the compression logic, the embodiment of the present invention further provides that the compression logic judgment value is equal to a second preset value, that is, the compression logic corresponds to the original byte data, and the byte data continuously increasing progressively exists; and the compression logic judges that the value is not equal to the first preset value and not equal to the second preset value, namely the compression logic decompresses and reads the compressed data under the condition that the original byte data corresponding to the compression logic has discontinuous same byte data and discontinuous incremental byte data.
As shown in fig. 4, firstly, according to step S410, determining a compression logic judgment value, if it is determined that the compression logic judgment value is equal to a second preset value in step S4210, determining that continuously increasing byte data exists in original byte data corresponding to compression logic in step S4211, further performing step S4212, performing a second logic number operation on nth byte data of the compressed data to obtain a data number j, wherein j is a natural number greater than or equal to 2; finally, according to step S4213, j bytes of data are sequentially read from the n +1 th byte of the compressed data.
Wherein, the second preset value may be 0xC 0; the second logical number operation may be an or operation with the nth byte data using 0x 38.
If the compression logic judgment value is not equal to the first preset value and not equal to the second preset value in the step S4220, determining that discontinuous and same discontinuous incremental byte data exist in original byte data corresponding to the compression logic in the step S4221, further executing a step S4222, and performing a third logic number operation on nth byte data of the compressed data to obtain a data number k, wherein k is a natural number greater than or equal to 2; finally, according to step S4223, k bytes of data are read sequentially starting from the n +1 th byte of data of the compressed data.
The third logical number operation may be an or operation with the nth byte data using 0x 00.
And finally, according to the step S430, acquiring the read byte data and recovering the original byte data.
In this embodiment, the compression logic determination value is further provided as a second preset value, that is, the compression logic corresponds to the original byte data, where the continuously increasing byte data exists; the compression logic judgment value is not equal to the first preset value and not equal to the second preset value, namely the compression logic corresponds to data decompression operation of the byte data which are discontinuous, same and discontinuously increased in the original byte data; therefore, the original byte data can be correctly recovered, compression and decompression processing of transmission data in the wireless communication network are realized, and the technical effects of improving data transmission efficiency and indirectly increasing the bandwidth resource utilization rate of the wireless communication network by reducing transmission of redundant data are achieved.
The following is an embodiment of a system for compressing and decompressing data according to an embodiment of the present invention. The embodiments of the data compression and decompression system belong to the same concept as the embodiments of the data compression and decompression method, and reference may be made to the embodiments of the data compression and decompression method for details not described in detail in the embodiments of the data compression and decompression system.
EXAMPLE five
On the basis of any embodiment of the present invention, as shown in fig. 5, an embodiment of the present invention provides a system 510 for data compression, where the system 510 includes: an original byte data scanning unit 511, a compressed storage unit 512, a first judgment unit 513, and a compressed data generation unit 514. Wherein,
an original byte data scanning unit 511 for scanning the original byte data;
a compression storage unit 512, configured to compress and store the original byte data;
a first judging unit 513, configured to judge whether scanning of the original byte data is completed;
a compressed data generating unit 514, configured to generate compressed data according to the stored byte data.
Compared with the technical scheme of data compression aiming at the data source in the prior art, the technical scheme of the invention can compress the transmission data, such as media data, test data, operation data and the like transmitted among different wireless nodes in a wireless communication network. According to the technical scheme, bytes are used as a unit, and when data compression is carried out on transmission data with certain redundancy, the technical effects of reducing the complexity of data compression and consuming time can be achieved. Taking the wireless communication network as an example, the data transmission efficiency between different wireless nodes in the wireless communication network can be improved, thereby indirectly increasing the technical effect of the bandwidth resource utilization rate of the wireless communication network.
EXAMPLE six
On the basis of any technical solution of the embodiment of the present invention, as shown in fig. 6, an embodiment of the present invention provides a system 610 for data decompression, where the system 610 includes: a compressed data scanning unit 611, a compression logic determination value and compression logic acquisition unit 612, a decompression reading unit 613, a second determination unit 614, and an original byte data recovery unit 615. Wherein,
a compressed data scanning unit 611 for scanning the compressed data;
a compression logic judgment value and compression logic obtaining unit 612, configured to perform compression logic judgment operation on nth byte data of the compressed data to obtain a compression logic judgment value and a compression logic, where n is a natural number greater than or equal to 1;
a decompression reading unit 613, configured to decompress and read the compressed data according to the compression logic determination value and the compression logic;
a second judging unit 614, configured to judge whether the compressed data is completely scanned;
an original byte data recovery unit 615, configured to recover original byte data according to the read byte data.
According to the technical scheme provided by the embodiment, decompression corresponding to data compression can be realized, and the technical effects of improving data transmission efficiency and indirectly increasing the bandwidth resource utilization rate of the wireless communication network by reducing transmission of redundant data are achieved.
EXAMPLE seven
On the basis of the above embodiments, the embodiments of the present invention further provide a specific implementation manner of data compression and decompression.
First, data compression example:
for example, the original byte data is: 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x05, 0x05, 0x05, 0x07, 0x09, 0x03, 0x05, and 13 bytes in total.
The data compression processing steps are as follows:
the first step is as follows: scanning original byte data to obtain 3 continuous same byte data 0x00, using 0x80|0x03 ═ 0x83, wherein "|" represents logical or operation, storing 0x83 as one byte data, storing 0x00 as another byte data, and storing byte data of 0x83 and 0x 00;
the second step is that: continuing to scan the original byte data to obtain 3 successively increased byte data 0x01, 0x02 and 0x03, using 0xC0|0x03 ═ 0xC3, storing 0xC3 as one byte data, storing 0x01 as another byte data, and storing 0xC3 and 0x 01;
the third step: continuing to scan the original byte data to obtain 3 consecutive identical byte data, namely 0x05, 0x05 and 0x05, storing 0x83 as one byte data and 0x05 as another byte data by using 0x80|0x03 ═ 0x83, wherein the stored byte data are 0x83 and 0x 05;
the fourth step: the original byte data is continuously scanned to obtain 4 discontinuous same byte data with discontinuous increment, the byte data is stored as one byte data by using 0x04, the byte data is stored as another byte data by using 0x07, 0x09, 0x03 and 0x05 in sequence, the stored byte data is 0x04, 0x07, 0x09, 0x03 and 0x05 in sequence, and the original byte data occupies 11 bytes after being compressed.
The compressed data is shown in table 1 below:
TABLE 1 compressed data
Second, data decompression example:
for example, the compressed data is: 0x83, 0x00, 0xC3, 0x01, 0x83, 0x05, 0x04, 0x07, 0x09, 0x03, 0x05, and 11 bytes in total.
The data decompression processing steps are as follows:
the first step is as follows: scanning the compressed data from the first byte data to obtain that the first byte data is 0x83, using 0x83|0xC0 ═ 0x80, where "|" represents logical or operation, and according to 0x80, judging that the same byte data exists in the original byte data continuously, further using 0x83|0x38 ═ 0x03, then reading the next byte data 0x00, which represents that 3 same byte data 0x00 continuously exist, and repeatedly reading 30 x00, so that the read byte data are 0x00, 0x00, and 0x 00;
the second step is that: continuing to scan the compressed data to obtain that the byte data is 0xC3, using 0xC3|0xC0 to 0xC0, judging that continuously increasing byte data exists in the original byte data according to 0xC0, further using 0xC3|0x38 to 0x03, then starting from the next byte data 0x01, indicating that 3 byte data continuously increasing from 0x01 exist, and sequentially reading 3 byte data, wherein the read byte data are 0x01, 0x02 and 0x 03;
the third step: continuing to scan the compressed data to obtain that the byte data is 0x83, using 0x83|0xC0 to be 0x80, judging that the original byte data has continuous same byte data according to 0x80, further using 0x83|0x38 to be 0x03, then starting from the next byte data 0x05, indicating that 3 continuous same byte data 0x05 exist, repeatedly reading 3 bytes 0x05, wherein the read byte data is 0x05, 0x05 and 0x 05;
the fourth step: the compressed data is scanned continuously to obtain byte data of 0x04, and when 0x04|0x00 is 0x04, the situation that the original byte data has discontinuous identical byte data with discontinuous increment can be judged according to 0x04, then the next 4 bytes of data are read in sequence from the next byte data of 0x07, the read byte data are 0x07, 0x09, 0x03 and 0x05, and after the decompression processing of the compressed data is finished, the compressed data occupies 13 bytes in total.
The decompressed data is shown in table 2 below:
TABLE 2 decompression data
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes in the detailed description of the present invention will be apparent to those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (19)

1. A method of data compression, comprising the steps of:
a: scanning original byte data;
b: if continuous same byte data exists in the original byte data, performing a first logical operation with the number of the continuous same byte data to obtain a first logical operation value, and storing the first logical operation value as one byte data and any one byte data of the continuous same byte data as another byte data;
c: judging whether the original byte data is scanned completely, if so, turning to the step d; if not, returning to the step a;
d: and generating compressed data according to the stored byte data.
2. The method of claim 1, wherein the step b further comprises:
and if the continuously increased byte data exists in the original byte data, performing second logical operation on the number of the continuously increased byte data to obtain a second logical operation value, and storing the second logical operation value as one byte data and the first byte data of the continuously increased byte data as the other byte data.
3. The method of claim 2, wherein the step b further comprises:
if the original byte data contains discontinuous and same byte data which is discontinuously increased, carrying out third logic operation on the original byte data and the number of the discontinuous and same byte data which is discontinuously increased to obtain a third logic operation value, and storing the third logic operation value as one byte data and sequentially storing each byte data of the discontinuous and same byte data which is discontinuously increased as another byte data.
4. The method of claim 1, wherein the first logical operation is an or operation using 0x80 as the number of consecutive identical bytes of data.
5. The method of claim 2, wherein the second logical operation is an or operation with 0xC0 for the successively increasing number of byte data.
6. The method of claim 3, wherein the third logical operation is an OR operation using 0x00 as the number of bytes of data that are not consecutive increments.
7. The method according to any one of claims 1 to 6, wherein after the step d, the method further comprises:
e: and adding interface information to the compressed data to generate a compressed data packet.
8. The method of claim 7, wherein the interface information includes a compression type and a size of the raw byte data.
9. A method of data decompression, comprising the steps of:
a: scanning the compressed data;
b: performing compression logic judgment operation on nth byte data of the compressed data to obtain a compression logic judgment value and compression logic, wherein n is a natural number greater than or equal to 1;
c: if the compression logic judgment value is equal to a first preset value, continuous same byte data exist in original byte data corresponding to the compression logic; performing a first logical number operation on the nth byte data to obtain a data number i, wherein i is a natural number greater than or equal to 2, and repeatedly reading the (n + 1) th byte data of the i compressed data;
d: judging whether the compressed data is scanned completely, if so, turning to step E; if not, returning to the step A;
e: and recovering the original byte data according to the read byte data.
10. The method of claim 9, wherein step C, further comprises:
if the compression logic judgment value is equal to a second preset value, the compression logic corresponds to the original byte data and continuously increased byte data exists in the original byte data; performing a second logical number operation on the nth byte data to obtain a data number j, wherein j is a natural number greater than or equal to 2; sequentially reading j bytes of data from the (n + 1) th byte of the compressed data.
11. The method of claim 10, wherein step C, further comprises:
if the compression logic judgment value is not equal to the first preset value and not equal to the second preset value, the compression logic corresponds to the original byte data, wherein the original byte data has discontinuous same byte data and discontinuous incremental byte data; performing a third logical number operation on the nth byte data to obtain a data number k, wherein k is a natural number greater than or equal to 2; sequentially reading k bytes of data from the (n + 1) th byte of the compressed data.
12. The method of any of claims 9 to 11, wherein the compression logic determines that the operation is an or operation with the nth byte data using 0xC 0.
13. The method of any one of claims 9 to 11, wherein the first preset value is 0x 80.
14. The method of claim 10 or 11, wherein the second preset value is 0xC 0.
15. The method of any one of claims 9 to 11, wherein the first logical number operation is an or operation with the nth byte data using 0x 38.
16. The method of claim 10 or 11, wherein the second logical number operation is an or operation with the nth byte data using 0x 38.
17. The method of claim 11, wherein the third logical number operation is an or operation with the nth byte data using 0x 00.
18. A system for data compression, comprising:
an original byte data scanning unit for scanning original byte data;
the compression storage unit is used for compressing and storing the original byte data;
the first judging unit is used for judging whether the original byte data is completely scanned or not;
and the compressed data generating unit is used for generating compressed data according to the stored byte data.
19. A system for data decompression, comprising:
a compressed data scanning unit for scanning the compressed data;
a compression logic judgment value and compression logic obtaining unit, configured to perform compression logic judgment operation on nth byte data of the compressed data to obtain a compression logic judgment value and a compression logic, where n is a natural number greater than or equal to 1;
the decompression reading unit is used for decompressing and reading the compressed data according to the compression logic judgment value and the compression logic;
a second judging unit, configured to judge whether scanning of the compressed data is completed;
and the original byte data recovery unit is used for recovering the original byte data according to the read byte data.
CN201510738681.6A 2015-11-04 2015-11-04 Data compression decompression method and data compression decompression system Withdrawn CN106656195A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510738681.6A CN106656195A (en) 2015-11-04 2015-11-04 Data compression decompression method and data compression decompression system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510738681.6A CN106656195A (en) 2015-11-04 2015-11-04 Data compression decompression method and data compression decompression system

Publications (1)

Publication Number Publication Date
CN106656195A true CN106656195A (en) 2017-05-10

Family

ID=58810369

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510738681.6A Withdrawn CN106656195A (en) 2015-11-04 2015-11-04 Data compression decompression method and data compression decompression system

Country Status (1)

Country Link
CN (1) CN106656195A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107835158A (en) * 2017-10-18 2018-03-23 中国银行股份有限公司 The transmission method and device of interaction data under SNA network system
CN110799959A (en) * 2017-05-26 2020-02-14 深圳配天智能技术研究院有限公司 Data compression method, decompression method and related equipment
CN111313907A (en) * 2020-02-19 2020-06-19 广西电网有限责任公司 Method and device for compressing mass power data
CN111464978A (en) * 2019-01-22 2020-07-28 岳秀兰 Vehicle remote driving system established by connection of primary wireless equipment and secondary wireless equipment through Internet of things
CN111600961A (en) * 2020-05-22 2020-08-28 山东超越数控电子股份有限公司 Method, system, equipment and medium for transmitting bitmap file through CAN port
CN114401322A (en) * 2022-01-14 2022-04-26 上海金融期货信息技术有限公司 Financial data bandwidth compression method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5592512A (en) * 1994-06-24 1997-01-07 Norand Corporation Adaptive display refresh and data compression in a radio frequency environment
CN103795421A (en) * 2014-02-26 2014-05-14 活点信息技术有限公司 Method for data compression and decompression i
CN103840835A (en) * 2012-11-26 2014-06-04 艺伦半导体技术股份有限公司 Data decompression method and device
CN104753540A (en) * 2015-03-05 2015-07-01 华为技术有限公司 Data compression method, data decompression method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5592512A (en) * 1994-06-24 1997-01-07 Norand Corporation Adaptive display refresh and data compression in a radio frequency environment
CN103840835A (en) * 2012-11-26 2014-06-04 艺伦半导体技术股份有限公司 Data decompression method and device
CN103795421A (en) * 2014-02-26 2014-05-14 活点信息技术有限公司 Method for data compression and decompression i
CN104753540A (en) * 2015-03-05 2015-07-01 华为技术有限公司 Data compression method, data decompression method and device

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110799959A (en) * 2017-05-26 2020-02-14 深圳配天智能技术研究院有限公司 Data compression method, decompression method and related equipment
CN110799959B (en) * 2017-05-26 2024-02-27 深圳配天智能技术研究院有限公司 Data compression method, decompression method and related equipment
CN107835158A (en) * 2017-10-18 2018-03-23 中国银行股份有限公司 The transmission method and device of interaction data under SNA network system
CN111464978A (en) * 2019-01-22 2020-07-28 岳秀兰 Vehicle remote driving system established by connection of primary wireless equipment and secondary wireless equipment through Internet of things
CN111313907A (en) * 2020-02-19 2020-06-19 广西电网有限责任公司 Method and device for compressing mass power data
CN111313907B (en) * 2020-02-19 2023-04-21 广西电网有限责任公司 Method and device for compressing massive power data
CN111600961A (en) * 2020-05-22 2020-08-28 山东超越数控电子股份有限公司 Method, system, equipment and medium for transmitting bitmap file through CAN port
CN114401322A (en) * 2022-01-14 2022-04-26 上海金融期货信息技术有限公司 Financial data bandwidth compression method and device

Similar Documents

Publication Publication Date Title
US9454552B2 (en) Entropy coding and decoding using polar codes
CN106656195A (en) Data compression decompression method and data compression decompression system
RU2682009C2 (en) Method and device for coding and decoding of basic data using compression of symbols
US20210152183A1 (en) Data compression method, data decompression method, and related apparatus, electronic device, and system
EP2061255A1 (en) Information processing device and method
CN102821275B (en) Data compression method and device, uncompressing data and device
US10015285B2 (en) System and method for multi-stream compression and decompression
CN102438145A (en) Image lossless compression method on basis of Huffman code
JP2012508522A (en) System and method for compressing a stream of integer data
GB2523347A (en) Encoder, decoder and method
WO2021031877A1 (en) Methods and apparatus for image coding and decoding, and chip
CN105163122B (en) A kind of compression of images and decompression method based on image block similarity
CN114222129A (en) Image compression encoding method, image compression encoding device, computer equipment and storage medium
CN111918071A (en) Data compression method, device, equipment and storage medium
CN111211787A (en) Industrial data compression method, system, storage medium and terminal
CN101980464B (en) Data coding method, decoding method, coder and decoder
KR100636370B1 (en) Apparatus and method for coding using bit-precision, and apparatus and method for decoding according to the same
CN104113394B (en) The compression of communication modulation signal and decompressing method
US10491241B1 (en) Data compression scheme utilizing a repetitive value within the data stream
US20050013438A1 (en) Method for ciphering a compressed audio or video stream preserving the coding syntax
US8938019B2 (en) Data transmitting device and data transmitting/receiving method
KR101268934B1 (en) Data compression/decompression device and method thereof
KR101670606B1 (en) Binary data compression and decompression method
CN110995274B (en) Decompression method and device
CN104702952B (en) A kind of image data compression method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20170510