WO2022041906A1 - Data compression method and compression apparatus - Google Patents

Data compression method and compression apparatus Download PDF

Info

Publication number
WO2022041906A1
WO2022041906A1 PCT/CN2021/097764 CN2021097764W WO2022041906A1 WO 2022041906 A1 WO2022041906 A1 WO 2022041906A1 CN 2021097764 W CN2021097764 W CN 2021097764W WO 2022041906 A1 WO2022041906 A1 WO 2022041906A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
memory space
length
compressed
compression
Prior art date
Application number
PCT/CN2021/097764
Other languages
French (fr)
Chinese (zh)
Inventor
苏毅
刘中全
姚建业
周文
周保文
周慧
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2022041906A1 publication Critical patent/WO2022041906A1/en

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/3059Digital compression and data reduction techniques where the original information is represented by a subset or similar information, e.g. lossy compression
    • H03M7/3064Segmenting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • 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

Definitions

  • the embodiments of the present application relate to the field of data processing, and in particular, to a data compression method and a compression device.
  • the traditional compression method is software compression. Specifically, the central processing unit (CPU, central processing unit) of the device calls the compression program, writes the data to be compressed into the device memory, and then compresses the data to be compressed to obtain the compressed data.
  • CPU central processing unit
  • the CPU When the data to be compressed includes both the data that needs to be compressed and the associated data that does not need to be compressed, the CPU will directly compress the data to be compressed including the associated data.
  • the associated data destroys the laws and characteristics of the original data, which will lead to The compression rate of the algorithm is reduced; at the same time, the compression of the associated data will also cause the compressed data to include unneeded content, reducing the compression rate.
  • Embodiments of the present application provide a data compression method and a compression device, which can improve the compression rate.
  • division refers to logical division, that is, the compression apparatus can distinguish two parts of the data or memory space, and perform different operations on the two parts.
  • a first aspect of the embodiments of the present application provides a data compression method, which is applied to a compression device, including:
  • the compression device When a user or the outside world issues a compression task, the compression device will receive an instruction for data compression;
  • the compression device When the compression device receives an instruction for data compression, the instruction will carry an identifier of the data to be compressed, and the compression device can determine the data to be compressed according to the identifier; or when the compression device starts compression according to its own needs, the compression device will also obtain The identifier of the data to be compressed;
  • the compression device can divide the data to be compressed into a plurality of data blocks.
  • the data block includes the first part of the data and the second part of the data.
  • the data that needs to be compressed is related to the text data block, also known as the associated data block;
  • the compressing device may compress the first part of the data without compressing the second part of the data to obtain compressed data, and the compressed data only includes the data obtained after the first part of the data is compressed.
  • the second part of the data may be a DIF field.
  • the compression apparatus may divide the One part of the data and the second part of the data, specifically,
  • the compression device can obtain the first starting address, the first data length and the second data length, the first starting address represents the starting address of the data to be compressed, the first data length represents the size of the first part of the data, and the second data length represents the second data length. the size of the partial data;
  • the compression apparatus may divide the data to be compressed into a plurality of data blocks according to the first starting address, the first data length and the second data length.
  • the compression apparatus may obtain the first starting address, the first data length and the first starting address according to the first description information of the data to be compressed.
  • the first description information may indicate the size of each block in the data to be compressed.
  • the compression apparatus may divide the data to be compressed by using a counter. Specifically,
  • the compression device can determine the starting address of the data to be compressed according to the first starting address, read the data to be compressed, and the counter records the first length corresponding to the read data until the first length is the same as the first data length, and then read The data taken is the text data block;
  • the memory space of the data to be processed is skipped, and the counter records the second length corresponding to the skipped memory space until the second length is the same as the second data length. At this time, the skipped data is the associated data block.
  • the compression apparatus may further divide the data to be compressed by means of memory mapping.
  • the compression apparatus may further divide the data to be compressed by calculating the start and end addresses of the data blocks. .
  • the length of each text data block is equal to is the same fixed value, and the first data length can represent the length of each text data block.
  • a first data length may be used to represent the length of each text data segment, and there is no need to perform multiple first data lengths. processing, can save computing resources.
  • the length of the text data block may have multiple values, and the A data length can have two or more.
  • the length of each associated data block is the same and fixed. value, the second data length may represent the length of each associated data block.
  • a second data length may be used to represent the length of each associated data segment, and there is no need to perform multiple second data lengths. processing, can save computing resources.
  • the length of the associated data block may have multiple values, and the Two data lengths can be two or more.
  • the compression apparatus may divide the processed memory space , the processed memory space is used to store the processed data, specifically,
  • the compression device can divide the processed memory space into a plurality of memory space blocks, the memory space block includes a first memory space and a second memory space, the first memory space is used for storing compressed data blocks, and the second memory space is used for storing second associated data, the second associated data is associated with the compressed data block;
  • the compression device can write the compressed data into the first memory space, skip the second memory space, and obtain processed data, which not only includes the compressed data, but also reserves the second memory space for storing the second memory space.
  • Linked Data
  • the vacated first memory space can be directly obtained.
  • the processed data in the second memory space does not need the storage device to copy the compressed data to free up the second memory space, thereby reducing the time delay of the compression process and improving the compression bandwidth of the storage device.
  • the second associated data may be a DIF field.
  • the compression apparatus may be divided according to the second starting address, the first memory space length, and the second memory space length.
  • the first memory space and the second memory space specifically,
  • the compression device can obtain the second start address, the first memory space length and the second memory space length, the second start address represents the start address of the processed data, the first memory space length represents the size of the first memory space, and the first memory space length represents the size of the first memory space.
  • the length of the second memory space indicates the size of the second memory space;
  • the compression device may divide the processed memory space for storing the processed data into a plurality of memory space blocks according to the second starting address, the first memory space length and the second memory space length.
  • the compression apparatus may obtain the second starting address, the first memory address, and the first memory according to the second description information of the processed data.
  • the space length and the second memory space length, the second description information may indicate the size of each block in the processed memory space.
  • the compression apparatus may divide the processed memory space by using a counter. Specifically,
  • the compression device can determine the starting address of the processed memory space according to the second starting address, write the compressed data into the processed memory space, and record the third length corresponding to the written data until the third length is the same as the first.
  • the length of the memory space is the same, the memory space written at this time is the first memory space, and the data block written is the compressed data block;
  • the memory space after processing is skipped, and the counter records the fourth length corresponding to the skipped memory space until the fourth length is the same as the length of the second memory space. At this time, the skipped memory space is the second memory space.
  • the compression apparatus may further divide the data to be compressed by memory mapping.
  • the compression apparatus may further divide the data by calculating the start and end addresses of the data blocks. Data to be compressed.
  • the length of each first memory space is With reference to any one of the thirteenth implementation manner to the seventeenth implementation manner of the first aspect, in the eighteenth implementation manner of the first aspect of the embodiments of the present application, the length of each first memory space is With the same fixed value, the length of the first memory space may represent the length of each first memory space.
  • the length of each first memory space when the length of each first memory space is the same fixed value, the length of each first memory space may be represented by one first memory space length, and there is no need for a plurality of first memory spaces Length processing can save computing resources.
  • the length of the first memory space may be multiple value, the length of the first memory space can be two or more.
  • the length of each second memory space is The same fixed value, the length of the second memory space can represent the length of each second memory space.
  • the length of each second memory space when the length of each second memory space is the same fixed value, the length of each second memory space may be represented by one second memory space length, and there is no need to perform a calculation of multiple second memory spaces. Length processing can save computing resources.
  • the length of the second memory space may be as many as possible. There are two or more lengths of the second memory space.
  • the compression apparatus may be coupled with the storage device, and the Both the compressed data and the first description information are stored in the storage device; the compression apparatus can call the first description information from the storage device, and obtain the first starting address, the first data length and the second data according to the first description information length.
  • the compression apparatus may be coupled to the storage device, Both the processed data and the second description information are stored in the storage device; the compression device can call the second description information from the storage device, and obtain the second starting address, the first memory space length and the second description information according to the second description information. The length of the second memory space.
  • the compression apparatus is located in the storage device, and the storage The central chip of the device is coupled, and both the data to be compressed and the processed data are stored in this storage device.
  • the compression device is located in the storage device and is integrated in the storage device.
  • the central chip of the storage device, the data to be compressed and the processed data are stored in the storage device.
  • the compression device is a software program, which is stored in a storage In the device, the storage device is instructed to perform corresponding operations, and both the data to be compressed and the processed data are stored in the storage device.
  • both the data to be compressed and the processed data are stored in the compression device.
  • the second part of the data may be It is the check data of the first part of the data.
  • the second part of the data may be is the description data of the first part of the data.
  • the second associated data may be check data of compressed data blocks.
  • the second associated data may be description data of the compressed data block.
  • a second aspect of the embodiments of the present application provides a compression device, including:
  • processors one or more processors, memories, input and output devices, and buses;
  • the above-mentioned one or more processors, memories, and input-output devices are connected to the above-mentioned bus;
  • the one or more processors described above are used to perform the following steps:
  • the data block includes the first part of the data and the second part of the data.
  • the data that needs to be compressed in the first part of the data is also called the text data block, and the second part of the data does not need to be compressed.
  • the data is associated with the text data block, also known as the associated data block;
  • the compression device is adapted to perform the method of the aforementioned first aspect.
  • a third aspect of the embodiments of the present application provides a compression device, including:
  • the first division unit is used to divide the data to be compressed into at least two data blocks, the data block includes the first part of the data and the second part of the data, the data that needs to be compressed in the first part of the data is also called the text data block, and the first part of the data needs to be compressed.
  • the second part of the data is the data that does not need to be compressed, and is related to the text data block, also known as the associated data block;
  • the compression unit is used for compressing the first part of data without compressing the second part of data to obtain compressed data.
  • the compression device is adapted to perform the method of the aforementioned first aspect.
  • a fourth aspect of the embodiments of the present application provides a computer-readable storage medium, where a program is stored in the computer-readable storage medium, and when the computer executes the program, the method described in the foregoing first aspect is performed.
  • a fifth aspect of the embodiments of the present application provides a computer program product.
  • the computer program product When the computer program product is executed on a computer, the computer executes the method described in the foregoing first aspect.
  • FIG. 1 is a schematic flowchart of a data compression method in the prior art
  • FIG. 2 is a schematic structural diagram of a compression device in an embodiment of the application.
  • FIG. 3 is a schematic flowchart of a data compression method in an embodiment of the application.
  • FIG. 4 is another schematic flowchart of the data compression method in the embodiment of the present application.
  • FIG. 5 is another schematic flowchart of the data compression method in the embodiment of the present application.
  • FIG. 6 is another schematic structural diagram of the compression device in the embodiment of the present application.
  • An embodiment of the present application provides a compression device that can be used for data compression.
  • the compression device may be located inside or outside a storage device, or may exist in the form of software, and the storage device performs corresponding functions.
  • the compression device provided by the embodiment of the present application The compression ratio of the compression process can be improved, and the memory and compression bandwidth of the storage device occupied during the compression process are reduced.
  • the data that needs to be compressed may be divided into multiple blocks by the data that does not need to be compressed.
  • the block composed of the data that needs to be compressed is called a text data block.
  • the chunks composed of data to be compressed are called associated data chunks, and text data chunks and associated data chunks may appear alternately in the data to be compressed.
  • the associated data segment is the data associated with the text data segment, and the associated relationship may be an association relationship for the compression device or an association relationship for the data source; if it is an association relationship for the data source , for the compression device, the associated data block may not be associated with the text data.
  • the data source That is to say, for the sensor, A data and B data are related; but for the compression device, the compression device does not know the relationship between A data and B data, only that A data needs to be compressed, B data does not need to be compressed.
  • the B data is the related data; for example, A is the displacement of the object movement, B is the instantaneous speed, the two are collected at the same time, but in the calculation of the average Only the displacement A is needed for the speed, and the instantaneous speed B is not needed.
  • the B data is the associated data of the A data; for the compression device, the associated data may also be associated with the text data.
  • the associated data can be
  • the verification data used to verify the integrity of the text data blocks, or other data related to the text data, such as description data used to describe the text data blocks, is not specifically limited here.
  • the above examples are only examples of linked data, and do not limit the linked data. As long as it is non-text data that appears in the data to be compressed, that is, data that does not need to be compressed, it can be called linked data.
  • the associated data chunk is the data collected together with the text data chunk, and the size of the associated data may be smaller or much smaller than the text data chunk, for example, when the associated data chunk is the verification data of the text data chunk , the size of the associated data block can be a few bytes, and the size of the text data block can be hundreds of kilobytes or even larger; the size of the associated data can also be similar to or the same as the text data, or it can be larger than the text data, There is no specific limitation here.
  • the above description of the relationship between the size of the associated data and the size of the text data is only an example of the relationship between the two, and the specific numerical value and data size unit do not constitute a limitation on the two data and the size relationship between the two.
  • the compression device reads the data to be compressed, and when the data to be compressed includes associated data blocks, the associated data blocks are also read together.
  • the compression device compresses the data to be compressed, and when the data to be compressed includes associated data blocks, the associated data blocks are also compressed together to obtain compressed data including the compressed associated data.
  • the compression device copies the compressed data to the storage device.
  • the compressed data includes the compressed associated data to obtain processed data including the compressed associated data.
  • the compression device When the data to be compressed includes both the text data that needs to be compressed and the associated data that does not need to be compressed, the compression device will compress the data to be compressed including the associated data, and the associated data will destroy the rules and characteristics of the original text data , resulting in the reduction of the compression rate of the algorithm; at the same time, the compression of the associated data will also cause the compressed data to include unneeded content, reducing the compression rate.
  • the present application provides a data compression method and a compression device, which are used to improve the compression rate.
  • the data to be compressed is located in a storage device, and the storage device is also used to store processed data obtained by corresponding processing of the data to be compressed.
  • the data to be compressed includes a plurality of data blocks, including text data blocks and corresponding data blocks.
  • the text data segment is associated with a first associated data segment.
  • the text data segment is referred to as the first part of data, and the first associated data segment is referred to as the second part of data.
  • the processed data may also be divided into multiple blocks, including the compressed data block, and a memory space is reserved after each compressed data block to store the compressed data block.
  • the memory space used to store the processed data is called the processed memory space, wherein the memory space used to store the compressed data blocks is called the first memory space, and the memory space used to store the second associated data blocks is called the first memory space.
  • Second memory space If the processed data does not need to be added to the second associated data, the processed data may not include the second memory space, but instead consists of a whole segment of compressed data, which is not specifically limited here.
  • the compression device may use the first starting address indicating the storage location of the data to be compressed, the first data length indicating the size of the text data block, and the first data length indicating the A second data length of the associated data block size divides the data to be compressed into a plurality of data blocks, that is, distinguishes the text data block from the first associated data block.
  • the compression device can indicate the size of the first memory space by representing the second starting address of the storage location of the processed data.
  • the first memory space length and the second memory space length indicating the size of the second memory space the processed memory space is divided into multiple memory space blocks, that is, the first memory space and the second memory space are distinguished.
  • the division refers to the logical division, that is, the compression device can distinguish the text data and the first check data, or distinguish the first memory space and the second memory space, and the two parts can be divided into two parts. perform different actions.
  • the associated data can be a data consistency protection (DIF, data integrity field) field, which is used to verify the integrity of the data sex.
  • DIF data consistency protection
  • this embodiment of the present application may also be other fields used for checking the integrity of a block, such as a self-defined field used for checking the integrity of a block, or a field used for checking the integrity of a block in other protocols. field; the associated data in this embodiment of the present application may also be data for other purposes, such as description data used to describe text data, which is not specifically limited here.
  • the associated data block in the embodiment of the present application only takes the DIF field as an example, all DIF fields can be replaced by other associated data, and all memory spaces used for storing DIF fields can be used for storing other associated data.
  • its role also changes with the changes of linked data.
  • the DIF field is used to verify data integrity, or a custom data is used to describe data information, and the description of the role of linked data. It does not constitute a restriction on Linked Data.
  • the function of dividing the data to be compressed and the memory space after processing needs to be realized by a compression device.
  • the compression device can be a hardware device located inside or outside the storage device, or it can be a software program stored in the storage device to guide the storage device. Perform corresponding operations, or be a storage device that can implement division and compression functions.
  • the storage device 200 in this embodiment of the present application may include a processor 201, a memory 202, a processor 203, and a communication bus 204, and the processor 203 is the above-mentioned compression device.
  • Storage device 200 may include multiple processors, such as processor 201 and processor 203 shown in FIG. 2 .
  • the processor 201 is the control center of the storage device.
  • the processor 201 is a central processing unit (CPU, central processing unit), including one CPU core or multiple CPU cores, such as CPU1 and CPU2 shown in FIG. 2 .
  • the processor 201 may also be a specific integrated circuit (ASIC, application specific integrated circuit), or be configured as one or more integrated circuits, for example: one or more microprocessors (DSP, digital signal processor), or , one or more field programmable gate arrays (FPGA, field programmable gate array).
  • the processor 201 can perform various functions of the storage device 200 by running or executing software programs stored in the memory 202 and calling data stored in the memory 202 .
  • the memory 202 can be used to store the data to be compressed and the processed data, and the data to be compressed can include a text data block and a first DIF field block, and the first DIF field block is used to verify the integrity of the text data block, and the two appear alternately.
  • the processed memory space corresponding to the processed data may include a first memory space and a second memory space, and the two appear alternately.
  • the first memory space is used to store compressed data blocks
  • the second memory space is used to store second DIF field blocks
  • the second DIF field blocks are used to verify the integrity of the compressed data blocks.
  • the memory 202 may also store a software program for executing the solution of the present application, and the execution is controlled by the processor 201 or the processor 203 .
  • the memory 202 may be a static storage device that can store static information and instructions, a random access memory (RAM, random access memory) or other types of dynamic storage devices that can store information and instructions, or an electrically accessible memory device. Erasing programmable read-only memory (EEPROM, electrically erasable programmable read-only memory) or other forms of virtual memory.
  • the memory 202 may exist independently and be connected to the processor 201 through the communication bus 204, or may be integrated with the processor 201, which is not specifically limited here.
  • the memory 202 may include multiple parts, the memory 202 for storing the data to be compressed may be a read-only memory (ROM, read-only memory) or any of the above forms, and the memory 202 for storing the processed data may be any of the above forms.
  • ROM read-only memory
  • the memory 202 for storing the processed data may be any of the above forms.
  • the processor 201 may invoke the processor 203 through an interface to perform corresponding operations, and Table 1 describes an interface form:
  • the data types of the parameters appearing in the embodiments of the present application may be integer type int, character type char as shown in Table 1, and may also be other types, such as long integer type long, etc., which are not specifically limited here.
  • the parameter inBuf is also called the first starting address, and the parameter outBuf is also called the second starting address, which respectively represent the storage locations of the data to be compressed and the processed data in the memory 202 .
  • the parameter inContinuity represents the data composition of the data to be compressed in the memory 202.
  • This parameter includes two sub-parameters, one is the first data length, which represents the length of a single text data block that needs to be compressed in the data to be compressed, that is, the first part of the data.
  • the other is the second data length, which represents the length of a single first DIF field block, that is, the length of the second part of the data.
  • the parameter outContinuity represents the composition of the processed memory space in the storage 202, the processed data is stored in the processed memory space, and this parameter also reflects the data composition of the processed data.
  • This parameter includes two sub-parameters, one is the length of the first memory space, indicating the length of a single compressed data block in the processed data, that is, the length of the first memory space; the other is the length of the second memory space, indicating the length of the processed data.
  • the length of a single second DIF field block in the post data that is, the length of the second memory space, and the second DIF field block is used to verify the integrity of the compressed data block.
  • the interface can also provide other parameters, including but not limited to the parameter inLen, the parameter outBufLen, and the parameter compressParams;
  • the parameter inLen represents the length of the data to be compressed
  • the parameter outBufLen represents the size of the memory space that can be used to store the processed data
  • the parameter compressParams It is used to describe the compression parameters.
  • the parameter compressParams can include but is not limited to the compression window length.
  • the compression window length represents the length of the encoded area in the sliding window of the LZ compression algorithm; when applying other compression algorithms, the interface Other compression parameters of other algorithms may also be provided, which are not specifically limited here.
  • the parameters provided by the interface of the present application include but are not limited to the above parameters, and the interface may not provide the above parameters, which is not limited here.
  • the first data length and the second data length in the parameter inContinuity can be two fixed values, using Indicates the length of all text data blocks and the first DIF field block in the data to be compressed.
  • the first data length in the parameter inContinuity can include the length value of each first data, or include part of the first data length.
  • the length value of a data that is, the value of the first data length, may have multiple values, which are not specifically limited here.
  • the second data length is similar to the first data length, and details are not repeated here.
  • the length of the first memory space and the length of the second memory space in the parameter outContinuity can be two fixed values.
  • the value is used to indicate the length of all compressed data blocks and the second DIF field block in the processed data.
  • the length of the first memory space in the parameter outContinuity may include the length value of each first memory space, Or include part of the length value of the first memory space, that is, there may be multiple values of the length of the first memory space, which is not specifically limited here.
  • the length of the second memory space is similar to the length of the first memory space, and details are not described herein again.
  • the processor 203 may be configured to divide the text data into blocks and the first DIF field blocks, and at the same time undertakes the functions of reading the text data blocks and data compression, which can avoid the first DIF field block. compression to increase the compression ratio.
  • the processor 203 may call the parameter inBuf, that is, the first starting address, and the parameter inContinuity, that is, the first data length and the second data length, according to the above-mentioned interface.
  • the compressed data is compressed to obtain compressed data.
  • the reading process of the processor 203 may be performed by means of direct memory access (DMA, direct memory access), or may be a new reading method that will appear in the future, as long as the data can be read from the memory 202
  • DMA direct memory access
  • the method of entering the compression device is not specifically limited here.
  • the processor 203 can also be used to divide the first memory space and the second memory space, and at the same time assumes the function of writing out the compressed data, so as to realize that a space is vacated in the processed data for storing the second DIF field data.
  • the processor 203 may call the parameter outBuf, that is, the second starting address, and the parameter outContinuity, that is, the length of the first memory space and the length of the second memory space, according to the above-mentioned interface. Determine the first memory space and the second memory space in the processed data according to the parameter outBuf and the parameter outContinuity, write the compressed data into the first memory space, and empty the second memory space for storing the second DIF field Block.
  • the processor 203 may include multiple compression cores, such as compression core 1 and compression core 2 shown in FIG. 2 , each core independently processes different compression tasks, that is, each The complete set of tasks for compression and writing, different compression cores process different data to be compressed.
  • the processor 203 may have the same physical form as the processor 201 , or may have a different physical form from the processor 201 .
  • the processor 203 may be a computing unit integrated in the central chip, or may exist in other forms, such as a processing chip with computing capability coupled with the central chip, or a hardware device with computing capability connected with a storage device through a physical interface, The hardware device is located in the compression device, which is not specifically limited here.
  • the central chip may include the processor 201 .
  • the processor 203 may be an acceleration card or a co-processor, a graphics processing unit (GPU, graphics processing unit) or a neural network processor (NPU, neural-network processing unit), or the like.
  • one or more processors 201 may be configured, and one or more processors 203 may also be configured.
  • the compression device may also be a software program stored in the memory 202, and the actions performed by the processor 203 are performed by the processor 201 according to the software program; or the compression device is the above storage device, and the processor 203 is a module specially used by the storage device for compression.
  • the function of the processor 203 may be implemented by the processor 201 or a special processor 203, which is not specifically limited here.
  • Both the processor 201 and the processor 203 can access the memory 202 through the communication bus 204 , read software programs and data stored in the memory 202 , and write data into the memory 202 .
  • the processor 201 When the processor 201 receives the instruction of the compression task, it can obtain the location identifier and the block length according to the continuity information of the data to be processed in the instruction.
  • the location identifier includes the first starting address and the second starting address
  • the block length includes the first A data length, a second data length, a first memory space length, and a second memory space length
  • a compression instruction, a location identifier and a block length are sent to the processor 203 through the interface to instruct the processor 203 to perform corresponding processing on the data to be processed. deal with.
  • the location identifier and block length may be issued to the processor 203 along with the compression instruction, or may be stored in the memory 202, and the processor 203 retrieves from the memory 202 after receiving the compression instruction, which is not specifically limited here.
  • the processor 203 is specifically used in scenarios that require data transmission and storage, and may specifically be a cloud server or a cloud service storage device, or other storage devices, such as servers used in networks, big data, storage, etc. or other storage devices, which are not specifically limited here.
  • the processor 203 can be applied to data compression or communication, and can also be applied to other scenarios, such as video encoding or other data processing scenarios, which are not specifically limited here.
  • the communication bus 204 may be an industry standard architecture (ISA, industry standard architecture) bus, a peripheral component interconnect (PCI, peripheral component) bus, or an extended industry standard architecture (EISA, extended industry standard architecture) bus or the like.
  • ISA industry standard architecture
  • PCI peripheral component interconnect
  • EISA extended industry standard architecture
  • the bus can be divided into address bus, data bus, control bus and so on. For ease of presentation, only one thick line is used in FIG. 2, but it does not mean that there is only one bus or one type of bus.
  • the device structure shown in FIG. 2 does not constitute a limitation on the storage device, and may include more or less components than shown, or combine some components, or arrange different components.
  • the compression apparatus may also be located outside the storage device, and specifically may be a hardware device coupled to the storage device through a physical interface, the hardware device is located inside the compression device and includes a processor 203, and the processor 203 passes through the physical interface and the storage device.
  • the bus 204 realizes the actions of reading data and writing data, and realizes the functions that can be realized by the above-mentioned processor 203 located inside the storage device.
  • the processor 203 can read data in a remote direct data access (RDMA, remote direct memory access) manner, which is not specifically limited here.
  • RDMA remote direct data access
  • the compression device determines the text data block to be compressed according to the first data length, the second data length and the first start address, and only reads the text data block, and does not read the first associated data block.
  • block that is, the above-mentioned first DIF field block, so that the compressed data does not include the first associated data block, preventing the reduction of the algorithm compression rate caused by the first associated data block destroying the law and characteristics of the original data, Therefore, the compression rate is improved; at the same time, the input data is prevented from becoming larger because the first associated data block is prevented from participating in the compression, thereby increasing the compression rate.
  • the compression apparatus determines, by using the first memory space length, the second memory space length, and the second starting address, the first memory space for storing the compressed data and the second memory space for storing the second association.
  • the data block that is, the second memory space of the second DIF field block, the compressed data is written into the first memory space, and the second memory space is vacated for storing the second associated data block, which can be stored in the memory 202
  • the processed data that frees up the second memory space is directly obtained from the storage device, and there is no need for the storage device to copy the compressed data to free up the second memory space, thereby reducing the time delay of the compression process and improving the compression bandwidth of the storage device.
  • the compression device may be located inside the storage device, or may not be located inside the storage device, which will be described separately below:
  • the compression device is inside the storage device.
  • the data compression method provided by an embodiment of the present application will be described in detail.
  • the method is applied to the storage device 200 shown in FIG. 2 .
  • the processor 201 and the processor 203 are used as examples for description.
  • both the processor 201 and the processor 203 are located in a storage device.
  • the method may include the following steps.
  • the processor 201 receives the compression instruction:
  • the processor 201 may receive the compression instruction, and the compression instruction may also be received through other channels. For example, when another device sends a compression request to the storage device 200, the processor 201 may also receive the compression instruction. , which is not specifically limited here.
  • the processor 201 obtains the location description information and the segment length:
  • the compression instruction will include the segment length, which includes the length of the text data block in the data to be processed and the length of the first DIF field block used to verify the text data block, and the length of the compressed data in the processed data.
  • the processor 201 may determine the location description information according to the memory space of the memory 202, that is, the storage location of the data to be compressed and the storage location of the processed data.
  • step S301 When the compression device starts compression according to its own needs, the processor 201 will not receive a compression instruction, that is, step S301 does not exist, and the compression device will also obtain the location description information and the segment length at this time.
  • the processor 201 obtains the data to be processed:
  • the processor 201 copies the data to be processed from the external storage of the memory to the memory 202. Specifically, the processor can also obtain the data to be processed from other places. For example, when the compression instruction in step S301 is sent externally, and the external data to be processed, the processor 201 may save the data to be processed, which is not specifically limited here.
  • the processor 201 may call the processor 203, and send a compression instruction to the processor 203, so that the processor 203 performs corresponding processing on the data to be processed. Specifically, calling the processor 203 needs to pass through the interface, and the interface provides the parameter inBuf, the parameter outBuf, the parameter inContinuity and the parameter outContinuity.
  • the above parameters have been described in the embodiment shown in FIG. 2 and will not be repeated here.
  • the processor 203 obtains the first starting address, the first data length and the second data length:
  • the processor 203 receives the compression instruction issued by the processor 201, and the instruction may include the location description information and segment length in step S302, and the processor 203 may obtain the parameter inBuf according to the storage location of the data to be compressed in the location description information, that is, the first a starting address, obtain the first data length according to the length of the text data block in the segment length, obtain the second data length according to the length of the first DIF field block in the segment length, the above-mentioned first data length and second data length
  • the length is the parameter inContinuity.
  • the processor 203 may also obtain the above-mentioned information without compressing the instruction.
  • the processor 203 may call the location description information and segment length from the memory 202, and then The first start address, the first data length and the second data length are obtained according to the location description information and the segment length.
  • the memory 202 will store the location description information and the segment length.
  • the processor 203 may directly use the storage location of the data to be compressed as the parameter inBuf, or perform data type conversion on the storage location of the data to be compressed, which is not specifically limited here.
  • the method of obtaining the parameter inContinuity is similar to that of the parameter inBuf, which will not be repeated here.
  • the processor 203 obtains the data to be compressed:
  • the processor 203 can determine the data to be compressed according to the compression instruction issued by the processor 201, that is, the data to be processed stored in the memory 202 is regarded as the data to be compressed. The location of the data and other descriptive information.
  • the processor 203 reads the text data into blocks:
  • the processor 203 may determine the starting address of the data to be compressed in the memory 202 according to the parameter inBuf.
  • the processor 203 starts a counter and initializes the value of the counter to 0.
  • the processor 203 reads the data to be compressed in the memory 202 into the cache memory of the processor 203, and the counter synchronously records the length of the read data.
  • the value of the counter is set to 0, and the data read by the processor 203 at this time is the text data block.
  • the processor 203 skips the length of the first DIF field block in the parameter inContinuity, and the data skipped by the processor 203 at this time is the first DIF field block.
  • the processor 203 continues to read the text data block and skips the first DIF field block to obtain continuous data to be compressed that does not include the first DIF field block, and the continuous data to be compressed includes all text data. Chunked, i.e. including the complete body data.
  • the names of the parameters are only examples, and are not intended to limit the parameters. For parameters with the same meaning, they should all be the parameters referred to in the embodiments of the present application.
  • the processor 203 may also determine the text data blocks in other ways, for example, by memory mapping, or by calculating the start and end addresses of the data blocks, There is no specific limitation here.
  • the processor 203 compresses the continuous data to be compressed to obtain compressed data, and the compressed data is stored in the cache memory of the processor 203 .
  • the processor 203 obtains the second starting address, the first memory space length and the second memory space length:
  • the compressed instruction received by the processor 203 from the processor 201 may include the location description information and the segment length, and the processor 203 may obtain the parameter outBuf according to the storage location of the processed data in the location description information, that is, the second starting address.
  • the length of the compressed data block in the segment length obtains the first memory space length, and according to the length of the second data block in the segment length, the second memory space length is obtained.
  • the above-mentioned first memory space length and second memory space length are For the parameter outContinuity.
  • the processor 203 may also obtain the above-mentioned information without compressing the instruction, which is similar to the above-mentioned step S305, and details are not repeated here.
  • the processor 203 writes the compressed data into the memory 202 to obtain the processed data.
  • the processor 203 may determine the starting address of the processed data in the memory 202 according to the parameter outBuf.
  • the processor 203 writes the compressed data into the memory 202, and the counter synchronously records the length of the written data.
  • the value of the counter is set to 0, and the memory space written by the processor 203 at this time is the first memory space.
  • the processor 203 skips the memory space of the block length of the second DIF field in the parameter outContinuity, and the memory space skipped by the processor 203 at this time is the second memory space.
  • the processor 203 continues to write the compressed data in the first memory space and skips the second memory space to obtain processed data including the compressed data blocks and the second memory space.
  • the processor 203 may also determine the first memory space in other ways, for example, by memory mapping, or by calculating the start and end of memory blocks
  • the address method is not specifically limited here.
  • step S309 may be performed after any one of steps S304 to S308, or may be performed simultaneously with step S305, as long as it is performed after step S304 and before step S310, which is not specifically limited here.
  • the identifier representing the data location may also be a parameter in other forms.
  • the parameters inBuf and outBuf are used as examples, which are not specifically limited here.
  • the identifier representing the length of the data block may also be a parameter in other forms.
  • the parameters inContinuity and outContinuity are used as examples, which are not specifically limited here.
  • the process of data compression may also be performed synchronously with the process of writing the compressed data into the memory 202 (step S310 ).
  • a character obtained from the compression process is stored in the memory 202 Write a character; or, the process of reading the text data into the cache memory of the processor 203 in blocks (step S307) can also be performed synchronously with steps S308 and S310, for example, the processor 203 calculates first in order to obtain compression The data is divided into chunks, how long the text data needs to be used, the text data of the corresponding length is read, the compressed data of the entire segment is directly obtained after compression, and then the compressed data of the entire segment is written into the memory 202; the details are not limited here. .
  • the processor 203 generates a DIF field and writes it into the second memory space.
  • the processed data obtained in step S310 includes a second memory space for placing the second DIF field.
  • the processor 203 may generate a second DIF field and fill it into the second memory space.
  • the action of generating the second DIF field and filling the second memory space can be completed not only by the processor 203 but also by the processor 201, which is not specifically limited here.
  • step S310 can also be performed synchronously with step S308.
  • the processor 203 loads a second memory space
  • the processor 203/processor 201 fills in the corresponding first memory space in the second memory space.
  • Two DIF fields which are not specifically limited here.
  • the processor 203 may be a computing unit or computing module integrated in the central chip, or may exist in other forms, such as a processing chip with computing capability coupled to the central chip, which is not specifically limited here.
  • the central chip may include the processor 201 .
  • the specific form of the processor 203 is the embodiment shown in FIG. 2 , and details are not repeated here.
  • the compression device is the storage device, that is, the processor 203 . It is the processor 201, which is located inside the storage device.
  • the method may include the following steps:
  • S401-S403 Similar to steps S301-S303 in the embodiment shown in FIG. 3, except that the execution body of the action is changed to the processor 203, which is not repeated here.
  • the processor 203 obtains the first starting address, the first data length and the second data length according to the compression instruction issued by the user or the outside world, or the parameters obtained when the compression is started by itself.
  • This step is similar to step S305 in the embodiment shown in FIG. 3 , and details are not repeated here.
  • step S405-S409 Similar to steps S307-S311 in the embodiment shown in FIG. 3, all actions of the processor 201 are executed by the processor 203, wherein step S408 is obtained according to the compression instruction issued by the user or the outside world, or when the compression is started by itself parameters to obtain the second starting address, the length of the first memory space, and the length of the second memory space, which will not be repeated here.
  • the compression device is not inside the storage device.
  • FIG. 3 a data compression method provided by another embodiment of the present application will be described.
  • the method is applied to the storage device 200 shown in FIG. 2 .
  • the processor 201 is located in the storage device, and the processor 203 is located in the storage device.
  • the processor 203 is coupled to the storage device through a physical interface.
  • the specific steps are similar to the previous embodiment shown in FIG. 3 , and details are not repeated here.
  • Fig. 5 is another schematic flow chart of the method shown in Fig. 3, which clearly shows the data composition of the data to be compressed, the processed data and the continuous data to be compressed, and the processing process of the data to be compressed by the compression device is as follows:
  • This step is the same as step S305 to step S307 in the embodiment of FIG. 3 , and details are not repeated here.
  • This step is the same as step S308 in the embodiment of FIG. 3 , and details are not repeated here.
  • S503 Divide the first memory space and the second memory space, copy the compressed data to the first memory space, and reserve the second memory space for the second DIF field:
  • step S309 This step is the same as step S309 to step S310 in the embodiment of FIG. 3 , and details are not repeated here.
  • another structure of the compression device includes:
  • a first dividing unit 601 configured to divide the data to be compressed into at least two data blocks, the data blocks including a first part of data and a second part of data;
  • the compressing unit 602 is configured to compress the first part of the data, ignore the second part of the data, and obtain compressed data.
  • a second dividing unit 603, configured to divide the processed memory space into at least two memory space blocks, where the memory space blocks include a first memory space and a second memory space;
  • a writing unit 604 configured to write the compressed data into the first memory space, ignore the second memory space, and obtain processed data
  • the first storage unit 605 is configured to store the data to be compressed.
  • the first dividing unit 601 may include a first obtaining subunit 6011 and a first dividing subunit 6012 .
  • the first obtaining subunit 6011 is specifically configured to obtain a first starting address, a first data length, and a second data length, where the first starting address indicates the starting address of the data to be compressed, and the first data length indicates the the size of the first part of the data, the second data length represents the size of the second part of the data;
  • the first dividing subunit 6012 is specifically configured to divide the data to be compressed into at least two data blocks according to the first starting address, the first data length and the second data length.
  • the first obtaining subunit 6011 may include a first obtaining module 60111.
  • the first obtaining module 60111 is specifically configured to obtain the first start address, the first data length and the second data length according to the first description information of the data to be compressed.
  • the second dividing unit 603 may include a second acquiring subunit 6031 and a second dividing subunit 6032 .
  • the second obtaining subunit 6031 is specifically configured to obtain a second starting address, a first memory space length and a second memory space length, where the second starting address represents the starting address of the processed memory space, and the first A memory space length represents the size of the first memory space, and the second memory space length represents the size of the second memory space;
  • the second dividing subunit 6032 is specifically configured to divide the processed memory space into at least two memory space blocks according to the second starting address, the first memory space length and the second memory space length.
  • the second obtaining subunit 6031 may include a second obtaining module 60311 .
  • the second obtaining module 60311 is specifically configured to obtain the second starting address, the first memory space length and the second memory space length according to the second description information of the processed data.
  • the compression apparatus may perform the operations performed by the compression apparatus in the foregoing embodiments shown in FIG. 3 to FIG. 5 , and details are not described herein again.
  • the disclosed system, apparatus and method may be implemented in other manners.
  • the apparatus embodiments described above are only illustrative.
  • the division of the units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not implemented.
  • the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as an independent product, may be stored in a computer-readable storage medium.
  • the technical solutions of the present application can be embodied in the form of software products in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, and the computer software products are stored in a storage medium , including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, read-only memory), random access memory (RAM, random access memory), magnetic disk or optical disk and other media that can store program codes .

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

