Data compression method and device, data decompression method and device and storage system

CN121532950APending Publication Date: 2026-02-13HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202480045969.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-07-27
Filing Date
2024-01-29
Publication Date
2026-02-13

AI Technical Summary

Technical Problem

The prior art needs to rely on all the previous data blocks during the decompression process of data blocks, resulting in an increase in computing resource overhead and wasting a large amount of computing resources.

Method used

By constructing similar trees of the tree structure, determine the target reference data block, and only rely on the data block on the root node path during decompression to avoid relying on all the data blocks in the previous linear relationship.

Benefits of technology

While ensuring the compression rate, reduce the computing resource overhead in the compression process, avoid the waste of computing resources, and improve performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121532950A_ABST
    Figure CN121532950A_ABST
Patent Text Reader

Abstract

A data compression method and apparatus, and a storage system, the method comprising: acquiring a first data block set, the first data block set comprising a plurality of similar data blocks, the plurality of data blocks comprising a target data block; a target reference data block is determined according to a similar tree corresponding to the first data block set, the similar tree is of a tree structure and comprises a plurality of father-child node pairs, and each father-child node pair is used for indicating two data blocks meeting similar conditions in the first data block set; the plurality of father-child node pairs comprise target father-child node pairs used for indicating the target reference data block and the target data block, and nodes corresponding to the target reference data block in the target father-child node pairs are father nodes of nodes corresponding to the target data block; and performing reference compression on the target data block according to the target reference data block to obtain a compressed target data block. According to the method, the resource overhead can be saved when the compressed data is decompressed, and the waste of a large number of computing resources is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Data compression and decompression method, device and storage system

[0001] This application claims priority from Russian patent application No. 2023119769 filed on July 27, 2023, entitled “Method, device and storage system for data compression and decompression”, the entire contents of which are incorporated herein by reference. Technical Field

[0002] The present application relates to the field of data compression, and more specifically, to a method, device and storage system for data compression and decompression. Background Art

[0003] With the increasing pace of informatization and the rapid development of big data, cloud computing, and artificial intelligence technologies, enterprises' demand for data is exploding. This massive amount of data inevitably places enormous pressure on data storage and management. Therefore, data reduction or compression is a key technology for improving storage space utilization in storage systems and meeting rapidly growing storage demands with limited storage capacity.

[0004] Similarity compression is a method of implementing data compression. Compared with the technical limitation of data deduplication that requires data blocks to be exactly the same to eliminate redundant data, similar data deduplication technology has a significant reduction effect on data blocks that are not completely duplicated but have a certain degree of similarity.

[0005] In a related similarity compression technology, similar data blocks are linearly related in similarity during similarity compression. That is, during block-reference compression, the compression of one block references all preceding blocks. This means that during decompression, decompressing one block relies on all preceding blocks in the linear relationship, increasing computing resource overhead.

[0006] Therefore, how to save resource overhead when decompressing compressed data and avoid wasting a large amount of computing resources has become a technical problem that urgently needs to be solved.

[0007] Summary of the Invention

[0008] The present application provides a method, device and storage system for data compression and decompression, which can save resource overhead when decompressing compressed data and avoid wasting a large amount of computing resources.

[0009] In a first aspect, a method for data compression is provided, the method comprising: obtaining a first data block set, the first data block set including a plurality of similar data blocks, the plurality of data blocks including a target data block; determining a target reference data block based on a similarity tree corresponding to the first data block set, the similarity tree being a tree structure, the similarity tree including a plurality of parent-child node pairs, each parent-child node pair being used to indicate two data blocks in the first data block set that meet similarity conditions; the plurality of parent-child node pairs including a target parent-child node pair for indicating a target reference data block and a target data block, and the node corresponding to the target reference data block in the target parent-child node pair being the parent node of the node corresponding to the target data block; performing reference compression on the target data block based on the target reference data block to obtain a compressed target data block.

[0010] In the above technical solution, when similarity compression is performed on the target data block, the target reference data block is determined based on a similarity tree with a tree structure. In this similarity tree, the node corresponding to the target reference data block is the parent node of the node of the target data block. Since the compression of the target data block refers to the target reference data block, and the node corresponding to the target data block and the node corresponding to the target reference data block are in a parent-child relationship in the similarity tree, when decompressing the data blocks, decompressing one of the data blocks will only rely on the data blocks on the root node path, and will not rely on all the previous data blocks in the linear relationship. Therefore, when decompressing, resource overhead can be saved, a large amount of computing resources can be avoided, and performance can be improved while ensuring the compression rate.

[0011] In combination with the first aspect, in some implementations of the first aspect, the method further includes: constructing the similarity tree according to the similar fingerprints of each of the multiple data blocks.

[0012] In the above technical solution, the similarity tree constructed based on the similar fingerprints of multiple data blocks can be used to compress or decompress the data blocks, so that the data can save resource overhead during the decompression process, avoid the waste of a large amount of computing resources, and improve performance while ensuring the compression rate.

[0013] In combination with the first aspect, in certain implementations of the first aspect, the multiple parent-child node pairs are determined based on the similar fingerprints of the multiple data blocks; and the similarity tree is constructed based on the multiple parent-child node pairs.

[0014] In combination with the first aspect, in certain implementations of the first aspect, a data block is selected from the first data block set as the root node of the similarity tree, and the child node corresponding to the root node is determined based on the similar fingerprints and similar conditions of multiple data blocks. The above-mentioned root node and the child node corresponding to the root node are then used as the parent node, and the similar fingerprints and similar conditions of the remaining data blocks are determined to determine the child node corresponding to the parent node.

[0015] In combination with the first aspect, in certain implementations of the first aspect, multiple parent-child node pairs that meet the conditions are determined based on the similar fingerprints of multiple data blocks in the first data block set, and these parent-child node pairs are combined together to construct a similarity tree corresponding to the first data block set.

[0016] In combination with the first aspect, in certain implementations of the first aspect, the method further includes: saving information of the similarity tree in multiple compressed data blocks corresponding to the first data block set, and the saved information of the similarity tree is used to decompress the multiple compressed data blocks corresponding to the first data block set.

[0017] In the above technical solution, the information of the similarity tree can be saved in multiple compressed data blocks corresponding to the first data block set. In this way, when the multiple compressed data blocks corresponding to the first data block set are decompressed, the reference data block of the compressed data block can be determined based on the information of the similarity tree, so that the data can save resource overhead during the decompression process, avoid the waste of a large amount of computing resources, and improve performance while ensuring the compression rate.

[0018] In combination with the first aspect, in certain implementations of the first aspect, the information of the similarity tree includes information of parent-child node pairs in the similarity tree.

[0019] In the above technical solution, the information of the parent-child node pairs in the similarity tree can be saved in the compressed data block. In this way, when the compressed data block is decompressed, the reference data block can be directly determined based on the information of the parent-child node pairs without constructing the entire similarity tree, thereby further saving computing resources.

[0020] In combination with the first aspect, in some implementations of the first aspect, the information of the similarity tree includes similarity fingerprints of the data blocks in the first data block set.

[0021] In the above technical solution, the similarity fingerprints of the data blocks in the first data block set can also be saved in the compressed data blocks. In this way, when the compressed data blocks are decompressed, a similarity tree can be first constructed based on the similarity fingerprints of the data blocks, and the reference data blocks can be determined based on the information of the parent-child node pairs in the similarity tree.

[0022] In combination with the first aspect, in certain implementations of the first aspect, the information of the similarity tree is stored in any compressed data block among the multiple compressed data blocks corresponding to the first data block set.

[0023] In combination with the first aspect, in some implementations of the first aspect, the information of the similarity tree is stored in a compressed data block corresponding to the root node of the similarity tree.

[0024] In the above technical solution, since the compressed data block corresponding to the root node needs to be decompressed when decompressing the data block, storing the similarity tree information in the compressed data block corresponding to the root node of the similarity tree can further save resource overhead.

[0025] In combination with the first aspect, in some implementations of the first aspect, a parent node in the similarity tree includes at least one child node.

[0026] In a second aspect, a method for data decompression is provided, the method comprising: obtaining compressed data, the compressed data comprising multiple compressed data blocks corresponding to a first data block set and information of a similarity tree corresponding to the first data block set, wherein the multiple compressed data blocks comprise a first compressed data block, the first compressed data block being compressed from a target data block in the first data block set, the similarity tree being a tree structure, and the similarity tree comprising multiple parent-child node pairs, each of the parent-child node pairs being used to indicate two data blocks in the first data block set that meet similarity conditions; determining an identifier of a target reference data block based on the information of the similarity tree, the node corresponding to the target reference data block and the node corresponding to the target data block constituting a parent-child node pair in the multiple parent-child node pairs, and the node corresponding to the target reference data block in the target parent-child node pair being the parent node of the node corresponding to the target data block; obtaining the target reference data block based on the identifier of the target reference data block, and decompressing the first compressed data block based on the target reference data block to obtain the target data block.

[0027] In combination with the second aspect, in certain implementations of the second aspect, the information of the similarity tree is stored in any compressed data block among the multiple compressed data blocks.

