WO2022198483A1 - 数据压缩方法、装置、可移动平台及存储介质 - Google Patents

数据压缩方法、装置、可移动平台及存储介质 Download PDF

Info

Publication number
WO2022198483A1
WO2022198483A1 PCT/CN2021/082630 CN2021082630W WO2022198483A1 WO 2022198483 A1 WO2022198483 A1 WO 2022198483A1 CN 2021082630 W CN2021082630 W CN 2021082630W WO 2022198483 A1 WO2022198483 A1 WO 2022198483A1
Authority
WO
WIPO (PCT)
Prior art keywords
encoded
data
data block
encoding
dictionary
Prior art date
Application number
PCT/CN2021/082630
Other languages
English (en)
French (fr)
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 深圳市大疆创新科技有限公司
Priority to PCT/CN2021/082630 priority Critical patent/WO2022198483A1/zh
Publication of WO2022198483A1 publication Critical patent/WO2022198483A1/zh

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

Definitions

  • the present application relates to the technical field of data compression, and in particular, to a data compression method, device, removable platform and storage medium.
  • Data compression refers to reducing the amount of data to reduce storage space and improving its transmission, storage and processing efficiency without losing useful information, or to reorganize data according to certain algorithms to reduce data redundancy and storage space. a technical method.
  • one of the objectives of the present application is to provide a data compression method, device, removable platform and storage medium.
  • an embodiment of the present application provides a data compression method, including:
  • the context data is used to indicate that the data block belongs to the same file to be compressed as the data block. Status information of compressed data during the compression process;
  • the data block is compressed according to the context data of the data block to generate an encoded code stream; wherein the data block and the data block subjected to the last compression process belong to different files to be compressed.
  • an embodiment of the present application provides a data compression device, including: a data reading module and a compression module;
  • the data reading module is used to read the data block of one of the multiple files to be compressed, and to read the context data of the data block;
  • the compression module is configured to compress the data block according to the context data of the data block, and generate an encoded code stream; wherein, the data block and the data block that was compressed last time belong to different file to be compressed.
  • an embodiment of the present application provides a movable platform, including:
  • a power system arranged in the body, for providing power for the movable platform
  • embodiments of the present application provide a computer-readable storage medium on which computer instructions are stored, and when the instructions are executed by a processor, implement the method described in the first aspect.
  • the data compression method provided by the embodiment of the present application can realize the data blocks of multiple files to be interspersed and compressed; in each compression process, the data blocks of one to-be-compressed file among the multiple to-be-compressed files are obtained. , and obtain the context data of the data block; the context data is used to indicate the state information of the compressed data belonging to the same file to be compressed as the data block in the compression process; according to the data block
  • the context data compresses the data blocks to generate an encoded code stream.
  • the data blocks subjected to compression processing this time and the data blocks subjected to compression processing last time may belong to different files to be compressed, so that the data blocks of multiple files are interspersed and compressed to ensure that multiple files are can be compressed in time; further, in the embodiment of the present application, the data blocks are connected in series with the compressed data of the same to-be-compressed file through context data, so as to ensure that the state between the data blocks of the same to-be-compressed file is continuous , so that the final compression result is consistent with the result of complete compression of a single file.
  • FIG. 1 is a schematic diagram of a compression process of a file in the related art provided by the present application.
  • FIG. 2 is a schematic diagram of data block interleaving compression of different files provided by an embodiment of the present application
  • FIG. 3 and 4 are schematic flow diagrams of different data compression methods provided by an embodiment of the present application.
  • FIG. 5 is a schematic diagram of a data block notification encoding position provided by an embodiment of the present application.
  • FIG. 6 is a schematic diagram of dictionary encoding provided by an embodiment of the present application.
  • FIG. 7 is a schematic diagram of a basic matching process in dictionary encoding provided by an embodiment of the present application.
  • 8A and 8B are different schematic diagrams of a repeated matching process in dictionary encoding provided by an embodiment of the present application.
  • FIG. 9 is a schematic diagram of storage of a hash chain provided by an embodiment of the present application.
  • FIG. 10A, FIG. 10B and FIG. 10C are different schematic diagrams of the dictionary position cycle number provided by an embodiment of the present application.
  • FIG. 11 is a schematic diagram of a circuit structure for encoding each bit in an interval encoding process provided by an embodiment of the present application;
  • 12 to 16 are schematic diagrams of different structures of a data compression apparatus provided by an embodiment of the present application.
  • FIG. 1 is a schematic diagram of a compression process in the related art.
  • a data compression apparatus compresses file A before compressing file B.
  • other files may be adversely affected because they are not compressed in time.
  • each component on the movable platform will continuously generate log information.
  • log information needs to be compressed in time. If the log information of one component is compressed and then the other is compressed, it may cause other components. Since the generated log information is not compressed in time, it occupies too much storage space and affects the normal operation of each component.
  • the embodiment of the present application provides a data compression method, which can realize the data block interleaving of multiple files for compression; in each compression process, obtain one of the multiple files to be compressed. the data block of the file to be compressed, and obtain the context data of the data block; the context data is used to indicate the state information of the compressed data belonging to the same file to be compressed as the data block during the compression process; The data block is compressed according to the context data of the data block to generate an encoded code stream.
  • the data blocks subjected to compression processing this time and the data blocks subjected to compression processing last time may belong to different files to be compressed, so that the data blocks of multiple files are interspersed and compressed to ensure that multiple files are can be compressed in time; further, in the embodiment of the present application, the data blocks are connected in series with the compressed data of the same to-be-compressed file through context data, so as to ensure that the state between the data blocks of the same to-be-compressed file is continuous , so that the final compression result is consistent with the result of complete compression of a single file.
  • the data compression method can be applied to a data compression apparatus.
  • the data compression device may be a computer chip or an integrated circuit with data processing capability, such as a central processing unit (Central Processing Unit, CPU), a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit Circuit (Application Specific Integrated Circuit, ASIC) or off-the-shelf Programmable Gate Array (Field-Programmable Gate Array, FPGA) etc.; wherein, the data compression device can be installed in a mobile platform, a terminal device or a computing device such as a server.
  • a central processing unit Central Processing Unit, CPU
  • DSP Digital Signal Processor
  • ASIC Application Specific Integrated Circuit
  • FPGA Field-Programmable Gate Array
  • the data compression apparatus may also be a device with data processing capability, such as a mobile platform, a terminal device, or a computing device such as a server.
  • a device with data processing capability such as a mobile platform, a terminal device, or a computing device such as a server.
  • the movable platform include, but are not limited to, unmanned aerial vehicles, unmanned vehicles, pan-tilts, unmanned ships, or mobile robots.
  • terminal devices include, but are not limited to: smartphones/mobile phones, tablet computers, personal digital assistants (PDAs), laptop computers, desktop computers, media content players, video game stations/systems, virtual reality systems, augmented reality Systems, wearable devices (eg, watches, glasses, gloves, headwear (eg, hats, helmets, virtual reality headsets, augmented reality headsets, head mounted devices (HMDs), headbands), pendants, armbands , leg loops, shoes, vest), remote control, or any other type of device.
  • PDAs personal digital assistants
  • laptop computers desktop computers
  • media content players e.g, video game stations/systems
  • virtual reality systems augmented reality Systems
  • wearable devices eg, watches, glasses, gloves, headwear (eg, hats, helmets, virtual reality headsets, augmented reality headsets, head mounted devices (HMDs), headbands), pendants, armbands , leg loops, shoes, vest), remote control, or any other type of device.
  • HMDs head mounted devices
  • the data compression apparatus is installed on an unmanned aerial vehicle as a computer chip or an integrated circuit, or the data unmanned aerial vehicle includes the data compression apparatus.
  • the unmanned aerial vehicle also includes other components, such as flight controllers, navigation components (such as GNSS modules), perception components (such as cameras, binocular vision sensors, etc.), and gimbal, etc.; during the flight of the unmanned aerial vehicle,
  • the flight controllers, navigation components (such as GNSS modules), sensing components (such as cameras, binocular vision sensors, etc.), and gimbal and other components on the UAV will continuously generate log information, and these data need to be compressed in time.
  • the data compression device provided in the embodiment of the present application can be used to compress multiple files to be compressed interspersed, that is, the data blocks that are compressed each time and the data blocks that are compressed last time may belong to Different files to be compressed ensure that the log information continuously generated by multiple components can be compressed in time.
  • FIG. 2 is a schematic diagram of data block interleaving compression of different files provided by an embodiment of the present application, and FIG.
  • the file A to be compressed includes a data block a1 and a data block a2
  • the to-be-compressed file B includes a data block b1 and a data block b2
  • the data compression device sequentially compresses the data block a1, the data block b1, the data block a2 and the data block b2 to generate a corresponding encoding code stream and output; in the process of compressing the data block, it is necessary to read the context data corresponding to each data block, and the context data is used to indicate that the compressed data belonging to the same to-be-compressed file as the data block is in the The state information in the compression process, the data block is compressed based on the context data corresponding to each data block, and the state between the data blocks of the same to-be-compressed file is ensured through the context data corresponding to each data block.
  • the context data of different data blocks is different. After generating the encoded code stream corresponding to the data block, it is necessary to acquire and store the state information of the data block during the compression process, so as to be used as the same data block to be compressed.
  • the context data of the next data block of the file is used to assist the compression process of the next data block.
  • FIG. 3 is a schematic flowchart of a data compression method provided by the embodiment of the present application.
  • the method may be executed by a data compression device. Methods include:
  • step S101 a data block of one of the multiple files to be compressed is obtained, and context data of the data block is obtained; the context data is used to indicate that the data block belongs to the same data block Status information of the compressed data of the file to be compressed during the compression process.
  • step S102 the data block is compressed according to the context data of the data block to generate an encoded code stream; wherein, the data block and the last compressed data block belong to different to-be Compressed file.
  • the multiple files to be compressed may be data streams whose data volume is increasing continuously;
  • the file to be compressed may be a file with a fixed amount of data.
  • a part of the multiple files to be compressed may be a data stream whose data volume is continuously increasing, and another part may be a file with a fixed data volume, which is not limited in this embodiment.
  • the generated data of the preset data volume may be configured as the to-be-compressed file.
  • One data block of the file is compressed, and block parameters corresponding to the data block are generated.
  • the to-be-compressed file is a file with a fixed amount of data
  • the to-be-compressed file can be divided, the data of each preset data amount is configured as one data block of the to-be-compressed file, and the data segment is generated.
  • the block parameter corresponding to the block; wherein, the specific value of the preset data amount may be specifically set according to the actual application scenario, for example, may be determined according to the processing capability of the data compression device.
  • the data block includes but is not limited to the attribute, data amount, compression parameter, storage address, storage address of context data, and storage address of the encoded code stream of the data block, etc.
  • the attribute of the data block is used to indicate the approximate position of the data block in the to-be-compressed file, for example, the attribute of the data block includes ⁇ first block, middle block, last block piece ⁇ .
  • the compression parameter may be the parameter of the compression algorithm used by the data compression apparatus.
  • the data compression apparatus uses the LZMA algorithm to compress
  • the compression parameter may include but is not limited to the dictionary size and the maximum search depth of the hash chain. , stop matching length, etc.
  • the storage addresses of the context data of different data blocks of the same file to be compressed are the same, which also facilitates the access process of the context data.
  • the data compression device needs to read the context data of the data block, and after generating the encoded code stream of the data block, the data compression device needs to divide the data into blocks.
  • the state information during the compression process is stored as the context data of the next data block of the to-be-compressed file, and the addresses read and stored by the data compression device are the same.
  • the storage addresses of the encoded code streams of different data blocks of the same file to be compressed are continuous, so that the compression results obtained after the interleaved compression of the data blocks of different files to be compressed are completely compressed with a single file The results are consistent, so as to ensure the normal progress of the subsequent decoding process.
  • the data compression device can directly The first data block is compressed, and the state information of the first data block during the compression process is stored as context data of the next data block of the to-be-compressed file.
  • the data compression apparatus performs compression processing on the last data block according to the context data of the last data block After that, since all the data in the to-be-compressed file has been compressed, there is no need to record the state information of the last data block during the compression process.
  • FIG. 4 is a schematic flowchart of another data compression method provided by an embodiment of the present application.
  • the method may be composed of A data compression device is performed, and the method includes:
  • step S201 a data block of one to-be-compressed file among the multiple to-be-compressed files is acquired.
  • step S202 it is determined whether the data block is the first data block of the to-be-compressed file. If yes, go to step S204; if not, go to step S203 and step S204.
  • step S203 the context data of the data block is acquired.
  • step S204 for the first data block, perform compression processing on the data block to generate an encoded code stream; for a non-first data block, compress the data block according to the context data of the data block Compression processing is performed to generate an encoded code stream.
  • step S205 it is determined whether the data block is the last data block of the to-be-compressed file. If yes, go to step S207; if not, go to step S206 and step S207.
  • step S206 the state information of the data block during the compression process is stored as the context data of the next data block of the to-be-compressed file.
  • step S207 it is determined whether all data blocks in the multiple files to be compressed have been compressed. If so, end. If not, step S201 is executed.
  • in order to further ensure the continuity of states between different data blocks of the same file to be compressed in the case that the data block is not the last data block of the file to be compressed, in During the process of compressing the data block, if the data amount of the remaining data to be encoded in the data block is not greater than the preset threshold, stop encoding the data block, and compress the remaining data block to be encoded.
  • the encoded data is stored as the context data of the next data block to encode the remaining data to be encoded in the compression process of the next data block, thereby further ensuring the continuity of the encoding process of different data blocks of the same to-be-compressed file .
  • the data to be encoded in the data block includes the remainder of the previous data block indicated by the context data.
  • the data to be encoded and its own data to be encoded are the data to be encoded and its own data to be encoded.
  • the preset threshold is 273 characters
  • the data block is not the last data block, after completing the encoding of a position, if the number of remaining characters to be encoded is less than or Equal to 273, it is necessary to stop encoding, save the remaining unencoded characters and the status information of the data block during the encoding process as context, and start encoding the remaining part in the next data block of the same to-be-compressed file to ensure the same
  • the different data blocks of the file are continuous.
  • the compression efficiency it is also beneficial to improve the compression efficiency by leaving the remaining data to be encoded in the data block for encoding in the compression process of the next data block.
  • the maximum length of the character string matched by the data compression device is 273, and the preset threshold can be determined according to the length of the character string that the data compression device can match.
  • the number of the remaining characters to be encoded in the block is less than or equal to 273, then stop encoding the data block, and store the remaining characters to be encoded as the context data of the next data block to be used in the compression of the next data block.
  • the length of the current string that can be matched is at most 50. If it is reserved for the next data block and then encoded, the original remaining 50 encodings Since the position of the character is connected with the next data block, the maximum length of the character string matched by the data compression device can be 273, which is beneficial to improve the compression efficiency.
  • an LZMA Lempel-Ziv-Markov chain-Algorithm
  • the data compression apparatus may Perform dictionary encoding on the characters to be encoded at the encoding position in the data block in turn to obtain the best matching result corresponding to the encoding position; then perform interval encoding on the best matching result corresponding to the encoding position to obtain the The encoded code stream of the data block.
  • LZMA Lempel-Ziv-Markov chain-Algorithm
  • the data compression apparatus may Perform dictionary encoding on the characters to be encoded at the encoding position in the data block in turn to obtain the best matching result corresponding to the encoding position; then perform interval encoding on the best matching result corresponding to the encoding position to obtain the The encoded code stream of the data block.
  • other encoding algorithms can also be used to compress the data blocks, and this embodiment does not do anything about it, for example, the LZ77 algorithm, the LZ78 algorithm, and the like can be used.
  • dictionary encoding uses the repeated structure information of data to realize data compression.
  • the encoded characters will be stored in the dictionary area, and the to-be-encoded characters in the to-be-encoded area will be compared with the encoded characters in the dictionary area to obtain a matching string, which can be expressed as (dist,len) , dist is the distance between the current character to be encoded and the first encoded character in the matched string, and len is the length of the matched string.
  • "abcde” can be represented by (15,5), so only (15,5) needs to be stored instead of the "abcde” character, thereby realizing compression.
  • the uncoded characters in the to-be-coded area are searched and compared with the coded characters in the dictionary area.
  • the basic matching method introduces a hash chain, and nodes with the same hash value are on the same hash chain, so that the position of the matched string in the dictionary can be located according to the hash node.
  • the hash chain consists of two arrays: the first array (set as hash array) and the second array (set as son array).
  • the hash array stores the first node of each hash chain, and the son array connects the first node with all nodes on the hash chain.
  • a third array (set as reps array) can be used to record the matching distance of the most recent n (such as 4) matching strings, They are reps0, reps1, reps2, and reps3 respectively.
  • reps array can be used to record the matching distance of the most recent n (such as 4) matching strings, They are reps0, reps1, reps2, and reps3 respectively.
  • ⁇ reps0, reps1, reps2, reps3 ⁇ ⁇ 1,1,1,1 ⁇ , that is is the default value.
  • the length of the repeated matching is 0.
  • the basic matching string obtained by encoding position 5 is (5,4)
  • the best matching result obtained by comparing the basic matching string and the repeated matching string is (5,4), which is updated according to the best matching result.
  • the context data of the data block at least includes a dictionary; the dictionary is used for Indicates the encoded characters belonging to the same file to be compressed as the data block; the data compression device can sequentially match the to-be-encoded characters at the encoding position in the data block according to the dictionary, and obtain the encoding position Corresponding base match string and repeat match string.
  • the context data of the data block further includes at least one hash chain, and the hash chain is used to locate the position in the dictionary of the character string matching at least one character to be encoded;
  • the data compression apparatus acquires at least one character to be encoded starting from the encoding position, and generates a first hash according to the at least one character to be encoded and then use the first hash value to find a matching hash chain, and obtain one or more basic strings corresponding to the encoding position according to the matching hash chain.
  • crc_byte1[1] d[7] ⁇ d[6] ⁇ d[1] ⁇ d[0];
  • crc_byte1[2] d[7] ⁇ d[6] ⁇ d[2] ⁇ d[1] ⁇ d[0] ⁇ 1;
  • crc_byte1[3] d[7] ⁇ d[3] ⁇ d[2] ⁇ d[1];
  • crc_byte1[4] d[6] ⁇ d[4] ⁇ d[3] ⁇ d[2] ⁇ d[0] ⁇ 1;
  • crc_byte1[5] d[7] ⁇ d[6] ⁇ d[5] ⁇ d[4] ⁇ d[3] ⁇ d[2] ⁇ d[1] ⁇ d[0] ⁇ 1;
  • crc_byte1[6] d[7] ⁇ d[6] ⁇ d[5] ⁇ d[4] ⁇ d[2] ⁇ d[1];
  • crc_byte1[7] d[7] ⁇ d[5] ⁇ d[3] ⁇ d[2] ⁇ d[1] ⁇ d[0] ⁇ 1;
  • crc_byte1[8] d[4] ⁇ d[3] ⁇ d[1] ⁇ d[0] ⁇ 1;
  • crc_byte1[9] d[5] ⁇ d[4] ⁇ d[2] ⁇ d[1] ⁇ 1;
  • crc_byte1[10] d[5] ⁇ d[3] ⁇ d[2] ⁇ d[0] ⁇ 1;
  • crc_byte1[11] d[4] ⁇ d[3] ⁇ d[1] ⁇ d[0] ⁇ 1.
  • the hash chain includes a first array (for example, referring to the hash array in FIG. 7 ) and a second array (for example, referring to the son data in FIG. 7 ); the first array is used to indicate each of the The first node of the hash chain, and the second array is used to indicate other nodes of the hash chain except the first node; wherein, each node is used to indicate that the at least one character to be encoded is matched.
  • the target position of the string in the dictionary The first array is cached in the first memory; the second array is cached in the second memory, and the storage modes of at least one hash chain in the first memory and the second memory are shown in FIG. 9 .
  • the value of each node of the hash chain represents the position information (such as the position number) of the target position of the character string matching the at least one character to be encoded in the dictionary , if the position code is larger, when the first memory and the second memory store the value of each node, the data bit width that needs to be stored is also larger, which increases the storage overhead. Therefore, in order to reduce the storage overhead, the position numbers of the encoded characters in the dictionary can be cyclically numbered within a preset number range, and the value of each node of the hash chain is the target position in the dictionary. , the data bit width of the value of each node of the hash chain will not increase without an upper limit, thereby reducing storage overhead.
  • the data compression apparatus includes a third memory.
  • the storage capacity of the third memory is usually relatively small, and the third memory is used for caching the dictionary and the data block.
  • the size of the dictionary is configured as 4KB for illustration, the position numbers corresponding to the positions of the encoded characters in the dictionary are cyclically numbered between 0 and 4094, and the first memory and the second memory are numbered cyclically. Stored is the position number of the corresponding dictionary position in the hash chain, please refer to FIG. 10A and FIG. 10B , the dictionary position moves with the current encoding position.
  • the data compression apparatus determines the first hash chain of the matching hash chain from the address pointed to by the first hash value in the first memory node and then use the hash value to update the first node of the matching hash chain.
  • the data compression apparatus may write the value of the first node before being updated into the address cached in the second array of the hash chain in the second memory, and then The value of the first node is updated according to the position number of at least one character to be encoded corresponding to the first hash value, so as to realize the updating process of the first node of the matching hash chain.
  • the hv address in the first memory is read to obtain the matching hash value of the hash chain.
  • the first node hash[hv] writes the value of hash[hv] into the address cached in the second array of the hash chain of the second memory, and writes at least one corresponding to the first hash value to be encoded
  • the position number of the character is written to the hv address in the first memory, thereby realizing the update process of the hash chain.
  • the data compression apparatus sequentially searches for each node in the hash chain according to the second array ; Compare the at least one character to be encoded with the encoded characters at the target position in the dictionary indicated by the node one by one to obtain one or more basic matching strings.
  • the data compression device sequentially searches for each node in the hash chain and performs the following steps: the data compression device determines that the dictionary indicated by the found node matches the at least one character to be encoded The distance between the position of the encoded character and the encoded position, if the distance is greater than the data length of the dictionary, it indicates that the encoded character indicated by the node is not in the dictionary, then the node does not carry out the string matching process , and end searching for the node of the hash chain, otherwise, compare the at least one character to be encoded with the encoded character at the target position in the dictionary indicated by the node one by one to obtain a basic matching string, and proceed to find the next node of said hash chain.
  • the data compression device further includes a fourth memory, and the dictionary and some characters to be encoded in the data block are cached in the third memory and the fourth memory; In the process of comparing the at least one character to be encoded with the encoded characters at the target position in the dictionary indicated by the node one by one, the dictionary indicated by the node that matches the at least one character to be encoded.
  • the coded character is read from the third memory, and the at least one character to be coded is read from the fourth memory, which is conducive to speeding up the reading efficiency and further improving the basic matching efficiency.
  • the encoded character matching the at least one to-be-encoded character and the at least one to-be-encoded character can also be read from the third memory or both can be read from the fourth memory, which is not done in this embodiment any restrictions.
  • the data compression apparatus may compare the at least one character to be coded with the coded character at the target position in the dictionary indicated by the node one by one, to obtain the basic matching character string.
  • Matching length if the matching length of the basic matching string obtained this time is greater than the matching length of the basic matching string obtained last time, keep the basic matching string obtained this time, because the matching distance of the basic matching string generated later It must be greater than the matching distance of the previous basic matching string. Only when the length is larger, the overall storage cost may be smaller than that of the previous basic matching string, so keep it. Otherwise, discard the basic matching string obtained this time.
  • the data compression apparatus further includes a fifth memory, and the fifth memory is used for caching the reserved basic matching strings.
  • the matching length of the basic matching character string is obtained, if it is determined that the matching length is greater than the data length of the remaining characters to be encoded in the data block, or the matching length is not less than the preset length, the comparison is stopped. process.
  • the obtained basic matching strings are cached in the fifth memory in the order of matching lengths.
  • the block parameters include compression parameters, and the compression parameters may include the set maximum search depth of the hash chain. 32 base match strings.
  • the context data also includes a repeated matching array; the repeated matching array is used to record at least one recent repeated matching process of the previous data block, the characters to be encoded and the already existing data in the dictionary.
  • the matching distance of encoded characters may obtain at least one matching distance indicated by the repeated matching array, and then compare the character to be encoded at the encoding position in the data block with the already-encoded character in the dictionary indicated by the matching distance.
  • the encoded characters are matched one by one, and the repeated matching strings corresponding to the encoded positions are obtained.
  • multiple basic matching strings and one repeated matching string may be obtained from the same encoding position, and the data compression apparatus may compare the basic matching strings and repeated matching strings to obtain the corresponding encoding position the best match result.
  • the best matching result is the lower encoding cost of the basic matching string and the repeated matching string.
  • the encoding cost of the basic matching string and the repeated matching may be determined. The encoding cost of the character string, the one with the smallest encoding cost is taken as the best matching result corresponding to the encoding position.
  • the three basic matching strings obtained for the embodiment shown in FIG. 7 are (15,5), (10,3), (6,3).
  • a coding position finally obtains a best matching result.
  • FIG. 6 , FIG. 7 , FIG. 8A and FIG. 8B there are 8 types of best matching results, as shown in Table 1.
  • pos_state[1:0] starts from 0 and increases by 1 with the movement of the encoding position
  • lit[7:0] is the unmatched character in the current encoding position
  • prev_byte[7:0] is the previous character of the current encoding position
  • last_match_lit[7:0] is a character after the last non-lit type (litNotMatched or litMatched) matching result
  • len[7:0] and dist[11 :0] are the matching length and matching distance, respectively.
  • the best matching result corresponding to the encoding position and other information required for interval encoding may be stored in the FIFO memory together, so that dictionary encoding and interval encoding are performed in parallel, that is, the data in the data blocks are executed in parallel.
  • the process of performing interval coding on the best matching result corresponding to the current coding position is performed in parallel with the process of performing dictionary coding on the character to be coded at the next coding position in the data block.
  • the data compression apparatus needs to update the dictionary and the related hash chain, so as to perform the basic matching process of the next encoding position .
  • the data compression apparatus may update the encoded characters and position numbers in the dictionary according to the encoded characters corresponding to the encoding positions.
  • the data compression The device can add the coded characters corresponding to the coding positions into the dictionary, remove the coded characters in the head of the dictionary according to the number of coded characters corresponding to the coding positions, and determine the corresponding coded characters of the coding positions. The position of the encoded character in the dictionary and the corresponding position number.
  • the data compression apparatus may read other remaining characters to be encoded in the data block from an external memory, and divide the data into Other remaining characters to be encoded of the block are buffered in the third memory and the fourth memory.
  • the data compression apparatus may update the hash chain according to the updated dictionary. Specifically, the data compression apparatus may determine the encoded characters removed from the dictionary according to the updated dictionary, and generate a second hash value according to the encoded characters removed from the dictionary; A hash value is not equal to the second hash value, and the value of the hash chain node in the address pointed to by the first hash value in the first memory is equal to the value pointed to by the second hash value The value of the hash chain node in the address pointed to by the second hash value is set to null.
  • the dictionary since the dictionary is moving, for the encoded characters and their position numbers that are moved out of the dictionary boundary, the corresponding hash chain node needs to be cleared, and the data compression device calculates the n bytes that are about to be moved out of the dictionary boundary.
  • the second hash value last_hv read the address of last_hv in the first memory to obtain hash[last_hv].
  • the hash value "empty" is written into the last_hv address in the first memory, thereby clearing the value of hash[last_hv].
  • the hash chain can perform the process of performing interval encoding on the best matching result corresponding to the current encoding position in parallel with the process of performing interval encoding on the next encoding position in the data block.
  • the process of dictionary encoding of characters to be encoded can perform the process of performing interval encoding on the best matching result corresponding to the current encoding position in parallel with the process of performing interval encoding on the next encoding position in the data block.
  • interval encoding is a binary arithmetic encoding, which is encoded in a bit (bit) unit.
  • the initial interval is a fixed value. According to each encoding of 0 or 1, the value of the interval is changed, and the frequency of occurrence of 0 and 1 is updated. Finally, a value in the interval can be used to represent all coded bits (bit).
  • the data compression apparatus determines the encoding format of the best matching result according to the category of the best matching result;
  • the best matching result is range-coded.
  • Table 3 the encoding formats corresponding to the best matching results of different matching categories are shown.
  • the data compression apparatus converts the best matching result into binary bits according to the encoding format of the best matching result, and then encodes each bit in the binary bits.
  • the context data further includes the size and lower limit of the coding interval determined when the last data block is coded for the interval, and the coded character; the coded character is used to indicate the frequency of occurrence of 0.
  • the data compression device determines the encoded character corresponding to the bit when encoding each bit; Bit update the encoded character; According to the updated encoded character and the context data, determine the size of the encoding interval corresponding to the bits of this encoding and the lower limit of the encoding interval; According to the size of the encoding interval, the lower limit of the encoding interval and the updated coded character to obtain the coded code stream of the bits.
  • the flag bit is used to indicate the matching category as shown in Table 1 and Table 2
  • a matching distance of 15 Assuming that the flag bit is 3'b010, the distance is represented by 12 bits, and the length is represented by 9 bits, the bit sequence that needs to be interval-coded for the entire matching string is 010_000000001111_000001001.
  • prob is recorded as the frequency of bit_0.
  • LZMA algorithm according to the matching situation, multiple arrays are used to record different probs, and each prob records the frequency of occurrence of 0 in the corresponding matching category (such as Table 3).
  • the interval will continue to decrease during the encoding process, and when the interval is smaller than a certain threshold, regularization processing is performed on the interval: the interval is extended, and the shifted bytes are recorded as part of the final code stream.
  • the circuit structure of the encoding device for encoding each bit is shown.
  • the circuit structure is used to implement the above calculation logic.
  • the frequency in the frequency memory is read. Address, get prob[10:0] (record the frequency of occurrence of 0 under the matching category), calculate the new frequency new_prob[10:0], and update it into the frequency memory. According to prob[10:0], calculate the interval range[31:0] and the lower limit of the interval low[32:0], and judge whether regularization processing is required according to the interval range[31:0].
  • both the interval range[31:0] and the interval lower limit low[31:0] are shifted to the left by 8 bits, and the bits shifted out by the interval lower limit low are judged at the same time: if not 0xFF, it will be used as the code stream; otherwise, wait for the next regularization , make the same judgment.
  • the subsequent (n-1) characters After completing the encoding of a position, if the matching length of this encoding is n, the subsequent (n-1) characters will calculate the hash value character by character and update the corresponding hash chain, but do not perform basic matching, repeating Match and interval encoding. After these (n-1) characters, the complete dictionary encoding and interval encoding process is continued.
  • Context data is stored in chunks of data.
  • the context data includes information about dictionary encoding, information about interval encoding, and remaining data to be encoded in the data block, wherein the information about dictionary encoding includes dictionary, information about basic matching, and information about Duplicate matching information.
  • the context data when the context data is written out, all the data on the above-mentioned memory and the values of the registers are written out to the context address in sequence, and when the context data is read in, the context data is read from the context address, And write to the corresponding memory in sequence or assign values to the corresponding registers, so as to realize the continuity of the state between different blocks of the same file.
  • the compression rate of the entire file is related to the content of each data block. After each data block is compressed, the accumulated compressed size of the corresponding file is updated to the file header. By reading the file header, you can know the cumulative compressed size and whether all data blocks of a file have been compressed.
  • an embodiment of the present application further provides a data compression apparatus 100, including: a data reading module 10 and a compression module 20;
  • the data reading module 10 is configured to read the data block of one of the multiple files to be compressed, and read the context data of the data block; the context data is used to indicate the The state information of the compressed data of the data block belonging to the same to-be-compressed file during the compression process;
  • the compression module 20 is configured to perform compression processing on the data sub-block according to the context data of the data sub-block to generate an encoded code stream; wherein, the data sub-block belongs to the data sub-block that was subjected to the compression processing last time. Different files to be compressed.
  • the to-be-compressed file includes a data stream whose data volume is increasing continuously, and/or a file whose data volume is fixed.
  • the data reading module 10 is specifically configured to: acquire configured block parameters, and acquire the data blocks according to the block parameters.
  • the block parameters include at least one or more of the following: attributes of the data block, data volume, compression parameters, storage addresses, storage addresses of context data, and data blocks of the data blocks.
  • the storage address of the encoded stream includes at least one or more of the following: attributes of the data block, data volume, compression parameters, storage addresses, storage addresses of context data, and data blocks of the data blocks.
  • the storage addresses of the context data of different data blocks of the same file to be compressed are the same; and/or, the storage addresses of the encoded code streams of different data blocks of the same file to be compressed are consecutive.
  • the data reading module 10 is specifically configured to: if the data block is not the first data block of the to-be-compressed file, read the context data of the data block.
  • the apparatus 100 further includes a data writing module 30 .
  • the data writing module 30 is configured to, if the data block is a non-last data block of the to-be-compressed file, use the state information of the data block during the compression process as the to-be-compressed file The context data of the next data chunk is stored.
  • the apparatus 100 further includes a data writing module 30 .
  • the compression module 20 is further configured to: in the case that the data block is a non-last data block of the to-be-compressed file, in the process of compressing the data block, if the data block is When the data amount of the remaining data to be encoded in the block is not greater than the preset threshold, the encoding of the data block is stopped.
  • the data writing module 30 is used to store the remaining data to be encoded in the data block as the context data of the next data block, so as to encode the remaining data to be encoded in the compression process of the next data block .
  • the to-be-encoded data of the data block includes the last data block indicated by the context data. The remaining data to be encoded and its own data to be encoded.
  • the compression module 20 includes a first encoder 21 and a second encoder 22 .
  • the first encoder 21 is configured to sequentially perform dictionary encoding on the characters to be encoded at the encoding positions in the data blocks according to the context data of the data blocks, and obtain the best matching result corresponding to the encoding positions.
  • the second encoder 22 is configured to perform interval encoding on the best matching result corresponding to the encoding position, and obtain the encoded code stream of the data block.
  • the process of performing interval encoding on the best matching result corresponding to the current encoding position in the data block is parallel to the process of dictionary encoding the character to be encoded at the next encoding position in the data block.
  • the apparatus 100 includes a FIFO memory 23 ; the best matching result corresponding to the encoding position is stored in the FIFO memory 23 .
  • the context data of the data block includes at least a dictionary; the dictionary is used to indicate the encoded characters that belong to the same file to be compressed as the data block.
  • the first encoder 21 is specifically configured to: sequentially match the characters to be encoded at the encoding positions in the data block according to the dictionary, and obtain the basic matching character string and the repeated matching character string corresponding to the encoding position; The basic matching string and the repeated matching string are compared to obtain the best matching result corresponding to the encoding position.
  • the position numbers corresponding to the positions of the encoded characters in the dictionary are cyclically numbered within a preset numbering range.
  • the context data of the data block further includes at least one hash chain, and the hash chain is used to locate the position in the dictionary of a character string matching at least one character to be encoded.
  • the first encoder 21 is further configured to: acquire at least one character to be encoded starting from the encoding position, generating a first hash value; using the first hash value to find a matching hash chain, and obtaining one or more basic strings corresponding to the encoding position according to the matching hash chain.
  • the hash chain includes a first array and a second array.
  • the first array is used to indicate the first node of the hash chain
  • the second array is used to indicate other nodes of the hash chain except the first node.
  • each node is used to indicate the target position in the dictionary of the character string matching the at least one character to be encoded.
  • the value of each node is the position number of the target position in the dictionary.
  • the first array is cached in the first memory 24 .
  • the first encoder 21 is further configured to: determine the first node of the matching hash chain from the address pointed to by the first hash value in the first memory 24; update the matching using the hash value The first node of the hash chain of .
  • the second array is cached in the second memory 25 .
  • the first encoder 21 is further configured to: write the value of the first node before being updated into the address cached in the second array of the hash chain in the second memory 25;
  • the position number of at least one character to be encoded corresponding to a hash value updates the value of the first node.
  • the first encoder 21 is further configured to: sequentially search for each node in the hash chain according to the second array; compare the at least one character to be encoded with the character indicated by the node.
  • the encoded characters at the target position in the dictionary are compared one by one to obtain one or more basic matching strings.
  • the first encoder 21 is further configured to: determine the The distance between the position of the encoded character matching the at least one to-be-encoded character in the dictionary and the encoding position; if the distance is greater than the data length of the dictionary, the search for the node of the hash chain ends.
  • the dictionary and some characters to be encoded in the data block are buffered in the third memory 26 and the fourth memory 27 .
  • the encoded character in the dictionary indicated by the node that matches the at least one to-be-encoded character is read from the third memory 26 ; the at least one to-be-encoded character is read from the fourth memory 27 read.
  • the first encoder 21 is further configured to: compare the at least one character to be encoded with the encoded characters at the target position in the dictionary indicated by the node one by one. Yes, get the matching length of the basic matching string; if the matching length of the basic matching string obtained this time is greater than the matching length of the basic matching string obtained last time, keep the basic matching string obtained this time and cache it to the In the fifth memory 28, otherwise, the basic matching string obtained this time is discarded.
  • the first encoder 21 is further configured to: if the matching length is greater than the data length of the remaining characters to be encoded in the data block, or the matching length is not less than a preset length, stop the ratio right process.
  • the first encoder 21 obtains the basic matching string corresponding to the encoding position and buffers it in the fifth memory 28 .
  • the first encoder 21 is further configured to: update the dictionary according to the encoded characters corresponding to the encoding positions.
  • the first encoder 21 is further configured to: update the encoded character and the position number in the dictionary according to the encoded character corresponding to the encoding position.
  • the dictionary and some characters to be encoded in the data block are buffered in the third memory 26 and the fourth memory 27 .
  • the first encoder 21 is further configured to: read other remaining characters to be encoded in the data block from an external memory, and store all the remaining characters to be encoded in the data block. Other remaining characters to be encoded in the data block are buffered in the third memory 26 and the fourth memory 27 .
  • the context data of the data block further includes at least one hash chain, and the hash chain is used to locate the position in the dictionary of the basic matching string corresponding to the encoding position.
  • the first encoder 21 is further configured to: update the hash chain according to the updated dictionary.
  • the hash chain includes a first array; the first array is used to indicate the first node of the hash chain; the first array is cached in the first memory 24 .
  • the first encoder 21 is further configured to: determine the encoded characters removed from the dictionary according to the updated dictionary, and generate a second hash value according to the encoded characters removed from the dictionary; if the The first hash value is not equal to the second hash value, and the value of the hash chain node in the address pointed to by the first hash value in the first memory 24 is equal to the second hash value.
  • the value of the hash chain node in the address pointed to by the value, and the value of the hash chain node in the address pointed to by the second hash value is set to null.
  • the context data further includes a repeated matching array; the repeated matching array is used to record the difference between the character to be encoded and the encoded character in the dictionary during at least one recent repeated matching process of the previous data block. match distance.
  • the first encoder 21 is further configured to: obtain at least one matching distance indicated by the repeated matching array; The encoded characters in the dictionary are matched one by one, and the repeated matching string corresponding to the encoding position is obtained.
  • the best matching result is the base matching string and the repeated matching string, whichever has a lower coding cost.
  • the second encoder 22 is further configured to: determine the encoding format of the best matching result according to the category of the best matching result; The best matching result is range-coded.
  • the second encoder 22 is further configured to: convert the best matching result into binary bits according to the encoding format of the best matching result; for each of the binary bits bits are encoded.
  • the context data further includes the size and lower limit of the coding interval determined when the last data block is coded for the interval, and the coded character; the coded character is used to indicate the frequency of occurrence of 0.
  • the second encoder 22 is also used to: when encoding each bit, determine the coded character corresponding to the bit; update the coded character according to the bit coded this time; according to the updated coded character And the context data, determine the size of the coding interval corresponding to the bits of this encoding and the lower limit of the coding interval; According to the size of the coding interval, the lower limit of the coding interval and the updated coded character, obtain the bit bit stream.
  • the apparatus further includes a frequency memory.
  • the data writing module 30 is further configured to store the encoded code stream corresponding to the data block to an external memory.
  • the various embodiments described herein can be implemented using computer readable media such as computer software, hardware, or any combination thereof.
  • the embodiments described herein can be implemented using application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays ( FPGA), processors, controllers, microcontrollers, microprocessors, electronic units designed to perform the functions described herein are implemented.
  • ASICs application specific integrated circuits
  • DSPs digital signal processors
  • DSPDs digital signal processing devices
  • PLDs programmable logic devices
  • FPGA field programmable gate arrays
  • processors controllers, microcontrollers, microprocessors, electronic units designed to perform the functions described herein are implemented.
  • embodiments such as procedures or functions may be implemented with separate software modules that allow the performance of at least one function or operation.
  • the software codes may be implemented by a software application (or program) written in any suitable programming language, which may be stored in
  • the embodiment of the present application also provides a movable platform, including:
  • a power system arranged in the body, for providing power for the movable platform
  • the movable platform includes, but is not limited to, unmanned aerial vehicles, unmanned vehicles, mobile robots, and the like.
  • non-transitory computer-readable storage medium such as a memory including instructions, executable by a processor of an apparatus to perform the above-described method.
  • the non-transitory computer-readable storage medium may be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, and the like.
  • a non-transitory computer-readable storage medium when the instructions in the storage medium are executed by the processor of the terminal, enable the terminal to execute the above method.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