Disclosed by embodiments of the present application are a data compression method and compression apparatus, used for increasing the compression rate. The method of the embodiments of the present application comprises: by means of location identification and continuous description information, dividing to-be-compressed data into main-text data blocks which need to be compressed, and first associated data blocks which do not need to be compressed; compressing only the main-text data blocks and not compressing the first associated data blocks, to obtain compressed data.

Description

一种数据压缩方法以及压缩装置A data compression method and compression device 技术领域technical field
本申请实施例涉及数据处理领域,尤其涉及一种数据压缩方法以及压缩装置。The embodiments of the present application relate to the field of data processing, and in particular, to a data compression method and a compression device.
背景技术Background technique
传统的压缩方式为软件压缩,具体是,设备中央处理器(CPU,central processing unit)调用压缩程序,将待压缩数据写入设备内存,再将待压缩数据压缩得到压缩后数据。The traditional compression method is software compression. Specifically, the central processing unit (CPU, central processing unit) of the device calls the compression program, writes the data to be compressed into the device memory, and then compresses the data to be compressed to obtain the compressed data.
当待压缩数据中既包括需要压缩的数据,也包括不需要压缩的关联数据时,CPU将会把包括关联数据的待压缩数据直接压缩,关联数据破坏了原有数据的规律和特征,将导致算法的压缩率降低;同时,对关联数据的压缩也会导致压缩后数据中包括本不需要的内容,降低压缩率。When the data to be compressed includes both the data that needs to be compressed and the associated data that does not need to be compressed, the CPU will directly compress the data to be compressed including the associated data. The associated data destroys the laws and characteristics of the original data, which will lead to The compression rate of the algorithm is reduced; at the same time, the compression of the associated data will also cause the compressed data to include unneeded content, reducing the compression rate.
发明内容SUMMARY OF THE INVENTION
本申请实施例提供了一种数据压缩方法和压缩装置,能够提高压缩率。Embodiments of the present application provide a data compression method and a compression device, which can improve the compression rate.
本申请实施例中,划分是指逻辑上的划分,即压缩装置可以将数据或内存空间的两个部分区别开来,对这两个部分执行不同操作的意思。In this embodiment of the present application, division refers to logical division, that is, the compression apparatus can distinguish two parts of the data or memory space, and perform different operations on the two parts.
本申请实施例第一方面提供了一种数据压缩方法,应用于压缩装置,包括:A first aspect of the embodiments of the present application provides a data compression method, which is applied to a compression device, including:
当用户或外界下达压缩任务时,压缩装置会接收到数据压缩的指令;When a user or the outside world issues a compression task, the compression device will receive an instruction for data compression;
当压缩装置接收到数据压缩的指令时,该指令中会带有待压缩数据的标识,压缩装置可以根据该标识确定待压缩数据;或当压缩装置根据自身需求自行启动压缩时,压缩装置也会获取待压缩数据的标识;When the compression device receives an instruction for data compression, the instruction will carry an identifier of the data to be compressed, and the compression device can determine the data to be compressed according to the identifier; or when the compression device starts compression according to its own needs, the compression device will also obtain The identifier of the data to be compressed;
压缩装置可以将待压缩数据划分为多个数据块,数据块包括第一部分数据和第二部分数据,第一部分数据是需要被压缩的数据,也称为正文数据分块,第二部分数据是不需要压缩的数据,与正文数据分块有关联,也称为关联数据分块;The compression device can divide the data to be compressed into a plurality of data blocks. The data block includes the first part of the data and the second part of the data. The data that needs to be compressed is related to the text data block, also known as the associated data block;
压缩装置可以对第一部分数据进行压缩,不对第二部分数据进行压缩,得到压缩后数据,该压缩后数据中仅包括第一部分数据压缩后得到的数据。The compressing device may compress the first part of the data without compressing the second part of the data to obtain compressed data, and the compressed data only includes the data obtained after the first part of the data is compressed.
本申请实施例中,通过划分正文数据分块和关联数据分块,不对关联数据分块进行压缩,可以避免关联数据破坏需要被压缩的正文数据的规律和特征,同时由于不对关联数据进行压缩,减少了被压缩数据的量,提高了压缩率。In the embodiment of the present application, by dividing the text data into blocks and the associated data, without compressing the associated data, it is possible to prevent the associated data from destroying the rules and characteristics of the text data to be compressed. At the same time, because the associated data is not compressed, The amount of compressed data is reduced and the compression ratio is improved.
结合第一方面,本申请实施例第一方面的第一种实施方式中,第二部分数据可以是DIF字段。With reference to the first aspect, in the first implementation manner of the first aspect of the embodiments of the present application, the second part of the data may be a DIF field.
结合第一方面或第一方面的第一种实施方式,本申请实施例第一方面的第二种实施方式中,压缩装置可以根据第一起始地址、第一数据长度和第二数据长度划分第一部分数据和第二部分数据,具体的,In combination with the first aspect or the first implementation manner of the first aspect, in the second implementation manner of the first aspect of the embodiments of the present application, the compression apparatus may divide the One part of the data and the second part of the data, specifically,
压缩装置可以获取第一起始地址、第一数据长度和第二数据长度,第一起始地址表示待压缩数据的起始地址,第一数据长度表示第一部分数据的大小,第二数据长度表示第二部分数据的大小;The compression device can obtain the first starting address, the first data length and the second data length, the first starting address represents the starting address of the data to be compressed, the first data length represents the size of the first part of the data, and the second data length represents the second data length. the size of the partial data;
压缩装置可以根据第一起始地址、第一数据长度和第二数据长度,将待压缩数据划分为多个数据块。The compression apparatus may divide the data to be compressed into a plurality of data blocks according to the first starting address, the first data length and the second data length.
结合第一方面的第二种实施方式,本申请实施例第一方面的第三种实施方式中,压缩装置可以根据待压缩数据的第一描述信息得到第一起始地址、第一数据长度和第二数据长度,该第 一描述信息可以表示待压缩数据中各分块的大小。In combination with the second implementation of the first aspect, in the third implementation of the first aspect of the embodiments of the present application, the compression apparatus may obtain the first starting address, the first data length and the first starting address according to the first description information of the data to be compressed. Two data lengths, the first description information may indicate the size of each block in the data to be compressed.
结合第一方面的第二种实施方式或第三种实施方式,本申请实施例第一方面的第四种实施方式中,压缩装置可以通过计数器来划分待压缩数据,具体的,With reference to the second or third implementation manner of the first aspect, in the fourth implementation manner of the first aspect of the embodiments of the present application, the compression apparatus may divide the data to be compressed by using a counter. Specifically,
压缩装置可以根据第一起始地址,确定待压缩数据的起始地址,读取待压缩数据,计数器记录读取数据对应的第一长度,直到该第一长度与第一数据长度相同,此时读取的数据即为正文数据分块;The compression device can determine the starting address of the data to be compressed according to the first starting address, read the data to be compressed, and the counter records the first length corresponding to the read data until the first length is the same as the first data length, and then read The data taken is the text data block;
跳过待处理数据的内存空间,计数器记录跳过内存空间对应的第二长度,直到该第二长度与第二数据长度相同,此时跳过的数据即为关联数据分块。The memory space of the data to be processed is skipped, and the counter records the second length corresponding to the skipped memory space until the second length is the same as the second data length. At this time, the skipped data is the associated data block.
结合第一方面的第二种实施方式或第三种实施方式,本申请实施例第一方面的第五种实施方式中,压缩装置还可以通过内存映射的方式来划分待压缩数据。In combination with the second implementation manner or the third implementation manner of the first aspect, in the fifth implementation manner of the first aspect of the embodiments of the present application, the compression apparatus may further divide the data to be compressed by means of memory mapping.
结合第一方面的第二种实施方式或第三种实施方式,本申请实施例第一方面的第六种实施方式中,压缩装置还可以通过计算数据分块起止地址的方式来划分待压缩数据。In combination with the second or third implementation manner of the first aspect, in the sixth implementation manner of the first aspect of the embodiments of the present application, the compression apparatus may further divide the data to be compressed by calculating the start and end addresses of the data blocks. .
结合第一方面、第一方面的第一种实施方式至第六种实施方式中的任一种,本申请实施例第一方面的第七种实施方式中,每个正文数据分块的长度都是同一个固定值,第一数据长度可以表示每个正文数据分块的长度。With reference to the first aspect and any one of the first to sixth embodiments of the first aspect, in the seventh embodiment of the first aspect of the embodiments of the present application, the length of each text data block is equal to is the same fixed value, and the first data length can represent the length of each text data block.
本申请实施例中,当每个正文数据分块的长度都是同一个固定值时,可以用一个第一数据长度表示每个正文数据分块的长度,不需要对多个第一数据长度进行处理,可以节省运算资源。In this embodiment of the present application, when the length of each text data segment is the same fixed value, a first data length may be used to represent the length of each text data segment, and there is no need to perform multiple first data lengths. processing, can save computing resources.
结合第一方面的第二种实施方式至第六种实施方式中的任一种,本申请实施例第一方面的第八种实施方式中,正文数据分块的长度可以有多个值,第一数据长度可以有两个或两个以上。With reference to any one of the second implementation manner to the sixth implementation manner of the first aspect, in the eighth implementation manner of the first aspect of the embodiment of the present application, the length of the text data block may have multiple values, and the A data length can have two or more.
结合第一方面的第二种实施方式至第八种实施方式中的任一种,本申请实施例第一方面的第九种实施方式中,每个关联数据分块的长度都是同一个固定值,第二数据长度可以表示每个关联数据分块的长度。In combination with any one of the second implementation manner to the eighth implementation manner of the first aspect, in the ninth implementation manner of the first aspect of the embodiments of the present application, the length of each associated data block is the same and fixed. value, the second data length may represent the length of each associated data block.
本申请实施例中,当每个关联数据分块的长度都是同一个固定值时,可以用一个第二数据长度表示每个关联数据分块的长度,不需要对多个第二数据长度进行处理,可以节省运算资源。In the embodiment of the present application, when the length of each associated data segment is the same fixed value, a second data length may be used to represent the length of each associated data segment, and there is no need to perform multiple second data lengths. processing, can save computing resources.
结合第一方面的第二种实施方式至第八种实施方式中的任一种,本申请实施例第一方面的第十种实施方式中,关联数据分块的长度可以有多个值,第二数据长度可以有两个或两个以上。With reference to any one of the second implementation manner to the eighth implementation manner of the first aspect, in the tenth implementation manner of the first aspect of the embodiments of the present application, the length of the associated data block may have multiple values, and the Two data lengths can be two or more.
结合第一方面、第一方面的第一种实施方式至第十种实施方式中的任一种,本申请实施例第一方面的第十一种实施方式中,压缩装置可以划分处理后内存空间,处理后内存空间用于存储处理后数据,具体的,With reference to the first aspect and any one of the first to tenth implementation manners of the first aspect, in the eleventh implementation manner of the first aspect of the embodiments of the present application, the compression apparatus may divide the processed memory space , the processed memory space is used to store the processed data, specifically,
压缩装置可以将处理后内存空间划分为多个内存空间块,内存空间块包括第一内存空间和第二内存空间,第一内存空间用于存储压缩后数据分块,第二内存空间用于存储第二关联数据,第二关联数据与压缩后数据分块有关联;The compression device can divide the processed memory space into a plurality of memory space blocks, the memory space block includes a first memory space and a second memory space, the first memory space is used for storing compressed data blocks, and the second memory space is used for storing second associated data, the second associated data is associated with the compressed data block;
压缩装置可以将压缩后数据写入第一内存空间,跳过第二内存空间,得到处理后数据,该处理后数据中既包括压缩后数据,又预留了第二内存空间用于存储第二关联数据。The compression device can write the compressed data into the first memory space, skip the second memory space, and obtain processed data, which not only includes the compressed data, but also reserves the second memory space for storing the second memory space. Linked Data.
本申请实施例中,通过划分第一内存空间和第二内存空间,将压缩后数据写入第一内存空间中,第二内存空间空出来用于存储第二关联数据,可以直接得到空出第二内存空间的处理后数据,不需要存储设备再拷贝压缩后数据以空出第二内存空间,减少压缩过程的时延,同时提高了存储设备的压缩带宽。In the embodiment of the present application, by dividing the first memory space and the second memory space, writing the compressed data into the first memory space, and vacating the second memory space for storing the second associated data, the vacated first memory space can be directly obtained. The processed data in the second memory space does not need the storage device to copy the compressed data to free up the second memory space, thereby reducing the time delay of the compression process and improving the compression bandwidth of the storage device.
结合第一方面的第十一种实施方式,本申请实施例第一方面的第十二种实施方式中,第二关联数据可以是DIF字段。With reference to the eleventh implementation manner of the first aspect, in the twelfth implementation manner of the first aspect of the embodiments of the present application, the second associated data may be a DIF field.
结合第一方面的第十二种实施方式,本申请实施例第一方面的第十三种实施方式中,压缩装置可以根据第二起始地址、第一内存空间长度和第二内存空间长度划分第一内存空间和第二内存空间,具体的,With reference to the twelfth implementation manner of the first aspect, in the thirteenth implementation manner of the first aspect of the embodiments of the present application, the compression apparatus may be divided according to the second starting address, the first memory space length, and the second memory space length. The first memory space and the second memory space, specifically,
压缩装置可以获取第二起始地址、第一内存空间长度和第二内存空间长度,第二起始地址表示处理后数据的起始地址,第一内存空间长度表示第一内存空间的大小,第二内存空间长度表示第二内存空间的大小;The compression device can obtain the second start address, the first memory space length and the second memory space length, the second start address represents the start address of the processed data, the first memory space length represents the size of the first memory space, and the first memory space length represents the size of the first memory space. The length of the second memory space indicates the size of the second memory space;
压缩装置可以根据第二起始地址、第一内存空间长度和第二内存空间长度,将用于存储处理后数据的处理后内存空间划分为多个内存空间块。The compression device may divide the processed memory space for storing the processed data into a plurality of memory space blocks according to the second starting address, the first memory space length and the second memory space length.
结合第一方面的第十三种实施方式,本申请实施例第一方面的第十四种实施方式中,压缩装置可以根据处理后数据的第二描述信息得到第二起始地址、第一内存空间长度和第二内存空间长度,该第二描述信息可以表示处理后内存空间中各分块的大小。With reference to the thirteenth implementation manner of the first aspect, in the fourteenth implementation manner of the first aspect of the embodiments of the present application, the compression apparatus may obtain the second starting address, the first memory address, and the first memory according to the second description information of the processed data. The space length and the second memory space length, the second description information may indicate the size of each block in the processed memory space.
结合第一方面的第十三种实施方式或第十四种实施方式,本申请实施例第一方面的第十五种实施方式中,压缩装置可以通过计数器来划分处理后内存空间,具体的,With reference to the thirteenth implementation manner or the fourteenth implementation manner of the first aspect, in the fifteenth implementation manner of the first aspect of the embodiments of the present application, the compression apparatus may divide the processed memory space by using a counter. Specifically,
压缩装置可以根据第二起始地址,确定处理后内存空间的起始地址,将压缩后数据写入处理后内存空间,计数器记录写入数据对应的第三长度,直到该第三长度与第一内存空间长度相同,此时写入的内存空间即为第一内存空间,写入的数据分块即为压缩后数据分块;The compression device can determine the starting address of the processed memory space according to the second starting address, write the compressed data into the processed memory space, and record the third length corresponding to the written data until the third length is the same as the first. The length of the memory space is the same, the memory space written at this time is the first memory space, and the data block written is the compressed data block;
跳过处理后内存空间,计数器记录跳过内存空间对应的第四长度,直到该第四长度与第二内存空间长度相同,此时跳过的内存空间即为第二内存空间。The memory space after processing is skipped, and the counter records the fourth length corresponding to the skipped memory space until the fourth length is the same as the length of the second memory space. At this time, the skipped memory space is the second memory space.
结合第一方面的第十三种实施方式或第十四种实施方式,本申请实施例第一方面的第十六种实施方式中,压缩装置还可以通过内存映射的方式来划分待压缩数据。With reference to the thirteenth implementation manner or the fourteenth implementation manner of the first aspect, in the sixteenth implementation manner of the first aspect of the embodiments of the present application, the compression apparatus may further divide the data to be compressed by memory mapping.
结合第一方面的第十三种实施方式或第十四种实施方式,本申请实施例第一方面的第十七种实施方式中,压缩装置还可以通过计算数据分块起止地址的方式来划分待压缩数据。With reference to the thirteenth implementation manner or the fourteenth implementation manner of the first aspect, in the seventeenth implementation manner of the first aspect of the embodiments of the present application, the compression apparatus may further divide the data by calculating the start and end addresses of the data blocks. Data to be compressed.
结合第一方面的第十三种实施方式至第十七种实施方式中的任一种,本申请实施例第一方面的第十八种实施方式中,每个第一内存空间的长度都是同一个固定值,第一内存空间长度可以表示每个第一内存空间的长度。With reference to any one of the thirteenth implementation manner to the seventeenth implementation manner of the first aspect, in the eighteenth implementation manner of the first aspect of the embodiments of the present application, the length of each first memory space is With the same fixed value, the length of the first memory space may represent the length of each first memory space.
本申请实施例中,当每个第一内存空间的长度都是同一个固定值时,可以用一个第一内存空间长度表示每个第一内存空间的长度,不需要对多个第一内存空间长度进行处理,可以节省运算资源。In this embodiment of the present application, when the length of each first memory space is the same fixed value, the length of each first memory space may be represented by one first memory space length, and there is no need for a plurality of first memory spaces Length processing can save computing resources.
结合第一方面的第十三种实施方式至第十七种实施方式中的任一种,本申请实施例第一方面的第十九种实施方式中,第一内存空间的长度可以有多个值,第一内存空间长度可以有两个或两个以上。With reference to any of the thirteenth implementation manner to the seventeenth implementation manner of the first aspect, in the nineteenth implementation manner of the first aspect of the embodiments of the present application, the length of the first memory space may be multiple value, the length of the first memory space can be two or more.
结合第一方面的第十三种实施方式至第十九种实施方式中的任一种,本申请实施例第一方面的第二十种实施方式中,每个第二内存空间的长度都是同一个固定值,第二内存空间长度可以表示每个第二内存空间的长度。With reference to any one of the thirteenth implementation manner to the nineteenth implementation manner of the first aspect, in the twentieth implementation manner of the first aspect of the embodiments of the present application, the length of each second memory space is The same fixed value, the length of the second memory space can represent the length of each second memory space.
本申请实施例中,当每个第二内存空间的长度都是同一个固定值时,可以用一个第二内存空间长度表示每个第二内存空间的长度,不需要对多个第二内存空间长度进行处理,可以节省运算资源。In this embodiment of the present application, when the length of each second memory space is the same fixed value, the length of each second memory space may be represented by one second memory space length, and there is no need to perform a calculation of multiple second memory spaces. Length processing can save computing resources.
结合第一方面的第十三种实施方式至第十九种实施方式中的任一种,本申请实施例第一方面的第二十一种实施方式中,第二内存空间的长度可以有多个值,第二内存空间长度可以有两个或两个以上。With reference to any one of the thirteenth implementation manner to the nineteenth implementation manner of the first aspect, in the twenty-first implementation manner of the first aspect of the embodiments of the present application, the length of the second memory space may be as many as possible. There are two or more lengths of the second memory space.
结合第一方面的第二种实施方式至第二十一种实施方式中的任一种,本申请实施例第一方面的第二十二种实施方式中,压缩装置可以与存储设备耦合,待压缩数据和第一描述信息都存储在该存储设备中;压缩装置可以从该存储设备中调用第一描述信息,并根据该第一描述信息得到第一起始地址、第一数据长度和第二数据长度。With reference to any one of the second implementation manner to the twenty-first implementation manner of the first aspect, in the twenty-second implementation manner of the first aspect of the embodiments of the present application, the compression apparatus may be coupled with the storage device, and the Both the compressed data and the first description information are stored in the storage device; the compression apparatus can call the first description information from the storage device, and obtain the first starting address, the first data length and the second data according to the first description information length.
结合第一方面的第十三种实施方式至第二十一种实施方式中的任一种,本申请实施例第一方面的第二十三种实施方式中,压缩装置可以与存储设备耦合,处理后数据和第二描述信息都存储在该存储设备中;压缩装置可以从该存储设备中调用第二描述信息,并根据该第二描述信息得到第二起始地址、第一内存空间长度和第二内存空间长度。With reference to any one of the thirteenth implementation manner to the twenty-first implementation manner of the first aspect, in the twenty-third implementation manner of the first aspect of the embodiments of the present application, the compression apparatus may be coupled to the storage device, Both the processed data and the second description information are stored in the storage device; the compression device can call the second description information from the storage device, and obtain the second starting address, the first memory space length and the second description information according to the second description information. The length of the second memory space.
结合第一方面的第二种实施方式至第二十一种实施方式中的任一种,本申请实施例第一方面的第二十四种实施方式中,压缩装置位于存储设备中,与存储设备的中央芯片耦合,待压缩数据和处理后数据都存储在该存储设备中。With reference to any one of the second implementation manner to the twenty-first implementation manner of the first aspect, in the twenty-fourth implementation manner of the first aspect of the embodiments of the present application, the compression apparatus is located in the storage device, and the storage The central chip of the device is coupled, and both the data to be compressed and the processed data are stored in this storage device.
结合第一方面的第二种实施方式至第二十一种实施方式中的任一种,本申请实施例第一方面的第二十五种实施方式中,压缩装置位于存储设备中,集成于该存储设备的中央芯片,待压缩数据和处理后数据都存储在该存储设备中。With reference to any one of the second implementation manner to the twenty-first implementation manner of the first aspect, in the twenty-fifth implementation manner of the first aspect of the embodiments of the present application, the compression device is located in the storage device and is integrated in the storage device. The central chip of the storage device, the data to be compressed and the processed data are stored in the storage device.
结合第一方面的第二种实施方式至第二十一种实施方式中的任一种,本申请实施例第一方面的第二十六种实施方式中,压缩装置是软件程序,保存在存储设备中,指导存储设备执行相应的操作,待压缩数据和处理后数据都存储在该存储设备中。With reference to any one of the second embodiment to the twenty-first embodiment of the first aspect, in the twenty-sixth embodiment of the first aspect of the embodiments of the present application, the compression device is a software program, which is stored in a storage In the device, the storage device is instructed to perform corresponding operations, and both the data to be compressed and the processed data are stored in the storage device.
结合第一方面的第二种实施方式至第二十一种实施方式中的任一种,本申请实施例第一方面的第二十七种实施方式中,待压缩数据和处理后数据都存储在压缩装置中。With reference to any one of the second implementation manner to the twenty-first implementation manner of the first aspect, in the twenty-seventh implementation manner of the first aspect of the embodiments of the present application, both the data to be compressed and the processed data are stored in the compression device.
结合第一方面或第一方面的第二种实施方式至第二十七种实施方式中的任一种,本申请实施例第一方面的第二十八种实施方式中,第二部分数据可以是第一部分数据的校验数据。With reference to the first aspect or any of the second to twenty-seventh implementation manners of the first aspect, in the twenty-eighth implementation manner of the first aspect of the embodiments of the present application, the second part of the data may be It is the check data of the first part of the data.
结合第一方面或第一方面的第二种实施方式至第二十七种实施方式中的任一种,本申请实施例第一方面的第二十九种实施方式中,第二部分数据可以是第一部分数据的描述数据。In combination with the first aspect or any one of the second to twenty-seventh implementation manners of the first aspect, in the twenty-ninth implementation manner of the first aspect of the embodiments of the present application, the second part of the data may be is the description data of the first part of the data.
结合第一方面、第一方面的第一种实施方式至第十一种实施方式或第一方面的第十二种实施方式至第二十九种实施方式中的任一种,本申请实施例第一方面的第三十种实施方式中,第二关联数据可以是压缩后数据分块的校验数据。In combination with any one of the first aspect, the first embodiment to the eleventh embodiment of the first aspect, or the twelfth embodiment to the twenty-ninth embodiment of the first aspect, the examples of the present application In a thirtieth implementation manner of the first aspect, the second associated data may be check data of compressed data blocks.
结合第一方面、第一方面的第一种实施方式至第十一种实施方式或第一方面的第十二种实施方式至第二十九种实施方式中的任一种,本申请实施例第一方面的第三十一种实施方式中,第二关联数据可以是压缩后数据分块的描述数据。In combination with any one of the first aspect, the first embodiment to the eleventh embodiment of the first aspect, or the twelfth embodiment to the twenty-ninth embodiment of the first aspect, the examples of the present application In a thirty-first implementation manner of the first aspect, the second associated data may be description data of the compressed data block.
本申请实施例第二方面提供了一种压缩装置,包括:A second aspect of the embodiments of the present application provides a compression device, including:
一个或多个处理器、存储器、输入输出设备以及总线;one or more processors, memories, input and output devices, and buses;
上述一个或多个处理器、存储器、输入输出设备与上述总线相连;The above-mentioned one or more processors, memories, and input-output devices are connected to the above-mentioned bus;
上述一个或多个处理器用于执行如下步骤:The one or more processors described above are used to perform the following steps:
将待压缩数据划分为至少两个数据块,数据块包括第一部分数据和第二部分数据,第一部分数据时需要被压缩的数据,也称为正文数据分块,第二部分数据是不需要压缩的数据,与正文数据分块有关联,也称为关联数据分块;Divide the data to be compressed into at least two data blocks. The data block includes the first part of the data and the second part of the data. The data that needs to be compressed in the first part of the data is also called the text data block, and the second part of the data does not need to be compressed. The data is associated with the text data block, also known as the associated data block;
对第一部分数据进行压缩,不对第二部分数据进行压缩,得到压缩后数据;Compressing the first part of the data, but not compressing the second part of the data, to obtain compressed data;
该压缩装置用于执行前述第一方面的方法。The compression device is adapted to perform the method of the aforementioned first aspect.
本申请实施例第三方面提供了一种压缩装置,包括:A third aspect of the embodiments of the present application provides a compression device, including:
第一划分单元,用于将待压缩数据划分为至少两个数据块,数据块包括第一部分数据和第 二部分数据,第一部分数据时需要被压缩的数据,也称为正文数据分块,第二部分数据是不需要压缩的数据,与正文数据分块有关联,也称为关联数据分块;The first division unit is used to divide the data to be compressed into at least two data blocks, the data block includes the first part of the data and the second part of the data, the data that needs to be compressed in the first part of the data is also called the text data block, and the first part of the data needs to be compressed. The second part of the data is the data that does not need to be compressed, and is related to the text data block, also known as the associated data block;
压缩单元,用于对第一部分数据进行压缩,不对第二部分数据进行压缩,得到压缩后数据。The compression unit is used for compressing the first part of data without compressing the second part of data to obtain compressed data.
该压缩装置用于执行前述第一方面的方法。The compression device is adapted to perform the method of the aforementioned first aspect.
本申请实施例第四方面提供了一种计算机可读存储介质,该计算机可读存储介质中保存有程序,当所述计算机执行所述程序时,执行前述第一方面所述的方法。A fourth aspect of the embodiments of the present application provides a computer-readable storage medium, where a program is stored in the computer-readable storage medium, and when the computer executes the program, the method described in the foregoing first aspect is performed.
本申请实施例第五方面提供了一种计算机程序产品,当该计算机程序产品在计算机上执行时,所述计算机执行前述第一方面所述的方法。A fifth aspect of the embodiments of the present application provides a computer program product. When the computer program product is executed on a computer, the computer executes the method described in the foregoing first aspect.
附图说明Description of drawings
图1为现有技术中数据压缩方法的流程示意图;1 is a schematic flowchart of a data compression method in the prior art;
图2为本申请实施例中压缩装置一个结构示意图;2 is a schematic structural diagram of a compression device in an embodiment of the application;
图3为本申请实施例中数据压缩方法一个流程示意图;3 is a schematic flowchart of a data compression method in an embodiment of the application;
图4为本申请实施例中数据压缩方法另一流程示意图;FIG. 4 is another schematic flowchart of the data compression method in the embodiment of the present application;
图5为本申请实施例中数据压缩方法另一流程示意图;FIG. 5 is another schematic flowchart of the data compression method in the embodiment of the present application;
图6为本申请实施例中压缩装置另一结构示意图。FIG. 6 is another schematic structural diagram of the compression device in the embodiment of the present application.
具体实施方式detailed description
本申请实施例提供了一种可用于数据压缩的压缩装置,该压缩装置可以位于存储设备内部或外部,也可以以软件形式存在,由存储设备完成相应的功能,本申请实施例提供的压缩装置可提高压缩过程的压缩率,减少压缩过程中占用存储设备的内存和压缩带宽。An embodiment of the present application provides a compression device that can be used for data compression. The compression device may be located inside or outside a storage device, or may exist in the form of software, and the storage device performs corresponding functions. The compression device provided by the embodiment of the present application The compression ratio of the compression process can be improved, and the memory and compression bandwidth of the storage device occupied during the compression process are reduced.
对于压缩装置所要处理的待压缩数据,对于其中需要被压缩的数据,可能被不需要压缩的数据分成多个分块,由需要被压缩的数据组成的分块称为正文数据分块,由不需要被压缩的数据组成的分块称为关联数据分块,正文数据分块和关联数据分块可能会在待压缩数据中交替出现。For the data to be compressed to be processed by the compression device, the data that needs to be compressed may be divided into multiple blocks by the data that does not need to be compressed. The block composed of the data that needs to be compressed is called a text data block. The chunks composed of data to be compressed are called associated data chunks, and text data chunks and associated data chunks may appear alternately in the data to be compressed.
关联数据分块是与正文数据分块有关联的数据,该关联关系可以是对于压缩装置来说的关联关系,也可以是对于数据源来说的关联关系;若是对于数据源来说的关联关系,对于压缩装置来说关联数据分块与正文数据可能是没有关联的,例如当一个传感器同时采集两种数据A和B,但在具体应用中只需用到A数据时,此时对于数据源即传感器来说,A数据与B数据是有关联的;但对于压缩装置来说,压缩装置并不知道A数据与B数据的关联关系,只知道A数据需要压缩,B数据不需要压缩,压缩装置会认为两者没有关联,但客观上两者是有关联的,因此B数据就是关联数据;举个例子,A是物体运动的位移,B是瞬时速度,两者同时采集,但在计算平均速度时只需要位移A,并不需要用到瞬时速度B,此时B数据就是A数据的关联数据;对于压缩装置来说,关联数据也可能与正文数据有关联关系,例如,关联数据可以是用于校验正文数据分块完整性的校验数据,或者是其他与正文数据有关联的数据,例如用于描述正文数据分块的描述数据,具体此处不作限定。上述例子只是对关联数据的举例,并不造成对关联数据的限定,只要是待压缩数据中出现的非正文数据,即不需要被压缩的数据,都可以称为关联数据。The associated data segment is the data associated with the text data segment, and the associated relationship may be an association relationship for the compression device or an association relationship for the data source; if it is an association relationship for the data source , for the compression device, the associated data block may not be associated with the text data. For example, when a sensor collects two kinds of data A and B at the same time, but only the A data is needed in a specific application, at this time, the data source That is to say, for the sensor, A data and B data are related; but for the compression device, the compression device does not know the relationship between A data and B data, only that A data needs to be compressed, B data does not need to be compressed. The device will think that the two are not related, but the two are objectively related, so the B data is the related data; for example, A is the displacement of the object movement, B is the instantaneous speed, the two are collected at the same time, but in the calculation of the average Only the displacement A is needed for the speed, and the instantaneous speed B is not needed. At this time, the B data is the associated data of the A data; for the compression device, the associated data may also be associated with the text data. For example, the associated data can be The verification data used to verify the integrity of the text data blocks, or other data related to the text data, such as description data used to describe the text data blocks, is not specifically limited here. The above examples are only examples of linked data, and do not limit the linked data. As long as it is non-text data that appears in the data to be compressed, that is, data that does not need to be compressed, it can be called linked data.
对于压缩装置来说,关联数据分块是与正文数据分块一同采集的数据,关联数据的大小可以比正文数据小或者小很多,例如当关联数据分块是正文数据分块的校验数据时,关联数据分块的大小可以是几个字节,而正文数据分块的大小可以是几百kb甚至更大;关联数据的大小也可以与正文数据差不多或者相同,也可以比正文数据大,具体此处不作限定。上述对关联数 据大小和正文数据大小关系的说明,只是对两者关系的举例,其中的具体数值和数据大小单位并不构成对该两数据及两者之间大小关系的限定。For the compression device, the associated data chunk is the data collected together with the text data chunk, and the size of the associated data may be smaller or much smaller than the text data chunk, for example, when the associated data chunk is the verification data of the text data chunk , the size of the associated data block can be a few bytes, and the size of the text data block can be hundreds of kilobytes or even larger; the size of the associated data can also be similar to or the same as the text data, or it can be larger than the text data, There is no specific limitation here. The above description of the relationship between the size of the associated data and the size of the text data is only an example of the relationship between the two, and the specific numerical value and data size unit do not constitute a limitation on the two data and the size relationship between the two.
一、现有技术的数据压缩流程。1. The data compression process of the prior art.
在现有技术中,数据压缩的流程如图1所示:In the prior art, the process of data compression is shown in Figure 1:
S101、读取待压缩数据。S101. Read the data to be compressed.
压缩设备读取待压缩数据,当待压缩数据中包括关联数据分块时,关联数据分块也被一并读取。The compression device reads the data to be compressed, and when the data to be compressed includes associated data blocks, the associated data blocks are also read together.
S102、压缩待压缩数据。S102. Compress the data to be compressed.
压缩设备对待压缩数据进行压缩,当待压缩数据中包括关联数据分块时,关联数据分块也被一并压缩,得到包括压缩后关联数据的压缩后数据。The compression device compresses the data to be compressed, and when the data to be compressed includes associated data blocks, the associated data blocks are also compressed together to obtain compressed data including the compressed associated data.
S103、拷贝压缩后数据。S103. Copy the compressed data.
压缩设备将压缩后数据拷贝至存储设备中,当待压缩数据中包括关联数据分块时,压缩后数据中包括压缩后的关联数据,得到包括压缩后关联数据的处理后数据。The compression device copies the compressed data to the storage device. When the data to be compressed includes associated data blocks, the compressed data includes the compressed associated data to obtain processed data including the compressed associated data.
当待压缩数据中既包括需要压缩的正文数据,也包括不需要压缩的关联数据时,压缩设备将会对包括关联数据的待压缩数据进行压缩,关联数据会破坏原有正文数据的规律和特征,导致算法的压缩率降低;同时,对关联数据的压缩也会导致压缩后数据中包括本不需要的内容,降低压缩率。When the data to be compressed includes both the text data that needs to be compressed and the associated data that does not need to be compressed, the compression device will compress the data to be compressed including the associated data, and the associated data will destroy the rules and characteristics of the original text data , resulting in the reduction of the compression rate of the algorithm; at the same time, the compression of the associated data will also cause the compressed data to include unneeded content, reducing the compression rate.
针对上述缺点,本申请提供了一种数据压缩方法和压缩装置,用于提高压缩率。In view of the above shortcomings, the present application provides a data compression method and a compression device, which are used to improve the compression rate.
在本申请实施例中,待压缩数据位于存储设备中,存储设备也用于存储待压缩数据经过相应处理得到的处理后数据,待压缩数据包括多个数据块,其中包括正文数据分块和与该正文数据分块有关联的第一关联数据分块,在本申请实施例中,正文数据分块称为第一部分数据,第一关联数据分块称为第二部分数据。In the embodiment of the present application, the data to be compressed is located in a storage device, and the storage device is also used to store processed data obtained by corresponding processing of the data to be compressed. The data to be compressed includes a plurality of data blocks, including text data blocks and corresponding data blocks. The text data segment is associated with a first associated data segment. In this embodiment of the present application, the text data segment is referred to as the first part of data, and the first associated data segment is referred to as the second part of data.
可选的,处理后数据也可能会被分为多个分块,其中包括压缩后数据分块,在每个压缩后数据分块后预留内存空间,用于存储与该压缩后数据分块有关联的第二关联数据分块。用于存储处理后数据的内存空间称为处理后内存空间,其中,用于存储压缩后数据分块的内存空间称为第一内存空间,用于存储第二关联数据分块的内存空间称为第二内存空间。若处理后数据不需要加入第二关联数据,处理后数据中也可以不包括第二内存空间,而是由整段的压缩后数据组成,具体此处不作限定。Optionally, the processed data may also be divided into multiple blocks, including the compressed data block, and a memory space is reserved after each compressed data block to store the compressed data block. There is an associated second associated data chunk. The memory space used to store the processed data is called the processed memory space, wherein the memory space used to store the compressed data blocks is called the first memory space, and the memory space used to store the second associated data blocks is called the first memory space. Second memory space. If the processed data does not need to be added to the second associated data, the processed data may not include the second memory space, but instead consists of a whole segment of compressed data, which is not specifically limited here.
本申请实施例中,当待压缩数据中包括第一关联数据分块时,压缩装置可以通过表示待压缩数据存储位置的第一起始地址、表示正文数据分块大小的第一数据长度和表示第一关联数据分块大小的第二数据长度,将待压缩数据划分为多个数据块,也即把正文数据分块和第一关联数据分块区分开来。In this embodiment of the present application, when the data to be compressed includes the first associated data block, the compression device may use the first starting address indicating the storage location of the data to be compressed, the first data length indicating the size of the text data block, and the first data length indicating the A second data length of the associated data block size divides the data to be compressed into a plurality of data blocks, that is, distinguishes the text data block from the first associated data block.
可选的,当处理后的数据需要包括用于存储第二关联数据分块的第二内存空间时,压缩装置可以通过表示处理后数据存储位置的第二起始地址、表示第一内存空间大小的第一内存空间长度和表示第二内存空间大小的第二内存空间长度,将处理后内存空间划分为多个内存空间块,也即把第一内存空间和第二内存空间区分开来。Optionally, when the processed data needs to include a second memory space for storing the second associated data block, the compression device can indicate the size of the first memory space by representing the second starting address of the storage location of the processed data. The first memory space length and the second memory space length indicating the size of the second memory space, the processed memory space is divided into multiple memory space blocks, that is, the first memory space and the second memory space are distinguished.
本申请实施例中,划分是指逻辑上的划分,即压缩装置可以将正文数据和第一校验数据区分开,或将第一内存空间和第二内存空间区别开来,对这两个部分执行不同的操作。In the embodiment of the present application, the division refers to the logical division, that is, the compression device can distinguish the text data and the first check data, or distinguish the first memory space and the second memory space, and the two parts can be divided into two parts. perform different actions.
在美国国家标准协会(ANSI,american national standards institute)T10委员会的保护信息(PI,protectioninformation)技术中,关联数据可以是数据一致性保护(DIF,data  integrity field)字段,用于校验数据的完整性。除了DIF字段以外,本申请实施例中还可以是其他用于检验分块完整性的字段,例如自定义的用于检验分块完整性的字段,或者其他协议中用于检验分块完整性的字段;本申请实施例中关联数据也可以是其他用途的数据,例如用于描述正文数据的描述数据,具体此处不做限定。In the protection information (PI, protection information) technology of the T10 committee of the American National Standards Institute (ANSI, american national standards institute), the associated data can be a data consistency protection (DIF, data integrity field) field, which is used to verify the integrity of the data sex. In addition to the DIF field, this embodiment of the present application may also be other fields used for checking the integrity of a block, such as a self-defined field used for checking the integrity of a block, or a field used for checking the integrity of a block in other protocols. field; the associated data in this embodiment of the present application may also be data for other purposes, such as description data used to describe text data, which is not specifically limited here.
本申请实施例中的关联数据分块仅以DIF字段为例,所有DIF字段均可由其他关联数据代替,所有用于存储DIF字段的内存空间均可用于存储其他关联数据。相应的,对于不同类型的关联数据,其作用也随关联数据的变动而变动,例如DIF字段用于校验数据完整性,或某自定义的数据用于描述数据信息,对关联数据作用的描述并不构成对关联数据的限制。The associated data block in the embodiment of the present application only takes the DIF field as an example, all DIF fields can be replaced by other associated data, and all memory spaces used for storing DIF fields can be used for storing other associated data. Correspondingly, for different types of linked data, its role also changes with the changes of linked data. For example, the DIF field is used to verify data integrity, or a custom data is used to describe data information, and the description of the role of linked data. It does not constitute a restriction on Linked Data.
二、压缩装置与存储设备的关系。Second, the relationship between the compression device and the storage device.
划分待压缩数据和处理后内存空间的功能,需要由压缩装置来实现,压缩装置可以是一个硬件装置,位于存储设备的内部或外部,也可以是存储在存储设备中的软件程序,指导存储设备执行相应的操作,或者是可以实现划分和压缩功能的存储装置。The function of dividing the data to be compressed and the memory space after processing needs to be realized by a compression device. The compression device can be a hardware device located inside or outside the storage device, or it can be a software program stored in the storage device to guide the storage device. Perform corresponding operations, or be a storage device that can implement division and compression functions.
请参阅图2,当压缩装置是存储设备内部的硬件装置时,本申请实施例的存储设备200可以包括处理器201、存储器202、处理器203和通信总线204,此时处理器203即为上述压缩装置。Referring to FIG. 2, when the compression device is a hardware device inside the storage device, the storage device 200 in this embodiment of the present application may include a processor 201, a memory 202, a processor 203, and a communication bus 204, and the processor 203 is the above-mentioned compression device.
存储设备200可以包括多个处理器,例如图2中所示的处理器201和处理器203。处理器201是存储设备的控制中心。通常情况下,处理器201是一个中央处理器(CPU,central processing unit),包括一个CPU核或多个CPU核,例如图2中所示的CPU1和CPU2。此外,处理器201也可以是特定集成电路(ASIC,application specific integrated circuit),或者是被配置成一个或多个集成电路,例如:一个或多个微处理器(DSP,digital signal processor),或者,一个或多个现场可编程门阵列(FPGA,field programmable gate array)。处理器201可以通过运行或执行存储在存储器202内的软件程序,以及调用存储在存储器202内的数据,执行存储设备200的各种功能。Storage device 200 may include multiple processors, such as processor 201 and processor 203 shown in FIG. 2 . The processor 201 is the control center of the storage device. Typically, the processor 201 is a central processing unit (CPU, central processing unit), including one CPU core or multiple CPU cores, such as CPU1 and CPU2 shown in FIG. 2 . In addition, the processor 201 may also be a specific integrated circuit (ASIC, application specific integrated circuit), or be configured as one or more integrated circuits, for example: one or more microprocessors (DSP, digital signal processor), or , one or more field programmable gate arrays (FPGA, field programmable gate array). The processor 201 can perform various functions of the storage device 200 by running or executing software programs stored in the memory 202 and calling data stored in the memory 202 .
存储器202可用于存储待压缩数据和处理后数据,待压缩数据中可以包括正文数据分块和第一DIF字段分块,第一DIF字段分块用于校验正文数据分块的完整性,两者交替出现。The memory 202 can be used to store the data to be compressed and the processed data, and the data to be compressed can include a text data block and a first DIF field block, and the first DIF field block is used to verify the integrity of the text data block, and the two appear alternately.
可选的,处理后数据所对应的处理后内存空间可以包括第一内存空间和第二内存空间,两者交替出现。第一内存空间用于存储压缩后数据分块,第二内存空间用于存储第二DIF字段分块,第二DIF字段分块用于校验压缩后数据分块的完整性。Optionally, the processed memory space corresponding to the processed data may include a first memory space and a second memory space, and the two appear alternately. The first memory space is used to store compressed data blocks, the second memory space is used to store second DIF field blocks, and the second DIF field blocks are used to verify the integrity of the compressed data blocks.
存储器202还可以存储执行本申请方案的软件程序,并由处理器201或处理器203来控制执行。The memory 202 may also store a software program for executing the solution of the present application, and the execution is controlled by the processor 201 or the processor 203 .
在物理形态上,存储器202可以是可存储静态信息和指令的静态存储设备,随机存取存储器(RAM,random access memory)或者可存储信息和指令的其他类型的动态存储设备,也可以是电可擦可编程只读存储器(EEPROM,electrically erasable programmable read-only memory)或其他形式的虚拟内存。存储器202可以是独立存在,通过通信总线204与处理器201相连接,也可以和处理器201集成在一起,具体此处不作限定。具体的,存储器202可以包括多个部分,用于存储待压缩数据的存储器202可以是只读存储器(ROM,read-only memory)或上述任一种形式,用于存储处理后数据的存储器202可以是上述任一种形式。In physical form, the memory 202 may be a static storage device that can store static information and instructions, a random access memory (RAM, random access memory) or other types of dynamic storage devices that can store information and instructions, or an electrically accessible memory device. Erasing programmable read-only memory (EEPROM, electrically erasable programmable read-only memory) or other forms of virtual memory. The memory 202 may exist independently and be connected to the processor 201 through the communication bus 204, or may be integrated with the processor 201, which is not specifically limited here. Specifically, the memory 202 may include multiple parts, the memory 202 for storing the data to be compressed may be a read-only memory (ROM, read-only memory) or any of the above forms, and the memory 202 for storing the processed data may be any of the above forms.
在本申请实施例中,处理器201可以通过接口调用处理器203执行相应的操作,表1中描述了一种接口形式:In this embodiment of the present application, the processor 201 may invoke the processor 203 through an interface to perform corresponding operations, and Table 1 describes an interface form:
表1面向非连续数据压缩装置的典型接口形式Table 1 Typical interface forms for non-continuous data compression devices
Figure PCTCN2021097764-appb-000001
Figure PCTCN2021097764-appb-000001
本申请实施例出现的参数,其数据类型可以如表一所示为整型int、字符型char,也可以是其他类型,例如长整型long等,具体此处不作限定。The data types of the parameters appearing in the embodiments of the present application may be integer type int, character type char as shown in Table 1, and may also be other types, such as long integer type long, etc., which are not specifically limited here.
其中,参数inBuf也叫第一起始地址,参数outBuf也叫第二起始地址,分别表示待压缩数据和处理后数据在存储器202中的存储位置。The parameter inBuf is also called the first starting address, and the parameter outBuf is also called the second starting address, which respectively represent the storage locations of the data to be compressed and the processed data in the memory 202 .
参数inContinuity表示存储器202中待压缩数据的数据组成,该参数包括两个子参数,一个是第一数据长度,表示待压缩数据中单个需要被压缩的正文数据分块的长度,也即是第一部分数据的长度;另一个是第二数据长度,表示单个第一DIF字段分块的长度,也即是第二部分数据的长度。The parameter inContinuity represents the data composition of the data to be compressed in the memory 202. This parameter includes two sub-parameters, one is the first data length, which represents the length of a single text data block that needs to be compressed in the data to be compressed, that is, the first part of the data The other is the second data length, which represents the length of a single first DIF field block, that is, the length of the second part of the data.
参数outContinuity表示存储器202中处理后内存空间的组成,处理后数据存储在处理后内存空间中,该参数也反映了处理后数据的数据组成。该参数包括两个子参数,一个是第一内存空间长度,表示处理后数据中单个压缩后数据分块的长度,也即是第一内存空间的长度;另一个是第二内存空间长度,表示处理后数据中单个第二DIF字段分块的长度,也即是第二内存空间的长度,第二DIF字段分块用于校验压缩后数据分块的完整性。The parameter outContinuity represents the composition of the processed memory space in the storage 202, the processed data is stored in the processed memory space, and this parameter also reflects the data composition of the processed data. This parameter includes two sub-parameters, one is the length of the first memory space, indicating the length of a single compressed data block in the processed data, that is, the length of the first memory space; the other is the length of the second memory space, indicating the length of the processed data The length of a single second DIF field block in the post data, that is, the length of the second memory space, and the second DIF field block is used to verify the integrity of the compressed data block.
可选的,接口还可以提供其他参数,包括但不限于参数inLen、参数outBufLen和参数compressParams;参数inLen表示待压缩数据的长度,参数outBufLen表示可用于存储处理后 数据的内存空间的大小;参数compressParams用于描述压缩参数,例如,当压缩算法为LZ算法时,参数compressParams可以包括但不限于压缩窗长,压缩窗长表示LZ压缩算法滑动窗口中已编码区域的长度;应用其他压缩算法时,接口也可以提供其他算法的其他压缩参数,具体此处不作限定。需要注意的是,本申请接口所提供的参数包括但不限于上述参数,接口也可以不提供上述参数,此处不作限定。Optionally, the interface can also provide other parameters, including but not limited to the parameter inLen, the parameter outBufLen, and the parameter compressParams; the parameter inLen represents the length of the data to be compressed, the parameter outBufLen represents the size of the memory space that can be used to store the processed data; the parameter compressParams It is used to describe the compression parameters. For example, when the compression algorithm is the LZ algorithm, the parameter compressParams can include but is not limited to the compression window length. The compression window length represents the length of the encoded area in the sliding window of the LZ compression algorithm; when applying other compression algorithms, the interface Other compression parameters of other algorithms may also be provided, which are not specifically limited here. It should be noted that the parameters provided by the interface of the present application include but are not limited to the above parameters, and the interface may not provide the above parameters, which is not limited here.
具体的,当待压缩数据中正文数据分块的长度和第一DIF字段分块的长度都是固定值时,参数inContinuity中第一数据长度和第二数据长度可以是固定的两个值,用于表示该待压缩数据中所有的正文数据分块和第一DIF字段分块的长度。当待压缩数据中正文数据分块的长度不是固定值时,即正文数据分块有多个长度时,参数inContinuity中的第一数据长度可以包括每个第一数据的长度值,或包括部分第一数据的长度值,即第一数据长度的值可以有多个,具体此处不作限定。第二数据长度与第一数据长度类似,具体此处不再赘述。Specifically, when the length of the text data block and the length of the first DIF field block in the data to be compressed are both fixed values, the first data length and the second data length in the parameter inContinuity can be two fixed values, using Indicates the length of all text data blocks and the first DIF field block in the data to be compressed. When the length of the text data block in the data to be compressed is not a fixed value, that is, when the text data block has multiple lengths, the first data length in the parameter inContinuity can include the length value of each first data, or include part of the first data length. The length value of a data, that is, the value of the first data length, may have multiple values, which are not specifically limited here. The second data length is similar to the first data length, and details are not repeated here.
同理,当处理后数据中压缩后数据分块的长度和第二DIF字段分块的长度都是固定值时,参数outContinuity中第一内存空间长度和第二内存空间长度可以是固定的两个值,用于表示该处理后数据中所有的压缩后数据分块和第二DIF字段分块的长度。当处理后数据中压缩后数据分块的长度不是固定值时,即压缩后数据分块有多个长度时,参数outContinuity中的第一内存空间长度可以包括每个第一内存空间的长度值,或包括部分第一内存空间的长度值,即第一内存空间长度的值可以有多个,具体此处不作限定。第二内存空间长度与第一内存空间长度类似,具体此处不再赘述。Similarly, when the length of the compressed data block and the length of the second DIF field block in the processed data are both fixed values, the length of the first memory space and the length of the second memory space in the parameter outContinuity can be two fixed values. The value is used to indicate the length of all compressed data blocks and the second DIF field block in the processed data. When the length of the compressed data block in the processed data is not a fixed value, that is, when the compressed data block has multiple lengths, the length of the first memory space in the parameter outContinuity may include the length value of each first memory space, Or include part of the length value of the first memory space, that is, there may be multiple values of the length of the first memory space, which is not specifically limited here. The length of the second memory space is similar to the length of the first memory space, and details are not described herein again.
需要注意的是,本申请实施例中的接口名称、参数名称、数据类型只是对参数和接口的举例,并不是对参数和接口的限定,对于具有相同含义的参数或接口,都应当属于本申请实施例所指的参数或接口。It should be noted that the interface names, parameter names, and data types in the embodiments of this application are only examples of parameters and interfaces, not limitations on parameters and interfaces. Parameters or interfaces with the same meaning shall belong to this application. The parameter or interface referred to by the embodiment.
在本申请实施例中,处理器203可以用于划分正文数据分块和第一DIF字段分块,同时承担了读取正文数据分块和数据压缩的功能,可以避免对第一DIF字段分块的压缩,提高压缩率。具体的,处理器203可以根据上述接口调用参数inBuf,即第一起始地址;和参数inContinuity,即第一数据长度和第二数据长度。根据参数inBuf和参数inContinuity确定待处理数据中的正文数据分块和第一DIF字段分块,仅读取正文数据分块,得到不包括第一DIF字段分块的连续待压缩数据,对连续待压缩数据进行压缩得到压缩后数据。In this embodiment of the present application, the processor 203 may be configured to divide the text data into blocks and the first DIF field blocks, and at the same time undertakes the functions of reading the text data blocks and data compression, which can avoid the first DIF field block. compression to increase the compression ratio. Specifically, the processor 203 may call the parameter inBuf, that is, the first starting address, and the parameter inContinuity, that is, the first data length and the second data length, according to the above-mentioned interface. Determine the text data block and the first DIF field block in the data to be processed according to the parameter inBuf and the parameter inContinuity, read only the text data block, and obtain the continuous to-be-compressed data that does not include the first DIF field block. The compressed data is compressed to obtain compressed data.
具体的,处理器203的读取过程,可以是以直接存储器访问(DMA,direct memory access)的方式进行,也可能是未来出现的新的读取方式,只要是能将数据从存储器202读取到压缩装置中的方式,具体此处不做限定。Specifically, the reading process of the processor 203 may be performed by means of direct memory access (DMA, direct memory access), or may be a new reading method that will appear in the future, as long as the data can be read from the memory 202 The method of entering the compression device is not specifically limited here.
可选的,处理器203也可以用于划分第一内存空间和第二内存空间,同时承担了写出压缩后数据的功能,从而实现在处理后数据中空出位置用于存储第二DIF字段分块。具体的,处理器203可以根据上述接口调用参数outBuf,即第二起始地址;和参数outContinuity,即第一内存空间长度和第二内存空间长度。根据参数outBuf和参数outContinuity确定处理后数据中的第一内存空间和第二内存空间,将压缩后数据写入第一内存空间中,同时将第二内存空间空出,用于存储第二DIF字段分块。Optionally, the processor 203 can also be used to divide the first memory space and the second memory space, and at the same time assumes the function of writing out the compressed data, so as to realize that a space is vacated in the processed data for storing the second DIF field data. Piece. Specifically, the processor 203 may call the parameter outBuf, that is, the second starting address, and the parameter outContinuity, that is, the length of the first memory space and the length of the second memory space, according to the above-mentioned interface. Determine the first memory space and the second memory space in the processed data according to the parameter outBuf and the parameter outContinuity, write the compressed data into the first memory space, and empty the second memory space for storing the second DIF field Block.
具体的,处理器203可以包含多个压缩核,例如图2中所示的压缩核1和压缩核2,每个核独立处理不同的压缩任务,即每个压缩核独立完成划分、读取、压缩和写出的整套任务,不同的压缩核处理不同的待压缩数据。Specifically, the processor 203 may include multiple compression cores, such as compression core 1 and compression core 2 shown in FIG. 2 , each core independently processes different compression tasks, that is, each The complete set of tasks for compression and writing, different compression cores process different data to be compressed.
处理器203可以和处理器201具有相同物理形态的处理器,也可以和处理器201具有不同物理形态的处理器。处理器203可以是集成于中央芯片的一个计算单元,也可以以其他形式存在,例如与中央芯片耦合的具备计算能力的处理芯片,或通过物理接口与存储设备连接的具备计算能力的硬件装置,该硬件装置位于压缩设备中,具体此处不作限定。具体的,中央芯片可以包括处理器201。在实际应用中,处理器203可以是一个加速卡或协处理器或图形处理器(GPU,graphics processing unit)或神经网络处理器(NPU,neural-network processing unit)等。在本实施例中,处理器201可以配置一个或多个,处理器203也可以配置一个或多个。The processor 203 may have the same physical form as the processor 201 , or may have a different physical form from the processor 201 . The processor 203 may be a computing unit integrated in the central chip, or may exist in other forms, such as a processing chip with computing capability coupled with the central chip, or a hardware device with computing capability connected with a storage device through a physical interface, The hardware device is located in the compression device, which is not specifically limited here. Specifically, the central chip may include the processor 201 . In practical applications, the processor 203 may be an acceleration card or a co-processor, a graphics processing unit (GPU, graphics processing unit) or a neural network processor (NPU, neural-network processing unit), or the like. In this embodiment, one or more processors 201 may be configured, and one or more processors 203 may also be configured.
在本申请实施例中,压缩装置也可以是存储在存储器202中的软件程序,则上述处理器203所执行的动作由处理器201根据该软件程序执行;或者压缩装置就是上述存储设备,处理器203就是存储设备专门用来压缩的模块,此时处理器203的功能可以由处理器201来实现,也可以由专门的处理器203来实现,具体此处不作限定。In this embodiment of the present application, the compression device may also be a software program stored in the memory 202, and the actions performed by the processor 203 are performed by the processor 201 according to the software program; or the compression device is the above storage device, and the processor 203 is a module specially used by the storage device for compression. In this case, the function of the processor 203 may be implemented by the processor 201 or a special processor 203, which is not specifically limited here.
处理器201和处理器203均可以通过通信总线204访问存储器202,读取存储器202中存储的软件程序和数据,以及将数据写入存储器202中。Both the processor 201 and the processor 203 can access the memory 202 through the communication bus 204 , read software programs and data stored in the memory 202 , and write data into the memory 202 .
处理器201在接收压缩任务的指令时,可以根据指令中待处理数据的连续性信息,得到位置标识和分块长度,位置标识包括第一起始地址和第二起始地址,分块长度包括第一数据长度、第二数据长度、第一内存空间长度和第二内存空间长度,通过接口向处理器203下达压缩指令、位置标识和分块长度,用于指示处理器203对待处理数据进行相应的处理。When the processor 201 receives the instruction of the compression task, it can obtain the location identifier and the block length according to the continuity information of the data to be processed in the instruction. The location identifier includes the first starting address and the second starting address, and the block length includes the first A data length, a second data length, a first memory space length, and a second memory space length, and a compression instruction, a location identifier and a block length are sent to the processor 203 through the interface to instruct the processor 203 to perform corresponding processing on the data to be processed. deal with.
具体的,位置标识和分块长度可以随压缩指令下达给处理器203,也可以存在存储器202中,处理器203接收到压缩指令后从存储器202中调取,具体此处不做限定。Specifically, the location identifier and block length may be issued to the processor 203 along with the compression instruction, or may be stored in the memory 202, and the processor 203 retrieves from the memory 202 after receiving the compression instruction, which is not specifically limited here.
从功能上来看,处理器203具体应用于需要进行数据传输和保存的场景中,具体可以是云服务器或云服务存储设备,或其他存储设备,例如,运用于网络、大数据、存储等的服务器或其他存储设备,具体此处不作限定。From a functional point of view, the processor 203 is specifically used in scenarios that require data transmission and storage, and may specifically be a cloud server or a cloud service storage device, or other storage devices, such as servers used in networks, big data, storage, etc. or other storage devices, which are not specifically limited here.
从应用场景来说,处理器203可以应用于数据压缩或通信,也可以用于其他场景,例如视频编码或其他的数据处理场景,具体此处不作限定。In terms of application scenarios, the processor 203 can be applied to data compression or communication, and can also be applied to other scenarios, such as video encoding or other data processing scenarios, which are not specifically limited here.
通信总线204,可以是工业标准体系结构(ISA,industry standard architecture)总线、外部设备互连(PCI,peripheral component)总线或扩展工业标准体系结构(EISA,extended industry standard architecture)总线等。该总线可以分为地址总线、数据总线、控制总线等。为便于表示,图2中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。The communication bus 204 may be an industry standard architecture (ISA, industry standard architecture) bus, a peripheral component interconnect (PCI, peripheral component) bus, or an extended industry standard architecture (EISA, extended industry standard architecture) bus or the like. The bus can be divided into address bus, data bus, control bus and so on. For ease of presentation, only one thick line is used in FIG. 2, but it does not mean that there is only one bus or one type of bus.
图2中示出的设备结构并不构成对存储设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。The device structure shown in FIG. 2 does not constitute a limitation on the storage device, and may include more or less components than shown, or combine some components, or arrange different components.
在本申请实施例中,压缩装置也可以位于存储设备外部,具体可以是通过物理接口与存储设备耦合的硬件装置,该硬件装置位于压缩设备内部且包括处理器203,处理器203通过物理接口和总线204实现读取数据和写入数据的动作,实现上述位于存储设备内部的处理器203所能实现的功能。此时,处理器203可以以远程直接数据存取(RDMA,remote direct memory access)的方式读取数据,具体此处不作限定。In this embodiment of the present application, the compression apparatus may also be located outside the storage device, and specifically may be a hardware device coupled to the storage device through a physical interface, the hardware device is located inside the compression device and includes a processor 203, and the processor 203 passes through the physical interface and the storage device. The bus 204 realizes the actions of reading data and writing data, and realizes the functions that can be realized by the above-mentioned processor 203 located inside the storage device. At this time, the processor 203 can read data in a remote direct data access (RDMA, remote direct memory access) manner, which is not specifically limited here.
在本申请实施例中,压缩装置通过第一数据长度、第二数据长度和第一起始地址确定需要被压缩的正文数据分块,仅读取正文数据分块,不读取第一关联数据分块,即上述第一DIF字段分块,使得被压缩的数据中不包括第一关联数据分块,防止因第一关联数据分块破坏原有数据的规律和特征所导致的算法压缩率降低,因此提高了压缩率;同时,防止第一关联数据分块参与压缩导致输入数据变大,从而提高了压缩率。In the embodiment of the present application, the compression device determines the text data block to be compressed according to the first data length, the second data length and the first start address, and only reads the text data block, and does not read the first associated data block. block, that is, the above-mentioned first DIF field block, so that the compressed data does not include the first associated data block, preventing the reduction of the algorithm compression rate caused by the first associated data block destroying the law and characteristics of the original data, Therefore, the compression rate is improved; at the same time, the input data is prevented from becoming larger because the first associated data block is prevented from participating in the compression, thereby increasing the compression rate.
可选的,在本申请实施例中,压缩装置通过第一内存空间长度、第二内存空间长度和第二起始地址确定用于存储压缩后数据的第一内存空间和用于存储第二关联数据分块,即上述第二DIF字段分块的第二内存空间,将压缩后数据写入第一内存空间中,第二内存空间空出来用于存储第二关联数据分块,可以在存储器202中直接得到空出第二内存空间的处理后数据,不需要存储设备再拷贝压缩后数据以空出第二内存空间,减少压缩过程的时延,同时提高了存储设备的压缩带宽。Optionally, in this embodiment of the present application, the compression apparatus determines, by using the first memory space length, the second memory space length, and the second starting address, the first memory space for storing the compressed data and the second memory space for storing the second association. The data block, that is, the second memory space of the second DIF field block, the compressed data is written into the first memory space, and the second memory space is vacated for storing the second associated data block, which can be stored in the memory 202 The processed data that frees up the second memory space is directly obtained from the storage device, and there is no need for the storage device to copy the compressed data to free up the second memory space, thereby reducing the time delay of the compression process and improving the compression bandwidth of the storage device.
三、压缩装置的工作过程。Third, the working process of the compression device.
压缩装置可以位于存储设备的内部,也可以不位于存储设备内部,以下将分别进行说明:The compression device may be located inside the storage device, or may not be located inside the storage device, which will be described separately below:
1、压缩装置在存储装置内部。1. The compression device is inside the storage device.
接下来,结合图3,对本申请一实施例提供的数据压缩方法进行详细说明,该方法应用于图2所示的存储设备200中,在这里以处理器201和处理器203为例进行说明,本实施例中处理器201与处理器203都位于存储设备中。如图3所示,该方法可以包括以下步骤。Next, with reference to FIG. 3 , the data compression method provided by an embodiment of the present application will be described in detail. The method is applied to the storage device 200 shown in FIG. 2 . Here, the processor 201 and the processor 203 are used as examples for description. In this embodiment, both the processor 201 and the processor 203 are located in a storage device. As shown in Figure 3, the method may include the following steps.
S301、处理器201接收压缩指令:S301, the processor 201 receives the compression instruction:
当用户或外界下达压缩指令时,处理器201可以接收到压缩指令,压缩指令也可以通过其他途径接收,例如,当其它设备给存储设备200发送压缩请求时,处理器201也可以接收到压缩指令,具体此处不作限定。When a user or the outside world issues a compression instruction, the processor 201 may receive the compression instruction, and the compression instruction may also be received through other channels. For example, when another device sends a compression request to the storage device 200, the processor 201 may also receive the compression instruction. , which is not specifically limited here.
S302、处理器201获取位置描述信息和分段长度:S302, the processor 201 obtains the location description information and the segment length:
压缩指令中会包括分段长度,分段长度包括待处理数据中正文数据分块的长度和用于校验该正文数据分块的第一DIF字段分块的长度,以及处理后数据中压缩后数据分块的长度和用于校验该压缩后数据分块的第二DIF字段分块的长度。同时处理器201可以根据存储器202的内存空间确定位置描述信息,即待压缩数据的存储位置和处理后数据的存储位置。The compression instruction will include the segment length, which includes the length of the text data block in the data to be processed and the length of the first DIF field block used to verify the text data block, and the length of the compressed data in the processed data. The length of the data block and the length of the second DIF field block used to verify the compressed data block. At the same time, the processor 201 may determine the location description information according to the memory space of the memory 202, that is, the storage location of the data to be compressed and the storage location of the processed data.
当压缩装置根据自身需求自行启动压缩时,处理器201不会接收压缩指令,即步骤S301不存在,此时压缩装置也会获取位置描述信息和分段长度。When the compression device starts compression according to its own needs, the processor 201 will not receive a compression instruction, that is, step S301 does not exist, and the compression device will also obtain the location description information and the segment length at this time.
S303、处理器201获取待处理数据:S303, the processor 201 obtains the data to be processed:
处理器201将待处理数据从存储器的外部存储拷贝至存储器202中,具体的,处理器也可以从其他地方获取待处理数据,例如当步骤S301的压缩指令是外部发送的,且外部还发送了待处理数据,则处理器201可以将该待处理数据保存下来,具体此处不做限定。The processor 201 copies the data to be processed from the external storage of the memory to the memory 202. Specifically, the processor can also obtain the data to be processed from other places. For example, when the compression instruction in step S301 is sent externally, and the external data to be processed, the processor 201 may save the data to be processed, which is not specifically limited here.
S304、处理器201调用处理器203:S304, the processor 201 calls the processor 203:
处理器201可以调用处理器203,给处理器203发送压缩指令,让处理器203对待处理数据进行相应的处理。具体的,调用处理器203需要通过接口,接口提供了参数inBuf、参数outBuf、参数inContinuity和参数outContinuity,上述参数在图2所示实施例中已说明,此处不再赘述。The processor 201 may call the processor 203, and send a compression instruction to the processor 203, so that the processor 203 performs corresponding processing on the data to be processed. Specifically, calling the processor 203 needs to pass through the interface, and the interface provides the parameter inBuf, the parameter outBuf, the parameter inContinuity and the parameter outContinuity. The above parameters have been described in the embodiment shown in FIG. 2 and will not be repeated here.
S305、处理器203获取第一起始地址、第一数据长度和第二数据长度:S305, the processor 203 obtains the first starting address, the first data length and the second data length:
处理器203接收处理器201下达的压缩指令,该指令中可以包括步骤S302中的位置描述信息和分段长度,处理器203可以根据位置描述信息中待压缩数据的存储位置得到参数inBuf,即第一起始地址,根据分段长度中正文数据分块的长度得到第一数据长度,根据分段长度中第一DIF字段分块的长度,得到第二数据长度,上述第一数据长度和第二数据长度即为参数inContinuity。The processor 203 receives the compression instruction issued by the processor 201, and the instruction may include the location description information and segment length in step S302, and the processor 203 may obtain the parameter inBuf according to the storage location of the data to be compressed in the location description information, that is, the first a starting address, obtain the first data length according to the length of the text data block in the segment length, obtain the second data length according to the length of the first DIF field block in the segment length, the above-mentioned first data length and second data length The length is the parameter inContinuity.
具体的,处理器203也可以不通过压缩指令获取上述信息,例如,压缩指令中不包括位置描述信息和分段长度时,处理器203可以从存储器202中调用位置描述信息和分段长度,再根 据位置描述信息和分段长度得到第一起始地址、第一数据长度和第二数据长度。相应的,步骤S302后存储器202将会保存位置描述信息和分段长度。Specifically, the processor 203 may also obtain the above-mentioned information without compressing the instruction. For example, when the compressing instruction does not include the location description information and segment length, the processor 203 may call the location description information and segment length from the memory 202, and then The first start address, the first data length and the second data length are obtained according to the location description information and the segment length. Correspondingly, after step S302, the memory 202 will store the location description information and the segment length.
具体的,处理器203可以直接将待压缩数据的存储位置作为参数inBuf,或对待压缩数据的存储位置进行数据类型变换,具体此处不作限定。得到参数inContinuity的方式与参数inBuf类似,具体此处不再赘述。Specifically, the processor 203 may directly use the storage location of the data to be compressed as the parameter inBuf, or perform data type conversion on the storage location of the data to be compressed, which is not specifically limited here. The method of obtaining the parameter inContinuity is similar to that of the parameter inBuf, which will not be repeated here.
S306、处理器203获取待压缩数据:S306, the processor 203 obtains the data to be compressed:
处理器203可以根据处理器201下达的压缩指令确定待压缩数据,即将存储器202中保存的待处理数据作为待压缩数据,此处的获取不是真的得到待压缩数据,而是指确定了待压缩数据的位置与其他描述信息。The processor 203 can determine the data to be compressed according to the compression instruction issued by the processor 201, that is, the data to be processed stored in the memory 202 is regarded as the data to be compressed. The location of the data and other descriptive information.
S307、处理器203读取正文数据分块:S307, the processor 203 reads the text data into blocks:
获取第一起始地址、第一数据长度和第二数据长度之后,处理器203可以根据参数inBuf确定存储器202中待压缩数据的起始地址。After acquiring the first starting address, the first data length and the second data length, the processor 203 may determine the starting address of the data to be compressed in the memory 202 according to the parameter inBuf.
此时,处理器203开启一个计数器,并将计数器的值初始化为0。At this time, the processor 203 starts a counter and initializes the value of the counter to 0.
处理器203将存储器202中的待压缩数据读取到处理器203的高速缓冲存储器中,计数器同步记录已读取数据的长度。The processor 203 reads the data to be compressed in the memory 202 into the cache memory of the processor 203, and the counter synchronously records the length of the read data.
当计数器的值等于参数inContinuity中正文数据分块的长度时,将计数器的值设置为0,此时处理器203所读取的数据即为正文数据分块。When the value of the counter is equal to the length of the text data block in the parameter inContinuity, the value of the counter is set to 0, and the data read by the processor 203 at this time is the text data block.
处理器203跳过参数inContinuity中第一DIF字段分块的长度,此时处理器203所跳过的数据即为第一DIF字段分块。The processor 203 skips the length of the first DIF field block in the parameter inContinuity, and the data skipped by the processor 203 at this time is the first DIF field block.
重复上述步骤,处理器203继续读取正文数据分块和跳过第一DIF字段分块,得到不包括第一DIF字段分块的连续待压缩数据,该连续待压缩数据中包括所有的正文数据分块,即包括完整的正文数据。Repeating the above steps, the processor 203 continues to read the text data block and skips the first DIF field block to obtain continuous data to be compressed that does not include the first DIF field block, and the continuous data to be compressed includes all text data. Chunked, i.e. including the complete body data.
本申请实施例中,各参数名称仅是举例,并不是对参数的限定,对于具有相同含义的参数,都应当是本申请实施例所指的参数。In the embodiments of the present application, the names of the parameters are only examples, and are not intended to limit the parameters. For parameters with the same meaning, they should all be the parameters referred to in the embodiments of the present application.
本申请实施例中,除了用计数器来确定待压缩数据分块,处理器203也可以通过其他方式确定正文数据分块,例如,通过内存映射的方式,或通过计算数据分块起止地址的方式,具体此处不作限定。In this embodiment of the present application, in addition to using the counter to determine the data blocks to be compressed, the processor 203 may also determine the text data blocks in other ways, for example, by memory mapping, or by calculating the start and end addresses of the data blocks, There is no specific limitation here.
S308、处理器203压缩连续待压缩数据:S308, the processor 203 compresses the continuous data to be compressed:
处理器203将连续待压缩数据压缩,得到压缩后数据,压缩后数据存储在处理器203的高速缓冲存储器中。The processor 203 compresses the continuous data to be compressed to obtain compressed data, and the compressed data is stored in the cache memory of the processor 203 .
S309、处理器203获取第二起始地址、第一内存空间长度和第二内存空间长度:S309, the processor 203 obtains the second starting address, the first memory space length and the second memory space length:
处理器203接收处理器201下达的压缩指令中可以包括位置描述信息和分段长度,处理器203可以根据位置描述信息中处理后数据的存储位置得到参数outBuf,即第二起始地址,根据分段长度中压缩后数据分块的长度得到第一内存空长度,根据分段长度中第二数据分块的长度,得到第二内存空间长度,上述第一内存空间长度和第二内存空间长度即为参数outContinuity。The compressed instruction received by the processor 203 from the processor 201 may include the location description information and the segment length, and the processor 203 may obtain the parameter outBuf according to the storage location of the processed data in the location description information, that is, the second starting address. The length of the compressed data block in the segment length obtains the first memory space length, and according to the length of the second data block in the segment length, the second memory space length is obtained. The above-mentioned first memory space length and second memory space length are For the parameter outContinuity.
具体的,处理器203也可以不通过压缩指令获取上述信息,与上述步骤S305类似,具体此处不再赘述。Specifically, the processor 203 may also obtain the above-mentioned information without compressing the instruction, which is similar to the above-mentioned step S305, and details are not repeated here.
S310、处理器203将压缩后数据写入存储器202中,得到处理后数据。S310. The processor 203 writes the compressed data into the memory 202 to obtain the processed data.
处理器203可以根据参数outBuf确定存储器202中处理后数据的起始地址。The processor 203 may determine the starting address of the processed data in the memory 202 according to the parameter outBuf.
此时,将计数器的值初始化为0。At this time, the value of the counter is initialized to 0.
处理器203将压缩后数据写入存储器202中,计数器同步记录已写入数据的长度。The processor 203 writes the compressed data into the memory 202, and the counter synchronously records the length of the written data.
当计数器的值等于参数outContinuity中压缩后数据分块的长度时,将计数器的值设置为0,此时处理器203所写入的内存空间即为第一内存空间。When the value of the counter is equal to the length of the compressed data block in the parameter outContinuity, the value of the counter is set to 0, and the memory space written by the processor 203 at this time is the first memory space.
处理器203跳过参数outContinuity中第二DIF字段分块长度的内存空间,此时处理器203所跳过的内存空间即为第二内存空间。The processor 203 skips the memory space of the block length of the second DIF field in the parameter outContinuity, and the memory space skipped by the processor 203 at this time is the second memory space.
处理器203继续在第一内存空间中写入压缩后数据和跳过第二内存空间,得到包括压缩后数据分块和第二内存空间的处理后数据。The processor 203 continues to write the compressed data in the first memory space and skips the second memory space to obtain processed data including the compressed data blocks and the second memory space.
本申请实施例中,除了用计数器来确定第一内存空间和第二内存空间,处理器203也可以通过其他方式确定第一内存空间,例如,通过内存映射的方式,或通过计算内存分块起止地址的方式,具体此处不作限定。In this embodiment of the present application, in addition to using a counter to determine the first memory space and the second memory space, the processor 203 may also determine the first memory space in other ways, for example, by memory mapping, or by calculating the start and end of memory blocks The address method is not specifically limited here.
在本申请实施例中,步骤S309可以在步骤S304至步骤S308中任一步之后执行,也可以与步骤S305同时执行,只要在步骤S304之后,步骤S310之前执行即可,具体此处不作限定。In this embodiment of the present application, step S309 may be performed after any one of steps S304 to S308, or may be performed simultaneously with step S305, as long as it is performed after step S304 and before step S310, which is not specifically limited here.
在本申请实施例中,除了参数inBuf和outBuf,表示数据位置的标识也可以是其他形式的参数,此处仅以参数inBuf和outBuf为例,具体此处不作限定。In the embodiment of the present application, in addition to the parameters inBuf and outBuf, the identifier representing the data location may also be a parameter in other forms. Here, only the parameters inBuf and outBuf are used as examples, which are not specifically limited here.
在本申请实施例中,除了参数inContinuity和outContinuity,表示数据分块长度的标识也可以是其他形式的参数,此处仅以参数inContinuity和outContinuity为例,具体此处不作限定。In the embodiment of the present application, in addition to the parameters inContinuity and outContinuity, the identifier representing the length of the data block may also be a parameter in other forms. Here, only the parameters inContinuity and outContinuity are used as examples, which are not specifically limited here.
在本申请实施例中,数据压缩的过程(步骤S308)也可以与将压缩后数据写入到存储器202中的过程(步骤S310)同步进行,例如,压缩过程得到一个字符,就在存储器202中写入一个字符;或者,将正文数据分块读取到处理器203高速缓冲存储器中的过程(步骤S307)也可以与步骤S308、S310同步进行,例如,处理器203先计算好为了得到压缩后数据分块,需要用到多长的正文数据,读取相应长度的正文数据,压缩后直接得到整段的压缩后数据,再将整段压缩后数据写入存储器202中;具体此处不作限定。In this embodiment of the present application, the process of data compression (step S308 ) may also be performed synchronously with the process of writing the compressed data into the memory 202 (step S310 ). For example, a character obtained from the compression process is stored in the memory 202 Write a character; or, the process of reading the text data into the cache memory of the processor 203 in blocks (step S307) can also be performed synchronously with steps S308 and S310, for example, the processor 203 calculates first in order to obtain compression The data is divided into chunks, how long the text data needs to be used, the text data of the corresponding length is read, the compressed data of the entire segment is directly obtained after compression, and then the compressed data of the entire segment is written into the memory 202; the details are not limited here. .
S311、处理器203生成DIF字段并写入第二内存空间中。S311. The processor 203 generates a DIF field and writes it into the second memory space.
步骤S310中得到的处理后数据中包括用于放置第二DIF字段的第二内存空间,得到处理后数据后,处理器203可以生成第二DIF字段,填入上述第二内存空间中。The processed data obtained in step S310 includes a second memory space for placing the second DIF field. After obtaining the processed data, the processor 203 may generate a second DIF field and fill it into the second memory space.
在本申请实施例中,生成第二DIF字段并填入第二内存空间的动作不仅可以由处理器203完成,也可以由处理器201完成,具体此处不作限定。In this embodiment of the present application, the action of generating the second DIF field and filling the second memory space can be completed not only by the processor 203 but also by the processor 201, which is not specifically limited here.
在本申请实施例中,步骤S310也可以与步骤S308同步进行,例如,处理器203加载得到一个第二内存空间,处理器203/处理器201就在该第二内存空间中填入对应的第二DIF字段,具体此处不做限定。In this embodiment of the present application, step S310 can also be performed synchronously with step S308. For example, when the processor 203 loads a second memory space, the processor 203/processor 201 fills in the corresponding first memory space in the second memory space. Two DIF fields, which are not specifically limited here.
本申请实施例中,处理器203可以是集成于中央芯片的一个计算单元或计算模块,也可以以其他形式存在,例如与中央芯片耦合的具备计算能力的处理芯片,具体此处不作限定。具体的,中央芯片可以包括处理器201。处理器203的具体形式如图2所示实施例,此处不再赘述。In this embodiment of the present application, the processor 203 may be a computing unit or computing module integrated in the central chip, or may exist in other forms, such as a processing chip with computing capability coupled to the central chip, which is not specifically limited here. Specifically, the central chip may include the processor 201 . The specific form of the processor 203 is the embodiment shown in FIG. 2 , and details are not repeated here.
2、压缩装置在存储装置内部的另一实施例。2. Another embodiment in which the compression device is inside the storage device.
接下来,结合图4,对本申请另一实施例提供的数据压缩方法进行说明,该方法应用于图2所示的存储设备200中,本实施例中压缩装置就是存储设备,也即处理器203就是处理器201,位于存储设备内部。如图4所示,该方法可以包括以下步骤:Next, with reference to FIG. 4 , a data compression method provided by another embodiment of the present application will be described. The method is applied to the storage device 200 shown in FIG. 2 . In this embodiment, the compression device is the storage device, that is, the processor 203 . It is the processor 201, which is located inside the storage device. As shown in Figure 4, the method may include the following steps:
S401-S403:与图3所示实施例中步骤S301-S303类似,只不过动作的执行主体改为处理 器203,此处不再赘述。S401-S403: Similar to steps S301-S303 in the embodiment shown in FIG. 3, except that the execution body of the action is changed to the processor 203, which is not repeated here.
S404、处理器203根据用户或外界下达的压缩指令,或自行启动压缩时得到的参数,获取第一起始地址、第一数据长度和第二数据长度。S404. The processor 203 obtains the first starting address, the first data length and the second data length according to the compression instruction issued by the user or the outside world, or the parameters obtained when the compression is started by itself.
该步骤与图3所示实施例中步骤S305类似,此处不再赘述。This step is similar to step S305 in the embodiment shown in FIG. 3 , and details are not repeated here.
S405-S409:与图3所示实施例中步骤S307-S311类似,所有处理器201的动作都由处理器203执行,其中步骤S408是根据用户或外界下达的压缩指令,或自行启动压缩时得到的参数,获取第二起始地址、第一内存空间长度和第二内存空间长度,此处不再赘述。S405-S409: Similar to steps S307-S311 in the embodiment shown in FIG. 3, all actions of the processor 201 are executed by the processor 203, wherein step S408 is obtained according to the compression instruction issued by the user or the outside world, or when the compression is started by itself parameters to obtain the second starting address, the length of the first memory space, and the length of the second memory space, which will not be repeated here.
3、压缩装置不在存储装置内部。3. The compression device is not inside the storage device.
接下来,结合图3,对本申请另一实施例提供的数据压缩方法进行说明,该方法应用于图2所示的存储设备200中,本实施例中处理器201位于存储设备中,处理器203位于压缩设备中,处理器203通过物理接口与存储设备耦合。如图3所示,具体步骤与图3所示上一实施例相似,具体此处不再赘述。Next, with reference to FIG. 3 , a data compression method provided by another embodiment of the present application will be described. The method is applied to the storage device 200 shown in FIG. 2 . In this embodiment, the processor 201 is located in the storage device, and the processor 203 is located in the storage device. Located in the compression device, the processor 203 is coupled to the storage device through a physical interface. As shown in FIG. 3 , the specific steps are similar to the previous embodiment shown in FIG. 3 , and details are not repeated here.
图5是对图3所示方法的另一流程示意图,该图清楚地展现了待压缩数据、处理后数据和连续待压缩数据的数据组成,压缩装置对待压缩数据的处理过程如下:Fig. 5 is another schematic flow chart of the method shown in Fig. 3, which clearly shows the data composition of the data to be compressed, the processed data and the continuous data to be compressed, and the processing process of the data to be compressed by the compression device is as follows:
S501、读取正文数据,不读取第一DIF字段,得到连续待压缩数据;S501, reading the text data, without reading the first DIF field, to obtain continuous data to be compressed;
该步骤与图3实施例的步骤S305至步骤S307相同,此处不再赘述。This step is the same as step S305 to step S307 in the embodiment of FIG. 3 , and details are not repeated here.
S502、压缩连续待压缩数据,得到压缩后数据:S502, compress the continuous data to be compressed, and obtain the compressed data:
该步骤与图3实施例的步骤S308相同,此处不再赘述。This step is the same as step S308 in the embodiment of FIG. 3 , and details are not repeated here.
S503、划分第一内存空间和第二内存空间,将压缩后数据拷贝至第一内存空间,为第二DIF字段预留第二内存空间:S503: Divide the first memory space and the second memory space, copy the compressed data to the first memory space, and reserve the second memory space for the second DIF field:
该步骤与图3实施例的步骤S309至步骤S310相同,此处不再赘述。This step is the same as step S309 to step S310 in the embodiment of FIG. 3 , and details are not repeated here.
下面对本申请实施例中压缩装置进行描述。The compression device in the embodiment of the present application will be described below.
四、压缩装置的结构。Fourth, the structure of the compression device.
请参阅图6,本申请实施例中,压缩装置另一结构包括:Referring to FIG. 6, in the embodiment of the present application, another structure of the compression device includes:
第一划分单元601,用于将待压缩数据划分为至少两个数据块,所述数据块包括第一部分数据和第二部分数据;a first dividing unit 601, configured to divide the data to be compressed into at least two data blocks, the data blocks including a first part of data and a second part of data;
压缩单元602,用于对所述第一部分数据进行压缩,忽略所述第二部分数据,得到压缩后数据。The compressing unit 602 is configured to compress the first part of the data, ignore the second part of the data, and obtain compressed data.
第二划分单元603,用于将处理后内存空间划分为至少两个内存空间块,所述内存空间块包括第一内存空间和第二内存空间;A second dividing unit 603, configured to divide the processed memory space into at least two memory space blocks, where the memory space blocks include a first memory space and a second memory space;
写入单元604,用于将所述压缩后数据写入所述第一内存空间,忽略所述第二内存空间,得到处理后数据;a writing unit 604, configured to write the compressed data into the first memory space, ignore the second memory space, and obtain processed data;
第一存储单元605,用于存储所述待压缩数据。The first storage unit 605 is configured to store the data to be compressed.
本实施例中,第一划分单元601可以包括第一获取子单元6011,第一划分子单元6012。In this embodiment, the first dividing unit 601 may include a first obtaining subunit 6011 and a first dividing subunit 6012 .
第一获取子单元6011具体用于获取第一起始地址、第一数据长度和第二数据长度,所述第一起始地址表示所述待压缩数据的起始地址,所述第一数据长度表示所述第一部分数据的大小,所述第二数据长度表示所述第二部分数据的大小;The first obtaining subunit 6011 is specifically configured to obtain a first starting address, a first data length, and a second data length, where the first starting address indicates the starting address of the data to be compressed, and the first data length indicates the the size of the first part of the data, the second data length represents the size of the second part of the data;
第一划分子单元6012具体用于根据所述第一起始地址、所述第一数据长度和所述第二数据长度,将所述待压缩数据划分为至少两个数据块。The first dividing subunit 6012 is specifically configured to divide the data to be compressed into at least two data blocks according to the first starting address, the first data length and the second data length.
本实施例中,第一获取子单元6011可以包括第一获取模块60111。In this embodiment, the first obtaining subunit 6011 may include a first obtaining module 60111.
第一获取模块60111具体用于根据所述待压缩数据的第一描述信息得到所述第一起始地址、所述第一数据长度和所述第二数据长度。The first obtaining module 60111 is specifically configured to obtain the first start address, the first data length and the second data length according to the first description information of the data to be compressed.
本实施例中,第二划分单元603可以包括第二获取子单元6031,第二划分子单元6032。In this embodiment, the second dividing unit 603 may include a second acquiring subunit 6031 and a second dividing subunit 6032 .
第二获取子单元6031具体用于获取第二起始地址、第一内存空间长度和第二内存空间长度,所述第二起始地址表示所述处理后内存空间的起始地址,所述第一内存空间长度表示所述第一内存空间的大小,所述第二内存空间长度表示所述第二内存空间的大小;The second obtaining subunit 6031 is specifically configured to obtain a second starting address, a first memory space length and a second memory space length, where the second starting address represents the starting address of the processed memory space, and the first A memory space length represents the size of the first memory space, and the second memory space length represents the size of the second memory space;
第二划分子单元6032具体用于根据所述第二起始地址、所述第一内存空间长度和所述第二内存空间长度,将所述处理后内存空间划分为至少两个内存空间块。The second dividing subunit 6032 is specifically configured to divide the processed memory space into at least two memory space blocks according to the second starting address, the first memory space length and the second memory space length.
本实施例中,第二获取子单元6031可以包括第二获取模块60311。In this embodiment, the second obtaining subunit 6031 may include a second obtaining module 60311 .
第二获取模块60311具体用于根据所述处理后数据的第二描述信息得到所述第二起始地址、所述第一内存空间长度和所述第二内存空间长度。The second obtaining module 60311 is specifically configured to obtain the second starting address, the first memory space length and the second memory space length according to the second description information of the processed data.
本实施例中,压缩装置可以执行前述图3至图5所示实施例中压缩装置所执行的操作,具体此处不再赘述。In this embodiment, the compression apparatus may perform the operations performed by the compression apparatus in the foregoing embodiments shown in FIG. 3 to FIG. 5 , and details are not described herein again.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system, device and unit described above may refer to the corresponding process in the foregoing method embodiments, which will not be repeated here.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,read-only memory)、随机存取存储器(RAM,random access memory)、磁碟或者光盘等各种可以存储程序代码的介质。The integrated unit, if implemented in the form of a software functional unit and sold or used as an independent product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the present application can be embodied in the form of software products in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, and the computer software products are stored in a storage medium , including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, read-only memory), random access memory (RAM, random access memory), magnetic disk or optical disk and other media that can store program codes .