[0028] In combination with the second aspect, in certain implementations of the second aspect, the information of the similarity tree includes similar fingerprints of multiple data blocks in the first data block set; based on the similar fingerprints of multiple data blocks in the first data block set, multiple parent-child node pairs in the similarity tree are determined; the similarity tree is constructed based on the multiple parent-child node pairs; and the identifier of the parent node of the node corresponding to the target data block in the similarity tree is used as the identifier of the target reference data block.

[0029] In combination with the second aspect, in certain implementations of the second aspect, the information of the similarity tree includes information of parent-child node pairs in the similarity tree; in the information of the parent-child node pairs, the identifier of the parent node of the node corresponding to the target data block is used as the identifier of the target reference data block.

[0030] In combination with the second aspect, in some implementations of the second aspect, a parent node in the similarity tree includes at least one child node.

[0031] In combination with the second aspect, in certain implementations of the second aspect, a second compressed data block is obtained from the multiple compressed data blocks based on the identifier of the target reference data block, and the second compressed data block is compressed by the target reference data block in the first data block set; the second compressed data block is decompressed based on the information of the similarity tree to obtain the target reference data block.

[0032] For the beneficial effects of each aspect in the second aspect, please refer to the beneficial effects of each aspect in the first aspect, and no further details will be given here.

[0033] According to a third aspect, a data compression device is provided, comprising: an acquisition module, a determination module, and a compression module. The acquisition module is configured to acquire a first data block set, wherein the first data block set includes a plurality of similar data blocks, wherein the plurality of data blocks include a target data block; the determination module is configured to determine a target reference data block based on a similarity tree corresponding to the first data block set, wherein the similarity tree is a tree structure and includes a plurality of parent-child node pairs, each of which is configured to indicate two data blocks in the first data block set that meet similarity conditions; wherein the plurality of parent-child node pairs include a target parent-child node pair for indicating the target reference data block and the target data block, and the node corresponding to the target reference data block in the target parent-child node pair is the parent node of the node corresponding to the target data block; and the compression module is configured to perform reference compression on the target data block based on the target reference data block to obtain a compressed target data block.

[0034] In combination with the third aspect, in some implementations of the third aspect, the apparatus further includes: a construction module configured to construct the similarity tree according to the similar fingerprints of the plurality of data blocks.

[0035] In combination with the third aspect, in certain implementations of the third aspect, the construction module is specifically used to: determine the multiple parent-child node pairs based on the similar fingerprints of the multiple data blocks; and construct the similarity tree based on the multiple parent-child node pairs.

[0036] In combination with the third aspect, in certain implementations of the third aspect, the construction module is specifically used to: select a data block from the first data block set as the root node of the similarity tree, and determine the child node corresponding to the root node based on the similar fingerprints and similar conditions of multiple data blocks, and then use the above-mentioned root node and the child node corresponding to the root node as the parent node, determine the similar fingerprints and similar conditions of the remaining data blocks to determine the child node corresponding to the parent node.

[0037] In combination with the third aspect, in certain implementations of the third aspect, the construction module is specifically used to: determine multiple parent-child node pairs that meet the conditions based on the similar fingerprints of multiple data blocks in the first data block set, and combine these parent-child node pairs together to construct a similarity tree corresponding to the first data block set.

[0038] In combination with the third aspect, in certain implementations of the third aspect, the device further includes: a storage module for storing information of the similarity tree in a compressed data block, and the stored information of the similarity tree is used to decompress multiple compressed data blocks corresponding to the first data block set.

[0039] In combination with the third aspect, in certain implementations of the third aspect, the information of the similarity tree includes information of parent-child node pairs in the similarity tree.

[0040] In combination with the third aspect, in certain implementations of the third aspect, the information of the similarity tree includes similarity fingerprints of the data blocks in the first data block set.

[0041] In combination with the third aspect, in certain implementations of the third aspect, the information of the similarity tree is stored in any compressed data block among the multiple compressed data blocks corresponding to the first data block set.

[0042] In combination with the third aspect, in certain implementations of the third aspect, a parent node in the similarity tree includes at least one child node.

[0043] In a fourth aspect, a data decompression device is provided, comprising: an acquisition module, a determination module, and an acquisition module. The acquisition module is configured to acquire compressed data, the compressed data comprising information about a plurality of compressed data blocks corresponding to a first data block set and a similarity tree corresponding to the first data block set, wherein the plurality of compressed data blocks comprises a first compressed data block, the first compressed data block being compressed from a target data block in the first data block set, the similarity tree being a tree structure and comprising a plurality of parent-child node pairs, each of the parent-child node pairs being used to indicate two data blocks in the first data block set that meet similarity conditions; the determination module is configured to determine an identifier of a target reference data block based on the information of the similarity tree, wherein a node corresponding to the target reference data block and a node corresponding to the target data block constitute a parent-child node pair in the plurality of parent-child node pairs, and the node corresponding to the target reference data block in the target parent-child node pair is the parent node of the node corresponding to the target data block; and the acquisition module is configured to acquire the target reference data block based on the identifier of the target reference data block, and decompress the first compressed data block based on the target reference data block to obtain the target data block.

[0044] In combination with the fourth aspect, in certain implementations of the fourth aspect, the information of the similarity tree is stored in any compressed data block among the multiple compressed data blocks.

[0045] In combination with the fourth aspect, in certain implementations of the fourth aspect, the information of the similarity tree includes similar fingerprints of multiple data blocks in the first data block set; the determination module is specifically used to: determine multiple parent-child node pairs in the similarity tree based on the similarity fingerprints of multiple data blocks in the first data block set; construct the similarity tree based on the multiple parent-child node pairs; and use the identifier of the parent node of the node corresponding to the target data block in the similarity tree as the identifier of the target reference data block.

[0046] In combination with the fourth aspect, in certain implementations of the fourth aspect, the information of the similarity tree includes information of parent-child node pairs in the similarity tree; the determination module is specifically used to: use the identifier of the parent node of the node corresponding to the target data block in the information of the parent-child node pair as the identifier of the target reference data block.

[0047] In combination with the fourth aspect, in certain implementations of the fourth aspect, a parent node in the similarity tree includes at least one child node.

[0048] In combination with the fourth aspect, in certain implementations of the fourth aspect, the acquisition module is specifically used to: obtain a second compressed data block from the multiple compressed data blocks based on the identifier of the target reference data block, where the second compressed data block is compressed from the target reference data block in the first data block set; and decompress the second compressed data block based on the information of the similarity tree to obtain the target reference data block.

[0049] In a fifth aspect, a storage system is provided, comprising a controller and a memory, wherein the controller is used to execute the method in the first aspect or any possible implementation of the first aspect to store the compressed data in the memory; or the controller is used to execute the method in the second aspect or any possible implementation of the second aspect to obtain the compressed data from the memory.

[0050] In a sixth aspect, a computing device is provided, comprising a processor and a memory; the processor is used to execute instructions stored in the memory so that the computing device executes the method in the first aspect or any possible implementation of the first aspect, or executes the method in the second aspect and any implementation of the second aspect.

[0051] Optionally, the processor may be a general-purpose processor, which may be implemented in hardware or software. When implemented in hardware, the processor may be a logic circuit, an integrated circuit, or the like; when implemented in software, the processor may be a general-purpose processor implemented by reading software code stored in a memory, which may be integrated into the processor or located independently of the processor.

[0052] As an example, the computing device may be a controller in the storage system, or may be a device with computing capabilities connected to the storage system, which is not specifically limited in this application. The device with computing capabilities may be an application server connected to the storage system, or may be a third-party computing device connected to the storage system.

[0053] In the seventh aspect, a computer program product comprising instructions is provided, which, when executed by a computing device, causes the computing device to execute the method as described in the first aspect and any one of its implementations, or the method as described in the second aspect and any one of its implementations.

[0054] In an eighth aspect, a computer-readable storage medium is provided, comprising computer program instructions. When the computer program instructions are executed by a computing device, the computing device executes the method in the first aspect and any one of the implementations of the first aspect, or executes the method in the second aspect and any one of the implementations of the second aspect.

[0055] By way of example, these computer-readable storages include, but are not limited to, one or more of the following: read-only memory (ROM), programmable ROM (PROM), erasable PROM (EPROM), Flash memory, electrically EPROM (EEPROM), and a hard drive.

[0056] Optionally, as an implementation manner, the above-mentioned storage medium may specifically be a non-volatile storage medium. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] FIG1 is a schematic diagram showing that the similarities between existing similar data blocks are in a linear relationship.

[0058] FIG2 is a schematic flow chart of a data compression method provided in an embodiment of the present application.

[0059] FIG3 is a schematic block diagram of multiple data blocks in a first data block set provided by an embodiment of the present application before and after compression.

[0060] FIG4 is a schematic diagram of a similarity tree corresponding to a first data block set provided in an embodiment of the present application.

[0061] FIG5 is a schematic flowchart of a data decompression method provided in an embodiment of the present application.

[0062] FIG6 is a schematic flowchart of a method for constructing a similarity tree corresponding to a first set of data blocks provided in an embodiment of the present application.

[0063] FIG7 is a schematic block diagram of a process of constructing a similarity tree corresponding to a first set of data blocks provided in an embodiment of the present application.

[0064] FIG8 is a schematic flowchart of another method for constructing a similarity tree corresponding to a set of similar data provided in an embodiment of the present application.