一种数据压缩方法、装置、可移动平台及存储介质,所述方法包括:获取多个待压缩文件中的其中一个待压缩文件的数据分块,以及,获取所述数据分块的上下文数据;所述上下文数据用于指示与所述数据分块属于同一待压缩文件的已压缩数据在压缩过程中的状态信息;根据所述数据分块的上下文数据对所述数据分块进行压缩处理,生成编码码流;其中,所述数据分块与上一次进行压缩处理的数据分块属于不同的待压缩文件。本实施例实现多个文件的数据分块穿插进行压缩。

Description

数据压缩方法、装置、可移动平台及存储介质 技术领域
本申请涉及数据压缩技术领域,具体而言,涉及一种数据压缩方法、装置、可移动平台及存储介质。
背景技术
数据压缩是指在不丢失有用信息的前提下,缩减数据量以减少存储空间,提高其传输、存储和处理效率,或按照一定的算法对数据进行重新组织,减少数据的冗余和存储的空间的一种技术方法。
相关技术中通常是对整个文件中的数据压缩完之后,再对下一个文件进行压缩。但是,针对于持续产生数据的文件,如果要将其压缩完再去压缩其他文件,可能使得其他文件由于未及时压缩而产生不利影响。
发明内容
有鉴于此,本申请的目的之一是提供一种数据压缩方法、装置、可移动平台及存储介质。
第一方面,本申请实施例提供了一种数据压缩方法,包括:
获取多个待压缩文件中的其中一个待压缩文件的数据分块,以及,获取所述数据分块的上下文数据;所述上下文数据用于指示与所述数据分块属于同一待压缩文件的已压缩数据在压缩过程中的状态信息;
根据所述数据分块的上下文数据对所述数据分块进行压缩处理,生成编码码流;其中,所述数据分块与上一次进行压缩处理的数据分块属于不同的待压缩文件。
第二方面,本申请实施例提供了一种数据压缩装置,包括:数据读取模块以及压缩模块;
所述数据读取模块,用于读取多个待压缩文件中的其中一个待压缩文件的数据分块,以及,读取所述数据分块的上下文数据;所述上下文数据用于指示与所述数据分 块属于同一待压缩文件的已压缩数据在压缩过程中的状态信息;
所述压缩模块,用于根据所述数据分块的上下文数据对所述数据分块进行压缩处理,生成编码码流;其中,所述数据分块与上一次进行压缩处理的数据分块属于不同的待压缩文件。
第三方面,本申请实施例提供了一种可移动平台,包括:
机体;
动力系统,设于所述机体内,用于为所述可移动平台提供动力;
以及,如第二方面任意一项所述的装置。
第四方面,本申请实施例提供了一种计算机可读存储介质,其上存储有计算机指令,该指令被处理器执行时实现如第一方面所述的方法。
本申请实施例所提供的一种数据压缩方法,能够实现多个文件的数据分块穿插进行压缩;在每次压缩过程中,获取多个待压缩文件中的其中一个待压缩文件的数据分块,以及,获取所述数据分块的上下文数据;所述上下文数据用于指示与所述数据分块属于同一待压缩文件的已压缩数据在压缩过程中的状态信息;根据所述数据分块的上下文数据对所述数据分块进行压缩处理,生成编码码流。本实施例中,本次进行压缩处理的数据分块与上一次进行压缩处理的数据分块可以是属于不同的待压缩文件,实现多个文件的数据分块穿插进行压缩,保证多个文件均能及时被压缩;进一步地,本申请实施例通过上下文数据将所述数据分块与同一待压缩文件的已压缩数据串联起来,从而能够保证同一待压缩文件的数据分块之间的状态是连续的,使得最终得到的压缩结果与单个文件完整进行压缩的结果一致。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1是本申请提供的相关技术中进行文件的压缩过程的示意图;
图2是本申请一个实施例提供的不同文件的数据分块穿插压缩的示意图;
图3及图4是本申请一个实施例提供的数据压缩方法的不同流程示意图;
图5是本申请一个实施例提供的数据分块通知编码位置的示意图;
图6是本申请一个实施例提供的字典编码的示意图;
图7是本申请一个实施例提供的字典编码中的基础匹配过程的示意图;
图8A及图8B是本申请一个实施例提供的字典编码中的重复匹配过程的不同示意图;
图9是本申请一个实施例提供的哈希链的存储示意图;
图10A、图10B以及图10C是本申请一个实施例提供的字典位置循环编号的不同示意图;
图11是本申请一个实施例提供的在区间编码过程中编码每个比特位的电路结构示意图;
图12~图16是本申请一个实施例提供的数据压缩装置的不同结构示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
相关技术中通常是对整个文件中的数据压缩完之后,再对下一个文件进行压缩。比如请参阅图1,为相关技术中的压缩过程的示意图,通常数据压缩装置将文件A压缩完后再对文件B进行压缩。但是,针对于持续产生数据的文件,如果要将其压缩完再去压缩其他文件,可能使得其他文件由于未及时压缩而产生不利影响。比如在可移动平台移动过程中,可移动平台上的各个部件均会持续地产生log信息,这些log信息需要及时压缩,如果对其中一个部件的log信息压缩完再压缩另一个,可能导致其他部件产生的log信息由于未及时压缩,占据过大的存储空间影响到各个部件的正常运行。
针对于相关技术中的问题,本申请实施例提供了一种数据压缩方法,能够实现多个文件的数据分块穿插进行压缩;在每次压缩过程中,获取多个待压缩文件中的其中一个待压缩文件的数据分块,以及,获取所述数据分块的上下文数据;所述上下文数据用于指示与所述数据分块属于同一待压缩文件的已压缩数据在压缩过程中的状态信息;根据所述数据分块的上下文数据对所述数据分块进行压缩处理,生成编码码流。本实施例中,本次进行压缩处理的数据分块与上一次进行压缩处理的数据分块可以是 属于不同的待压缩文件,实现多个文件的数据分块穿插进行压缩,保证多个文件均能及时被压缩;进一步地,本申请实施例通过上下文数据将所述数据分块与同一待压缩文件的已压缩数据串联起来,从而能够保证同一待压缩文件的数据分块之间的状态是连续的,使得最终得到的压缩结果与单个文件完整进行压缩的结果一致。
其中,所述数据压缩方法可以应用于数据压缩装置中。
在一些实施例中,所述数据压缩装置可以是具有数据处理能力的计算机芯片或者集成电路,例如中央处理单元(Central Processing Unit,CPU)、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)或者现成可编程门阵列(Field-Programmable Gate Array,FPGA)等;其中,所述数据压缩装置可以安装于可移动平台、终端设备或者服务器等计算设备。
在另一些实施例中,所述数据压缩装置也可以是具有数据处理能力的设备,如可移动平台、终端设备或者服务器等计算设备。其中,所述可移动平台的示例包括但不限于无人飞行器、无人驾驶车辆、云台、无人驾驶船只或者移动机器人等。所述终端设备的示例包括但不限于:智能电话/手机、平板计算机、个人数字助理(PDA)、膝上计算机、台式计算机、媒体内容播放器、视频游戏站/系统、虚拟现实系统、增强现实系统、可穿戴式装置(例如,手表、眼镜、手套、头饰(例如,帽子、头盔、虚拟现实头戴耳机、增强现实头戴耳机、头装式装置(HMD)、头带)、挂件、臂章、腿环、鞋子、马甲)、遥控器、或者任何其他类型的装置。
在一示例性的应用场景中,比如所述数据压缩装置作为计算机芯片或者集成电路安装于无人飞行器上,或者所述数据无人飞行器上包括有所述数据压缩装置。所述无人飞行器还包括有其他部件,如飞行控制器、导航部件(如GNSS模块),感知部件(如摄像头、双目视觉传感器等)以及云台等等;在无人飞行器飞行过程中,无人飞行器上的飞行控制器、导航部件(如GNSS模块),感知部件(如摄像头、双目视觉传感器等)以及云台等部件会持续地产生log信息,需要对这些数据及时进行压缩,在这种情况下,可以通过本申请实施例提供的数据压缩装置来对多个待压缩文件穿插进行压缩,即每次进行压缩处理的数据分块与上一次进行压缩处理的数据分块可以是属于不同的待压缩文件,保证多个部件持续产生的log信息均能及时被压缩。请参阅图2,图2为本申请实施例提供的不同文件的数据分块穿插压缩的示意图,图2以2个文件为例进行说明:待压缩文件A包括数据分块a1和数据分块a2,待压缩文件B包括数据分块b1和数据分块b2,数据压缩装置依次对数据分块a1、数据分块b1、数据分块a2和数据分块b2进行压缩处理,生成对应的编码码流并输出;在对数据分块进行压缩处 理的过程中,需要读取各个数据分块对应的上下文数据,所述上下文数据用于指示与所述数据分块属于同一待压缩文件的已压缩数据在压缩过程中的状态信息,基于各个数据分块对应的上下文数据对所述数据分块进行压缩处理,实现通过各个数据分块对应的上下文数据保证同一待压缩文件的数据分块之间的状态是连续的,使得最终得到的压缩结果与单个文件完整进行压缩的结果一致。其中,不同数据分块的上下文数据是不同的,在生成所述数据分块对应的编码码流之后,需要获取并存储所述数据分块在压缩处理过程中的状态信息,以便作为同一待压缩文件的下一个数据分块的上下文数据使用,辅助下一个数据分块的压缩过程。
接下来对本申请实施例提供的数据压缩方法进行说明:请参阅图3,图3为本申请实施例提供的一种数据压缩方法的流程示意图,所述方法可以由数据压缩装置来执行,所述方法包括:
在步骤S101中,获取多个待压缩文件中的其中一个待压缩文件的数据分块,以及,获取所述数据分块的上下文数据;所述上下文数据用于指示与所述数据分块属于同一待压缩文件的已压缩数据在压缩过程中的状态信息。
在步骤S102中,根据所述数据分块的上下文数据对所述数据分块进行压缩处理,生成编码码流;其中,所述数据分块与上一次进行压缩处理的数据分块属于不同的待压缩文件。
在一些实施例中,所述多个待压缩文件可以是数据量正在持续增加的数据流;当然,本申请实施例所提供的数据压缩方法也适用于数据量固定的文件,即所述多个待压缩文件可以是数据量固定的文件。或者,所述多个待压缩文件中一部分可以是数据量正在持续在增加的数据流,另一部分可以是数据量固定的文件,本实施例对此不做任何限制。
在一些实施例中,如果待压缩文件为数据量正在持续增加的数据流,在所述待压缩文件产生预设大小的数据量之后,可以将产生的预设数据量的数据配置为所述待压缩文件的1个数据分块,并生成所述数据分块对应的分块参数。如果所述待压缩文件为数据量固定的文件,可以划分所述待压缩文件,将每个预设数据量的数据配置为所述待压缩文件的1个数据分块,并生成所述数据分块对应的分块参数;其中,所述预设数据量的具体取值可依据实际应用场景进行具体设置,比如可以根据所述数据压缩装置的处理能力所确定。
其中,所述数据分块包括但不限于所述数据分块的属性、数据量、压缩参数、存储地址、上下文数据的存储地址、以及所述数据分块的编码码流的存储地址等。在一 个例子中,所述数据分块的属性用于指示该数据分块处于所述待压缩文件中的大致位置,比如所述数据分块的属性包括{首分块、中间分块、末分块}。所述压缩参数可以是所述数据压缩装置所使用的压缩算法的参数,比如所述数据压缩装置使用LZMA算法进行压缩,则所述压缩参数可以包括但不限于字典大小、哈希链最大搜索深度、停止匹配的长度等。
在一些实施例中,为了方便对上下文数据的管理,同一待压缩文件的不同数据分块的上下文数据的存储地址相同,同时也方便所述上下文数据的存取过程,在对所述数据分块进行压缩处理的过程中,所述数据压缩装置需要读取所述数据分块的上下文数据,在生成所述数据分块的编码码流之后,所述数据压缩装置需要将所述数据分块在压缩处理过程中的状态信息作为所述待压缩文件的下一个数据分块的上下文数据进行存储,所述数据压缩装置读取和存储的地址相同。
在一些实施例中,同一待压缩文件的不同数据分块的编码码流的存储地址是连续的,从而使得不同待压缩文件的数据分块在穿插压缩后得到的压缩结果与单个文件完整进行压缩的结果一致,从而保证后续的解码过程正常进行。
在所述数据分块为所述待压缩文件的首个数据分块的情况下,所述待压缩文件还没有已压缩数据,即首个数据分块没有上下文数据,所述数据压缩装置可以直接对所述首个数据分块进行压缩处理,并将所述首个数据分块在压缩处理过程中的状态信息作为所述待压缩文件的下一个数据分块的上下文数据进行存储。
在所述数据分块为所述待压缩文件的末个数据分块的情况下,所述数据压缩装置在根据所述末个数据分块的上下文数据对所述末个数据分块进行压缩处理之后,由于所述待压缩文件中的数据已全部压缩完,则无需记录所述末个数据分块在压缩处理过程中的状态信息。
针对于所述数据分块为首个数据分块或者末个数据分块的情况,请参阅图4,图4为本申请实施例提供的另一种数据压缩方法的流程示意图,所述方法可以由数据压缩装置来执行,所述方法包括:
在步骤S201中,获取多个待压缩文件中的其中一个待压缩文件的数据分块。
在步骤S202中,判断所述数据分块是否为所述待压缩文件的首个数据分块。若是,执行步骤S204;若否,执行步骤S203以及步骤S204。
在步骤S203中,获取所述数据分块的上下文数据。
在步骤S204中,对于首个数据分块,对所述数据分块进行压缩处理,生成编码码流;对于非首个数据分块,根据所述数据分块的上下文数据对所述数据分块进行压缩 处理,生成编码码流。
在步骤S205中,判断所述数据分块是否为所述待压缩文件的末个数据分块。若是,执行步骤S207;若否,执行步骤S206以及步骤S207。
在步骤S206中,将所述数据分块在压缩处理过程中的状态信息作为所述待压缩文件的下一个数据分块的上下文数据进行存储。
在步骤S207中,判断所述多个待压缩文件中的所有数据分块是否均已压缩完。若是,则结束。若否,则执行步骤S201。
在一些实施例中,为了进一步保证同一待压缩文件的不同数据分块之间的状态的连续性,在所述数据分块为所述待压缩文件的非末个数据分块的情况下,在对所述数据分块进行压缩的过程中,如果所述数据分块的剩余待编码数据的数据量不大于预设阈值,停止编码所述数据分块,并将所述数据分块的剩余待编码数据作为下一个数据分块的上下文数据进行存储,以在下一个数据分块的压缩过程中编码所述剩余待编码数据,从而进一步保证同一待压缩文件的不同数据分块的编码过程的连续性。
即是说,在所述数据分块为所述待压缩文件的非首个数据分块的情况下,所述数据分块的待编码数据包括所述上下文数据指示的上一个数据分块的剩余待编码数据以及自身的待编码数据。
在一个例子中,请参阅图5,假设所述预设阈值为273字符,若所述数据分块非末个数据分块,在完成一个位置的编码后,若剩余待编码字符的数量小于或等于273,需要停止编码,将剩余未编码字符以及所述数据分块在编码过程中的状态信息保存为上下文,在同一个待压缩文件下一个数据分块再开始编码剩余部分,从而保证同一个文件不同数据分块之间是连续。
从另一个方面说,将所述数据分块的剩余待编码数据留到下一个数据分块的压缩过程中编码,也有利提高压缩效率,比如在使用LZMA算法进行压缩的过程中,假设所述数据压缩装置匹配的字符串的长度最大为273,所述预设阈值可以根据所述数据压缩装置所能匹配的字符串的长度确定,比如设所述预设阈值为273,如果所述数据分块的剩余待编码字符的数量小于或者等于273,则停止编码所述数据分块,并将所述剩余待编码字符作为下一个数据分块的上下文数据进行存储,以在下一个数据分块的压缩过程中编码所述剩余待编码字符;比如所述剩余待编码字符有50个时,当前能够匹配的字符串的长度最多50,如果留到下一个数据分块再编码,在原来剩余50个编码字符的位置,由于跟下一个数据分块连接起来了,所以所述数据压缩装置匹配的字符串的长度最大可以为273,从而有利于提高压缩效率。
在一些实施例中,在对所述数据分块进行压缩处理的过程中,可以使用LZMA(Lempel-Ziv-Markov chain-Algorithm)算法对所述数据分块进行压缩处理,所述数据压缩装置可以对所述数据分块中编码位置处的待编码字符依次进行字典编码,获得所述编码位置对应的最佳匹配结果;然后对所述编码位置对应的最佳匹配结果进行区间编码,获取所述数据分块的编码码流。当然,也可以使用其他编码算法对所述数据分块进行压缩处理,本实施例对此不做任何仙子,比如可以使用LZ77算法、LZ78算法等。
其中,字典编码是利用数据的重复结构信息来实现数据压缩。如图6所示,已编码字符会存储在字典区中,待编码区中的待编码字符会与字典区中的已编码字符进行比较,得到匹配的字符串,可以表示为(dist,len),dist为当前待编码字符与匹配的字符串中首个已编码字符的距离,len为匹配的字符串的长度。在图6中,用(15,5)就可以表示“abcde”,所以只需要存储(15,5)而不需要存储“abcde”字符,从而实现压缩。
待编码区中的未编码字符与字典区中的已编码字符进行查找比较,有基础匹配和重复匹配两种方式。
这里对基础匹配方式进行描述:基础匹配方式引入哈希链,相同哈希值的节点在同一条哈希链上,从而可以根据哈希节点来定位字典中匹配的字符串的位置。哈希链包括两个数组:第一数组(设为hash数组)和第二数组(设为son数组)。hash数组存储每条哈希链的首节点,son数组将首节点与该哈希链上所有节点连接起来。
在一个例子中,如图7所示,在编码位置15之前,存在一条哈希链,3个节点分别为位置9、5、0。以从编码位置15开始的3个待编码字符abc计算哈希值hv1,根据hash数组元素hash[hv1]==9,第一个匹配的字符串的位置为9。同时将位置15更新到哈希链中,即更新hash[hv1]=15,son[15]=9。从位置15与位置9开始,逐字符比较,得到匹配的字符串的长度,匹配结果为(6,3)。根据son[9]==5,得到第二个匹配的字符串的位置为5,逐字符比较得到匹配结果为(10,3)。根据son[5]==0,得到第三个匹配的字符串的位置为0,逐字符比较得到匹配结果为(15,5)。则在当前编码位置15可以得到3个基础匹配字符串为(15,5)、(10,3)、(6,3)。
这里对重复匹配方式进行描述:一般认为在邻近字符中更容易找到匹配的字符串,比如可以用第三数组(设为reps数组)记录最近n(比如4)次匹配的字符串的匹配距离,分别为reps0,reps1,reps2,reps3。进行下一个编码位置的编码时,会从这4次匹配距离的位置进行匹配,匹配结果只需要记录匹配长度而不需要匹配距离,将匹配长度最长的一个作为本次得到的重复匹配字符串。
在一个例子中,请参阅图8A,在编码到位置5时,由于之前的编码位置都没有匹配字符串,则{reps0,reps1,reps2,reps3}={1,1,1,1},即为默认值。在当前编码位置5,重复匹配会从匹配距离reps0=1处进行匹配,查找与编码位置5距离为1的位置,即位置4,得到的重复匹配的长度为0。而在基础匹配过程中,编码位置5得到的基础匹配串为(5,4),比较基础匹配字符串和重复匹配字符串得到最佳匹配结果为(5,4),根据最佳匹配结果更新reps数组,得到{reps0,reps1,reps2,reps3}={5,1,1,1}。请参阅图8B,当编码到编码位置10时,有{reps0,reps1,reps2,reps3}={5,1,1,1},则会分别从匹配距离reps0=5(即编码位置5)和匹配距离reps1=1(编码位置9)处进行匹配,在reps0=5处,找到重复匹配字符串“abc”,所以重复匹配结果为reps0处,匹配长度为3。
在压缩所述数据分块的过程中,在所述数据分块为待压缩文件的非首个数据分块的情况下,所述数据分块的上下文数据至少包括有字典;所述字典用于指示与所述数据分块属于同一待压缩文件的已编码字符;所述数据压缩装置可以根据所述字典对所述数据分块中编码位置处的待编码字符依次进行匹配,获取所述编码位置对应的基础匹配字符串以及重复匹配字符串。
这里对基础匹配过程进行说明:所述数据分块的上下文数据还包括至少一条哈希链,所述哈希链用于定位与至少一个待编码字符匹配的字符串在所述字典中的位置;在基于所述字典对所述数据分块进行基础匹配的过程中,所述数据压缩装置获取从所述编码位置开始的至少一个待编码字符,并根据所述至少一个待编码字符生成第一哈希值,然后使用所述第一哈希值查找匹配的哈希链,并根据所述匹配的哈希链获得所述编码位置对应的一个或多个基础字符串。
在一个例子中,比如所述数据压缩装置获取从所述编码位置开始的3个待编码字符,比如分别为byte0、byte1和byte2,然后计算第一哈希值,设第一哈希值为hv,则有hv[11:0]={byte0[3:0],byte2[7:0]}^crc_byte1[11:0];其中{}表示位拼接符,“[11:0]、[3:0]、[7:0]”表示比特位宽,如[11:0]表示有12bit,[3:0]表示有4bit,[7:0]表示有8bit。crc计算如下:令d[7:0]=byte1[7:0],则有:
crc_byte1[0]=d[6]^d[0];
crc_byte1[1]=d[7]^d[6]^d[1]^d[0];
crc_byte1[2]=d[7]^d[6]^d[2]^d[1]^d[0]^1;
crc_byte1[3]=d[7]^d[3]^d[2]^d[1];
crc_byte1[4]=d[6]^d[4]^d[3]^d[2]^d[0]^1;
crc_byte1[5]=d[7]^d[6]^d[5]^d[4]^d[3]^d[2]^d[1]^d[0]^1;
crc_byte1[6]=d[7]^d[6]^d[5]^d[4]^d[2]^d[1];
crc_byte1[7]=d[7]^d[5]^d[3]^d[2]^d[1]^d[0]^1;
crc_byte1[8]=d[4]^d[3]^d[1]^d[0]^1;
crc_byte1[9]=d[5]^d[4]^d[2]^d[1]^1;
crc_byte1[10]=d[5]^d[3]^d[2]^d[0]^1;
crc_byte1[11]=d[4]^d[3]^d[1]^d[0]^1。
在一些实施例中,所述哈希链包括有第一数组(例如参照图7的hash数组)和第二数组(例如参照图7的son数据);所述第一数组用于指示各个所述哈希链的首个节点,所述第二数组用于指示所述哈希链除所述首个节点以外的其他节点;其中,每个节点用于指示与所述至少一个待编码字符匹配的字符串在所述字典中的目标位置。所述第一数组缓存于第一存储器中;所述第二数组缓存于第二存储器中,至少一条哈希链在第一存储器和第二存储器的存储方式如图9所示。
结合图9以及图7所示,所述哈希链的每个节点的值表征与所述至少一个待编码字符匹配的字符串在所述字典中的目标位置的位置信息(比如说位置编号),如果位置编码越大,第一存储器和第二存储器在存储每个节点的值时,所需存储的数据位宽也越大,加大了存储开销。因此,为了减少存储开销,所述字典中的已编码字符的位置编号可以在预设的编号范围内进行循环编号,所述哈希链的每个节点的值为所述目标位置在所述字典中的位置编号,则所述哈希链的每个节点的值的数据位宽不会无上限增长,从而减少了存储开销。
在一些实施例中,所述数据压缩装置包括有第三存储器,为了节省存储开销,所述第三存储器的存储容量通常比较小,所述第三存储器用于缓存字典和所述数据分块的部分待编码字符。在一个例子中,以所述字典的大小被配置为4KB为例进行说明,所述字典中的已编码字符的位置对应的位置编号在0~4094之间循环编号,第一存储器和第二存储器存储的是哈希链中对应的字典位置的位置编号,请参阅图10A以及图10B,字典位置随着当前编码位置而移动。当编码到编码位置0上的待编码字符时,字典位置的位置编号和字典在第三存储中的缓存情况如图10A所示,在编码完成编码位置0上的待编码字符之后,将该编码位置上的已编码字符加入所述字典中,并移除所述字典中的其他已编码字符,即字典的大小是固定的,不会无限增大。如图10B所示,当编码到编码位置4上的待编码字符时,编码位置4之前的已编码字符已加入所述字典中,并且所述字典中原位置编号为0~4的已编码字符已移除,并以循环编号方式为加入所述字典中的已编码字符编号,其中,所述第三存储器中用于缓存原位置编 号为0~4的已编码字符的地址可以被重新使用,比如可以将所述数据分块的部分待编码字符写入。
在使用所述第一哈希值查找匹配的哈希链的过程中,所述数据压缩装置从所述第一存储器中所述第一哈希值指向的地址确定匹配的哈希链的首个节点,然后使用所述哈希值更新所述匹配的哈希链的首个节点。在一种可能的实现方式中,所述数据压缩装置可以将未更新前所述首个节点的值写入所述第二存储器中所述哈希链的第二数组所缓存的地址中,然后根据所述第一哈希值对应的至少一个待编码字符的位置编号更新所述首个节点的值,从而实现所述匹配的哈希链的首个节点的更新过程。
在一个例子中,请参阅图9,在从所述编码位置开始的3个待编码字符计算得到第一哈希值hv之后,读取第一存储器中的hv地址,得到匹配的哈希链的首个节点hash[hv],将hash[hv]的值写入第二存储器所述哈希链的第二数组所缓存的地址中,并将所述第一哈希值对应的至少一个待编码字符的位置编号写到第一存储器中的hv地址,从而实现哈希链的更新过程。
在根据所述匹配的哈希链获得所述编码位置对应的一个或多个基础字符串的过程中,所述数据压缩装置根据所述第二数组依次查找所述哈希链中的每个节点;将所述至少一个待编码字符与所述节点指示的所述字典中目标位置处的已编码字符逐个进行比对,获得一个或多个基础匹配字符串。
其中,所述数据压缩装置依次查找所述哈希链中的每个节点并执行以下步骤:所述数据压缩装置确定查找到的该节点指示的所述字典中与所述至少一个待编码字符匹配的已编码字符的位置与所述编码位置的距离,如果所述距离大于所述字典的数据长度,表明该节点所指示的已编码字符不在所述字典中,则该节点不进行字符串匹配过程,并结束查找所述哈希链的节点,否则,将所述至少一个待编码字符与所述节点指示的所述字典中目标位置处的已编码字符逐个进行比对,获得基础匹配字符串,并继续查找所述哈希链的下一个节点。
示例性的,为了提高基础匹配效率,所述数据压缩装置还包括有第四存储器,所述字典以及所述数据分块的部分待编码字符缓存在第三存储器以及第四存储器中;在将所述至少一个待编码字符与所述节点指示的所述字典中目标位置处的已编码字符逐个进行比对的过程中,所述节点指示的所述字典中与所述至少一个待编码字符匹配的已编码字符从所述第三存储器中读取,所述至少一个待编码字符从所述第四存储器中读取,从而有利于加快读取效率,进一步提高基础匹配效率。当然,与所述至少一个待编码字符匹配的已编码字符、以及所述至少一个待编码字符也可以均从第三存储器 读取或者均从第四存储器中读取,本实施例对此不做任何限制。
为了进一步节省后续的编码开销,所述数据压缩装置可以将所述至少一个待编码字符与所述节点指示的所述字典中目标位置处的已编码字符逐个进行比对,得到基础匹配字符串的匹配长度;如果本次获取的基础匹配字符串的匹配长度大于上一次获取的基础匹配字符串的匹配长度,保留本次获取的基础匹配字符串,因为后产生的基础匹配字符串,其匹配距离一定大于前一个基础匹配字符串的匹配距离,只有在长度更大时,整体存储开销才可能比前一个基础匹配字符串的小,因此将其保留,否则,丢弃本次获取的基础匹配字符串。示例性的,所述数据压缩装置还包括有第五存储器,所述第五存储器用于缓存保留的基础匹配字符串。
其中,在得到基础匹配字符串的匹配长度时,如果确定所述匹配长度大于所述数据分块中剩余待编码字符的数据长度,或者所述匹配长度不小于预设长度,则停止比对的过程。示例性的,将得到的基础匹配字符串按照匹配长度的顺序缓存在第五存储器中。示例性的,所述分块参数包括压缩参数,所述压缩参数中可以包括设定的哈希链的最大搜索深度,比如设定哈希链最大搜素深度为32,则一个编码位置最多有32个基础匹配字符串。
这里对重复匹配的过程进行说明:所述上下文数据还包括重复匹配数组;所述重复匹配数组用于记录上一个数据分块最近至少一次重复匹配过程中,待编码字符与所述字典中的已编码字符的匹配距离。所述数据压缩装置可以获取所述重复匹配数组所指示的至少一个匹配距离,然后将所述数据分块中所述编码位置处的待编码字符与所述匹配距离指示的所述字典中的已编码字符逐个进行匹配,获取所述编码位置对应的重复匹配字符串。
在一些实施例中,同一个编码位置可能得到多个基础匹配字符串和一个重复匹配字符串,所述数据压缩装置可以比较所述基础匹配字符串以及重复匹配字符串,获得所述编码位置对应的所述最佳匹配结果。在一些实施例中,所述最佳匹配结果为所述基础匹配字符串以及所述重复匹配字符串中编码代价较小者,比如可以确定所述基础匹配字符串的编码代价和所述重复匹配字符串的编码代价,将编码代价最小的一个作为所述编码位置对应的最佳匹配结果。
在一个例子中,比如针对于图7所示的实施例得到的3个基础匹配字符串为(15,5)、(10,3)、(6,3),可以通过比较3个基础匹配字符串之间的距离和长度来确定编码代价;比如先将基础匹配字符串1(15,5)与基础匹配字符串2(10,3)进行编码开销比较,若满足(len1==len2+1)&&((dist1>>7)>dist2),则认为基础匹配字符串2的编码开 销更小,继续将基础匹配字符串2与基础匹配字符串3进行开销比较,如此循环;否则,结束编码开销比较,基础匹配字符串1在所有匹配字符串中开销最小,是最佳基础匹配字符串。其中,“>>”表示右移符号。在获得最佳基础匹配字符串之后,将最佳基础匹配字符串与重复匹配字符串进行编码开销比较,若满足rep_len+1>=main_len||(rep_len+2>=main_len)&&(main_dist>=2^9),认为重复匹配字符串更好,否则,认为最佳基础匹配字符串更好;其中,rep_len为重复匹配字符串的长度,main_len和main_dist分别为最佳基础匹配字符串的长度和距离。
一个编码位置最终得到一个最佳匹配结果,在如图6、图7、图8A以及图8B所示的实施例中,最佳匹配结果有8种类型,如表1所示。
表1
Figure PCTCN2021082630-appb-000001
上述8种类型需要保存的信息如表2所示:其中pos_state[1:0]从0开始,随着编码位置的移动而+1;lit[7:0]为当前编码位置未匹配的字符;prev_byte[7:0]为当前编码位置的前一个字符;last_match_lit[7:0]为上一个非lit类型(litNotMatched或litMatched)的匹配结果之后的一个字符;len[7:0]和dist[11:0]分别为匹配长度和匹配距离。
表2
匹配类别 保存格式
litNotMatched 000+pos_state[1:0]+lit[7:0]+prev_byte[7:0]
litMatched 001+pos_state[1:0]+lit[7:0]+prev_byte[7:0]+last_match_lit[7:0]
match 010+pos_state[1:0]+len[8:0]+dist[11:0]
shortRep[0] 011+pos_state[1:0]
longRep[0] 100+pos_state[1:0]+len[8:0]
longRep[1] 101+pos_state[1:0]+len[8:0]
longRep[2] 110+pos_state[1:0]+len[8:0]
longRep[3] 111+pos_state[1:0]+len[8:0]
在一些实施例中,可以将所述编码位置对应的最佳匹配结果以及区间编码需要的其他信息一起存储在FIFO存储器中,从而实现字典编码和区间编码并行执行,即对所述数据分块中当前编码位置对应的最佳匹配结果进行区间编码的过程与对所述数据分块中下一个编码位置处的待编码字符进行字典编码的过程并行执行。
在一些实施例中,在获得所述编码位置对应的所述最佳匹配结果之后,所述数据压缩装置需要对字典以及相关的哈希链进行更新,以便进行下一个编码位置的基础匹配的过程。
针对于所述字典的更新:所述数据压缩装置可以根据所述编码位置对应的已编码字符更新所述字典中的已编码字符以及位置编号,比如请参见图10A以及图10B,所述数据压缩装置可以将所述编码位置对应的已编码字符加入所述字典中,根据所述编码位置对应的已编码字符的数量移除所述字典头部的已编码字符,并确定所述编码位置对应的已编码字符在所述字典中的位置及相应的位置编号。
其中,在所述根据所述编码位置处的已编码字符更新所述字典之后,所述数据压缩装置可以从外部存储器读取所述数据分块的其他剩余待编码字符,并将所述数据分块的其他剩余待编码字符缓存在第三存储器以及第四存储器中。
针对于所述哈希链的更新:所述数据压缩装置可以根据更新后的字典更新所述哈希链。具体来说,所述数据压缩装置可以根据所述更新后的字典确定移出所述字典的已编码字符,并根据所述移出所述字典的已编码字符生成第二哈希值;如果所述第一哈希值不等于所述第二哈希值、且在所述第一存储器中所述第一哈希值指向的地址中所述哈希链节点的值等于所述第二哈希值指向的地址中所述哈希链节点的值,将所述第二哈希值指向的地址中所述哈希链节点的值置为空。
在一个例子中,由于字典在移动,对于移出字典边界的已编码字符及其位置编号,需要清除其对应的哈希链节点,所述数据压缩装置计算即将移出字典边界处的n个字节的第二哈希值last_hv,读取第一存储器中的last_hv地址,得到hash[last_hv]。在满足(last_hv!=hv)&&(hash[last_hv]==hash[hv])时,将哈希值“空”写入第一存储器中last_hv地址,从而清除hash[last_hv]的值。请参阅图10B以及图10C,在当前编码位置为4的时候,如果不进行哈希链清除,由于last_hv!=hv,所以更新哈希链hash[hv]时没有覆盖hash[hast_hv]的值,此时hash[lastHv]=4。在编码位置5的时候,计算哈希 链的下一个节点(设为nextHv),如果nextHv==lastHv,则hash[nextHv]==hash[lastHv]==4,而这时候hash[lastHv]==4对应的已编码字符已经是移出字典外的,所以更新son[hash[lashHv]]=4是错误的。所以需要清除。清除后,在下一次哈希链查找过程如果计算的nextHv==lastHv,由于hash[lastHv]已经清除,所以son[hash[nextHv]]==son[hash[lastHv]]==empty,正确。
在更新完所述字典以及所述哈希链之后,所述哈希链可以并行进行当前编码位置对应的最佳匹配结果进行区间编码的过程与对所述数据分块中下一个编码位置处的待编码字符进行字典编码的过程。
这里对区间编码的过程进行说明:区间编码是一种二进制算术编码,以比特(bit)为单位进行编码。初始区间为一个固定值,根据每次编码0或1,改变区间的值,并更新0和1出现的频次。最终用区间内的一个值,可以表示所有编码过的比特(bit)。
基于如表1和表2的匹配类别,所述数据压缩装置根据所述最佳匹配结果的类别确定所述最佳匹配结果的编码格式;根据所述最佳匹配结果的编码格式对所述最佳匹配结果进行区间编码。如表3所示,示出了不同的匹配类别的最佳匹配结果对应的编码格式。
表3
Figure PCTCN2021082630-appb-000002
在一些实施例中,所述数据压缩装置根据所述最佳匹配结果的编码格式将所述最佳匹配结果转换为二进制比特位,然后对所述二进制比特位中的每个比特位进行编码。其中,所述上下文数据还包括有上一个数据分块最后一次进行区间编码时确定的编码区间的大小和下限、以及编码字符;所述编码字符用于指示0出现的频次。在对所述二进制比特位中的每个比特位进行编码的过程中,所述数据压缩装置在编码每个比特 位时,确定所述比特位对应的所述编码字符;根据本次编码的比特位更新所述编码字符;根据更新后的编码字符以及所述上下文数据,确定本次编码的比特位对应的编码区间的大小以及编码区间的下限;根据所述编码区间的大小、编码区间的下限以及所述更新后的编码字符,获得所述比特位的编码码流。
在一个例子中,以编码(15,5)匹配字符串为例,需要编码标志位(所述标志位用于表示如表1和表2所示的匹配类别)、匹配距离15、匹配长度5。假设标志位为3'b010,用12bit表示距离,用9bit表示长度,则整个匹配串需要进行区间编码的bit顺序为010_000000001111_000001001。其中,记prob为bit_0的频次,在LZMA算法中,根据匹配情况,用多个数组来记录不同的prob,每个prob记录在对应的匹配类别(如表3)下0出现的频次。设频次统计上限为2^11,p0为bit_0的概率,p0’为更新后bit_0的概率,p1为bit_1的概率,range为区间大小,low为区间下限。编码每一个bit时,先找到该匹配情况下对应的prob,然后计算:p0=prob/2^11;p1=1-p0。编码bit 0时:range=range*p0;p0'=p0+p1/2^5;low=low。编码bit 1时:range=range-range*p0;p0'=p0-p0/2^5;low=low+range*p0。在一些实施例中,在编码过程中区间会不断减小,小于一定阈值时,对区间进行正则化处理:将区间进行扩展,同时记录移出的字节(byte),作为最终码流的一部分。
示例性的,如图11所示,示出了所述编码装置编码每个比特位的电路结构,该电路结构用于实现上述计算逻辑,编码每比特(bit)时,读频次存储器中的频次地址,得到prob[10:0](记录该匹配类别下0出现的频次),计算得到新的频次new_prob[10:0],并更新到频次存储器中。根据prob[10:0],计算区间range[31:0]和区间下限low[32:0],并根据区间range[31:0]判断是否需要进行正则化处理。正则化处理时,区间range[31:0]和区间下限low[31:0]都左移8bit,同时判断区间下限low移出的比特位:若非0xFF,则作为码流;否则,等待下一次正则化,进行同样的判断。
在完成一个位置的编码后,若该次编码的匹配长度为n,则后续(n-1)个字符都逐字符进行计算哈希值并更新对应的哈希链,但不进行基础匹配、重复匹配和区间编码。在这(n-1)个字符之后,再继续进行完整的字典编码与区间编码过程。
在完成所述数据分块的压缩之后,如果所述数据分块不是待压缩文件中的最后一块,则将所述数据分块在压缩处理过程中的状态信息作为所述待压缩文件的下一个数据分块的上下文数据进行存储。所述上下文数据包括有关于字典编码的信息、有关于区间编码的信息以及所述数据分块的剩余待编码数据,其中,有关于字典编码的信息包括字典、有关于基础匹配的信息和有关于重复匹配的信息。
在一个例子中,在上下文数据写出时,将上述提到的存储器上的全部数据和寄存器的数值按顺序写出到上下文地址,上下文数据读入时,从上下文地址读取所述上下文数据,并按顺序写到对应的存储器或者给对应寄存器赋值,从而实现同文件不同分块之间状态的连续性。
其中,整个文件的压缩率与每个数据分块的内容有关,在每个数据分块压缩结束后,将对应文件累计的压缩后大小更新到文件头部。通过读取文件头,可以获知累计压缩后的大小,以及一个文件是否所有数据分块都已压缩完成。
相应地,请参阅图12,本申请实施例还提供了一种数据压缩装置100,包括:数据读取模块10以及压缩模块20;
所述数据读取模块10,用于读取多个待压缩文件中的其中一个待压缩文件的数据分块,以及,读取所述数据分块的上下文数据;所述上下文数据用于指示与所述数据分块属于同一待压缩文件的已压缩数据在压缩过程中的状态信息;
所述压缩模块20,用于根据所述数据分块的上下文数据对所述数据分块进行压缩处理,生成编码码流;其中,所述数据分块与上一次进行压缩处理的数据分块属于不同的待压缩文件。
在一实施例中,所述待压缩文件包括数据量正在持续增加的数据流,和/或,数据量固定的文件。
在一实施例中,所述数据读取模块10具体用于:获取已配置的分块参数,并根据所述分块参数获取所述数据分块。
在一实施例中,所述分块参数包括以下至少一项或多项:所述数据分块的属性、数据量、压缩参数、存储地址、上下文数据的存储地址、以及所述数据分块的编码码流的存储地址。
在一实施例中,同一待压缩文件的不同数据分块的上下文数据的存储地址相同;和/或,同一待压缩文件的不同数据分块的编码码流的存储地址是连续的。
在一实施例中,所述数据读取模块10具体用于:如果所述数据分块为所述待压缩文件的非首个数据分块,读取所述数据分块的上下文数据。
在一实施例中,请参阅图13,所述装置100还包括数据写出模块30。
所述数据写出模块30,用于如果所述数据分块为所述待压缩文件的非末个数据分块,将所述数据分块在压缩处理过程中的状态信息作为所述待压缩文件的下一个数据分块的上下文数据进行存储。在一实施例中,所述装置100还包括数据写出模块30。
所述压缩模块20还用于:在所述数据分块为所述待压缩文件的非末个数据分块的情况下,在对所述数据分块进行压缩的过程中,如果所述数据分块的剩余待编码数据的数据量不大于预设阈值,停止编码所述数据分块。
所述数据写出模块30,用于将所述数据分块的剩余待编码数据作为下一个数据分块的上下文数据进行存储,以在下一个数据分块的压缩过程中编码所述剩余待编码数据。
在一实施例中,在所述数据分块为所述待压缩文件的非首个数据分块的情况下,所述数据分块的待编码数据包括所述上下文数据指示的上一个数据分块的剩余待编码数据以及自身的待编码数据。
在一实施例中,请参阅图14,所述压缩模块20包括第一编码器21和第二编码器22。
所述第一编码器21用于根据所述数据分块的上下文数据对所述数据分块中编码位置处的待编码字符依次进行字典编码,获得所述编码位置对应的最佳匹配结果。
所述第二编码器22用于对所述编码位置对应的最佳匹配结果进行区间编码,获取所述数据分块的编码码流。
在一实施例中,对所述数据分块中当前编码位置对应的最佳匹配结果进行区间编码的过程与对所述数据分块中下一个编码位置处的待编码字符进行字典编码的过程并行执行。
在一实施例中,请参阅图15,所述装置100包括FIFO存储器23;所述编码位置对应的最佳匹配结果存储在FIFO存储器23中。
在一实施例中,所述数据分块的上下文数据至少包括有字典;所述字典用于指示与所述数据分块属于同一待压缩文件的已编码字符。
所述第一编码器21具体用于:根据所述字典对所述数据分块中编码位置处的待编码字符依次进行匹配,获取所述编码位置对应的基础匹配字符串以及重复匹配字符串;比较所述基础匹配字符串以及重复匹配字符串,获得所述编码位置对应的所述最佳匹配结果。
在一实施例中,所述字典中的已编码字符的位置对应的位置编号在预设的编号范围内进行循环编号。
在一实施例中,所述数据分块的上下文数据还包括至少一条哈希链,所述哈希链用于定位与至少一个待编码字符匹配的字符串在所述字典中的位置。
在获取所述编码位置对应的基础匹配字符串的过程中,所述第一编码器21还用于: 获取从所述编码位置开始的至少一个待编码字符,并根据所述至少一个待编码字符生成第一哈希值;使用所述第一哈希值查找匹配的哈希链,并根据所述匹配的哈希链获得所述编码位置对应的一个或多个基础字符串。
在一实施例中,所述哈希链包括有第一数组和第二数组。
所述第一数组用于指示所述哈希链的首个节点,所述第二数组用于指示所述哈希链除所述首个节点以外的其他节点。
其中,每个节点用于指示与所述至少一个待编码字符匹配的字符串在所述字典中的目标位置。
在一实施例中,所述每个节点的值为所述目标位置在所述字典中的位置编号。
在一实施例中,请参阅图16,所述第一数组缓存于第一存储器24中。
所述第一编码器21还用于:从所述第一存储器24中所述第一哈希值指向的地址确定匹配的哈希链的首个节点;使用所述哈希值更新所述匹配的哈希链的首个节点。
在一实施例中,请参阅图16,所述第二数组缓存于第二存储器25中。
所述第一编码器21还用于:将未更新前所述首个节点的值写入所述第二存储器25中所述哈希链的第二数组所缓存的地址中;根据所述第一哈希值对应的至少一个待编码字符的位置编号更新所述首个节点的值。
在一实施例中,所述第一编码器21还用于:根据所述第二数组依次查找所述哈希链中的每个节点;将所述至少一个待编码字符与所述节点指示的所述字典中目标位置处的已编码字符逐个进行比对,获得一个或多个基础匹配字符串。
在一实施例中,在所述根据所述第二数组依次查找所述哈希链中的每个节点的过程中,所述第一编码器21还用于:确定每个节点指示的所述字典中与所述至少一个待编码字符匹配的已编码字符的位置与所述编码位置的距离;如果所述距离大于所述字典的数据长度,则结束查找所述哈希链的节点。
在一实施例中,请参阅图16,所述字典以及所述数据分块的部分待编码字符缓存在第三存储器26以及第四存储器27中。
其中,所述节点指示的所述字典中与所述至少一个待编码字符匹配的已编码字符从所述第三存储器26中读取;所述至少一个待编码字符从所述第四存储器27中读取。
在一实施例中,请参阅图16,所述第一编码器21还用于:将所述至少一个待编码字符与所述节点指示的所述字典中目标位置处的已编码字符逐个进行比对,得到基础匹配字符串的匹配长度;如果本次获取的基础匹配字符串的匹配长度大于上一次获取的基础匹配字符串的匹配长度,保留本次获取的基础匹配字符串并缓存至所述第五 存储器28中,否则,丢弃本次获取的基础匹配字符串。
在一实施例中,所述第一编码器21还用于:如果所述匹配长度大于所述数据分块中剩余待编码字符的数据长度,或者所述匹配长度不小于预设长度,停止比对的过程。
在一实施例中,请参阅图16,所述第一编码器21获得所述编码位置对应的基础匹配字符串缓存在第五存储器28中。
在一实施例中,所述第一编码器21还用于:根据所述编码位置对应的已编码字符更新所述字典。
在一实施例中,所述第一编码器21还用于:根据所述编码位置对应的已编码字符更新所述字典中的已编码字符以及位置编号。
在一实施例中,所述字典以及所述数据分块的部分待编码字符缓存在第三存储器26以及第四存储器27中。
在所述根据所述编码位置处的已编码字符更新所述字典之后,所述第一编码器21还用于:从外部存储器读取所述数据分块的其他剩余待编码字符,并将所述数据分块的其他剩余待编码字符缓存在第三存储器26以及第四存储器27中。
在一实施例中,所述数据分块的上下文数据还包括至少一条哈希链,所述哈希链用于定位所述编码位置对应的基础匹配字符串在所述字典中的位置。
在所述根据所述编码位置对应的已编码字符更新所述字典之后,所述第一编码器21还用于:根据更新后的字典更新所述哈希链。
在一实施例中,所述哈希链包括有第一数组;所述第一数组用于指示所述哈希链的首个节点;所述第一数组缓存于第一存储器24中。
所述第一编码器21还用于:根据所述更新后的字典确定移出所述字典的已编码字符,并根据所述移出所述字典的已编码字符生成第二哈希值;如果所述第一哈希值不等于所述第二哈希值、且在所述第一存储器24中所述第一哈希值指向的地址中所述哈希链节点的值等于所述第二哈希值指向的地址中所述哈希链节点的值,将所述第二哈希值指向的地址中所述哈希链节点的值置为空。
在一实施例中,所述上下文数据还包括重复匹配数组;所述重复匹配数组用于记录上一个数据分块最近至少一次重复匹配过程中,待编码字符与所述字典中的已编码字符的匹配距离。
所述第一编码器21还用于:获取所述重复匹配数组所指示的至少一个匹配距离;将所述数据分块中所述编码位置处的待编码字符与所述匹配距离指示的所述字典中的已编码字符逐个进行匹配,获取所述编码位置对应的重复匹配字符串。
在一实施例中,所述最佳匹配结果为所述基础匹配字符串以及所述重复匹配字符串中编码代价较小者。
在一实施例中,所述第二编码器22还用于:根据所述最佳匹配结果的类别确定所述最佳匹配结果的编码格式;根据所述最佳匹配结果的编码格式对所述最佳匹配结果进行区间编码。
在一实施例中,所述第二编码器22还用于:根据所述最佳匹配结果的编码格式将所述最佳匹配结果转换为二进制比特位;对所述二进制比特位中的每个比特位进行编码。
在一实施例中,所述上下文数据还包括有上一个数据分块最后一次进行区间编码时确定的编码区间的大小和下限、以及编码字符;所述编码字符用于指示0出现的频次。
所述第二编码器22还用于:在编码每个比特位时,确定所述比特位对应的所述编码字符;根据本次编码的比特位更新所述编码字符;根据更新后的编码字符以及所述上下文数据,确定本次编码的比特位对应的编码区间的大小以及编码区间的下限;根据所述编码区间的大小、编码区间的下限以及所述更新后的编码字符,获得所述比特位的编码码流。
在一些实施例中,所述装置还包括频次存储器。
在一些实施例中,所述数据写出模块30还用于将所述数据分块对应的编码码流存储到外部存储器。
对于装置实施例而言,由于其基本对应于方法实施例,所以相关之处参见方法实施例的部分说明即可。以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。
这里描述的各种实施方式可以使用例如计算机软件、硬件或其任何组合的计算机可读介质来实施。对于硬件实施,这里描述的实施方式可以通过使用特定用途集成电路(ASIC)、数字信号处理器(DSP)、数字信号处理装置(DSPD)、可编程逻辑装置(PLD)、现场可编程门阵列(FPGA)、处理器、控制器、微控制器、微处理器、被设计为执行这里描述的功能的电子单元中的至少一种来实施。对于软件实施,诸如过程或功能的实施方式可以与允许执行至少一种功能或操作的单独的软件模块来实施。软件代码可以 由以任何适当的编程语言编写的软件应用程序(或程序)来实施,软件代码可以存储在存储器中并且由控制器执行。
相应的,本申请实施例还提供了一种可移动平台,包括:
机体;
动力系统,设于所述机体内,用于为所述可移动平台提供动力;
以及,如上述任意一项所述的数据压缩装置。
在一些实施例中,所述可移动平台包括但不限于无人飞行器、无人驾驶车辆、移动机器人等。
在示例性实施例中,还提供了一种包括指令的非临时性计算机可读存储介质,例如包括指令的存储器,上述指令可由装置的处理器执行以完成上述方法。例如,非临时性计算机可读存储介质可以是ROM、随机存取存储器(RAM)、CD-ROM、磁带、软盘和光数据存储设备等。
一种非临时性计算机可读存储介质,当存储介质中的指令由终端的处理器执行时,使得终端能够执行上述方法。
需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。
以上对本申请实施例所提供的方法和装置进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。