Claims (27)

  1. 一种数据压缩方法,其特征在于,所述方法应用于压缩装置,所述方法包括:A data compression method, wherein the method is applied to a compression device, and the method includes:
    获取待压缩数据;Get the data to be compressed;
    将所述待压缩数据划分为至少两个数据块,所述数据块包括第一部分数据和第二部分数据,所述第二部分数据为所述第一部分数据的关联数据;Dividing the data to be compressed into at least two data blocks, the data blocks include a first part of data and a second part of data, and the second part of data is associated data of the first part of data;
    对所述第一部分数据进行压缩,不对所述第二部分数据进行压缩,得到压缩后数据。The first part of the data is compressed, and the second part of the data is not compressed to obtain compressed data.
  2. 根据权利要求1所述的方法,其特征在于,所述将所述待压缩数据划分为至少两个数据块,包括:The method according to claim 1, wherein the dividing the data to be compressed into at least two data blocks comprises:
    获取第一起始地址、第一数据长度和第二数据长度,所述第一起始地址表示所述待压缩数据的起始地址,所述第一数据长度表示所述第一部分数据的大小,所述第二数据长度表示所述第二部分数据的大小;Obtain a first start address, a first data length, and a second data length, where the first start address represents the start address of the data to be compressed, the first data length represents the size of the first part of the data, and the The second data length represents the size of the second part of the data;
    根据所述第一起始地址、所述第一数据长度和所述第二数据长度,将所述待压缩数据划分为至少两个数据块。The data to be compressed is divided into at least two data blocks according to the first starting address, the first data length and the second data length.
  3. 根据权利要求2所述的方法,其特征在于,所述获取第一起始地址、第一数据长度和第二数据长度,包括:The method according to claim 2, wherein the acquiring the first starting address, the first data length and the second data length comprises:
    根据所述待压缩数据的第一描述信息得到所述第一起始地址、所述第一数据长度和所述第二数据长度。The first start address, the first data length and the second data length are obtained according to the first description information of the data to be compressed.
  4. 根据权利要求3所述的方法,其特征在于,所述压缩装置与存储设备耦合,所述存储设备中存储所述待压缩数据和所述第一描述信息,所述根据所述待压缩数据的第一描述信息得到所述第一起始地址、所述第一数据长度和所述第二数据长度,包括:The method according to claim 3, wherein the compressing device is coupled to a storage device, and the storage device stores the data to be compressed and the first description information, and the data to be compressed and the first description information are stored in the storage device. The first description information obtains the first start address, the first data length and the second data length, including:
    所述压缩装置从所述存储设备中调用所述第一描述信息,根据所述第一描述信息得到所述第一起始地址、所述第一数据长度和所述第二数据长度。The compressing apparatus calls the first description information from the storage device, and obtains the first starting address, the first data length and the second data length according to the first description information.
  5. 根据权利要求1至4中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 4, wherein the method further comprises:
    将处理后内存空间划分为至少两个内存空间块,所述内存空间块包括第一内存空间和第二内存空间;dividing the processed memory space into at least two memory space blocks, the memory space blocks including a first memory space and a second memory space;
    将所述压缩后数据写入所述第一内存空间,跳过所述第二内存空间,得到处理后数据。Write the compressed data into the first memory space, skip the second memory space, and obtain processed data.
  6. 根据权利要求5所述的方法,其特征在于,所述将处理后内存空间划分为至少两个内存空间块,包括:The method according to claim 5, wherein the dividing the processed memory space into at least two memory space blocks comprises:
    获取第二起始地址、第一内存空间长度和第二内存空间长度,所述第二起始地址表示所述处理后数据的起始地址,所述第一内存空间长度表示所述第一内存空间的大小,所述第二内存空间长度表示所述第二内存空间的大小;Obtain a second starting address, a first memory space length, and a second memory space length, where the second starting address represents the starting address of the processed data, and the first memory space length represents the first memory The size of the space, the length of the second memory space represents the size of the second memory space;
    根据所述第二起始地址、所述第一内存空间长度和所述第二内存空间长度,将所述处理后内存空间划分为至少两个内存空间块。The processed memory space is divided into at least two memory space blocks according to the second starting address, the first memory space length and the second memory space length.
  7. 根据权利要求6所述的方法,其特征在于,所述获取第二起始地址、第一内存空间长度和第二内存空间长度,包括:The method according to claim 6, wherein the acquiring the second starting address, the first memory space length and the second memory space length comprises:
    根据所述处理后数据的第二描述信息得到所述第二起始地址、所述第一内存空间长度 和所述第二内存空间长度。The second starting address, the first memory space length and the second memory space length are obtained according to the second description information of the processed data.
  8. 根据权利要求7所述的方法,其特征在于,所述压缩装置与存储设备耦合,所述存储设备中存储所述待压缩数据和所述第二描述信息,所述根据所述处理后数据的第二描述信息得到所述第二起始地址、所述第一内存空间长度和所述第二内存空间长度,包括:The method according to claim 7, wherein the compressing device is coupled to a storage device, and the storage device stores the data to be compressed and the second description information, and the data to be compressed and the second description information are stored in the storage device. The second description information obtains the second starting address, the first memory space length and the second memory space length, including:
    所述压缩装置从所述存储设备中调用所述第二描述信息,根据所述第二描述信息得到所述第二起始地址、所述第一内存空间长度和所述第二内存空间长度。The compression apparatus calls the second description information from the storage device, and obtains the second starting address, the first memory space length and the second memory space length according to the second description information.
  9. 一种压缩装置,其特征在于,所述压缩装置包括一个或多个处理器、存储器、输入输出设备以及总线,其中,所述一个或多个处理器用于,A compression device, characterized in that the compression device includes one or more processors, a memory, an input and output device, and a bus, wherein the one or more processors are used to:
    将待压缩数据划分为至少两个数据块,所述数据块包括第一部分数据和第二部分数据,所述第二部分数据为所述第一部分数据的关联数据;Dividing the data to be compressed into at least two data blocks, the data blocks include a first part of data and a second part of data, and the second part of data is associated data of the first part of data;
    对所述第一部分数据进行压缩,不对所述第二部分数据进行压缩,得到压缩后数据。The first part of the data is compressed, and the second part of the data is not compressed to obtain compressed data.
  10. 根据权利要求9所述的压缩装置,其特征在于,所述一个或多个处理器用于,The compression apparatus of claim 9, wherein the one or more processors are configured to:
    获取第一起始地址、第一数据长度和第二数据长度,所述第一起始地址表示所述待压缩数据的起始地址,所述第一数据长度表示所述第一部分数据的大小,所述第二数据长度表示所述第二部分数据的大小;Obtain a first start address, a first data length, and a second data length, where the first start address represents the start address of the data to be compressed, the first data length represents the size of the first part of the data, and the The second data length represents the size of the second part of the data;
    根据所述第一起始地址、所述第一数据长度和所述第二数据长度,将所述待压缩数据划分为至少两个数据块。The data to be compressed is divided into at least two data blocks according to the first starting address, the first data length and the second data length.
  11. 根据权利要求10所述的压缩装置,其特征在于,所述一个或多个处理器用于,11. The compression apparatus of claim 10, wherein the one or more processors are configured to:
    根据所述待压缩数据的第一描述信息得到所述第一起始地址、所述第一数据长度和所述第二数据长度。The first start address, the first data length and the second data length are obtained according to the first description information of the data to be compressed.
  12. 根据权利要求9所述的压缩装置,其特征在于,所述一个或多个处理器用于,The compression apparatus of claim 9, wherein the one or more processors are configured to:
    将处理后内存空间划分为至少两个内存空间块,所述内存空间块包括第一内存空间和第二内存空间;dividing the processed memory space into at least two memory space blocks, the memory space blocks including a first memory space and a second memory space;
    将所述压缩后数据写入所述第一内存空间,忽略所述第二内存空间,得到处理后数据。Write the compressed data into the first memory space, ignore the second memory space, and obtain processed data.
  13. 根据权利要求12所述的压缩装置,其特征在于,所述一个或多个处理器用于,13. The compression apparatus of claim 12, wherein the one or more processors are configured to:
    获取第二起始地址、第一内存空间长度和第二内存空间长度,所述第二起始地址表示所述处理后内存空间的起始地址,所述第一内存空间长度表示所述第一内存空间的大小,所述第二内存空间长度表示所述第二内存空间的大小;Obtain a second starting address, a first memory space length, and a second memory space length, where the second starting address represents the starting address of the processed memory space, and the first memory space length represents the first The size of the memory space, the length of the second memory space represents the size of the second memory space;
    根据所述第二起始地址、所述第一内存空间长度和所述第二内存空间长度,将所述处理后内存空间划分为至少两个内存空间块。The processed memory space is divided into at least two memory space blocks according to the second starting address, the first memory space length and the second memory space length.
  14. 根据权利要求13所述的压缩装置,其特征在于,所述一个或多个处理器用于,14. The compression apparatus of claim 13, wherein the one or more processors are configured to:
    根据所述处理后数据的第二描述信息得到所述第二起始地址、所述第一内存空间长度和所述第二内存空间长度。The second start address, the first memory space length and the second memory space length are obtained according to the second description information of the processed data.
  15. 根据权利要求9至14中任一项所述的压缩装置,其特征在于,所述存储器存储所述待压缩数据。The compression apparatus according to any one of claims 9 to 14, wherein the memory stores the data to be compressed.
  16. 根据权利要求9至14中任一项所述的压缩装置,其特征在于,所述压缩装置位于存储设备中,所述存储设备存储所述待压缩数据。The compression apparatus according to any one of claims 9 to 14, wherein the compression apparatus is located in a storage device, and the storage device stores the data to be compressed.
  17. 根据权利要求9至14中任一项所述的压缩装置,其特征在于,所述压缩装置与 存储设备耦合,所述存储设备存储所述待压缩数据。The compression apparatus according to any one of claims 9 to 14, wherein the compression apparatus is coupled with a storage device, and the storage device stores the data to be compressed.
  18. 一种压缩装置,其特征在于,所述压缩装置包括:A compression device, characterized in that the compression device comprises:
    第一划分单元,用于将待压缩数据划分为至少两个数据块,所述数据块包括第一部分数据和第二部分数据,所述第二部分数据为所述第一部分数据的关联数据;a first dividing unit, configured to divide the data to be compressed into at least two data blocks, where the data blocks include a first part of data and a second part of data, and the second part of data is associated data of the first part of data;
    压缩单元,用于对所述第一部分数据进行压缩,忽略所述第二部分数据,得到压缩后数据。A compression unit, configured to compress the first part of data, ignore the second part of data, and obtain compressed data.
  19. 根据权利要求18所述的压缩装置,其特征在于,所述第一划分单元包括:The compression apparatus according to claim 18, wherein the first dividing unit comprises:
    第一获取子单元,用于获取第一起始地址、第一数据长度和第二数据长度,所述第一起始地址表示所述待压缩数据的起始地址,所述第一数据长度表示所述第一部分数据的大小,所述第二数据长度表示所述第二部分数据的大小;a first obtaining subunit, configured to obtain a first starting address, a first data length and a second data length, where the first starting address represents the starting address of the data to be compressed, and the first data length represents the The size of the first part of the data, the second data length represents the size of the second part of the data;
    第一划分子单元,用于根据所述第一起始地址、所述第一数据长度和所述第二数据长度,将所述待压缩数据划分为至少两个数据块。A first dividing subunit, configured to divide the data to be compressed into at least two data blocks according to the first starting address, the first data length and the second data length.
  20. 根据权利要求19所述的压缩装置,其特征在于,所述第一获取子单元包括:The compression apparatus according to claim 19, wherein the first obtaining subunit comprises:
    第一获取模块,用于根据所述待压缩数据的第一描述信息得到所述第一起始地址、所述第一数据长度和所述第二数据长度。A first obtaining module, configured to obtain the first start address, the first data length and the second data length according to the first description information of the data to be compressed.
  21. 根据权利要求18所述的压缩装置,其特征在于,所述压缩装置包括:The compression device of claim 18, wherein the compression device comprises:
    第二划分单元,用于将处理后内存空间划分为至少两个内存空间块,所述内存空间块包括第一内存空间和第二内存空间;a second dividing unit, configured to divide the processed memory space into at least two memory space blocks, where the memory space blocks include a first memory space and a second memory space;
    写入单元,用于将所述压缩后数据写入所述第一内存空间,忽略所述第二内存空间,得到处理后数据。A writing unit, configured to write the compressed data into the first memory space, ignore the second memory space, and obtain processed data.
  22. 根据权利要求21所述的压缩装置,其特征在于,所述第二划分单元包括:The compression apparatus according to claim 21, wherein the second dividing unit comprises:
    第二获取子单元,用于获取第二起始地址、第一内存空间长度和第二内存空间长度,所述第二起始地址表示所述处理后内存空间的起始地址,所述第一内存空间长度表示所述第一内存空间的大小,所述第二内存空间长度表示所述第二内存空间的大小;The second obtaining subunit is configured to obtain a second starting address, a first memory space length and a second memory space length, where the second starting address represents the starting address of the processed memory space, and the first The memory space length represents the size of the first memory space, and the second memory space length represents the size of the second memory space;
    第二划分子单元,用于根据所述第二起始地址、所述第一内存空间长度和所述第二内存空间长度,将所述处理后内存空间划分为至少两个内存空间块。The second dividing subunit is configured to divide the processed memory space into at least two memory space blocks according to the second starting address, the first memory space length and the second memory space length.
  23. 根据权利要求22所述的压缩装置,其特征在于,所述第二获取子单元包括:The compression apparatus according to claim 22, wherein the second obtaining subunit comprises:
    第二获取模块,用于根据所述处理后数据的第二描述信息得到所述第二起始地址、所述第一内存空间长度和所述第二内存空间长度。A second obtaining module, configured to obtain the second starting address, the first memory space length and the second memory space length according to the second description information of the processed data.
  24. 根据权利要求18至23中任一项所述的压缩装置,其特征在于,所述压缩装置包括:The compression device according to any one of claims 18 to 23, wherein the compression device comprises:
    第一存储单元,用于存储所述待压缩数据。The first storage unit is used to store the data to be compressed.
  25. 根据权利要求18至23中任一项所述的压缩装置,其特征在于,所述压缩装置位于存储设备中,所述存储设备存储所述待压缩数据。The compression apparatus according to any one of claims 18 to 23, wherein the compression apparatus is located in a storage device, and the storage device stores the data to be compressed.
  26. 根据权利要求18至23中任一项所述的压缩装置,其特征在于,所述压缩装置与存储设备耦合,所述存储设备存储所述待压缩数据。The compression apparatus according to any one of claims 18 to 23, wherein the compression apparatus is coupled with a storage device, and the storage device stores the data to be compressed.
  27. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中保存有程序,当所述计算机执行所述程序时,执行如权利要求1至8中任一项所述的方法。A computer-readable storage medium, wherein a program is stored in the computer-readable storage medium, and when the computer executes the program, the method according to any one of claims 1 to 8 is executed.