[0065] FIG9 is a schematic block diagram of another process of constructing a similarity tree corresponding to a first set of data blocks provided in an embodiment of the present application.

[0066] FIG10 is a schematic block diagram of a data compression device 1000 provided in an embodiment of the present application.

[0067] FIG11 is a schematic block diagram of a data decompression device 1100 provided in an embodiment of the present application.

[0068] FIG12 is a schematic diagram of a system architecture provided in an embodiment of the present application.

[0069] FIG13 is a schematic diagram of a centralized storage system applicable to an embodiment of the present application.

[0070] FIG14 is a schematic diagram of a distributed storage system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0071] The technical solution in this application will be described below with reference to the accompanying drawings.

[0072] This application will present various aspects, embodiments, or features around systems including multiple devices, components, modules, etc. It should be understood and appreciated that each system may include additional devices, components, modules, etc., and / or may not include all of the devices, components, modules, etc. discussed in conjunction with the figures. Furthermore, combinations of these aspects may also be used.

[0073] Additionally, in the embodiments of this application, words such as "exemplary" and "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described in this application as "exemplary" should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of the word "exemplary" is intended to present concepts in a concrete manner.

[0074] In the embodiments of the present application, “corresponding” and “relevant” may sometimes be used interchangeably. It should be noted that when the distinction between them is not emphasized, the meanings they intend to express are consistent.

[0075] The business scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. A person skilled in the art will appreciate that, with the evolution of network architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are equally applicable to similar technical problems.

[0076] References to "one embodiment" or "some embodiments" in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present application. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in yet other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0077] In this application, "at least one" means one or more, and "more" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: including the existence of A alone, the existence of A and B at the same time, and the existence of B alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.

[0078] For the convenience of description, the basic concepts involved in the embodiments of the present application are first described in detail below.

[0079] 1. Data compression

[0080] Data compression is the process of encoding existing data using less space. It reduces the amount of data to reduce storage space and improve transmission, storage, and processing efficiency without losing useful information. It also involves reorganizing data according to a specific algorithm to reduce data redundancy and storage space.

[0081] Compression technologies can be categorized as lossless or lossy. Lossless compression involves decompressing compressed data to produce data that is identical to the original. Lossy compression involves decompressing compressed data to produce data that is different from the original. This technique is primarily used in image and video compression.

[0082] 2. Compression rate (CR)

[0083] The compression ratio is the ratio of the compressed file size to the uncompressed file size. For example, if a 100MB file is compressed to 90MB, the compression ratio is 90 / 100*100% = 90%. Generally, the lower the compression ratio, the better. However, the smaller the compression ratio, the longer the decompression time.

[0084] 3. Deduplication (de-duplication)

[0085] Deduplication is a method of implementing data compression. Traditional compression technologies can only eliminate redundant information within files, while deduplication technology can effectively reduce the physical storage space occupied by data by eliminating identical files or data blocks in distributed storage systems. This technology is widely used in storage backup and archiving systems.

[0086] 4. Similarity Compression

[0087] Similarity compression is another data compression method. Unlike deduplication, which requires identical data blocks to eliminate redundant data, similarity compression significantly reduces the size of data blocks that are not completely duplicated but have a certain degree of similarity. Specifically, a reference data block is identified among multiple similar data blocks, and the data block to be compressed is compressed based on this reference data block.

[0088] With the increasing pace of informatization and the rapid development of big data, cloud computing, and artificial intelligence technologies, enterprises' demand for data is exploding. This massive amount of data inevitably places enormous pressure on data storage and management. Therefore, data reduction or compression is a key technology for improving storage space utilization in storage systems and meeting rapidly growing storage demands with limited storage capacity.

[0089] In a related technical solution, when similar compression is performed, as shown in FIG1 , the similarity between similar data blocks is in a linear relationship. That is, during the data block reference compression process, the compression of a data block refers to all the data blocks before it. This means that during the data block decompression process, decompressing one of the data blocks will rely on all the previous data blocks, thus increasing the decompression resource overhead. For example, as shown in FIG1 , taking the decompression of data block 10 as an example, decompressing data block 10 requires all data blocks 1 to 9 to be decompressed, but data block 10 is most similar to data block 9, and its similarity benefit mainly comes from data block 9. Therefore, relying on all the previous data blocks when decompressing data block 10 will result in a large waste of computing resources.

[0090] In view of this, an embodiment of the present application provides a data compression method, which can save resource overhead when decompressing compressed data and avoid wasting a large amount of computing resources.

[0091] Figure 2 is a schematic flow chart of a data compression method provided by an embodiment of the present application. As shown in Figure 2, the method may include steps 210-230, and steps 210-230 are described in detail below.

[0092] Step 210: Acquire a first data block set, where the first data block set includes a target data block.

[0093] In an embodiment of the present application, a group of similar data blocks can be determined based on the similarity between the data blocks, and the group of data blocks constitutes a first data block set. The first data block set includes multiple similar data blocks. As an example, the multiple data blocks include a target data block.

[0094] There are many methods for determining a group of similar data blocks, which are not specifically limited in the embodiments of the present application. In one example, a group of similar data blocks can be determined based on the similar fingerprints of multiple data blocks.

[0095] It should be understood that the above-mentioned data block can be a file, or it can be a combination of file slices, and the embodiments of the present application do not make specific limitations on this.

[0096] For example, as shown in Figure 3, based on the similar fingerprints of the data blocks, data blocks 1 to 7 are determined as a group of similar data blocks, that is, the first data block set includes data blocks 1 to 7.

[0097] Step 220: Determine a target reference data block according to the similarity tree corresponding to the first data block set.

[0098] Optionally, before step 220, embodiments of the present application may construct a similarity tree corresponding to the first data block set. Specifically, multiple parent-child node pairs may be determined based on the similarity fingerprints of the multiple data blocks included in the first data block set, and the similarity tree may be constructed based on these multiple parent-child node pairs. Two possible implementations of constructing the similarity tree are described in detail below.

[0099] In one possible implementation, a data block can be selected from the first data block set as the root node of the similarity tree. Based on the similarity fingerprints and similarity conditions of the multiple data blocks, the child nodes corresponding to the root node are determined. The root node and its corresponding child nodes are then used as parent nodes. The similarity fingerprints and similarity conditions of the remaining data blocks are then used to determine the child nodes corresponding to the parent node. This process is repeated until a similarity tree corresponding to the first data block set is constructed. This implementation is described in detail below in conjunction with FIG6 and is not described in detail here.

[0100] In another possible implementation, rather than selecting a single data block as the root node of the similarity tree, multiple parent-child node pairs that meet the criteria are determined based on the similarity fingerprints of the multiple data blocks in the first data block set. These parent-child node pairs are then combined to construct the similarity tree corresponding to the first data block set. This implementation is described in detail below with reference to FIG8 and is not detailed here.

[0101] In an embodiment of the present application, the similarity tree corresponding to the first data block set is a tree structure, and the similarity tree includes multiple parent-child node pairs, each parent-child node pair is used to indicate two data blocks in the first data block set that meet the similarity condition. In one example, a parent node pair in the similarity tree includes at least one child node.

[0102] For example, Figure 4 shows a similarity tree constructed to represent the similarity between data blocks 1 and 7 shown in Figure 3. The similarity tree includes multiple parent-child node pairs, each consisting of two nodes in the similarity tree that have a parent-child relationship. For example, data block 1 and data block 2 form a parent-child node pair, where data block 1 is the parent node of data block 2 and data block 2 is the child node of data block 1.

[0103] It should be noted that, taking data block 1 as an example, data block 1 as a parent node can contain at least one child node. Figure 4 is illustrated by taking the example of data block 1 containing one child node. Data block 1 can also contain other child nodes, and the embodiment of the present application does not make specific limitations on this.

[0104] In an embodiment of the present application, the target reference data block can be determined based on the similarity tree corresponding to the first data block set. Specifically, the similarity tree corresponding to the first data block set may include multiple parent-child node pairs, and the multiple parent-child node pairs include a target parent-child node pair for indicating the target reference data block and the target data block. Since the node corresponding to the target reference data block in the target parent-child node pair is the parent node of the node corresponding to the target data block, the target reference data block can be used as a reference data block when performing data compression on the target data block.

[0105] Taking the similarity tree shown in FIG4 as an example, assuming that data block 2 is the target data block, since the node corresponding to data block 1 is the parent node of the node corresponding to data block 2, data block 2 can be used as the target reference data block of data block 1.

[0106] Step 230: Perform reference compression on the target data block according to the target reference data block to obtain a compressed target data block.

[0107] In the embodiment of the present application, similar compression (also referred to as reference compression) can be performed on the target data block according to the target reference data block determined above to obtain a compressed target data block. For the specific similar compression process, please refer to the description above and will not be repeated here.

[0108] The following takes the first data block set in FIG. 3 as an example, and combines the similarity tree corresponding to the first data block set in FIG. 4 to illustrate the process of similarity compression of the data blocks included in the first data block set.