Claims (70)

  1. 一种数据压缩方法,其特征在于,包括:
    获取多个待压缩文件中的其中一个待压缩文件的数据分块,以及,获取所述数据分块的上下文数据;所述上下文数据用于指示与所述数据分块属于同一待压缩文件的已压缩数据在压缩过程中的状态信息;
    根据所述数据分块的上下文数据对所述数据分块进行压缩处理,生成编码码流;其中,所述数据分块与上一次进行压缩处理的数据分块属于不同的待压缩文件。
  2. 根据权利要求1所述的方法,其特征在于,所述待压缩文件包括数据量正在持续增加的数据流,和/或,数据量固定的文件。
  3. 根据权利要求1所述的方法,其特征在于,所述获取多个待压缩文件中的其中一个待压缩文件的数据分块,还包括:
    获取已配置的分块参数,并根据所述分块参数获取所述数据分块。
  4. 根据权利要求3所述的方法,其特征在于,所述分块参数包括以下至少一项或多项:所述数据分块的属性、数据量、压缩参数、存储地址、上下文数据的存储地址、以及所述数据分块的编码码流的存储地址。
  5. 根据权利要求1所述的方法,其特征在于,同一待压缩文件的不同数据分块的上下文数据的存储地址相同;和/或,
    同一待压缩文件的不同数据分块的编码码流的存储地址是连续的。
  6. 根据权利要求1所述的方法,其特征在于,所述获取所述数据分块的上下文数据,包括:
    如果所述数据分块为所述待压缩文件的非首个数据分块,获取所述数据分块的上下文数据。
  7. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    如果所述数据分块为所述待压缩文件的非末个数据分块,将所述数据分块在压缩处理过程中的状态信息作为所述待压缩文件的下一个数据分块的上下文数据进行存储。
  8. 根据权利要求1或7所述的方法,其特征在于,所述根据所述数据分块的上下文数据对所述数据分块进行压缩,还包括:
    在所述数据分块为所述待压缩文件的非末个数据分块的情况下,在对所述数据分块进行压缩的过程中,如果所述数据分块的剩余待编码数据的数据量不大于预设阈值,停止编码所述数据分块;
    将所述数据分块的剩余待编码数据作为下一个数据分块的上下文数据进行存储, 以在下一个数据分块的压缩过程中编码所述剩余待编码数据。
  9. 根据权利要求8所述的方法,其特征在于,在所述数据分块为所述待压缩文件的非首个数据分块的情况下,所述数据分块的待编码数据包括所述上下文数据指示的上一个数据分块的剩余待编码数据以及自身的待编码数据。
  10. 根据权利要求1所述的方法,其特征在于,所述根据所述数据分块的上下文数据对所述数据分块进行压缩,包括:
    根据所述数据分块的上下文数据对所述数据分块中编码位置处的待编码字符依次进行字典编码,获得所述编码位置对应的最佳匹配结果;
    对所述编码位置对应的最佳匹配结果进行区间编码,获取所述数据分块的编码码流。
  11. 根据权利要求10所述的方法,其特征在于,对所述数据分块中当前编码位置对应的最佳匹配结果进行区间编码的过程与对所述数据分块中下一个编码位置处的待编码字符进行字典编码的过程并行执行。
  12. 根据权利要求11所述的方法,其特征在于,所述编码位置对应的最佳匹配结果存储在FIFO存储器中。
  13. 根据权利要求10所述的方法,其特征在于,所述数据分块的上下文数据至少包括有字典;所述字典用于指示与所述数据分块属于同一待压缩文件的已编码字符;
    所述根据所述数据分块的上下文数据对所述数据分块中编码位置处的待编码字符依次进行字典编码,包括:
    根据所述字典对所述数据分块中编码位置处的待编码字符依次进行匹配,获取所述编码位置对应的基础匹配字符串以及重复匹配字符串;
    比较所述基础匹配字符串以及重复匹配字符串,获得所述编码位置对应的所述最佳匹配结果。
  14. 根据权利要求13所述的方法,其特征在于,所述字典中的已编码字符的位置对应的位置编号在预设的编号范围内进行循环编号。
  15. 根据权利要求13或14所述的方法,其特征在于,所述数据分块的上下文数据还包括至少一条哈希链,所述哈希链用于定位与至少一个待编码字符匹配的字符串在所述字典中的位置;
    所述根据所述字典对所述数据分块中编码位置处的待编码字符依次进行匹配,获取所述编码位置对应的基础匹配字符串,包括:
    获取从所述编码位置开始的至少一个待编码字符,并根据所述至少一个待编码字 符生成第一哈希值;
    使用所述第一哈希值查找匹配的哈希链,并根据所述匹配的哈希链获得所述编码位置对应的一个或多个基础字符串。
  16. 根据权利要求15所述的方法,其特征在于,所述哈希链包括有第一数组和第二数组;
    所述第一数组用于指示所述哈希链的首个节点,所述第二数组用于指示所述哈希链除所述首个节点以外的其他节点;
    其中,每个节点用于指示与所述至少一个待编码字符匹配的字符串在所述字典中的目标位置。
  17. 根据权利要求16所述的方法,其特征在于,所述每个节点的值为所述目标位置在所述字典中的位置编号。
  18. 根据权利要求16所述的方法,其特征在于,所述第一数组缓存于第一存储器中;
    所述使用所述第一哈希值查找匹配的哈希链,包括:
    从所述第一存储器中所述第一哈希值指向的地址确定匹配的哈希链的首个节点;
    使用所述哈希值更新所述匹配的哈希链的首个节点。
  19. 根据权利要求18所述的方法,其特征在于,所述第二数组缓存于第二存储器中;
    所述使用所述哈希值更新所述匹配的哈希链的首个节点,包括:
    将未更新前所述首个节点的值写入所述第二存储器中所述哈希链的第二数组所缓存的地址中;
    根据所述第一哈希值对应的至少一个待编码字符的位置编号更新所述首个节点的值。
  20. 根据权利要求19所述的方法,其特征在于,所述根据所述匹配的哈希链获得所述编码位置对应的一个或多个基础字符串,包括:
    根据所述第二数组依次查找所述哈希链中的每个节点;
    将所述至少一个待编码字符与所述节点指示的所述字典中目标位置处的已编码字符逐个进行比对,获得一个或多个基础匹配字符串。
  21. 根据权利要求20所述的方法,其特征在于,在所述根据所述第二数组依次查找所述哈希链中的每个节点时,所述方法还包括:
    确定每个节点指示的所述字典中与所述至少一个待编码字符匹配的已编码字符的 位置与所述编码位置的距离;
    如果所述距离大于所述字典的数据长度,则结束查找所述哈希链的节点。
  22. 根据权利要求20所述的方法,其特征在于,所述字典以及所述数据分块的部分待编码字符缓存在第三存储器以及第四存储器中;
    其中,所述节点指示的所述字典中与所述至少一个待编码字符匹配的已编码字符从所述第三存储器中读取;所述至少一个待编码字符从所述第四存储器中读取。
  23. 根据权利要求20所述的方法,其特征在于,所述将所述至少一个待编码字符与所述节点指示的所述字典中目标位置处的已编码字符逐个进行比对,获得一个或多个基础匹配字符串,还包括:
    将所述至少一个待编码字符与所述节点指示的所述字典中目标位置处的已编码字符逐个进行比对,得到基础匹配字符串的匹配长度;
    如果本次获取的基础匹配字符串的匹配长度大于上一次获取的基础匹配字符串的匹配长度,保留本次获取的基础匹配字符串,否则,丢弃本次获取的基础匹配字符串。
  24. 根据权利要求23所述的方法,其特征在于,所述得到基础匹配字符串的匹配长度,还包括:
    如果所述匹配长度大于所述数据分块中剩余待编码字符的数据长度,或者所述匹配长度不小于预设长度,停止比对的过程。
  25. 根据权利要求14至24任意一项所述的方法,其特征在于,在所述获得所述编码位置对应的所述最佳匹配结果之后,还包括:
    根据所述编码位置对应的已编码字符更新所述字典。
  26. 根据权利要求25所述的方法,其特征在于,所述根据所述编码位置对应的已编码字符更新所述字典,包括:
    根据所述编码位置对应的已编码字符更新所述字典中的已编码字符以及位置编号。
  27. 根据权利要求25所述的方法,其特征在于,所述字典以及所述数据分块的部分待编码字符缓存在第三存储器以及第四存储器中;
    在所述根据所述编码位置处的已编码字符更新所述字典之后,还包括:
    从外部存储器读取所述数据分块的其他剩余待编码字符,并将所述数据分块的其他剩余待编码字符缓存在第三存储器以及第四存储器中。
  28. 根据权利要求25所述的方法,其特征在于,所述数据分块的上下文数据还包括至少一条哈希链,所述哈希链用于定位所述编码位置对应的基础匹配字符串在所述字典中的位置;
    在所述根据所述编码位置对应的已编码字符更新所述字典之后,还包括:
    根据更新后的字典更新所述哈希链。
  29. 根据权利要求28所述的方法,其特征在于,所述哈希链包括有第一数组;所述第一数组用于指示所述哈希链的首个节点;所述第一数组缓存于第一存储器中;
    所述根据更新后的字典更新所述哈希链,包括:
    根据所述更新后的字典确定移出所述字典的已编码字符,并根据所述移出所述字典的已编码字符生成第二哈希值;
    如果所述第一哈希值不等于所述第二哈希值、且在所述第一存储器中所述第一哈希值指向的地址中所述哈希链节点的值等于所述第二哈希值指向的地址中所述哈希链节点的值,将所述第二哈希值指向的地址中所述哈希链节点的值置为空。
  30. 根据权利要求13所述的方法,其特征在于,所述上下文数据还包括重复匹配数组;所述重复匹配数组用于记录上一个数据分块最近至少一次重复匹配过程中,待编码字符与所述字典中的已编码字符的匹配距离;
    所述根据所述字典对所述数据分块中编码位置处的待编码字符依次进行匹配,获取所述编码位置对应的重复匹配字符串,包括:
    获取所述重复匹配数组所指示的至少一个匹配距离;
    将所述数据分块中所述编码位置处的待编码字符与所述匹配距离指示的所述字典中的已编码字符逐个进行匹配,获取所述编码位置对应的重复匹配字符串。
  31. 根据权利要求13所述的方法,其特征在于,所述最佳匹配结果为所述基础匹配字符串以及所述重复匹配字符串中编码代价较小者。
  32. 根据权利要求10所述的方法,其特征在于,所述对所述最佳匹配结果进行区间编码,包括:
    根据所述最佳匹配结果的类别确定所述最佳匹配结果的编码格式;
    根据所述最佳匹配结果的编码格式对所述最佳匹配结果进行区间编码。
  33. 根据权利要求32所述的方法,其特征在于,所述根据所述最佳匹配结果的编码格式对所述最佳匹配结果进行区间编码,包括:
    根据所述最佳匹配结果的编码格式将所述最佳匹配结果转换为二进制比特位;
    对所述二进制比特位中的每个比特位进行编码。
  34. 根据权利要求33所述的方法,其特征在于,所述上下文数据还包括有上一个数据分块最后一次进行区间编码时确定的编码区间的大小和下限、以及编码字符;所述编码字符用于指示0出现的频次;
    所述对所述二进制比特位中的每个比特位进行编码,包括:
    在编码每个比特位时,确定所述比特位对应的所述编码字符;
    根据本次编码的比特位更新所述编码字符;
    根据更新后的编码字符以及所述上下文数据,确定本次编码的比特位对应的编码区间的大小以及编码区间的下限;
    根据所述编码区间的大小、编码区间的下限以及所述更新后的编码字符,获得所述比特位的编码码流。
  35. 一种数据压缩装置,其特征在于,包括:数据读取模块以及压缩模块;
    所述数据读取模块,用于读取多个待压缩文件中的其中一个待压缩文件的数据分块,以及,读取所述数据分块的上下文数据;所述上下文数据用于指示与所述数据分块属于同一待压缩文件的已压缩数据在压缩过程中的状态信息;
    所述压缩模块,用于根据所述数据分块的上下文数据对所述数据分块进行压缩处理,生成编码码流;其中,所述数据分块与上一次进行压缩处理的数据分块属于不同的待压缩文件。
  36. 根据权利要求35所述的装置,其特征在于,所述待压缩文件包括数据量正在持续增加的数据流,和/或,数据量固定的文件。
  37. 根据权利要求35所述的装置,其特征在于,所述数据读取模块具体用于:获取已配置的分块参数,并根据所述分块参数获取所述数据分块。
  38. 根据权利要求37所述的装置,其特征在于,所述分块参数包括以下至少一项或多项:所述数据分块的属性、数据量、压缩参数、存储地址、上下文数据的存储地址、以及所述数据分块的编码码流的存储地址。
  39. 根据权利要求35所述的装置,其特征在于,同一待压缩文件的不同数据分块的上下文数据的存储地址相同;和/或,
    同一待压缩文件的不同数据分块的编码码流的存储地址是连续的。
  40. 根据权利要求35所述的装置,其特征在于,所述数据读取模块具体用于:
    如果所述数据分块为所述待压缩文件的非首个数据分块,读取所述数据分块的上下文数据。
  41. 根据权利要求35所述的装置,其特征在于,所述装置还包括数据写出模块;
    所述数据写出模块,用于如果所述数据分块为所述待压缩文件的非末个数据分块,将所述数据分块在压缩处理过程中的状态信息作为所述待压缩文件的下一个数据分块的上 下文数据进行存储。
  42. 根据权利要求35或41所述的装置,其特征在于,所述装置还包括数据写出模块;
    所述压缩模块还用于:在所述数据分块为所述待压缩文件的非末个数据分块的情况下,在对所述数据分块进行压缩的过程中,如果所述数据分块的剩余待编码数据的数据量不大于预设阈值,停止编码所述数据分块;
    所述数据写出模块,用于将所述数据分块的剩余待编码数据作为下一个数据分块的上下文数据进行存储,以在下一个数据分块的压缩过程中编码所述剩余待编码数据。
  43. 根据权利要求42所述的装置,其特征在于,在所述数据分块为所述待压缩文件的非首个数据分块的情况下,所述数据分块的待编码数据包括所述上下文数据指示的上一个数据分块的剩余待编码数据以及自身的待编码数据。
  44. 根据权利要求35所述的装置,其特征在于,所述压缩模块包括第一编码器和第二编码器;
    所述第一编码器用于根据所述数据分块的上下文数据对所述数据分块中编码位置处的待编码字符依次进行字典编码,获得所述编码位置对应的最佳匹配结果;
    所述第二编码器用于对所述编码位置对应的最佳匹配结果进行区间编码,获取所述数据分块的编码码流。
  45. 根据权利要求44所述的装置,其特征在于,对所述数据分块中当前编码位置对应的最佳匹配结果进行区间编码的过程与对所述数据分块中下一个编码位置处的待编码字符进行字典编码的过程并行执行。
  46. 根据权利要求45所述的装置,其特征在于,所述装置包括FIFO存储器;
    所述编码位置对应的最佳匹配结果存储在FIFO存储器中。
  47. 根据权利要求44所述的装置,其特征在于,所述数据分块的上下文数据至少包括有字典;所述字典用于指示与所述数据分块属于同一待压缩文件的已编码字符;
    所述第一编码器具体用于:
    根据所述字典对所述数据分块中编码位置处的待编码字符依次进行匹配,获取所述编码位置对应的基础匹配字符串以及重复匹配字符串;
    比较所述基础匹配字符串以及重复匹配字符串,获得所述编码位置对应的所述最佳匹配结果。
  48. 根据权利要求47所述的装置,其特征在于,所述字典中的已编码字符的位置对应的位置编号在预设的编号范围内进行循环编号。
  49. 根据权利要求47或48所述的装置,其特征在于,所述数据分块的上下文数据还 包括至少一条哈希链,所述哈希链用于定位与至少一个待编码字符匹配的字符串在所述字典中的位置;
    在获取所述编码位置对应的基础匹配字符串的过程中,所述第一编码器还用于:
    获取从所述编码位置开始的至少一个待编码字符,并根据所述至少一个待编码字符生成第一哈希值;
    使用所述第一哈希值查找匹配的哈希链,并根据所述匹配的哈希链获得所述编码位置对应的一个或多个基础字符串。
  50. 根据权利要求49所述的装置,其特征在于,所述哈希链包括有第一数组和第二数组;
    所述第一数组用于指示所述哈希链的首个节点,所述第二数组用于指示所述哈希链除所述首个节点以外的其他节点;
    其中,每个节点用于指示与所述至少一个待编码字符匹配的字符串在所述字典中的目标位置。
  51. 根据权利要求50所述的装置,其特征在于,所述每个节点的值为所述目标位置在所述字典中的位置编号。
  52. 根据权利要求50所述的装置,其特征在于,所述第一数组缓存于第一存储器中;
    所述第一编码器还用于:从所述第一存储器中所述第一哈希值指向的地址确定匹配的哈希链的首个节点;使用所述哈希值更新所述匹配的哈希链的首个节点。
  53. 根据权利要求52所述的装置,其特征在于,所述第二数组缓存于第二存储器中;
    所述第一编码器还用于:
    将未更新前所述首个节点的值写入所述第二存储器中所述哈希链的第二数组所缓存的地址中;
    根据所述第一哈希值对应的至少一个待编码字符的位置编号更新所述首个节点的值。
  54. 根据权利要求53所述的装置,其特征在于,所述第一编码器还用于:
    根据所述第二数组依次查找所述哈希链中的每个节点;
    将所述至少一个待编码字符与所述节点指示的所述字典中目标位置处的已编码字符逐个进行比对,获得一个或多个基础匹配字符串。
  55. 根据权利要求54所述的装置,其特征在于,在所述根据所述第二数组依次查找所述哈希链中的每个节点的过程中,所述第一编码器还用于:
    确定每个节点指示的所述字典中与所述至少一个待编码字符匹配的已编码字符的位置与所述编码位置的距离;
    如果所述距离大于所述字典的数据长度,则结束查找所述哈希链的节点。
  56. 根据权利要求54所述的装置,其特征在于,所述字典以及所述数据分块的部分待编码字符缓存在第三存储器以及第四存储器中;
    其中,所述节点指示的所述字典中与所述至少一个待编码字符匹配的已编码字符从所述第三存储器中读取;所述至少一个待编码字符从所述第四存储器中读取。
  57. 根据权利要求54所述的装置,其特征在于,所述第一编码器还用于:
    将所述至少一个待编码字符与所述节点指示的所述字典中目标位置处的已编码字符逐个进行比对,得到基础匹配字符串的匹配长度;
    如果本次获取的基础匹配字符串的匹配长度大于上一次获取的基础匹配字符串的匹配长度,保留本次获取的基础匹配字符串,否则,丢弃本次获取的基础匹配字符串。
  58. 根据权利要求57所述的装置,其特征在于,所述第一编码器还用于:如果所述匹配长度大于所述数据分块中剩余待编码字符的数据长度,或者所述匹配长度不小于预设长度,停止比对的过程。
  59. 根据权利要求47至58任意一项所述的装置,其特征在于,所述第一编码器还用于:根据所述编码位置对应的已编码字符更新所述字典。
  60. 根据权利要求59所述的装置,其特征在于,所述第一编码器还用于:根据所述编码位置对应的已编码字符更新所述字典中的已编码字符以及位置编号。
  61. 根据权利要求59所述的装置,其特征在于,所述字典以及所述数据分块的部分待编码字符缓存在第三存储器以及第四存储器中;
    在所述根据所述编码位置处的已编码字符更新所述字典之后,所述第一编码器还用于:从外部存储器读取所述数据分块的其他剩余待编码字符,并将所述数据分块的其他剩余待编码字符缓存在第三存储器以及第四存储器中。
  62. 根据权利要求59所述的装置,其特征在于,所述数据分块的上下文数据还包括至少一条哈希链,所述哈希链用于定位所述编码位置对应的基础匹配字符串在所述字典中的位置;
    在所述根据所述编码位置对应的已编码字符更新所述字典之后,所述第一编码器还用于:根据更新后的字典更新所述哈希链。
  63. 根据权利要求62所述的装置,其特征在于,所述哈希链包括有第一数组;所述第一数组用于指示所述哈希链的首个节点;所述第一数组缓存于第一存储器中;
    所述第一编码器还用于:
    根据所述更新后的字典确定移出所述字典的已编码字符,并根据所述移出所述字典的 已编码字符生成第二哈希值;
    如果所述第一哈希值不等于所述第二哈希值、且在所述第一存储器中所述第一哈希值指向的地址中所述哈希链节点的值等于所述第二哈希值指向的地址中所述哈希链节点的值,将所述第二哈希值指向的地址中所述哈希链节点的值置为空。
  64. 根据权利要求47所述的装置,其特征在于,所述上下文数据还包括重复匹配数组;所述重复匹配数组用于记录上一个数据分块最近至少一次重复匹配过程中,待编码字符与所述字典中的已编码字符的匹配距离;
    所述第一编码器还用于:获取所述重复匹配数组所指示的至少一个匹配距离;
    将所述数据分块中所述编码位置处的待编码字符与所述匹配距离指示的所述字典中的已编码字符逐个进行匹配,获取所述编码位置对应的重复匹配字符串。
  65. 根据权利要求47所述的装置,其特征在于,所述最佳匹配结果为所述基础匹配字符串以及所述重复匹配字符串中编码代价较小者。
  66. 根据权利要求44所述的装置,其特征在于,所述第二编码器还用于:
    根据所述最佳匹配结果的类别确定所述最佳匹配结果的编码格式;
    根据所述最佳匹配结果的编码格式对所述最佳匹配结果进行区间编码。
  67. 根据权利要求66所述的装置,其特征在于,所述第二编码器还用于:根据所述最佳匹配结果的编码格式将所述最佳匹配结果转换为二进制比特位;
    对所述二进制比特位中的每个比特位进行编码。
  68. 根据权利要求67所述的装置,其特征在于,所述上下文数据还包括有上一个数据分块最后一次进行区间编码时确定的编码区间的大小和下限、以及编码字符;所述编码字符用于指示0出现的频次;
    所述第二编码器还用于:
    在编码每个比特位时,确定所述比特位对应的所述编码字符;
    根据本次编码的比特位更新所述编码字符;
    根据更新后的编码字符以及所述上下文数据,确定本次编码的比特位对应的编码区间的大小以及编码区间的下限;
    根据所述编码区间的大小、编码区间的下限以及所述更新后的编码字符,获得所述比特位的编码码流。
  69. 一种可移动平台,其特征在于,包括:
    机体;
    动力系统,设于所述机体内,用于为所述可移动平台提供动力;
    以及,如权利要求35至68任意一项所述的装置。
  70. 一种计算机可读存储介质,其特征在于,其上存储有计算机指令,该指令被处理器执行时实现权利要求1至34任意一项所述的方法。
