CN106936441B - Data compression method and device - Google Patents

Data compression method and device Download PDF

Info

Publication number
CN106936441B
CN106936441B CN201710108980.0A CN201710108980A CN106936441B CN 106936441 B CN106936441 B CN 106936441B CN 201710108980 A CN201710108980 A CN 201710108980A CN 106936441 B CN106936441 B CN 106936441B
Authority
CN
China
Prior art keywords
data
compressed
length
compression algorithm
compression
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.)
Active
Application number
CN201710108980.0A
Other languages
Chinese (zh)
Other versions
CN106936441A (en
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 guotengan Vocational Education Technology Co.,Ltd.
Original Assignee
Shenzhen Gta Education Tech 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 Gta Education Tech Ltd filed Critical Shenzhen Gta Education Tech Ltd
Priority to CN201710108980.0A priority Critical patent/CN106936441B/en
Publication of CN106936441A publication Critical patent/CN106936441A/en
Application granted granted Critical
Publication of CN106936441B publication Critical patent/CN106936441B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M7/00Conversion of a code where information is represented by a given sequence or number of digits to a code where the same, similar or subset of information is represented by a different sequence or number of digits
    • H03M7/30Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction
    • H03M7/60General implementation details not specific to a particular type of compression
    • H03M7/6064Selection of Compressor
    • H03M7/6082Selection strategies
    • H03M7/6088Selection strategies according to the data type

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention provides a data compression method, which comprises the following steps: receiving a data compression request, acquiring data to be compressed and a compression algorithm selected by compressing the data; compressing the data to be compressed according to the selected compression algorithm to obtain compressed data; and adding the identifier corresponding to the compression algorithm to a first specified position of the packet header, and generating a compressed data packet by the compressed data and the packet header. By setting the identification of the compression algorithm, the method can adapt to the decompression and compression of the compressed files with different algorithms, and is beneficial to improving the use convenience of users.

Description

Data compression method and device
Technical Field
The invention belongs to the field of data compression, and particularly relates to a data compression method and device.
Background
Data compression is a method for reorganizing data according to a certain algorithm on the premise of not losing useful information, reducing the redundancy and storage space of the data and improving the transmission, storage and processing efficiency of the data. After the data to be stored and transmitted is compressed by the data compression algorithm, a smaller storage space can be used for storing more data, and in the data transmission process, network resources can be greatly saved and the transmission efficiency is improved.
At present, when data is compressed, existing data compression tools, such as WINRAR, WINZIP, good compression, 360 compression and the like, are generally selected. And the compression algorithms employed by different compression tools may also be different. Therefore, when a user uses the compression tool a for compression, in different use environments, such as sending compressed data to other users or copying the compressed data to other devices, the data may not be effectively decompressed due to the difference of the compression tools. The user is required to install a corresponding compression tool in the new device, and the operation is troublesome.
Disclosure of Invention
The invention aims to provide a data compression method and a data compression device, which are used for solving the problems that compressed data cannot be effectively adapted to different tools for decompression and the operation of a user is inconvenient in the prior art due to various compression tools.
In a first aspect, an embodiment of the present invention provides a data compression method, where the method includes:
receiving a data compression request, acquiring data to be compressed and a compression algorithm selected by compressing the data;
compressing the data to be compressed according to the selected compression algorithm to obtain compressed data;
and adding the identifier corresponding to the compression algorithm to a first specified position of the packet header, and generating a compressed data packet by the compressed data and the packet header.
With reference to the first aspect, in a first possible implementation manner of the first aspect, after the steps of receiving a data compression request, acquiring data to be compressed, and selecting a compression algorithm selected for compressing the data, the method further includes:
performing cyclic redundancy check on data to be compressed to generate a cyclic redundancy check result;
and adding the cyclic redundancy check result to a second appointed position of the packet header.
With reference to the first aspect, in a second possible implementation manner of the first aspect, after the steps of receiving a data compression request, acquiring data to be compressed, and selecting a compression algorithm selected for compressing the data, the method further includes:
acquiring the length of the compressed data and the original length of the data needing to be compressed;
writing the length of the compressed data into a third designated position of the packet header, and writing the original length of the data needing to be compressed into a fourth designated position of the packet header.
In a second aspect, an embodiment of the present invention provides a data decompression method, where the method includes:
receiving a data decompression request, acquiring an identifier corresponding to a compression algorithm corresponding to compressed data in a compressed data packet, and acquiring the compressed data at a specified position of the compressed data packet;
and searching a corresponding compression algorithm according to the identifier, and decompressing the compressed data according to the compression algorithm to obtain decompressed data.
With reference to the second aspect, in a first possible implementation manner of the second aspect, after the step of searching for a corresponding compression algorithm according to the identifier, and decompressing the compressed data according to the compression algorithm to obtain decompressed data, the method further includes:
checking the decompressed data by a cyclic result checking method to generate a checking result of the decompressed data;
and comparing the verification result of the decompressed data with the verification result stored at the second appointed position of the packet header, and judging the integrity of the decompressed data according to the comparison result.
With reference to the second aspect, in a second possible implementation manner of the second aspect, before the step of searching for a corresponding compression algorithm according to the identifier, and decompressing the compressed data according to the compression algorithm to obtain decompressed data, the method further includes:
acquiring the length of compressed data stored in a third appointed position of the packet header and the length of the compressed data in the compressed data packet, and judging whether the data is complete according to the comparison result of the length of the compressed data and the stored length;
after the step of searching for the corresponding compression algorithm according to the identifier and decompressing the compressed data according to the compression algorithm to obtain decompressed data, the method further comprises:
and acquiring the length of the data before compression stored in the fourth specified position of the packet header and the length of the decompressed data, and judging whether the decompressed data is complete or not according to the comparison result of the length of the decompressed data and the stored length.
In a third aspect, an embodiment of the present invention provides a data compression apparatus, where the apparatus includes:
the request unit is used for receiving a data compression request, acquiring data to be compressed and a compression algorithm selected by compressing the data;
the compression unit is used for compressing the data to be compressed according to the selected compression algorithm to obtain compressed data;
and the compressed data packet generating unit is used for adding the identifier corresponding to the compression algorithm to a first specified position of the packet header and generating a compressed data packet by the compressed data and the packet header.
With reference to the third aspect, in a first possible implementation manner of the third aspect, the apparatus further includes:
the check unit is used for performing cyclic redundancy check on the data to be compressed to generate a cyclic redundancy check result;
and the check result adding unit is used for adding the cyclic redundancy check result to a second appointed position of the packet header.
With reference to the third aspect, in a second possible implementation manner of the third aspect, the apparatus further includes:
an original length obtaining unit, configured to obtain a length of the compressed data and an original length of the data to be compressed;
and the original length writing unit is used for writing the length of the compressed data into a third specified position of the packet header and writing the original length of the data needing to be compressed into a fourth specified position of the packet header.
In a fourth aspect, an embodiment of the present invention provides a data decompression apparatus, where the apparatus includes:
the data acquisition unit is used for receiving a data decompression request, acquiring an identifier corresponding to a compression algorithm corresponding to compressed data in a compressed data packet, and acquiring the compressed data at a specified position of the compressed data packet;
and the decompression unit is used for searching a corresponding compression algorithm according to the identifier, decompressing the compressed data according to the compression algorithm and obtaining decompressed data.
In the invention, when data is compressed, the data to be compressed is compressed by a selected compression algorithm, the identifier of the selected compression algorithm is added to the first specified position of the packet header, and a compressed data packet is generated by the packet header and the compressed data. When decompression is carried out, the identification of the compression algorithm at the first designated position of the packet header is read, and the corresponding compression algorithm is called to decompress the compressed data to obtain the analyzed data. By setting the identification of the compression algorithm, the method can adapt to the decompression and compression of the compressed files with different algorithms, and is beneficial to improving the use convenience of users.
Drawings
Fig. 1 is a flowchart of an implementation of a data compression method according to a first embodiment of the present invention;
FIG. 2 is a flowchart of an implementation of a data decompression method according to a second embodiment of the present invention;
FIG. 3 is a schematic structural diagram of a data compression apparatus according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of a data decompression device according to a third embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The embodiments of the present invention provide a data compression method and apparatus, so as to solve the problem in the prior art that compressed data packets cannot be identified and decompressed between different tools because various compression tools are used and compression algorithms adopted by different compression tools are different. For example, after a file is compressed using a first compression algorithm tool X, the file may fail to be decompressed if a second compression algorithm tool Y is used to decompress the file. Therefore, the user needs to install a plurality of compression tools at the terminal, and the operation is troublesome.
The first embodiment is as follows:
fig. 1 shows an implementation flow of a data compression method provided by a first embodiment of the present invention, which is detailed as follows:
in step S101, a data compression request is received, and data to be compressed and a compression algorithm selected for compressing the data are acquired.
Specifically, the receiving of the data compression request may call a data compression program interface in the method to generate the data compression request when the user needs to compress the data.
The data needing to be compressed is the file needing to be compressed and selected by the user. The file may be an audio file, a video file, a text file, or other file, etc. The data to be compressed may be one file or a combination of multiple files.
The compression algorithm selected by the compressed data can be used for performing compression test analysis and judgment on a sample of the data to be compressed after the data to be compressed is obtained. For example, the data to be compressed is judged to be a video file, or the data to be compressed is judged to be an audio file, or the data to be compressed is judged to be a text file, and the like, and the compression result is tested according to the sample data of the file, so that the compression effect of the compression algorithm is good, and the compression algorithm is selected. Of course, the compression algorithm may also be selected by the user based on a selection request from the user.
The compression algorithm may be integrated in the compression tool corresponding to the method in advance, or the compression algorithm may be integrated in the server, and after the compression tool selects the corresponding compression algorithm, the corresponding compression algorithm is acquired locally or in the server.
In step S102, the data to be compressed is compressed according to the selected compression algorithm, so as to obtain compressed data.
After the compression algorithm is selected in step S101, the data to be compressed is compressed according to the selected compression algorithm, and compressed data is obtained. And the storage space occupied by the compressed data is smaller than that occupied by the data needing to be compressed.
In step S103, the identifier corresponding to the compression algorithm is added to the first designated position of the packet header, and a compressed data packet is generated from the compressed data and the packet header.
According to the selected compression algorithm, the identifier corresponding to the compression algorithm can be found. The corresponding relation between the compression algorithm and the identifier can be set, and the type of the compression algorithm is recorded in a first designated position of the packet header through a small number of bytes. For example, the first designated location may be a small number of bytes, and may be 4 bytes.
After the compressed data and the packet header generate a compressed data packet, the compressed data packet can be stored or transmitted, and can be used for decompression by other compression tools, or used for decompression by a tool corresponding to the method in other devices, so that decompressed data, namely data before compression, is obtained.
Of course, in a further optimized embodiment of the present invention, after the steps of receiving a data compression request, obtaining data to be compressed, and selecting a compression algorithm selected for compressing the data, the method further includes: performing cyclic redundancy check on data to be compressed to generate a cyclic redundancy check result; and adding the cyclic redundancy check result to a second appointed position of the packet header.
The header may be provided with a second designated location, and the cyclic redundancy check result may be stored in the second designated location. And the cyclic redundancy check result is generated by performing cyclic redundancy check on the data needing to be compressed. By setting the cyclic redundancy check result, when the compressed packet is decompressed, cyclic redundancy check can be performed on the decompressed data, so that whether the compressed data is complete or not can be verified. If the check is wrong, the data loss or the error exists in the compression or decompression process.
In addition, in a further optimization mode, after the steps of receiving a data compression request, acquiring data to be compressed, and selecting a compression algorithm selected for compressing the data, the method further includes:
acquiring the length of the compressed data and the original length of the data needing to be compressed; writing the length of the compressed data into a third designated position of the packet header, and writing the original length of the data needing to be compressed into a fourth designated position of the packet header.
The length of the compressed data and the original length of the data needing to be compressed are set in the packet header. When the user decompresses the compressed packet, it may be determined whether the length of the current compressed data matches the length stored at the third designated location according to the length of the compressed data stored in the packet header. And if the length of the decompressed data is not consistent with the length stored in the fourth designated position, an error-reporting prompt is sent out.
The data compression method can select the required compression algorithm to compress the data to be compressed, thereby generating the compression packets corresponding to different compression algorithms. Can meet the requirements of different decompression tools. And the decompression method corresponding to the method, such as the decompression method shown in fig. 2, can directly decompress the data packets compressed by different algorithms, thereby greatly improving the convenience of use for users.
Example two:
fig. 2 shows an implementation flow of a data decompression method provided by a second embodiment of the present invention, which is detailed as follows:
in step S201, a data decompression request is received, an identifier corresponding to a compression algorithm corresponding to compressed data in a compressed data packet is obtained, and the compressed data is obtained at a specified position of the compressed data packet.
Corresponding to the compression method in the first embodiment, the decompression method receives the data decompression request, and may initiate the decompression request by calling a data decompression program interface in the method, or trigger the decompression instruction in a tool by opening a tool corresponding to the method.
When a compressed packet is decompressed, firstly, an identifier of a compression algorithm of a packet header of the compressed data packet is obtained, and compressed data is obtained at a specified position of the compressed data packet. The compressed data may be stored behind the header of the compressed data packet.
In step S202, a corresponding compression algorithm is searched according to the identifier, and the compressed data is decompressed according to the compression algorithm to obtain decompressed data.
And according to the identifier corresponding to the compression algorithm, the corresponding compression algorithm can be found. According to the searched compression algorithm, decompression operation can be carried out on the compressed data in the compressed data packet, and the decompression requirements of the compressed data corresponding to different compression algorithms can be met.
Of course, the compression algorithm may be stored in the tool corresponding to the method, or may be stored in the server, and after the corresponding compression algorithm is found, the corresponding compression algorithm may be obtained locally, or may be obtained from the server.
In addition, as a further optimization of the present invention, after the steps of searching for a corresponding compression algorithm according to the identifier, and decompressing the compressed data according to the compression algorithm to obtain decompressed data, the method further includes:
checking the decompressed data by a cyclic result checking method to generate a checking result of the decompressed data; and comparing the verification result of the decompressed data with the verification result stored at the second appointed position of the packet header, and judging the integrity of the decompressed data according to the comparison result.
By setting a cyclic check result in the packet header, the decompressed data can be checked, and whether the decompressed data is modified or lost can be found in time.
In addition, corresponding to the optimization manner in the first embodiment, before the steps of searching for the corresponding compression algorithm according to the identifier, and decompressing the compressed data according to the compression algorithm to obtain decompressed data, the method further includes:
acquiring the length of compressed data stored in a third appointed position of the packet header and the length of the compressed data in the compressed data packet, and judging whether the data is complete according to the comparison result of the length of the compressed data and the stored length;
after the step of searching for the corresponding compression algorithm according to the identifier and decompressing the compressed data according to the compression algorithm to obtain decompressed data, the method further comprises:
and acquiring the length of the data before compression stored in the fourth specified position of the packet header and the length of the decompressed data, and judging whether the decompressed data is complete or not according to the comparison result of the length of the decompressed data and the stored length.
The identifier corresponding to the compression algorithm is searched for in the first designated position of the packet header, and the compressed data is decompressed according to the searched compression algorithm, so that the method can adapt to the decompression requirements of the data compressed by different compression tools. Is beneficial to improving the convenience of the user. And the compressed data packet is generated by the compression method corresponding to the method, so that the requirements of users on adopting different compression algorithms for data can be greatly improved.
Example three:
fig. 3 shows a schematic structural diagram of a data compression apparatus according to a third embodiment of the present invention, which is detailed as follows:
the data compression device of the embodiment of the invention comprises:
a request unit 301, configured to receive a data compression request, obtain data to be compressed, and compress a compression algorithm selected by the data;
a compressing unit 302, configured to compress data to be compressed according to the selected compression algorithm to obtain compressed data;
a compressed data packet generating unit 303, configured to add an identifier corresponding to the compression algorithm to a first specified location of the packet header, and generate a compressed data packet from the compressed data and the packet header.
Preferably, the apparatus further comprises:
the check unit is used for performing cyclic redundancy check on the data to be compressed to generate a cyclic redundancy check result;
and the check result adding unit is used for adding the cyclic redundancy check result to a second appointed position of the packet header.
Preferably, the apparatus further comprises:
an original length obtaining unit, configured to obtain a length of the compressed data and an original length of the data to be compressed;
and the original length writing unit is used for writing the length of the compressed data into a third specified position of the packet header and writing the original length of the data needing to be compressed into a fourth specified position of the packet header.
The data compression apparatus shown in fig. 3 corresponds to the data compression method shown in fig. 1, and will not be described repeatedly herein.
In addition, the present invention also provides a data decompression apparatus, as shown in fig. 4, the data decompression apparatus including:
a data obtaining unit 401, configured to receive a data decompression request, obtain an identifier corresponding to a compression algorithm corresponding to compressed data in a compressed data packet, and obtain the compressed data at a specified position of the compressed data packet;
a decompression unit 402, configured to search for a corresponding compression algorithm according to the identifier, and decompress the compressed data according to the compression algorithm to obtain decompressed data.
Preferably, the apparatus further comprises:
the verification result generating unit is used for verifying the decompressed data by a cyclic result verification method to generate a verification result of the decompressed data;
and the verification result comparison unit is used for comparing the verification result of the decompressed data with the verification result stored at the second appointed position of the packet header and judging the integrity of the decompressed data according to the comparison result.
Preferably, the apparatus further comprises:
a first length comparing unit, configured to obtain the length of the compressed data stored in the third specified location of the packet header and the length of the compressed data in the compressed data packet, and determine whether the data is complete according to a comparison result between the length of the compressed data and the stored length;
and the second length comparison unit is used for acquiring the length of the data before compression stored in the fourth specified position of the packet header and the length of the decompressed data, and judging whether the decompressed data is complete according to the comparison result of the length of the decompressed data and the stored length.
The data compression device and the data decompression device in the embodiment of the present invention correspond to the data compression method in the first embodiment and the data decompression method in the second embodiment, respectively.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents and improvements made within the spirit and principle of the present invention are intended to be included within the scope of the present invention.

Claims (7)

1. A method of data compression, the method comprising:
receiving a data compression request, acquiring data to be compressed and selecting a compression algorithm selected by compressing the data, wherein the compression algorithm is stored in a local place or a server;
compressing the data to be compressed according to the selected compression algorithm to obtain compressed data;
adding the identifier corresponding to the compression algorithm to a first designated position of a packet header, and generating a compressed data packet by the compressed data and the packet header;
wherein, after the steps of receiving a data compression request, obtaining data to be compressed, and selecting a compression algorithm selected to compress the data, the method further comprises:
acquiring the length of the compressed data and the original length of the data needing to be compressed;
writing the length of the compressed data into a third designated position of the packet header, and writing the original length of the data needing to be compressed into a fourth designated position of the packet header.
2. The method of claim 1, wherein after the steps of receiving a data compression request, obtaining data to be compressed, and selecting a compression algorithm selected to compress the data, the method further comprises:
performing cyclic redundancy check on data to be compressed to generate a cyclic redundancy check result;
and adding the cyclic redundancy check result to a second appointed position of the packet header.
3. A method for data decompression, the method comprising:
receiving a data decompression request, acquiring an identifier corresponding to a compression algorithm corresponding to compressed data in a compressed data packet, and acquiring the compressed data at a specified position of the compressed data packet, wherein the compression algorithm is stored in a local place or a server;
searching a corresponding compression algorithm according to the identification, decompressing the compressed data according to the compression algorithm to obtain decompressed data;
before the steps of searching for a corresponding compression algorithm according to the identifier and decompressing the compressed data according to the compression algorithm to obtain decompressed data, the method further includes:
acquiring the length of compressed data stored in a third appointed position of the packet header and the length of the compressed data in the compressed data packet, and judging whether the data is complete according to the comparison result of the length of the compressed data and the stored length;
after the step of searching for the corresponding compression algorithm according to the identifier and decompressing the compressed data according to the compression algorithm to obtain decompressed data, the method further comprises:
and acquiring the length of the data before compression stored in the fourth specified position of the packet header and the length of the decompressed data, and judging whether the decompressed data is complete or not according to the comparison result of the length of the decompressed data and the stored length.
4. The method according to claim 3, wherein after the steps of searching for the corresponding compression algorithm according to the identifier, and decompressing the compressed data according to the compression algorithm to obtain decompressed data, the method further comprises:
checking the decompressed data by a cyclic result checking method to generate a checking result of the decompressed data;
and comparing the verification result of the decompressed data with the verification result stored at the second appointed position of the packet header, and judging the integrity of the decompressed data according to the comparison result.
5. An apparatus for compressing data, the apparatus comprising:
the request unit is used for receiving a data compression request, acquiring data to be compressed and a compression algorithm selected by compressing the data, and the compression algorithm is stored in a local place or a server;
the compression unit is used for compressing the data to be compressed according to the selected compression algorithm to obtain compressed data;
a compressed data packet generating unit, configured to add an identifier corresponding to the compression algorithm to a first specified location of a packet header, and generate a compressed data packet from the compressed data and the packet header;
an original length obtaining unit, configured to obtain a length of the compressed data and an original length of the data to be compressed;
and the original length writing unit is used for writing the length of the compressed data into a third specified position of the packet header and writing the original length of the data needing to be compressed into a fourth specified position of the packet header.
6. The apparatus of claim 5, further comprising:
the check unit is used for performing cyclic redundancy check on the data to be compressed to generate a cyclic redundancy check result;
and the check result adding unit is used for adding the cyclic redundancy check result to a second appointed position of the packet header.
7. A data decompression apparatus, characterized in that the apparatus comprises:
the data acquisition unit is used for receiving a data decompression request, acquiring an identifier corresponding to a compression algorithm corresponding to compressed data in a compressed data packet, and acquiring the compressed data at a specified position of the compressed data packet, wherein the compression algorithm is stored locally or in a server;
the decompression unit is used for searching a corresponding compression algorithm according to the identifier and decompressing the compressed data according to the compression algorithm to obtain decompressed data;
a first length comparing unit, configured to obtain the length of the compressed data stored in the third specified location of the packet header and the length of the compressed data in the compressed data packet, and determine whether the data is complete according to a comparison result between the length of the compressed data and the stored length;
and the second length comparison unit is used for acquiring the length of the data before compression stored in the fourth specified position of the packet header and the length of the decompressed data, and judging whether the decompressed data is complete according to the comparison result of the length of the decompressed data and the stored length.
CN201710108980.0A 2017-02-27 2017-02-27 Data compression method and device Active CN106936441B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710108980.0A CN106936441B (en) 2017-02-27 2017-02-27 Data compression method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710108980.0A CN106936441B (en) 2017-02-27 2017-02-27 Data compression method and device

Publications (2)

Publication Number Publication Date
CN106936441A CN106936441A (en) 2017-07-07
CN106936441B true CN106936441B (en) 2020-08-21

Family

ID=59424163

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710108980.0A Active CN106936441B (en) 2017-02-27 2017-02-27 Data compression method and device

Country Status (1)

Country Link
CN (1) CN106936441B (en)

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107423397B (en) * 2017-07-26 2020-05-19 北京时代民芯科技有限公司 Adaptive compression storage and decompression extraction method for multitask micro-system
CN108268658B (en) * 2018-02-06 2021-02-26 政采云有限公司 MySQL database-based large text field storage method and system
CN109274377A (en) * 2018-08-22 2019-01-25 泰康保险集团股份有限公司 Data processing method, device, medium and the electronic equipment of block chain network
CN108958966A (en) * 2018-09-27 2018-12-07 合肥达博科技有限公司 A kind of data guard method and device of lossless data compression
CN109683872A (en) * 2018-11-08 2019-04-26 广州视源电子科技股份有限公司 Webpage script processing and decompressing method, device and system
CN109634529A (en) * 2018-12-12 2019-04-16 浪潮(北京)电子信息产业有限公司 A kind of data compression method and decompressing method
CN111385268B (en) * 2018-12-29 2023-02-24 大唐移动通信设备有限公司 Data packet header compression confirmation method and communication equipment
CN111835686A (en) * 2019-04-19 2020-10-27 百度在线网络技术(北京)有限公司 Data compression method, data decompression method, data compression device, data decompression device, electronic equipment and storage medium
CN110430168A (en) * 2019-07-05 2019-11-08 视联动力信息技术股份有限公司 A kind of method and apparatus of data compression
CN111337133B (en) * 2020-03-02 2021-08-03 浙江大华技术股份有限公司 Infrared data generation method and device and infrared data analysis method and device
CN111552669A (en) * 2020-04-26 2020-08-18 北京达佳互联信息技术有限公司 Data processing method and device, computing equipment and storage medium
CN112487880B (en) * 2020-11-13 2021-09-24 河北省科学院应用数学研究所 Median filter, device and system based on maximum error criterion
CN112559463B (en) * 2020-12-18 2023-08-25 杭州数梦工场科技有限公司 Compressed file processing method and device
CN115809221A (en) * 2021-09-15 2023-03-17 华为技术有限公司 Data compression method and device
CN114817160A (en) * 2022-04-08 2022-07-29 深圳Tcl新技术有限公司 File decompression method and device, electronic equipment and computer readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101478370A (en) * 2009-01-20 2009-07-08 中兴通讯股份有限公司 File compression method and apparatus based on file system
CN101841337A (en) * 2010-05-06 2010-09-22 华为终端有限公司 Data compression and decompression processing method and mobile storage device
CN104796155A (en) * 2012-05-30 2015-07-22 北京奇虎科技有限公司 Data compression method and device
US9112525B1 (en) * 2014-03-28 2015-08-18 Comtech Ef Data Corp. System and method for parallel hash-based data compression

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101478370A (en) * 2009-01-20 2009-07-08 中兴通讯股份有限公司 File compression method and apparatus based on file system
CN101841337A (en) * 2010-05-06 2010-09-22 华为终端有限公司 Data compression and decompression processing method and mobile storage device
CN104796155A (en) * 2012-05-30 2015-07-22 北京奇虎科技有限公司 Data compression method and device
US9112525B1 (en) * 2014-03-28 2015-08-18 Comtech Ef Data Corp. System and method for parallel hash-based data compression

Also Published As

Publication number Publication date
CN106936441A (en) 2017-07-07

Similar Documents

Publication Publication Date Title
CN106936441B (en) Data compression method and device
CN109034993B (en) Account checking method, account checking equipment, account checking system and computer readable storage medium
CN107273280B (en) Log processing method and device, electronic equipment and storage medium
US10210064B2 (en) Systems and methods for device compatibility testing and reporting
CN107436844B (en) Method and device for generating interface use case aggregate
CN103348334B (en) Cloud system and the compressing file in cloud system and transfer approach
US9104582B1 (en) Optimized data storage
CN104246767A (en) Telemetry system for a cloud synchronization system
CN110661829B (en) File downloading method and device, client and computer readable storage medium
CN105095367B (en) A kind of acquisition method and device of client data
CN109408507B (en) Multi-attribute data processing method, device, equipment and readable storage medium
CN109669795A (en) Crash info processing method and processing device
US8880108B2 (en) Short message processing method and apparatus
CN110618999A (en) Data query method and device, computer storage medium and electronic equipment
CN106557308A (en) A kind of software continuous integrated approach and device
CN109617708B (en) Compression method, device and system for embedded point log
CN111400117B (en) Method for automatically testing Ceph cluster
CN111427917A (en) Search data processing method and related product
CN115297104A (en) File uploading method and device, electronic equipment and storage medium
CN104637496A (en) Computer system and audio comparison method
CN109491699B (en) Resource checking method, device, equipment and storage medium of application program
CN107704557B (en) Processing method and device for operating mutually exclusive data, computer equipment and storage medium
CN105657473A (en) Data processing method and device
CN114070471B (en) Test data packet transmission method, device, system, equipment and medium
CN105786791A (en) Data topic acquisition method and apparatus

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
CB03 Change of inventor or designer information

Inventor after: Gao Ning

Inventor after: Yu Bing

Inventor before: Yu Bing

CB03 Change of inventor or designer information
CB02 Change of applicant information

Address after: 518000 12th Floor, Building A4, Nanshan Zhiyuan, 1001 Xueyuan Avenue, Nanshan District, Shenzhen City, Guangdong Province

Applicant after: Shenzhen Guotaian Educational Technology Co., Ltd.

Address before: 518000 Checkpoint, Nantou, Shenzhen, Guangdong Province, 30 Building 3, Zhiheng Industrial Park, Gate 2, Nanshan District, Shenzhen

Applicant before: GTA INFORMATION TECHNOLOGY CO., LTD. (GTA)

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20211216

Address after: 518000 Room 201, building A, No. 1, Qian Wan Road, Qianhai Shenzhen Hong Kong cooperation zone, Shenzhen, Guangdong (Shenzhen Qianhai business secretary Co., Ltd.)

Patentee after: Shenzhen guotengan Vocational Education Technology Co.,Ltd.

Address before: 518000 12th Floor, Building A4, Nanshan Zhiyuan, 1001 Xueyuan Avenue, Nanshan District, Shenzhen City, Guangdong Province

Patentee before: SHENZHEN GTA EDUCATION TECH Ltd.

TR01 Transfer of patent right