[0109] As shown in Figure 3, since data block 1 is the root node, data block 1 can be self-compressed, that is, similar compression can be performed within data block 1. The parent node of data block 2 is data block 1. Therefore, the reference data block of data block 2 is data block 1. Data block 2 can be reference compressed based on data block 1, that is, the information in data block 2 that is the same as that in data block 1 can be deleted to achieve similar compression. The parent node of data block 3 is data block 1. Therefore, the reference data block of data block 3 is data block 1. Data block 3 can be reference compressed based on data block 1, that is, the information in data block 3 that is the same as that in data block 1 can be deleted to achieve similar compression. The parent node of data block 4 is data block 1. Therefore, the reference data block of data block 4 is data block 1. Data block 4 can be reference compressed based on data block 1, that is, the information in data block 4 that is the same as that in data block 1 can be deleted to achieve similar compression. The parent nodes of data block 5 are data block 3 and data block 1. Therefore, the reference data blocks of data block 5 are data block 3 and data block 1. Data block 5 can be compressed based on data block 3 and data block 1. In other words, the information in data block 5 that is the same as that in data block 3 and data block 1 can be deleted to achieve similar compression. The parent nodes of data block 6 are data block 4 and data block 1. Therefore, the reference data blocks of data block 6 are data block 4 and data block 1. Data block 6 can be compressed based on data block 4 and data block 1. In other words, the information in data block 6 that is the same as that in data block 4 and data block 1 can be deleted to achieve similar compression. The parent nodes of data block 7 are data block 6, data block 4, and data block 1. Therefore, the reference data blocks of data block 7 are data block 6, data block 4, and data block 1. Data block 7 can be compressed based on data block 6, data block 4, and data block 1. In other words, the information in data block 7 that is the same as that in data block 6, data block 4, and data block 1 can be deleted to achieve similar compression.

[0110] In an embodiment of the present application, after data compression is performed on a data block in a first data set, information of a similarity tree corresponding to the first data set can also be saved, so that when decompressing multiple compressed data corresponding to the first data set, the reference data block corresponding to the compressed data block can be determined through the saved similarity tree information, and the compressed data block can be decompressed based on the determined reference data block.

[0111] There are multiple ways to implement the similarity tree information, which is not specifically limited in the embodiments of the present application. In one possible implementation, the similarity tree information includes information about parent-child node pairs in the similarity tree. In another possible implementation, the similarity tree information includes similarity fingerprints of data blocks in the first data set.

[0112] The following describes in detail how the similarity tree information is stored.

[0113] In one possible implementation, the example of similarity tree information including information about parent-child node pairs in the similarity tree is taken. In one example, all parent-child node pair information in the similarity tree can be saved in any compressed data of the multiple compressed data corresponding to the first data set. For example, all parent-child node pair information can be saved in the compressed data block corresponding to the root node of the similarity tree. In another example, the parent node information of each compressed data block can be saved in the data block. In another example, the similarity tree information required to decompress the data block can also be saved in each compressed data block.

[0114] Take the similarity tree shown in Figure 4 as an example. In one example, all parent-child node pair information is stored in the compressed data block corresponding to the root node of the similarity tree. For example, the parent-child node pair information stored in the compressed data block 1 corresponding to the root node includes 2,1; 3,1; 4,1; 5,3; 6,4; 7,6. In another example, the parent node information of the data block is stored in each compressed data block. For example, the parent-child node pair information stored in the compressed data block 2 is "2,1", the parent-child node pair information stored in the compressed data block 3 is "3,1", the parent-child node pair information stored in the compressed data block 4 is "4,1", the parent-child node pair information stored in the compressed data block 5 is "5,3", the parent-child node pair information stored in the compressed data block 6 is "6,4", and the parent-child node pair information stored in the compressed data block 7 is 7,6". In another example, the similarity tree information required to decompress the data block can also be stored in the compressed data block. For another example, the information of the similarity tree required to decompress the data block is stored in each compressed data block. For example, the parent-child node pair information stored in the compressed data block 2 is "2,1", the parent-child node pair information stored in the compressed data block 3 is "3,1", the parent-child node pair information stored in the compressed data block 4 is "4,1", the parent-child node pair information stored in the compressed data block 5 is "5,3" and "3,1", the parent-child node pair information stored in the compressed data block 6 is "6,4" and "4,1", and the parent-child node pair information stored in the compressed data block 7 is "7,6", "6,4" and "4,1".

[0115] Among them, "2,1" means that data block 2 is a child node of data block 1, "3,1" means that data block 3 is a child node of data block 1, "4,1" means that data block 3 is a child node of data block 1, "5,3" means that data block 5 is a child node of data block 3, "6,4" means that data block 6 is a child node of data block 4, and "7,6" means that data block 7 is a child node of data block 6.

[0116] In another possible implementation, the information of the similarity tree includes the similarity fingerprints of the data blocks in the first data set as an example. In one example, the similarity fingerprints of all the data blocks in the first data set can be saved in any one of the multiple compressed data corresponding to the first data set. For example, the similarity fingerprints of all the data blocks in the first data set can be saved in the compressed data block corresponding to the root node of the similarity tree. Taking the similarity tree shown in Figure 4 as an example, the similarity fingerprints of all the data blocks include the similarity fingerprints of data block 1 to data block 7. In another example, the similarity fingerprints of some data blocks in the first data set can also be saved in the compressed data block, and the sum of the similarity fingerprints of these partial data blocks is the similarity fingerprints of all the data blocks in the first data set. For example, the similarity fingerprint of data block 1 is saved in the compressed data block 1, the similarity fingerprints of data block 2 to data block 4 are saved in the compressed data block 2, and the similarity fingerprints of data block 5 to data block 7 are saved in the compressed data block 3.

[0117] In the above technical solution, when similarity compression is performed on the target data block, the target reference data block is determined based on a similarity tree with a tree structure. In this similarity tree, the node corresponding to the target reference data block is the parent node of the node of the target data block. Since the compression of the target data block refers to the target reference data block, and the node corresponding to the target data block and the node corresponding to the target reference data block are in a parent-child relationship in the similarity tree, when decompressing the data blocks, decompressing one of the data blocks will only rely on the data blocks on the root node path, and will not rely on all the previous data blocks in the linear relationship. Therefore, when decompressing, resource overhead can be saved, a large amount of computing resources can be avoided, and performance can be improved while ensuring the compression rate.

[0118] Figure 5 is a schematic flow chart of a data decompression method provided by an embodiment of the present application. As shown in Figure 5, the method may include steps 510-530, and steps 510-530 are described in detail below.

[0119] Step 510: Obtain compressed data.

[0120] In an embodiment of the present application, the obtained compressed data may include: a plurality of compressed data blocks corresponding to a first data block set and information about a similarity tree corresponding to the first data block set. The plurality of compressed data blocks includes a first compressed data block, which is obtained by compressing a target data block in the first data block set. The similarity tree has a tree structure and includes a plurality of parent-child node pairs, each parent-child node pair being used to indicate two data blocks in the first data block set that meet a similarity condition.

[0121] It should be understood that the embodiment of the present application can perform data compression on multiple data blocks included in the first data block set respectively to obtain multiple compressed data blocks, and the multiple compressed data blocks can be referred to as multiple compressed data blocks corresponding to the first data block set.

[0122] The information of the similarity tree corresponding to the first data block set obtained above can be the similarity fingerprints of multiple data blocks in the first data block set, or it can also be the information of the parent-child node pair in the similarity tree. The embodiment of the present application does not limit this. The information of the similarity tree can be obtained from a compressed data, or partial information can be obtained from multiple compressed data respectively. The specific method is related to the storage method of the similarity tree information. Please refer to the description above for the storage method of the similarity tree information, which will not be repeated here.

[0123] Step 520: Determine the identifier of the target reference data block based on the information of the similarity tree.

[0124] In the embodiment of the present application, after obtaining the information of the similarity tree corresponding to the first data block set, the identifier of the target reference data block can be determined based on the information of the similarity tree. Two specific implementation methods of determining the identifier of the target reference data block are described in detail below.

[0125] In one possible implementation, the information of the similarity tree obtained includes similarity fingerprints of multiple data blocks in the first data block set. In this implementation, multiple parent-child node pairs in the similarity tree can be determined based on the similarity fingerprints of the multiple data blocks, and a similarity tree can be constructed based on the multiple parent-child node pairs. Since the node corresponding to the target reference data block and the node corresponding to the target data block constitute one of the multiple parent-child node pairs in the similarity tree, and the node corresponding to the target reference data block in the target parent-child node pair is the parent node of the node corresponding to the target data block, the identifier of the parent node of the node corresponding to the target data block in the similarity tree can be used as the identifier of the target reference data block.

[0126] In another possible implementation, the obtained similarity tree information includes information about parent-child node pairs in the similarity tree. In this implementation, the identifier of the parent node of the node corresponding to the target data block in the information about the parent-child node pairs can be used as the identifier of the target reference data block.

[0127] For example, taking the target data block as data block 5, and the first compressed data block being obtained by compressing data block 5, according to the above similarity tree information (5, 3), it can be determined that the node corresponding to data block 3 is the parent node of the node corresponding to data block 5. Therefore, data block 3 (the data block before compression) can be used as the target reference data block to decompress the first compressed data block to obtain data block 5.

[0128] Step 530: Obtain a target reference data block and decompress the first compressed data block according to the target reference data block to obtain a target data block.