PCT/CN2021/082630 2021-03-24 2021-03-24 数据压缩方法、装置、可移动平台及存储介质 WO2022198483A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2021/082630 WO2022198483A1 (zh) 2021-03-24 2021-03-24 数据压缩方法、装置、可移动平台及存储介质

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2021/082630 WO2022198483A1 (zh) 2021-03-24 2021-03-24 数据压缩方法、装置、可移动平台及存储介质

Publications (1)

Publication Number Publication Date
WO2022198483A1 true WO2022198483A1 (zh) 2022-09-29

Family

ID=83396228

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/082630 WO2022198483A1 (zh) 2021-03-24 2021-03-24 数据压缩方法、装置、可移动平台及存储介质

Country Status (1)

Country Link
WO (1) WO2022198483A1 (zh)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115577149A (zh) * 2022-12-13 2023-01-06 浪潮电子信息产业股份有限公司 一种数据处理方法、装置、设备及可读存储介质
CN116388767A (zh) * 2023-04-11 2023-07-04 河南大学 用于软件开发数据的安全管理方法
CN116505952A (zh) * 2023-06-27 2023-07-28 厦门立林科技有限公司 红外码压缩方法、装置、智能设备及存储介质
CN117113106A (zh) * 2023-10-19 2023-11-24 深圳大普微电子股份有限公司 一种数据压缩方法、装置及电子设备和存储介质
CN117195005A (zh) * 2023-11-03 2023-12-08 山东四季车网络科技有限公司 基于智慧洗车的信息数据管理系统
CN117874049A (zh) * 2024-03-08 2024-04-12 北京龙创悦动网络科技有限公司 一种手游数据更新方法及系统
CN117950598A (zh) * 2024-03-26 2024-04-30 深圳市凯博科技有限公司 一种电子产品设计数据智能存储方法
CN117950598B (zh) * 2024-03-26 2024-06-07 深圳市凯博科技有限公司 一种电子产品设计数据智能存储方法

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120268298A1 (en) * 2009-09-04 2012-10-25 Yun-Sik Oh Method and apparatus for compressing and decompressing block unit data
CN102982046A (zh) * 2011-09-07 2013-03-20 中国移动通信集团公司 一种网页数据压缩存储方法和系统
CN106991134A (zh) * 2017-03-13 2017-07-28 人和未来生物科技(长沙)有限公司 一种基于对象存储的大型数据云存储方法
CN107087184A (zh) * 2017-04-28 2017-08-22 华南理工大学 一种多媒体数据再压缩方法
CN110888851A (zh) * 2018-08-15 2020-03-17 阿里巴巴集团控股有限公司 压缩文件创建和解压的方法及装置、以及电子和存储设备

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120268298A1 (en) * 2009-09-04 2012-10-25 Yun-Sik Oh Method and apparatus for compressing and decompressing block unit data
CN102982046A (zh) * 2011-09-07 2013-03-20 中国移动通信集团公司 一种网页数据压缩存储方法和系统
CN106991134A (zh) * 2017-03-13 2017-07-28 人和未来生物科技(长沙)有限公司 一种基于对象存储的大型数据云存储方法
CN107087184A (zh) * 2017-04-28 2017-08-22 华南理工大学 一种多媒体数据再压缩方法
CN110888851A (zh) * 2018-08-15 2020-03-17 阿里巴巴集团控股有限公司 压缩文件创建和解压的方法及装置、以及电子和存储设备

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115577149A (zh) * 2022-12-13 2023-01-06 浪潮电子信息产业股份有限公司 一种数据处理方法、装置、设备及可读存储介质
CN115577149B (zh) * 2022-12-13 2023-03-10 浪潮电子信息产业股份有限公司 一种数据处理方法、装置、设备及可读存储介质
CN116388767A (zh) * 2023-04-11 2023-07-04 河南大学 用于软件开发数据的安全管理方法
CN116388767B (zh) * 2023-04-11 2023-10-13 河北湛泸软件开发有限公司 用于软件开发数据的安全管理方法
CN116505952A (zh) * 2023-06-27 2023-07-28 厦门立林科技有限公司 红外码压缩方法、装置、智能设备及存储介质
CN116505952B (zh) * 2023-06-27 2023-09-08 厦门立林科技有限公司 红外码压缩方法、装置、智能设备及存储介质
CN117113106A (zh) * 2023-10-19 2023-11-24 深圳大普微电子股份有限公司 一种数据压缩方法、装置及电子设备和存储介质
CN117113106B (zh) * 2023-10-19 2024-03-19 深圳大普微电子股份有限公司 一种数据压缩方法、装置及电子设备和存储介质
CN117195005A (zh) * 2023-11-03 2023-12-08 山东四季车网络科技有限公司 基于智慧洗车的信息数据管理系统
CN117195005B (zh) * 2023-11-03 2024-01-26 山东四季车网络科技有限公司 基于智慧洗车的信息数据管理系统
CN117874049A (zh) * 2024-03-08 2024-04-12 北京龙创悦动网络科技有限公司 一种手游数据更新方法及系统
CN117874049B (zh) * 2024-03-08 2024-06-11 北京龙创悦动网络科技有限公司 一种手游数据更新方法及系统
CN117950598A (zh) * 2024-03-26 2024-04-30 深圳市凯博科技有限公司 一种电子产品设计数据智能存储方法
CN117950598B (zh) * 2024-03-26 2024-06-07 深圳市凯博科技有限公司 一种电子产品设计数据智能存储方法

