Summary of the invention
A kind of be designed to provide data compression method, device and equipment, the another object of the application of the application isA kind of data decompression method, apparatus and equipment are provided, to effectively improve applicability and compatibility, solution is led because of system upgradeThe problem of compressed data of cause can not normally be read ensures the normal use of storage system.
In order to solve the above technical problems, in a first aspect, this application discloses a kind of data compression methods, comprising:
Obtain target original data;
Using default compression algorithm, the target original data compression is generated into destination packed data;
Compress informational data is generated, the compress informational data includes the information data of the default compression algorithm;
According to default encapsulation standard, the compress informational data and destination packed data encapsulation are generated into compressed dataPacket, described in decompressing destination packed data generation according to the compress informational data when reading the compressed data packetsTarget original data.
Optionally, it is described by the target original data compression generation destination packed data include: utilize hardware-compressed card willThe target original data compression generates the destination packed data;
The compress informational data further includes the edition data of the driving of the hardware-compressed card.
Optionally, described that the compress informational data and destination packed data encapsulation are generated into compressed data packets packetIt includes:
The compressed data packets are encapsulated as using the compress informational data as header data and the destination packed data.
Second aspect, disclosed herein as well is a kind of data decompression methods, comprising:
Obtain the compressed data packets for generating compress informational data and destination packed data according to default encapsulation standard packaging;The destination packed data is generated by target original data through default compression algorithm compression, and the compress informational data includes described pre-If the information data of compression algorithm;
The compress informational data and the destination packed data are obtained according to the default encapsulation standard;
The default compression algorithm is determined according to the compress informational data;
Destination packed data decompression is generated into the target original data according to the default compression algorithm.
Optionally, the compress informational data further includes the edition data of the driving of hardware-compressed card;
It is described determine according to the compress informational data the default compression algorithm after, further includes:
Obtain the edition data of the driving of the hardware-compressed card;
The driving of the hardware-compressed card corresponding with the edition data is downloaded and installs, to utilize the hardware pressureDestination packed data decompression is generated the target original data according to the default compression algorithm by contracting card.
Optionally, described to include: according to the default encapsulation standard acquisition compress informational data
According to the default encapsulation standard, the compression information being located in the packet header section of the compressed data packets is obtainedData.
The third aspect, disclosed herein as well is a kind of data compression devices, comprising:
Former data acquisition module, for obtaining target original data;
Compression module, for using default compression algorithm, the target original data compression to be generated destination packed data;
Logging modle, for generating compress informational data, the compress informational data includes the default compression algorithmInformation data;
Package module, for according to default encapsulation standard, the compress informational data and the destination packed data to be sealedDress generates compressed data packets, to decompress the target pressure according to the compress informational data when decompressing the compressed data packetsContracting data generate the target original data.
Fourth aspect, disclosed herein as well is a kind of data decompressors, comprising:
Compressed package obtains module, seals compress informational data and destination packed data according to default encapsulation standard for obtainingFill the compressed data packets generated;The destination packed data is generated by target original data through default compression algorithm compression, the pressureContracting information data includes the information data of the default compression algorithm;
Module is unsealed, for obtaining the compress informational data and the targeted compression number according to the default encapsulation standardAccording to;
Determining module, for determining the default compression algorithm according to the compress informational data;
Decompression module, it is former for destination packed data decompression to be generated the target according to the default compression algorithmData.
5th aspect, disclosed herein as well is a kind of data compression devices, comprising:
Memory, for storing computer program;
Processor realizes the step of any data compression method as described above for executing the computer programSuddenly.
6th aspect, disclosed herein as well is a kind of data decompression equipment, comprising:
Memory, for storing computer program;
Processor realizes the step of any data decompression method as described above for executing the computer programSuddenly.
Data compression method provided herein includes: to obtain target original data;It, will be described using default compression algorithmTarget original data compression generates destination packed data;Compress informational data is generated, the compress informational data includes described defaultThe information data of compression algorithm;According to default encapsulation standard, the compress informational data and the destination packed data are encapsulatedCompressed data packets are generated, to decompress the targeted compression according to the compress informational data when reading the compressed data packetsData generate the target original data.As it can be seen that present invention take advantage of that can be used for determining that target original data are compressed to targeted compressionIt has been together constituted with compressed data packets progress with destination packed data by the compress informational data of default compression algorithm when dataStorage, so that being even if the compression algorithm of storage system default is changed in subsequent reading compressed data packetsSystem still can determine default compression algorithm corresponding with the destination packed data according to compress informational data, thus successDecompression obtains target original data, and compressed data caused by solving the problems, such as because of system upgrade etc. can not normally be read, and ensuresThe normal use of storage system effectively improves applicability and compatibility, and effectively increases user experience.The application is mentionedData compression device, equipment and the data decompression method, apparatus and equipment of confession equally have above-mentioned beneficial effect.
Specific embodiment
The core of the application is to provide a kind of data compression method, device and equipment, another core of the application and isA kind of data decompression method, apparatus and equipment are provided, to effectively improve applicability and compatibility, solution is led because of system upgradeThe problem of compressed data of cause can not normally be read ensures the normal use of storage system.
In order to which technical solutions in the embodiments of the present application is more clearly and completely described, below in conjunction with this ShenPlease attached drawing in embodiment, technical solutions in the embodiments of the present application is introduced.Obviously, described embodiment is onlySome embodiments of the present application, instead of all the embodiments.Based on the embodiment in the application, those of ordinary skill in the artEvery other embodiment obtained without making creative work, shall fall in the protection scope of this application.
The embodiment of the present application discloses a kind of data compression method, and shown referring to Fig.1, this method mainly includes following stepIt is rapid:
S11: target original data are obtained.
S12: using default compression algorithm, target original data compression is generated into destination packed data.
S13: generating compress informational data, and compress informational data includes the information data of default compression algorithm.
S14: according to default encapsulation standard, generating compressed data packets for compress informational data and destination packed data encapsulation,Target original data are generated to decompress destination packed data according to compress informational data when reading compressed data packets.
Specifically, due in the prior art carry out compression storage when, only by the target after target original data compressionCompressed data is stored, and does not record compression algorithm specifically used in compression process, therefore, once when storage systemSystem upgrading or other reasons and after having replaced compression algorithm, system, which will be unable to successfully decompress out, uses initial compression algorithm pressureContract the data generated, causes compressed data of the user before system upgrade can not be used, seriously affects storage systemService operation and user experience.
Based on this, in data compression method provided herein, using current default compression algorithm that target is formerAfter data compression generates destination packed data, the information data of compression algorithm will further can be also preset about this as pressureContracting information data equally stores.The information data of described default compression algorithm is for determining the default compression algorithm, toolBody may include identifier number (those skilled in the art can designed, designed) and related algorithm parameter of the default compression algorithm etc..TogetherWhen, for the ease of identification, compress informational data itself is not necessarily to be compressed.
In addition, destination packed data and its compress informational data can be specifically described preset according to certain encapsulation standardEncapsulation standard and form a compressed data packets to be stored.It is easily understood that default encapsulation standard is for identificationWhich partial data is destination packed data in one compressed data packets and which partial data is compress informational data.
Wherein, as a preferred embodiment, described default encapsulation standard specifically can be with are as follows: makees compress informational dataCompressed data packets are encapsulated as header data and destination packed data.
Specifically, those skilled in the art's general custom will control class or mark category information is placed in packet header, therefore preferablyGround, can be using compress informational data as header data.On this basis, the also settable verification data of packet tail, those skilled in the artMember can voluntarily select and realization is arranged, and the application is not limited thereto.
It, can be according to default encapsulation standard in compressed data packets as a result, when subsequent when reading the compressed data packetsDestination packed data and compress informational data are recognized accurately respectively, and the targeted compression number is determined according to compress informational dataAccording to corresponding default compression algorithm, and then destination packed data can be solved according to the default compression algorithm determinedPressure, to successfully obtain corresponding target original data.
Data compression method provided herein, by obtaining target original data;Using default compression algorithm, by targetFormer data compression generates destination packed data;Compress informational data is generated, compress informational data includes the letter of default compression algorithmCease data;According to default encapsulation standard, compress informational data and destination packed data encapsulation are generated into compressed data packets, so as toDestination packed data is decompressed according to compress informational data when depressurizing compression data packet and generates target original data.As it can be seen that the application is sharpIt, will with the compress informational data of default compression algorithm when can be used for determining that target original data are compressed to destination packed dataIt has together constituted with compressed data packets with destination packed data and has been stored, so that even if the compression of storage system default is calculatedMethod is changed in subsequent reading compressed data packets, and system still can be determined and is somebody's turn to do according to compress informational dataThe corresponding default compression algorithm of destination packed data solves so that successfully decompression obtains target original data because of system upgrade etc.The problem of caused compressed data can not normally be read has ensured the normal use of storage system, has effectively improved applicabilityAnd compatibility, and effectively increase user experience.
Data compression method provided herein, on the basis of the above, as a kind of preferred embodiment, by meshMarking former data compression generation destination packed data includes:
Target original data compression is generated into destination packed data using hardware-compressed card;
The compress informational data further includes the edition data of the driving of hardware-compressed card.
Specifically, when being destination packed data by target original data compression, Software Compression and hardware pressure specifically can be usedContracting two ways.Wherein, tool of compression used in hardware-compressed mode is hardware-compressed card, it needs storage system to installCorresponding driving.Driving due to hardware-compressed card there is also there is the case where upgrading, in this embodiment, it is preferred that, alsoAlso the edition data of the driving of hardware-compressed card can be regard as compress informational data, the information data one with default compression algorithmWith storing, also to determine the driving of corresponding hardware-compressed card when reading compressed data packets, to successfully complete meshThe decompression for marking former data is read.
Also need supplement is, it is preferable that improves for the ease of follow-up function or the exploitation of other function, in addition to default pressureOther than the edition data of information data and hardware-compressed the card driving of compression algorithm, those skilled in the art can also be in compression informationOne reserved field is set in data, to cope with the demand for adding other data.
Data decompression method provided herein is introduced below.Referring to shown in Fig. 2, this method mainly include withLower step:
S21: the compression number for generating compress informational data and destination packed data according to default encapsulation standard packaging is obtainedAccording to packet;Destination packed data is generated by target original data through default compression algorithm compression, and compress informational data includes default compressionThe information data of algorithm.
S22: compress informational data and destination packed data are obtained according to default encapsulation standard.
S23: default compression algorithm is determined according to compress informational data.
S24: destination packed data is decompressed according to default compression algorithm and generates target original data.
The particular content of data decompression method provided herein can be corresponded to reference to previously described data compression method,Identical content just repeats no more here.
Data decompression method provided herein, by obtaining compress informational data and destination packed data according to pre-If encapsulating the compressed data packets that standard packaging generates;Wherein, destination packed data is by target original data through default compression algorithm pressureContracting generates, and compress informational data includes the information data of default compression algorithm;Compression Information Number is obtained according to default encapsulation standardAccording to and destination packed data, and default compression algorithm is determined according to compress informational data;To according to default compression algorithm by meshIt marks compressed data decompression and generates target original data.As it can be seen that present invention take advantage of that can be used for determining that target original data are compressed to meshDefault compression algorithm when marking compressed data simultaneously together constitutes with compressed data packets with destination packed data and the compression that is storedInformation data, so that being even if the compression algorithm of storage system default is changed in subsequent reading compressed data packetsSystem still can determine default compression algorithm corresponding with the destination packed data according to compress informational data, thus successDecompression obtains target original data, and compressed data caused by solving the problems, such as because of system upgrade etc. can not normally be read, and ensuresThe normal use of storage system effectively improves applicability and compatibility, and effectively increases user experience.
A kind of data decompression method provided herein, on the basis of the above, as preferred embodiment, compressionInformation data further includes the edition data of the driving of hardware-compressed card;
After determining default compression algorithm according to compress informational data, further includes:
Obtain the edition data of the driving of hardware-compressed card;
The driving of hardware-compressed card corresponding with edition data is downloaded and installs, to utilize hardware-compressed card, according to pre-If destination packed data is decompressed and generates target original data by compression algorithm.
Data decompression method provided herein, on the basis of the above, as a kind of preferred embodiment, according toDefault encapsulation standard obtains compress informational data
According to default encapsulation standard, the compress informational data being located in the packet header section of compressed data packets is obtained.
Data compression device provided herein is introduced below.
Referring to Fig. 3, Fig. 3 is a kind of structural block diagram of data compression device provided herein, comprising:
Former data acquisition module 31, for obtaining target original data;
Compression module 32, for using default compression algorithm, target original data compression to be generated destination packed data;
Logging modle 33, for generating compress informational data, compress informational data includes the Information Number of default compression algorithmAccording to;
Package module 34, for according to default encapsulation standard, compress informational data and destination packed data encapsulation to be generatedCompressed data packets generate target original number to decompress destination packed data according to compress informational data in depressurizing compression data packetAccording to.
As it can be seen that data compression device provided herein, is utilized and can be used for determining that target original data are compressed to meshThe compress informational data of default compression algorithm when mark compressed data, has together constituted with compressed data with destination packed data for itPacket is stored, so that even if the compression algorithm of storage system default is become in subsequent reading compressed data packetsMore, system still can determine default compression algorithm corresponding with the destination packed data according to compress informational data, fromAnd successfully decompress and obtain target original data, compressed data caused by solving the problems, such as because of system upgrade etc. can not normally be read,The normal use for having ensured storage system effectively improves applicability and compatibility, and effectively increases user experience.
On the basis of above content, as a kind of preferred embodiment, in data compression device provided herein, compressionModule 32 is specifically used for: target original data compression being generated destination packed data using hardware-compressed card;Compress informational data is alsoThe edition data of driving including hardware-compressed card.
On the basis of above content, as a kind of preferred embodiment, in data compression device provided herein, encapsulationModule 34 is specifically used for: being encapsulated as compressed data packets for compress informational data as header data and destination packed data.
Data decompressor provided herein is introduced below.
Referring to Fig. 4, Fig. 4 is a kind of structural block diagram of data decompressor provided herein, comprising:
Compressed package obtains module 41, for obtaining compress informational data and destination packed data according to default encapsulation standardEncapsulate the compressed data packets generated;Destination packed data is generated by target original data through default compression algorithm compression, compresses informationData include the information data of default compression algorithm;
Module 42 is unsealed, for obtaining compress informational data and destination packed data according to default encapsulation standard;
Determining module 43, for determining default compression algorithm according to compress informational data;
Decompression module 44 generates target original data for decompressing destination packed data according to default compression algorithm.
As it can be seen that data decompressor provided herein, is utilized and can be used for determining that target original data are compressed to meshDefault compression algorithm when marking compressed data simultaneously together constitutes with compressed data packets with destination packed data and the compression that is storedInformation data, so that being even if the compression algorithm of storage system default is changed in subsequent reading compressed data packetsSystem still can determine default compression algorithm corresponding with the destination packed data according to compress informational data, thus successDecompression obtains target original data, and compressed data caused by solving the problems, such as because of system upgrade etc. can not normally be read, and ensuresThe normal use of storage system effectively improves applicability and compatibility, and effectively increases user experience.
On the basis of above content, as a kind of preferred embodiment, in data decompressor provided herein, compressionInformation data further includes the edition data of the driving of hardware-compressed card;Decompression module 44 is specifically used for: obtaining hardware-compressed cardThe edition data of driving;Download and install the driving of hardware-compressed card corresponding with edition data;Using hardware-compressed card, according toDefault compression algorithm, which decompresses destination packed data, generates target original data.
On the basis of above content, as a kind of preferred embodiment, in data decompressor provided herein, deblockingModule 42 is specifically used for: according to default encapsulation standard, obtaining the compress informational data being located in the packet header section of compressed data packets.
Further, disclosed herein as well is a kind of data compression devices, comprising:
Memory, for storing computer program;
Processor realizes the step of any data compression method as described above for executing the computer programSuddenly.
Further, disclosed herein as well is a kind of data decompression equipment, comprising:
Memory, for storing computer program;
Processor realizes the step of any data decompression method as described above for executing the computer programSuddenly.
Each embodiment is described in a progressive manner in the application, the highlights of each of the examples are with other realitiesThe difference of example is applied, the same or similar parts in each embodiment may refer to each other.For device disclosed in embodiment, setFor standby, since it is corresponded to the methods disclosed in the examples, so being described relatively simple, related place is referring to method partExplanation.
It should be noted that in present specification, the relational terms of such as " first " and " second " etc are used merely toOne entity or operation and another entity or operate is distinguished, without necessarily requiring or implying these entities orThere are any actual relationship or orders between person's operation.In addition, the terms "include", "comprise" or its any otherVariant is intended to non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not onlyIt including those elements, but also including other elements that are not explicitly listed, or further include for this process, method, objectProduct or the intrinsic element of equipment.In the absence of more restrictions, the element limited by sentence "including a ...",It is not precluded in the process, method, article or apparatus that includes the element that there is also other identical elements.
Technical solution provided herein is described in detail above.Specific case used herein is to this ShenPrinciple and embodiment please is expounded, the present processes that the above embodiments are only used to help understand and itsCore concept.It should be pointed out that for those skilled in the art, in the premise for not departing from the application principleUnder, can also to the application, some improvement and modification can also be carried out, these improvement and modification are also fallen into the protection scope of the application.