[0129] In the embodiment of the present application, after obtaining the target reference data block according to the identifier of the target reference data block, the first compressed data block can be decompressed based on the target reference data block to obtain the target data block.

[0130] As an example, second compressed data can be obtained from multiple compressed data sets based on the identifier of the target reference data block. The second compressed data is compressed from the target reference data block in the first data set. The second compressed data block is then decompressed based on the similarity tree information to obtain the target reference data block. The method for decompressing the second data block is the same as the method for decompressing the first compressed data block. Specifically, for example, the data block referenced when compressing the target reference data block to obtain the second compressed data block can be determined based on the similarity tree information. The second compressed data block is then decompressed based on the referenced data block to obtain the target reference data block.

[0131] For example, the second compressed data block is obtained by compressing data block 3. Based on the similarity tree information (3, 1), it can be determined that the node corresponding to data block 1 is the parent node of the node corresponding to data block 3. Therefore, data block 1 (the data block before compression) can be used as the target reference data block to decompress the second compressed data block to obtain data block 3. Similarly, a third compressed data block can be obtained from multiple target reference data blocks. This compressed data block is obtained by compressing data block 1. Based on the similarity tree information in Figure 4, it can be determined that data block 1 is the root node of the similarity tree and is self-compressed. Therefore, after decompressing the third compressed data block, data block 1 (the data block before compression) is obtained.

[0132] The following describes in detail different implementations of how to construct the similarity tree shown in Figure 4 in conjunction with Figures 6-9. It should be understood that the examples in Figures 6-9 are merely intended to help those skilled in the art understand the embodiments of the present application, and are not intended to limit the embodiments of the application to the specific numerical values ​​or specific scenarios illustrated in Figures 6-9. It is obvious that those skilled in the art can make various equivalent modifications or changes based on the following examples given in Figures 6-9, and such modifications and changes also fall within the scope of the embodiments of the present application.

[0133] Figure 6 is a schematic flow chart of a method for constructing a similarity tree corresponding to a first set of data blocks provided by an embodiment of the present application. As shown in Figure 6, the method may include steps 610-670, which are described in detail below.

[0134] Step 610: Obtain a group of similar data blocks (data block 1 - data block 7).

[0135] As an example, as shown in FIG3 , the group of similar data blocks includes data block 1 to data block 7 .

[0136] Step 620: Select a data block from the group of similar data blocks as the root node of the similarity tree.

[0137] In the embodiment of the present application, a data block can be arbitrarily selected from the group of similar data blocks as the root node of the similarity tree. For ease of description, as shown in FIG7 , data block 1 is used as the root node of the similarity tree.

[0138] Step 630: Obtain similar fingerprints (fp1-fp7) corresponding to each similar data in the above set of similar data blocks.

[0139] In an embodiment of the present application, after determining a group of similar data, similar fingerprints corresponding to each similar data can be obtained. For example, taking the group of similar data blocks including data blocks 1 to 7 as an example, the obtained similar fingerprints may include fp1 to fp7, where fp1 represents the similar fingerprint corresponding to data block 1, fp2 represents the similar fingerprint corresponding to data block 2, and so on.

[0140] Step 640: Find the fp that meets the first similarity condition with fp1 from fp2-fp7, and use the data block corresponding to the fp as the child node of data block 1.

[0141] As an example, in an embodiment of the present application, a first similarity condition may be set, and an fp that satisfies the first similarity condition with fp1 may be found from fp2-fp7, and the data block corresponding to the fp may be used as a child node of data block 1.

[0142] For example, since fp is a 4-bit value, assuming the first similarity condition is that all four bits are identical to fp1, then fp2-fp7 that have all four bits identical to fp1 can be considered to meet the first similarity condition. For example, as shown in Figure 7, assuming that all four bits of fp2 and fp1 are identical, data block 2 corresponding to fp2 can be considered a child node of data block 1.

[0143] Step 650: Find an fp from fp3-fp7 that meets the second similarity condition with fp1 or fp2, and use the data block corresponding to the fp as a child node of data block 1 or data block 2.

[0144] As an example, in an embodiment of the present application, a second similarity condition can be set, and an fp that meets the second similarity condition with fp1 or fp2 can be found from fp3-fp7, and the data block corresponding to the fp can be used as a child node of data block 1 or data block 2.

[0145] For example, assuming the second similarity condition is that the three bits are identical to those in fp1 or fp2, then the fp3-fp7 that have the same three bits as those in fp1 or fp2 can be considered to meet the second similarity condition. For example, as shown in Figure 7, fp3 and fp1 have the same three bits, and fp4 and fp1 have the same three bits. Therefore, data block 3 corresponding to fp3 can be made a child node of data block 1. Similarly, data block 4 corresponding to fp4 can be made a child node of data block 1.

[0146] Step 660: Find out the fp from fp5-fp7 that meets the third similarity condition with fp1-fp4, and use the data block corresponding to the fp as the child node of the corresponding data block in data block 1-data block 4.

[0147] As an example, in an embodiment of the present application, a third similarity condition can be set, and an fp that meets the third similarity condition with fp1-fp4 can be found from fp5-fp7, and the child node of the corresponding data block in data block 1-data block 4 corresponding to the fp can be found.

[0148] For example, assuming the third similarity condition is that two bits are identical to those in fp1-fp4, then any fp in fp5-fp7 that has two bits identical to those in any fp in fp1-fp4 can be considered to meet the second similarity condition. For example, as shown in Figure 7, fp5 and fp3 have two identical bits, and fp6 and fp4 have two identical bits. Therefore, data block 5 corresponding to fp5 can be made a child node of data block 3. Similarly, data block 6 corresponding to fp6 can be made a child node of data block 4.

[0149] Step 670: fp7 and fp6 meet the fourth similarity condition, and the data block corresponding to fp7 is used as the child node of data block 6.

[0150] For example, assuming that the third similarity condition is the same as one bit in fp1-fp6, for example, as shown in FIG7 , fp7 is the same as fp6 in one bit, therefore, data block 7 corresponding to fp7 can be used as a child node of data block 6.

[0151] In the embodiment of the present application, a similarity tree as shown in FIG. 4 can be constructed through the method in FIG. 6 .

[0152] Figure 8 is a schematic flow chart of another method for constructing a similarity tree corresponding to a set of similar data provided by an embodiment of the present application. As shown in Figure 8, the method may include steps 810-860, which are described in detail below.

[0153] Step 810: Obtain a group of similar data blocks (data block 1 - data block 7).

[0154] Similar to step 610, please refer to the description in step 610 for details, which will not be repeated here.

[0155] Step 820: Obtain similar fingerprints (fp1-fp7) corresponding to each similar data in the above set of similar data blocks.

[0156] Similar to step 630, please refer to the description in step 630 for details, which will not be repeated here.

[0157] Step 830: Find fp that meets the first similarity condition from fp1-fp7.

[0158] In the embodiment of the present application, it is assumed that the first similarity condition is that the four bits of two or more fp are the same. For example, the four bits of two or more fp in fp1-fp7 are the same, then the two or more fp can be called fp that meets the first similarity condition.

[0159] For example, as shown in FIG9 , assuming that the four bits of fp1 and fp2 are the same, fp1 and fp2 satisfy the first similarity condition, and data block 2 corresponding to fp2 can be used as a child node of data block 1 corresponding to fp1.

[0160] Step 840: Find fp that meets the second similarity condition from fp1-fp7.

[0161] In the embodiment of the present application, it is assumed that the second similarity condition is that the three bits of two or more fp are the same. For example, the three bits of two or more fp in fp1-fp7 are the same, then the two or more fp can be called fp that meets the second similarity condition.

[0162] For example, as shown in Figure 9, assume that fp1 and fp3 have the same three bits, and fp1 and fp4 have the same three bits. Therefore, fp1 and fp3 meet the second similarity condition, and fp1 and fp4 also meet the second similarity condition. Data block 3 corresponding to fp3 can be a child node of data block 1 corresponding to fp1, and data block 4 corresponding to fp4 can be a child node of data block 1 corresponding to fp1.

[0163] Step 850: Find fp from fp1-fp7 that meets the third similarity condition.

[0164] In the embodiment of the present application, it is assumed that the third similarity condition is that the two bits of two or more fp are the same. For example, the two bits of two or more fp in fp1-fp7 are the same, then the two or more fp can be called fp that meets the third similarity condition.

[0165] For example, as shown in Figure 9, assume that fp3 and fp5 have two identical bits, and fp4 and fp6 have two identical bits. Therefore, fp3 and fp5 satisfy the third similarity condition, and fp4 and fp6 also satisfy the third similarity condition. Data block 5 corresponding to fp5 can be a child node of data block 3 corresponding to fp3, and data block 6 corresponding to fp6 can be a child node of data block 1 corresponding to fp4.

[0166] Step 860: Find fp that meets the fourth similarity condition from fp1-fp7.

[0167] In the embodiment of the present application, it is assumed that the fourth similarity condition is that one bit of two or more fp's are identical. For example, one bit of two or more fp's in fp1-fp7 are identical. Then, the two or more fp's can be called fp's that meet the fourth similarity condition.