Similar Documents

Publication Publication Date Title
WO2022198483A1 (zh) 数据压缩方法、装置、可移动平台及存储介质
JP4961126B2 (ja) リモート差分圧縮のための候補オブジェクトを見つける効率のよいアルゴリズム
US10187081B1 (en) Dictionary preload for data compression
US20130181851A1 (en) Encoding method, encoding apparatus, decoding method, decoding apparatus, and system
CN107682016B (zh) 一种数据压缩方法、数据解压方法及相关系统
US10680645B2 (en) System and method for data storage, transfer, synchronization, and security using codeword probability estimation
WO2023160123A1 (zh) Lz系列压缩算法编解码速度优化方法
WO2020253406A1 (zh) 一种数据处理方法、装置及计算机可读存储介质
JP2014534486A (ja) スケーラブル・データ・デュプリケーションのための方法、システム、およびコンピュータ・プログラム
JPH09153818A (ja) データ圧縮・伸長装置
JP2021527376A (ja) データ圧縮
US20230393737A1 (en) System and method for multiple pass data compaction utilizing delta encoding
CN116170027B (zh) 一种毒检设备数据管理系统及处理方法
US11928335B2 (en) System and method for data compaction utilizing mismatch probability estimation
WO2010050924A1 (en) Method and apparatus for compressing and decompressing data records
JP2017530592A (ja) 適応率圧縮ハッシュ処理デバイス
CN101469989B (zh) 一种手机网络导航中导航数据的压缩方法
US8868584B2 (en) Compression pattern matching
CN104410424A (zh) 嵌入式设备内存数据的快速无损压缩方法
US10565182B2 (en) Hardware LZMA compressor
US9287893B1 (en) ASIC block for high bandwidth LZ77 decompression
US20240020006A1 (en) System and method for compaction of floating-point numbers within a dataset
WO2021103013A1 (zh) 一种数据编码、数据解码方法、设备及存储介质
WO2014030180A1 (ja) 格納プログラム、格納方法、格納装置、伸張プログラム、伸張方法及び伸張装置
CN114791904A (zh) 布隆过滤器的持久化压缩方法及装置

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: 21932111

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: 21932111

Country of ref document: EP

Kind code of ref document: A1