PCT/CN2021/097764 2020-08-31 2021-06-01 Data compression method and compression apparatus WO2022041906A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010897258.1A CN114124103A (en) 2020-08-31 2020-08-31 Data compression method and compression device
CN202010897258.1 2020-08-31

Publications (1)

Publication Number Publication Date
WO2022041906A1 true WO2022041906A1 (en) 2022-03-03

Family

ID=80352556

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/097764 WO2022041906A1 (en) 2020-08-31 2021-06-01 Data compression method and compression apparatus

Country Status (2)

Country Link
CN (1) CN114124103A (en)
WO (1) WO2022041906A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030012275A1 (en) * 2001-06-25 2003-01-16 International Business Machines Corporation Multiple parallel encoders and statistical analysis thereof for encoding a video sequence
CN101088084A (en) * 2003-12-29 2007-12-12 文丘里无线公司 Reusable compressed objects
CN101957836A (en) * 2010-09-03 2011-01-26 清华大学 Configurable real-time transparent compressing method in file system
CN111384961A (en) * 2018-12-28 2020-07-07 上海寒武纪信息科技有限公司 Data compression/decompression device and data compression method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030012275A1 (en) * 2001-06-25 2003-01-16 International Business Machines Corporation Multiple parallel encoders and statistical analysis thereof for encoding a video sequence
CN101088084A (en) * 2003-12-29 2007-12-12 文丘里无线公司 Reusable compressed objects
CN101957836A (en) * 2010-09-03 2011-01-26 清华大学 Configurable real-time transparent compressing method in file system
CN111384961A (en) * 2018-12-28 2020-07-07 上海寒武纪信息科技有限公司 Data compression/decompression device and data compression method