[0168] For example, as shown in Figure 9, assuming that fp6 and fp7 have one bit in common, fp6 and fp7 satisfy the fourth similarity condition. Data block 7 corresponding to fp7 can be used as a child node of data block 6 corresponding to fp6.

[0169] In an embodiment of the present application, by using the method in Figure 8 above, the fp that meets the first similarity condition, the fp that meets the second similarity condition, the fp that meets the third similarity condition, and the fp that meets the fourth similarity condition are combined, and a similarity tree as shown in Figure 4 can also be constructed.

[0170] It should be noted that the embodiments of the present application do not specifically limit the application scenarios of constructing the similarity tree shown in Figures 6 or 8. For example, the method for constructing a similarity tree can be applied in the aforementioned data compression field. For another example, the method for constructing a similarity tree can also be applied in other data processing fields associated with similarity grouping.

[0171] The data compression method and data decompression method provided by the embodiments of the present application are described in detail above in conjunction with Figures 1 to 9. Below, an embodiment of the device of the present application will be described in detail in conjunction with Figures 10 to 14. It should be understood that the description of the method embodiment corresponds to the description of the device embodiment. Therefore, for portions not described in detail, reference can be made to the above method embodiment.

[0172] Figure 10 is a schematic block diagram of a data compression apparatus 1000 provided in an embodiment of the present application. Apparatus 1000 can be implemented using software, hardware, or a combination of both. Apparatus 1000 provided in an embodiment of the present application can implement the data compression method provided in an embodiment of the present application. Apparatus 1000 includes: an acquisition module 1001, a determination module 1002, and a compression module 1003. Among them, the acquisition module 1001 is used to obtain a first data block set, which includes multiple similar data blocks, and the multiple data blocks include a target data block; the determination module 102 is used to determine the target reference data block based on the similarity tree corresponding to the first data block set, the similarity tree is a tree structure, and the similarity tree includes multiple parent-child node pairs, each of the parent-child node pairs is used to indicate two data blocks in the first data block set that meet the similarity condition; wherein the multiple parent-child node pairs include a target parent-child node pair for indicating the target reference data block and the target data block, and the node corresponding to the target reference data block in the target parent-child node pair is the parent node of the node corresponding to the target data block; the compression module 1003 is used to perform reference compression on the target data block based on the target reference data block to obtain a compressed target data block.

[0173] Optionally, the apparatus 1000 further includes: a construction module, configured to construct the similarity tree according to the similar fingerprints of the plurality of data blocks.

[0174] Optionally, the construction module is specifically configured to: determine the plurality of parent-child node pairs according to the respective similar fingerprints of the plurality of data blocks; and construct the similarity tree according to the plurality of parent-child node pairs.

[0175] Optionally, the construction module is specifically used to: select a data block from the first data block set as the root node of the similarity tree, and determine the child node corresponding to the root node based on the similar fingerprints and similar conditions of multiple data blocks, and then use the above-mentioned root node and the child node corresponding to the root node as the parent node, and determine the similar fingerprints and similar conditions of the remaining data blocks to determine the child node corresponding to the parent node.

[0176] Optionally, the construction module is specifically configured to determine a plurality of parent-child node pairs that meet the conditions according to the similar fingerprints of the plurality of data blocks in the first data block set, and combine these parent-child node pairs to construct a similarity tree corresponding to the first data block set.

[0177] Optionally, the apparatus 1000 further includes: a storage module, configured to store information of the similarity tree in a compressed data block, wherein the stored information of the similarity tree is used to decompress the multiple compressed data blocks corresponding to the first data block set.

[0178] Optionally, the information of the similarity tree includes information of parent-child node pairs in the similarity tree.

[0179] Optionally, the information of the similarity tree includes similarity fingerprints of the data blocks in the first data block set.

[0180] Optionally, the information of the similarity tree is stored in any compressed data block among the multiple compressed data blocks corresponding to the first data block set.

[0181] Optionally, a parent node in the similarity tree includes at least one child node.

[0182] The above-mentioned apparatus 1000 can be embodied in the form of a functional module. The term "module" herein can be implemented in the form of software and / or hardware, and is not specifically limited thereto.

[0183] It should be noted that: when the device 1000 provided in the above embodiment executes the above method, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. For example, the acquisition module 1001 can be used to execute any step in the above method, the determination module 1002 can be used to execute any step in the above method, and the compression module 1003 can be used to execute any step in the above method. The steps that the acquisition module 1001, the determination module 1002, and the compression module 1003 are responsible for implementing can be specified as needed, and all the functions of the above device can be realized by respectively implementing different steps in the above method through the acquisition module 1001, the determination module 1002, and the compression module 1003.

[0184] Figure 11 is a schematic block diagram of a data decompression apparatus 1100 provided in an embodiment of the present application. Apparatus 1100 can be implemented using software, hardware, or a combination of both. Apparatus 1100 provided in an embodiment of the present application can implement the data decompression method provided in an embodiment of the present application. Apparatus 1100 includes: an acquisition module 1101, a determination module 1102, and an acquisition module 1103. Among them, the acquisition module 1101 is used to obtain compressed data, which includes multiple compressed data blocks corresponding to the first data block set and information of a similarity tree corresponding to the first data block set, wherein the multiple compressed data blocks include a first compressed data block, which is compressed by the target data block in the first data block set, and the similarity tree is a tree structure, and the similarity tree includes multiple parent-child node pairs, each of which is used to indicate two data blocks in the first data block set that meet the similarity condition; the determination module 1102 is used to determine the identifier of the target reference data block based on the information of the similarity tree, the node corresponding to the target reference data block and the node corresponding to the target data block constitute a parent-child node pair in the multiple parent-child node pairs, and the node corresponding to the target reference data block in the target parent-child node pair is the parent node of the node corresponding to the target data block; the acquisition module 1103 is used to obtain the target reference data block according to the identifier of the target reference data block, and decompress the first compressed data block according to the target reference data block to obtain the target data block.

[0185] Optionally, the information of the similarity tree is stored in any compressed data block among the multiple compressed data blocks.

[0186] Optionally, the information of the similarity tree includes similar fingerprints of multiple data blocks in the first data block set; the determination module 1102 is specifically used to: determine multiple parent-child node pairs in the similarity tree based on the similarity fingerprints of multiple data blocks in the first data block set; construct the similarity tree based on the multiple parent-child node pairs; and use the identifier of the parent node of the node corresponding to the target data block in the similarity tree as the identifier of the target reference data block.

[0187] Optionally, the similarity tree information includes information of parent-child node pairs in the similarity tree; the determination module 1102 is specifically used to: use the identifier of the parent node of the node corresponding to the target data block in the information of the parent-child node pair as the identifier of the target reference data block.

[0188] Optionally, a parent node in the similarity tree contains at least one child node.

[0189] Optionally, the acquisition module 1103 is specifically used to: obtain a second compressed data block from the multiple compressed data blocks according to the identifier of the target reference data block, where the second compressed data block is compressed from the target reference data block in the first data block set; and decompress the second compressed data block according to the information of the similarity tree to obtain the target reference data block.

[0190] The above-mentioned apparatus 1100 can be embodied in the form of a functional module. The term "module" herein can be implemented in the form of software and / or hardware, and is not specifically limited thereto.

[0191] It should be noted that: when the device 1100 provided in the above embodiment executes the above method, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. For example, the acquisition module 1101 can be used to execute any step in the above method, the determination module 1102 can be used to execute any step in the above method, and the acquisition module 1103 can be used to execute any step in the above method. The steps that the acquisition module 1101, the determination module 1102, and the acquisition module 1103 are responsible for implementing can be specified as needed, and all the functions of the above device can be realized by respectively implementing different steps in the above method through the acquisition module 1101, the determination module 1102, and the acquisition module 1103.

[0192] The modules of each example described in the embodiments of this application can be implemented with electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0193] In addition, the device and method embodiments provided in the above embodiments belong to the same concept, and their specific implementation processes are detailed in the method embodiments above and will not be repeated here.

[0194] As shown in FIG12 , it is a schematic diagram of a system architecture provided in an embodiment of the present application, wherein the system includes an application server 200 and a storage system 100 .

[0195] In actual application scenarios, users access data through applications. The computers running these applications are called "application servers 200." Application servers 200 can be physical or virtual machines. Physical application servers 200 include, but are not limited to, desktop computers, servers, laptops, and mobile devices. Application servers 200 access data from the storage system 100 through a switch. The switch is optional; application servers 200 can also communicate directly with the storage system 100 over the network.

[0196] The storage system 100 includes one or more hard disks and other storage devices with specific storage functions. The actual address of the storage space provided by the hard disks and other storage devices is not directly exposed to the application server 200. The hard disk can be of any type, such as a solid-state drive, a mechanical hard disk, or other types of hard disks. Each hard disk is divided into several physical blocks (chunks), which are mapped into logical blocks to form a storage pool. The storage pool is used to provide storage space to the upper (such as the application server 200). This storage space actually comes from the hard disks included in the storage system 100.

[0197] In order to minimize the storage space occupied by data copies, in one example, the storage system 100 can execute the above-mentioned data compression method to compress the user's data and store the compressed data (compressed data) in the memory; or, the storage system 100 can also obtain the stored compressed data (compressed data) from the memory, execute the above-mentioned data decompression method to decompress the compressed data to obtain the pre-compressed data, and send the obtained pre-compressed data to the user. In another example, the application server 200 can execute the above-mentioned data compression method to compress the user's data and store the compressed data (compressed data) in the storage system 100; or, the application server 200 can also obtain the stored compressed data (compressed data) from the storage system 100, execute the above-mentioned data decompression method to decompress the compressed data to obtain the pre-compressed data, and send the obtained pre-compressed data to the user.

[0198] In the embodiment of the present application, the type of storage system 100 is not limited. The storage system 100 can be a centralized storage system or a distributed storage system. The following Figures 13 and 14 exemplify a possible centralized storage system and a possible centralized storage system and distributed storage system.

[0199] It should be understood that, for ease of description, the following description is made by taking the method of the storage system 100 performing the above-mentioned data compression or data decompression as an example.

[0200] FIG13 shows a centralized storage system applicable to embodiments of the present application. A centralized storage system is characterized by a unified entry point through which all data from external devices must pass. This entry point is the centralized storage system's engine 121. Engine 121 is the core component of the centralized storage system, implementing many of the system's advanced functions.

[0201] As shown in FIG13 , the engine 121 includes one or more controllers. FIG13 takes the example of an engine including controller 0 for explanation.

[0202] Engine 121 also includes a front-end interface 123 and a back-end interface 124. Front-end interface 123 is used to communicate with application server 200, thereby providing storage services for application server 200. Back-end interface 124 is used to communicate with hard disks 132 to expand the storage system's capacity. Through back-end interface 126, engine 121 can connect to more hard disks 132, thereby forming a very large storage resource pool.

[0203] In the embodiment of the present application, the controller 0 can execute the data compression method and / or data decompression method mentioned in the embodiment of the present application. That is, the controller 0 can compress the user's data to obtain compressed data (compressed data), and store the compressed data (compressed data) to the hard disk 132 in the hard disk box 130 to execute the above-mentioned data compression method. The controller 0 can also obtain the compressed data (compressed data) from the hard disk 132 in the hard disk box 130, decompress the compressed data to obtain the data before compression, and send the obtained data before compression to the user to execute the above-mentioned data decompression method.

[0204] In terms of hardware, as shown in FIG13 , the controller 0 includes at least a processor 125 and a memory 122. The processor 125 is a central processing unit (CPU) that is used to process data access requests from the application server, such as a write data request for writing data initiated by a user through the application server, or a read data request for reading data initiated by a user through the application server, and is also used to process requests generated within the storage system. For example, when the processor 125 receives a write data request sent by the application server 200 through the front-end port 123, it temporarily stores the data in these write data requests in the memory 122. When the total amount of data in the memory 122 reaches a certain threshold, the processor 125 sends the data stored in the memory 122 to the hard disk 132 through the back-end port for persistent storage.

[0205] Memory 122 refers to an internal memory that exchanges data directly with the processor. It can read and write data at any time and at a very high speed. It serves as a temporary data storage for the operating system or other running programs. Memory can be random access memory or read-only memory (ROM). Random access memory is dynamic random access memory (DRAM) or storage class memory (SCM). DRAM is a semiconductor memory that, like most random access memories (RAM), is a volatile memory device. Memory 122 can also be a module composed of dual in-line memory modules or dual in-line memory modules (DIMM, DRAM), or a solid state disk (SSD).

[0206] Computer program instructions are stored in the memory 122 , and the processor 125 runs the computer program instructions in the memory 122 to execute the data compression method or data decompression method provided in the embodiments of the present application.

[0207] The engine 121 may not have a hard drive slot; the hard drive 132 must be placed in the hard drive enclosure 130, and the back-end interface 124 communicates with the hard drive enclosure 130. The back-end interface 124 exists in the form of an adapter card in the engine 121. Two or more back-end interfaces 124 can be used simultaneously on one engine 121 to connect to multiple hard drive enclosures. Alternatively, the adapter card can be integrated into the motherboard, in which case the adapter card can communicate with the processor 125 via the PCIE bus.

[0208] It should be noted that FIG13 shows only one engine 121 . However, in actual applications, the storage system may include two or more engines 121 , and redundancy or load balancing may be performed between the multiple engines 121 .

[0209] The hard disk frame 130 includes a control unit 131 and several hard disks 132. The control unit 131 can have various forms. In one case, the hard disk frame 130 is an intelligent disk frame. As shown in Figure 13, the control unit 131 includes a CPU and a memory. The CPU is used to perform operations such as address conversion and reading and writing data. The memory is used to temporarily store data to be written to the hard disk 132, or data read from the hard disk 132 to be sent to the controller. In another case, the control unit 131 is a programmable electronic component, such as a data processing unit (DPU). Optionally, the DPU here can also be replaced with a processing chip such as a graphics processing unit (GPU) or an embedded neural network processor (NPU).

[0210] As shown in FIG14 , a distributed storage system provided in an embodiment of the present application includes a computing node cluster and a storage node cluster. The computing node cluster includes one or more computing nodes 210 ( FIG14 shows two computing nodes 210, but is not limited to two computing nodes 210), and each computing node 210 can communicate with each other. A computing node 210 is a computing device, such as a server, a desktop computer, or a storage array controller.

[0211] The computing node 210 can process data access requests from outside the distributed storage system, such as a write data request initiated by a user through an application server for writing data, or a read data request initiated by a user through an application server for reading data, and is also used to process requests generated within the storage system.

[0212] In terms of hardware, as shown in Figure 14, the computing node 210 includes at least a processor 212, a memory 213 and a network card 214. Among them, the processor 212 is a central processing unit (CPU) or other processing chip with processing functions, which is used to process data access requests from outside the computing node 210, or requests generated inside the computing node 210. For example, when the processor 212 receives a write data request sent by a user, it temporarily saves the data in these write data requests in the memory 213. When the total amount of data in the memory 213 reaches a certain threshold, the processor 212 sends the data stored in the memory 213 to the storage node 220 for persistent storage. Figure 14 only shows one CPU 212. In actual applications, there are often multiple CPUs 212, and one CPU 212 has one or more CPU cores. This embodiment does not limit the number of CPUs and the number of CPU cores.

[0213] The type of memory 213 is similar to the memory 122 mentioned above. For details, please refer to the above description and will not be repeated here.

[0214] Network card 214 is used to communicate with storage node 220. For example, when the total amount of data in memory 213 reaches a certain threshold, computing node 210 can send a request to storage node 220 via network card 214 to persistently store the data. In addition, computing node 210 may also include a bus for communication between various components within computing node 110.

[0215] Functionally, since compute node 210 in Figure 14 primarily performs computing tasks, it can utilize remote storage for persistent data storage. Therefore, it has less local storage than a conventional server, thereby saving cost and space. However, this does not mean that compute node 210 cannot have local storage. In actual implementation, compute node 110 may also have a small number of internal hard drives or external hard drives.

[0216] Any computing node 210 can access any storage node 220 in the storage node cluster through the network. The storage node cluster includes multiple storage nodes 220 (three storage nodes 220 are shown in FIG14 , but the present invention is not limited to three storage nodes 220).

[0217] The storage node 220 can process data access requests sent from the computing node 210 and write data to the hard disk 225 or read data from the hard disk 225 .

[0218] In an embodiment of the present application, the storage node 220 may execute the data compression method or the data decompression method provided in the embodiment of the present application.

[0219] From a hardware perspective, a storage node 220 includes a processor 221, a memory 222, a network card 223, and multiple hard disks 225. The network card 224 is used to communicate with the computing node 210. The hard disk 225 is used to store data and can be a disk or other type of storage medium, such as a solid-state drive or a shingled magnetic recording hard disk. The processor 221 is used to write data to the hard disk 225 or read data from the hard disk 225 according to a read / write data request. In the process of reading and writing data, the processor 221 needs to convert the address carried in the read / write data request into an address that can be recognized by the hard disk. In the embodiment of the present application, the processor 221 serves as the main core unit of the storage node 220 and executes the data compression method or data decompression method provided in the embodiment of the present application.

[0220] The type of processor 221 is similar to that of processor 112 , and details thereof can be found in the above description, which will not be repeated here.

[0221] In another embodiment, some functions of the processor 221 can be offloaded to the network card 223. The network card 223 is an intelligent network card. It can include a CPU and memory. The CPU is used to perform operations that can be performed by the processor 221, such as address conversion and reading and writing data. The memory in the network card is used to temporarily store data to be written to the hard disk 225, or data read from the hard disk 225 to be sent to the computing node 210. The CPU can also be a programmable electronic component, such as a DPU. Optionally, the DPU here can also be a processing chip such as a GPU or an NPU. There is no ownership relationship between the network card 223 and the hard disk 225 in the storage node 220, and the network card 223 can access any hard disk 225 in the storage node 210.

[0222] It should be noted that Figures 13 and 14 are only exemplary illustrations of possible hardware structures of the storage system. The data compression method or data decompression method provided in the embodiments of the present application is also applicable to other systems or devices with storage functions.

[0223] This embodiment also provides a computer program product including instructions. The computer program product may be software or a program product including instructions that can be executed on a computing device cluster or stored in any available medium. When executed by a computing device cluster, the computer program product causes the computing device cluster to perform the above-mentioned method or implement the functions of the above-mentioned apparatus.