Also Published As

Publication number Publication date
CN114124103A (en) 2022-03-01

Similar Documents

Publication Publication Date Title
CN109918018B (en) Data storage method and storage equipment
CN111813713B (en) Data acceleration operation processing method and device and computer readable storage medium
CN106648955B (en) Compression method and related device
CN111913659B (en) Block data processing method, device and system and storage medium
TW201034468A (en) Video compression circuit and method thereof
CN108615151A (en) Data processing method, block chain server and node device
CN116662038B (en) Industrial information detection method, device, equipment and medium based on shared memory
CN115168259B (en) Data access method, device, equipment and computer readable storage medium
CN115964319A (en) Data processing method for remote direct memory access and related product
EP4322003A1 (en) Data transmission method, data processing method, and related product
CN115470156A (en) RDMA-based memory use method, system, electronic device and storage medium
WO2022041906A1 (en) Data compression method and compression apparatus
CN110515872B (en) Direct memory access method, device, special computing chip and heterogeneous computing system
CN109213745B (en) Distributed file storage method, device, processor and storage medium
US11604753B2 (en) Inter device data exchange via external bus by utilizing communication port
CN117539807A (en) Data transmission method, related equipment and storage medium
CN112068965A (en) Data processing method and device, electronic equipment and readable storage medium
CN112817526B (en) Data storage method, device and medium
CN108874994A (en) A kind of piecemeal reads the method, apparatus and computer storage medium of data
JP3604795B2 (en) Print control device and print control method
WO2021237513A1 (en) Data compression storage system and method, processor, and computer storage medium
CN114238250A (en) Program file compression method and device and electronic equipment
CN115880416A (en) Three-dimensional model display method and device, server and storage medium
WO2024082695A1 (en) Batching method and apparatus for draw instructions
WO2024066753A1 (en) Data compression method and related apparatus

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21859750

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21859750

Country of ref document: EP

Kind code of ref document: A1