[0224] This embodiment also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium capable of storing data on a computing device, or a data storage device such as a data center that contains one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, or a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive). The computer-readable storage medium includes instructions that, when executed by a computing device cluster, cause the computing device cluster to perform the method provided above.

[0225] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0226] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0227] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0228] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0229] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0230] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0231] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0232] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

Claims

1. A method for data compression, characterized in that: The method comprises: Acquire a first data block set, wherein the first data block set includes a plurality of similar data blocks, and the plurality of data blocks includes a target data block; Determine a target reference data block according to a similarity tree corresponding to the first data block set, wherein the similarity tree is a tree structure and includes a plurality of parent-child node pairs, each of which is used to indicate two data blocks in the first data block set that meet a similarity condition; wherein the plurality of parent-child node pairs include a target parent-child node pair for indicating the target reference data block and the target data block, and the node corresponding to the target reference data block in the target parent-child node pair is the parent node of the node corresponding to the target data block; The target data block is subjected to reference compression according to the target reference data block to obtain a compressed target data block.

2. The method according to claim 1, characterized in that The method further includes: constructing the similarity tree according to the similarity fingerprints of the plurality of data blocks.

3. The method according to claim 2, characterized in that The constructing the similarity tree according to the similar fingerprints of the plurality of data blocks comprises: Determining the plurality of parent-child node pairs according to the respective similar fingerprints of the plurality of data blocks; The similarity tree is constructed according to the plurality of parent-child node pairs.

4. The method according to any one of claims 1 to 3, characterized in that The method further includes: saving information of the similarity tree in a plurality of compressed data blocks corresponding to the first data block set, wherein the saved information of the similarity tree is used to decompress the plurality of compressed data blocks corresponding to the first data block set.

5. The method according to claim 4, characterized in that The information of the similarity tree includes information of parent-child node pairs in the similarity tree.

6. The method according to claim 4, characterized in that The information of the similarity tree includes similarity fingerprints of the data blocks in the first data block set.

7. The method according to any one of claims 1 to 6, characterized in that A parent node in the similarity tree includes at least one child node.

8. A method for decompressing data, characterized in that: The method comprises: Acquire compressed data, the compressed data including multiple compressed data blocks corresponding to a first data block set and information of a similarity tree corresponding to the first data block set, wherein the multiple compressed data blocks include a first compressed data block, the first compressed data block is obtained by compressing a target data block in the first data block set, the similarity tree is a tree structure, and the similarity tree includes multiple parent-child node pairs, each of the parent-child node pairs is used to indicate two data blocks in the first data block set that meet a similarity condition; Determine an identifier of a target reference data block according to information of the similarity tree, wherein a node corresponding to the target reference data block and a node corresponding to the target data block constitute a parent-child node pair among the plurality of parent-child node pairs, and the node corresponding to the target reference data block in the target parent-child node pair is a parent node of the node corresponding to the target data block; The target reference data block is obtained according to the identifier of the target reference data block, and the first compressed data block is decompressed according to the target reference data block to obtain the target data block.

9. The method according to claim 8, characterized in that The information of the similarity tree is stored in any compressed data block among the plurality of compressed data blocks.

10. The method according to claim 8 or 9, characterized in that: The information of the similarity tree includes similar fingerprints of a plurality of data blocks in the first data block set; The step of determining the identifier of the target reference data block according to the information of the similarity tree comprises: Determining a plurality of parent-child node pairs in the similarity tree according to similar fingerprints of a plurality of data blocks in the first data block set; Constructing the similarity tree according to the plurality of parent-child node pairs; The identifier of the parent node of the node corresponding to the target data block in the similarity tree is used as the identifier of the target reference data block.

11. The method according to claim 8 or 9, characterized in that: The information of the similar tree includes information of parent-child node pairs in the similar tree; The step of determining the identifier of the target reference data block according to the information of the similarity tree comprises: The identifier of the parent node of the node corresponding to the target data block in the information of the parent-child node pair is used as the target reference data block 's logo.

12. The method according to any one of claims 8 to 11, characterized in that A parent node in the similarity tree contains at least one child node.

13. The method according to any one of claims 8 to 12, characterized in that The obtaining the target reference data block according to the identifier of the target reference data block comprises: Acquire a second compressed data block from the multiple compressed data blocks according to the identifier of the target reference data block, where the second compressed data block is obtained by compressing the target reference data block in the first data block set; The second compressed data block is decompressed according to the information of the similarity tree to obtain the target reference data block.

14. A data compression device, characterized in that: include: An acquisition module, configured to acquire a first data block set, wherein the first data block set includes a plurality of similar data blocks, and the plurality of data blocks includes a target data block; a determination module, configured to determine a target reference data block according to a similarity tree corresponding to the first data block set, wherein the similarity tree is a tree structure and includes a plurality of parent-child node pairs, each of which is used to indicate two data blocks in the first data block set that meet a similarity condition; wherein the plurality of parent-child node pairs include a target parent-child node pair for indicating the target reference data block and the target data block, and the node corresponding to the target reference data block in the target parent-child node pair is the parent node of the node corresponding to the target data block; The compression module is used to perform reference compression on the target data block according to the target reference data block to obtain a compressed target data block.

15. The device according to claim 14, characterized in that The device also includes: The construction module is used to construct the similarity tree according to the similar fingerprints of each of the multiple data blocks.

16. The device according to claim 15, characterized in that The building blocks are specifically used for: Determining the plurality of parent-child node pairs according to the respective similar fingerprints of the plurality of data blocks; The similarity tree is constructed according to the plurality of parent-child node pairs.

17. The device according to any one of claims 14 to 16, characterized in that The device also includes: The storage module is used to store the information of the similarity tree in the multiple compressed data blocks corresponding to the first data block set, and the stored information of the similarity tree is used to decompress the multiple compressed data blocks corresponding to the first data block set.

18. The device according to claim 17, characterized in that The information of the similarity tree includes information of parent-child node pairs in the similarity tree.

19. The device according to claim 17, characterized in that The information of the similarity tree includes similarity fingerprints of the data blocks in the first data block set.

20. The device according to any one of claims 14 to 19, characterized in that A parent node in the similarity tree includes at least one child node.

21. A data decompression device, characterized in that: include: an acquisition module, configured to acquire compressed data, wherein the compressed data includes information of a plurality of compressed data blocks corresponding to a first data block set and a similarity tree corresponding to the first data block set, wherein the plurality of compressed data blocks includes a first compressed data block, the first compressed data block is obtained by compressing a target data block in the first data block set, the similarity tree is a tree structure, and the similarity tree includes a plurality of parent-child node pairs, each of the parent-child node pairs is used to indicate two data blocks in the first data block set that meet a similarity condition; a determination module, configured to determine an identifier of a target reference data block according to information of the similarity tree, wherein a node corresponding to the target reference data block and a node corresponding to the target data block constitute a parent-child node pair among the plurality of parent-child node pairs, and the node corresponding to the target reference data block in the target parent-child node pair is a parent node of the node corresponding to the target data block; An obtaining module is used to obtain the target reference data block according to the identifier of the target reference data block, and decompress the first compressed data block according to the target reference data block to obtain the target data block.

22. The device according to claim 21, characterized in that The information of the similarity tree is stored in any compressed data block among the plurality of compressed data blocks.

23. The device according to claim 21 or 22, characterized in that The information of the similarity tree includes similar fingerprints of a plurality of data blocks in the first data block set; The determination module is specifically used for: Determining a plurality of parent-child node pairs in the similarity tree according to similar fingerprints of a plurality of data blocks in the first data block set; Constructing the similarity tree according to the plurality of parent-child node pairs; The identifier of the parent node of the node corresponding to the target data block in the similarity tree is used as the identifier of the target reference data block.

24. The device according to claim 21 or 22, characterized in that The information of the similar tree includes information of parent-child node pairs in the similar tree; The determination module is specifically used for: The identifier of the parent node of the node corresponding to the target data block in the information of the parent-child node pair is used as the identifier of the target reference data block.

25. The device according to any one of claims 21 to 24, characterized in that A parent node in the similarity tree contains at least one child node.

26. The device according to any one of claims 21 to 25, characterized in that The acquisition module is specifically used for: Acquire a second compressed data block from the multiple compressed data blocks according to the identifier of the target reference data block, where the second compressed data block is obtained by compressing the target reference data block in the first data block set; The second compressed data block is decompressed according to the information of the similarity tree to obtain the target reference data block.

27. A storage system, characterized in that: The method comprises a controller and a memory, wherein the controller is used to execute the method according to any one of claims 1 to 13, store the compressed data in the memory, or obtain the compressed data from the memory.

28. A computing device, characterized in that The computing device includes a processor and a memory; The processor is configured to execute instructions stored in the memory so that the computing device performs the method according to any one of claims 1 to 13.

29. A computer program product comprising instructions, characterized in that When the instructions are executed by a computing device, the computing device is caused to perform the method according to any one of claims 1 to 13.

30. A computer-readable storage medium, characterized in that: The method comprises computer program instructions, which, when executed by a computing device, perform the method according to any one of claims 1 to 13.