Offline Duplicate Removal Method, Apparatus, Electronic Device, Storage Medium, and Program Product

By using the data fingerprint and fingerprint management unit to compare and move the address in the offline deduplication method within the storage device, the impact of traditional online deduplication on IO performance is solved, and efficient data deduplication and storage space utilization are achieved.

CN114661521BActive Publication Date: 2025-06-24RUIZHE (HANGZHOU) TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210186802.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-28
Publication Date
2025-06-24
Estimated Expiration
2042-02-28

AI Technical Summary

Technical Problem

Traditional data deduplication operations are completed by the host-side CPU in a stand-alone or distributed environment, which increases the complexity of system design and has a high pressure on CPU computing. The online deduplication method will affect the IO performance of the storage device, making it difficult to ensure the service quality of upper-level applications.

Method used

The offline deduplication method is implemented inside the storage device. By obtaining the data fingerprint of the valid data blocks in the currently scanned area during the data transfer process, and recording the corresponding physical block address in the fingerprint management unit, address comparison and transfer, and updating the address mapping table to achieve data deduplication.

Benefits of technology

By performing offline deduplication during background data transfer, the impact on the front-end read and write performance is reduced, the service quality of upper-level applications is improved, and storage space is effectively saved and storage space utilization is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114661521B_ABST
    Figure CN114661521B_ABST
Patent Text Reader

Abstract

The present application provides an offline deduplication method, apparatus, electronic device, storage medium and program product. According to the data fingerprints of valid data blocks in the current scanned area during the data migration process, obtain the valid physical block addresses recorded in the fingerprint management unit; if the valid physical block address is the same as the current physical block address of the valid data block, then move the valid data block to the first physical block address, and synchronously update the fingerprint management unit and the address mapping table, where the address mapping table includes the mapping relationship between the logical block address and the physical block address of each data block; otherwise, map the logical block address of the valid data block in the address mapping table to the valid physical block address; after the migration of the valid data blocks in the current scanned area is completed, perform erasure. The present application performs data offline deduplication during the background data migration process, avoiding data online deduplication when writing data in the foreground, thereby reducing the impact on the foreground read and write performance and improving the service quality of upper-layer applications.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer storage, and particularly to an offline deduplication method, apparatus, electronic device, storage medium, and program product. Background Art

[0002] Data deduplication is a technology used to eliminate duplicate or redundant data to improve storage utilization. Traditional data deduplication operations are completed by the central processing unit (CPU) on the host side in a single machine or distributed environment. This implementation method increases the complexity of system design and causes a large computational pressure on the host-side CPU. To solve the above problems, an idea of performing data deduplication operations inside the storage device is proposed.

[0003] Currently, the method of performing data deduplication operations inside the storage device is online deduplication, that is, data deduplication operations are performed while data is being written to the storage device. Due to the complexity of the data deduplication operation itself, the above online deduplication method will have a huge impact on the IO performance of the storage device, making it difficult to ensure the quality of service of the upper-layer applications. Summary of the Invention

[0004] This application provides an offline deduplication method, apparatus, electronic device, storage medium, and program product to achieve data deduplication inside the storage device.

[0005] In a first aspect, this application provides an offline deduplication method, including: obtaining the data fingerprints of the valid data blocks in the current scanned area during the data migration process and sending them to the fingerprint management unit; the fingerprint management unit records the valid physical block addresses of the valid data blocks corresponding to each data fingerprint; comparing the valid physical block address corresponding to the valid data block returned by the fingerprint management unit with the current physical block address of the valid data block; if the addresses are the same, moving the valid data block to the first physical block address, recording the data fingerprint and the first physical block address of the valid data block in the fingerprint management unit, and replacing the physical block address in the address mapping table that is the same as the valid physical block address with the first physical block address; the address mapping table includes the mapping relationship between the logical block address and the physical block address of each data block; otherwise, replacing the physical block address in the address mapping table that is the same as the valid data block address with the first physical block address; otherwise, mapping the logical block address of the valid data block in the address mapping table to the valid physical block address; erasing the data blocks in the current scanned area.

[0006] Second aspect, the present application provides an offline deduplication device, including: an acquisition module, configured to acquire data fingerprints of valid data blocks in the current scanned area during the data migration process, and send them to the fingerprint management unit; the fingerprint management unit records the valid physical block addresses of the valid data blocks corresponding to each data fingerprint; a processing module, configured to compare the valid physical block address returned by the fingerprint management unit corresponding to the valid data block with the current physical block address of the valid data block; the processing module is further configured to, if the addresses are the same, migrate the valid data block to the first physical block address, record the data fingerprint and the first physical block address of the valid data block in the fingerprint management unit, and replace the physical block address in the address mapping table that is the same as the valid physical block address with the first physical block address; the address mapping table includes the mapping relationship between the logical block address and the physical block address of each data block; otherwise, map the logical block address of the valid data block in the address mapping table to the valid physical block address. An erasure module is configured to erase the data blocks in the current scanned area.

[0007] Third aspect, the present application provides an electronic device, including: a processor, and a memory communicatively connected to the processor; the memory stores computer execution instructions; the processor executes the computer execution instructions stored in the memory to implement the method as in the first aspect.

[0008] Fourth aspect, the present application provides a computer-readable storage medium, in which computer execution instructions are stored, and when the computer execution instructions are executed by a processor, they are used to implement the method as in the first aspect.

[0009] Fifth aspect, the present application provides a computer program product, including a computer program, and when the computer program is executed by a processor, it implements the method as in the first aspect.

[0010] The offline deduplication method, device, electronic device, storage medium and program product provided by the present application obtain the valid physical block address recorded in the fingerprint management unit through the data fingerprint of the valid data block in the current scanned area during the data migration process; compare the valid physical block address with the current physical block address of the valid data block; if they are the same, migrate the valid data block to the first physical block address, and synchronously update the fingerprint management unit and the address mapping table; wherein, the address mapping table includes the mapping relationship between the logical block address and the physical block address of each data block; otherwise, do not migrate the valid data block, but map the logical block address of the valid data block in the address mapping table to the valid physical block address; when the migration of the valid data blocks in the current scanned area is completed, erase the current scanned area. The above solution performs offline deduplication of data during the background data migration process, avoiding online deduplication of data when writing data in the foreground, thereby reducing the impact on the foreground read and write performance and improving the service quality of upper-layer applications. Brief Description of the Drawings

[0011] The accompanying drawings herein are incorporated into and constitute a part of this specification, showing embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application.

[0012] Figure 1 An application scenario of an offline deduplication method provided by an embodiment of the present application;

[0013] Figure 2 A flowchart of an offline deduplication method provided by an embodiment of the present application;

[0014] Figure 3 A schematic diagram of an address mapping table provided by an embodiment of the present application;

[0015] Figure 4 Another schematic diagram of an address mapping table provided by an embodiment of the present application;

[0016] Figure 5 Another schematic diagram of an address mapping table provided by an embodiment of the present application;

[0017] Figure 6 A flowchart of another offline deduplication method provided by an embodiment of the present application;

[0018] Figure 7 Another schematic diagram of an address mapping table provided by an embodiment of the present application;

[0019] Figure 8 A flowchart of another offline deduplication method provided by an embodiment of the present application;

[0020] Figure 9 A schematic diagram of the structure of an offline deduplication device provided by an embodiment of the present application;

[0021] Figure 10 A schematic diagram of the structure of an electronic device provided by an embodiment of the present application.

[0022] Through the above accompanying drawings, specific embodiments of the present application have been shown, and there will be more detailed descriptions hereinafter. These drawings and textual descriptions are not intended to limit the scope of the concept of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. Detailed Description of the Embodiments

[0023] Here, exemplary embodiments will be described in detail, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Instead, they are only examples of devices and methods consistent with some aspects of the present application.

[0024] First, the nouns of the embodiments of the present application are explained:

[0025] Physical Block Address (PBA): Information is stored in blocks in storage devices. In order to correctly store or obtain information, each block corresponds to a unique address to identify the storage location, which is an absolute address.

[0026] Logical Block Address (LBA): A relative address, a general mechanism for describing the block where data is located on a computer storage device, generally used in auxiliary memory devices such as hard disks. The logical block address can be calculated or transformed by the addressing method to obtain the actual effective address of the storage device (i.e., the physical block address).

[0027] Data deduplication is a technology used to eliminate duplicate or redundant data to improve storage utilization. It is a common method to reduce data writing or storage. For multiple writes of the same data, after data deduplication, only one complete copy of the data needs to be written.

[0028] Traditional data deduplication operations are performed by the host CPU in a single machine or distributed environment. In addition, an additional data mapping layer needs to be maintained to record the address mapping information of duplicate data in the storage space. This implementation method increases the complexity of system design and creates a large computing pressure on the host CPU. By performing data deduplication operations inside the storage device, the problems existing in the above traditional methods can be effectively solved.

[0029] The current idea of ​​performing data deduplication inside storage devices is mainly online deduplication, that is, performing data deduplication when data is written to the storage device. Due to the complexity of the data deduplication operation itself, this online deduplication method will have a huge impact on the IO performance of the storage device, making it difficult to ensure the service quality of the upper-layer application.

[0030] Based on this, the present application provides an offline deduplication method, device, electronic device, storage medium and program product to realize offline deduplication of data in a storage device, that is, the device performs data deduplication processing when executing background data migration, so as to minimize the performance impact of deduplication operations on foreground reading and writing.

[0031] The offline deduplication method provided by the embodiments of this application can be applicable to Figure 1 the application scenario shown in the figure. The execution subject of this method can be an offline deduplication device, or a storage device integrated with an offline deduplication device. Specifically, it can be a solid state drive (Solid State Disk or Solid State Drive, abbreviated as SSD). Figure 1 Taking the solid state drive integrated with the offline deduplication device as an example, the embodiments will be described.

[0032] As Figure 1 shown in the figure, after the user performs foreground operations such as document editing and image processing, the data to be saved can be written to the SDD in the host. The SDD is a hard disk made of a solid state electronic storage chip array. As Figure 1 shown in the figure, it includes storage chips, cache chips, main control chips, etc.

[0033] Different from the characteristic that the data stored in a mechanical hard disk drive (abbreviated as HDD) can be overwritten, when writing data to an SSD, the main control writes it into a blank storage area. When writing data to this storage area again, an erase operation needs to be performed first before writing. However, reading and writing are in units of pages, and erasing is in units of blocks (composed of multiple pages). Among them, the size of a page is generally 4KB or 8KB, and a block generally has 128 to 256 pages.

[0034] Assume that the minimum unit for writing data is 4KB, and the minimum unit for erasing data is 1024KB. Due to the mismatch between the writing unit and the erasing unit, it is currently not possible to perform an operation of first erasing and then writing to a 4KB storage area alone. In one example, when the foreground operation backs up an already written document data and then writes it to the SSD again, the main control will write the backed-up data to a new storage area. At this time, the backed-up document data becomes duplicate data or redundant data. In another example, when the foreground operation deletes a document, the storage area on the SSD storing the document data may not be immediately erased. Therefore, it is easy to understand that there may be both data that does not need to be erased and data that needs to be erased in a 1024KB storage area.

[0035] As the foreground operation continuously writes data to the SSD, the remaining storage space of the SSD will become smaller and smaller. To improve the storage space utilization rate and not affect the IO performance at the same time, it is an offline deduplication to select to perform data migration and deduplication operations in the background when the SSD is in an idle state, for example, performing data deduplication during garbage collection or wear leveling operations in the background.

[0036] The following uses specific embodiments to elaborate in detail on the technical solution and how the technical solution solves the above technical problems. The following several specific embodiments can be combined with each other, and the same or similar concepts or processes may not be elaborated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0037] Embodiment 1

[0038] Figure 2 As shown in the flowchart of an offline deduplication method provided by an embodiment of the present application, the execution subject of this method can be an offline deduplication device. This device can be implemented through a computer program, for example, application software, etc.; or, this device can also be implemented as a medium storing relevant computer programs, for example, a USB flash drive, a cloud disk, etc.; or, this device can also be implemented through an entity device integrated or installed with relevant computer programs, for example, a chip, etc. The following takes a storage device integrated with an offline deduplication device as the execution subject (hereinafter referred to as the storage device) for illustration.

[0039] As Figure 2 shown, it includes the following steps:

[0040] S100. Obtain the data fingerprints of the valid data blocks in the current scanned area during the data migration process, and send them to the fingerprint management unit; the fingerprint management unit records the valid physical block addresses of the valid data blocks corresponding to each data fingerprint.

[0041] S200. According to the valid physical block addresses of the valid data blocks returned by the fingerprint management unit, compare the valid physical block addresses with the current physical block addresses of the valid data blocks.

[0042] S300. If the addresses are the same, move the valid data block to the first physical block address, record the data fingerprint and the first physical block address of the valid data block in the fingerprint management unit, and replace the physical block address in the address mapping table that is the same as the valid physical block address with the first physical block address; the address mapping table includes the mapping relationship between the logical block address and the physical block address of each data block; otherwise, map the logical block address of the valid data block in the address mapping table to the valid physical block address.

[0043] S400. After the migration of the valid data blocks in the current scanned area is completed, erase the data blocks in the current scanned area.

[0044] Specifically, in step S100, the storage device performs offline deduplication of data during the background data migration process, such as during the operations of garbage collection or wear leveling in the background. Compared with performing online deduplication of data in the foreground, it reduces the impact on the I / O performance of the storage device and ensures the service quality of the upper-layer applications.

[0045] A feasible implementation mode. The triggering execution of the offline deduplication operation can be self-started, which is more convenient for device management. Specifically, for example, the deduplication operation can be self-started when the foreground read / write operation pressure is small and the remaining storage space of the storage device is lower than a preset value; it can also be self-started after a preset time when the foreground read / write pressure is small; or the deduplication operation can be self-started at a fixed time preset by the user, such as a certain time point every day or a certain day of the week or a certain day of the month, etc., when the foreground read / write pressure is small.

[0046] Another feasible implementation mode. The triggering execution of the offline deduplication operation can also be to start the deduplication operation after receiving a deduplication instruction from the foreground, which is more flexible. Specifically, for example, the deduplication operation is started based on the user's operation instruction. For example, when it is found that the storage space of the storage device is insufficient or a space shortage warning sent by the storage device is received, the user actively issues a deduplication instruction.

[0047] Among them, when the background performs the offline deduplication operation, the foreground can simultaneously perform read / write operations. Compared with directly performing online deduplication when writing data in the foreground, the impact on the IO performance of the storage device is greatly reduced. When the background performs the offline deduplication operation, the foreground can also not perform read / write operations. At this time, data deduplication does not affect the read / write performance of the foreground. In the actual application process, when the requirements for the IO performance of the storage device and the quality of the upper-layer application service are not high, or when the IO performance configuration of the storage device is very high, it is possible to select parallel foreground read / write and background deduplication, which is beneficial to improving the storage space release speed and utilization rate.

[0048] Further, in step S100, the current scanned area is the physical space area on the storage device where data migration is about to be performed. Data blocks are stored on the physical space area, and the data blocks correspond to physical block addresses PBA. Exemplarily, the data blocks are sequentially processed according to the PBA. For valid data blocks, the data fingerprints of the valid data blocks are obtained and sent to the fingerprint management unit. It should be noted that relative to the concept of valid data blocks, invalid data blocks can refer to data such as documents or pictures modified or deleted by foreground operations. The technologies involved in identifying valid data blocks and invalid data blocks can refer to related technologies and will not be specifically introduced here.

[0049] Further, in step S200, the data fingerprint is used to identify the data block, and data blocks with the same content have the same data fingerprint. The fingerprint management unit is used to record the data fingerprint and the corresponding valid physical block address. When the data fingerprint of the valid data block is recorded in the fingerprint management unit, the fingerprint management unit returns the recorded corresponding valid physical block address. Among them, when the data fingerprint of the valid data block is stored in the fingerprint management unit, it indicates that the data block may be a duplicate data block, that is, data blocks with the same content stored at different physical block addresses are scanned and deduplication is required; it may also not be a duplicate data block, that is, the physical block address of the scanned data block is the same as the physical block address recorded by the fingerprint management unit, and deduplication is not required. Therefore, it is necessary to further compare the valid physical block address returned by the fingerprint management unit with the current physical block address of the valid data block.

[0050] Further, in step S300, when the valid physical block address is the same as the current physical block address, it indicates that the data block is an original data block rather than a duplicate data block, and no deduplication is performed during data migration. Specifically, the data block is written to a new physical block address (i.e., the first physical block address), and at the same time, the valid physical block address corresponding to the data fingerprint in the fingerprint management unit is updated to the first physical block address, and the address mapping table is updated. When the valid physical block address is different from the current physical block address, it indicates that the data block is a duplicate data block, and deduplication is performed during data migration. Specifically, the data block is not written to the new physical block address, and only the address mapping table is updated.

[0051] The update process of the address mapping table is illustrated by way of example below.

[0052] Exemplarily, Figure 3 FIG. is a schematic diagram of an address mapping table provided by an embodiment of the present application. The address mapping table includes the mapping relationship between the logical block address and the physical block address of each data block. As Figure 3 shown, each LBA corresponds to a PBA. Among them, the data blocks with LBA of 0x13 and LBA of 0x11 have the same content, and the fingerprint management unit records the data fingerprint of the data block with LBA of 0x11 and the corresponding valid physical block address as 0x21. Therefore, when the data block with LBA of 0x13 is scanned, its corresponding PBA is updated to 0x21, and there is no need to allocate a new physical block address for the data block with LBA of 0x13, saving storage space.

[0053] Further, the address mapping table further includes the previous deduplicated logical block address and the next deduplicated logical block address corresponding to the logical block address; wherein, the previous deduplicated logical block address is the previous logical block address that points to the same physical block address as the current logical block address; the next deduplicated logical block address is the next logical block address that points to the same physical block address as the current logical block address.

[0054] As shown Figure 3 in the figure, each LBA also corresponds to a deduplicated previous LBA and a deduplicated next LBA, which are used to serially map multiple LBAs to the same PBA. For the data block with LBA 0x11, its corresponding PBA is 0x21; for the data block with LBA 0x13, its corresponding PBA is also 0x21. At this time, for the LBA of 0x11, its next deduplicated LBA is 0x13 (there is no previous deduplicated LBA, which is represented by the invalid value 0xFFFFFFFF), and for the LBA of 0x13, its previous deduplicated LBA is 0x11 (there is no next deduplicated LBA).

[0055] In one example, based on Figure 3 the above,[[]]END]] Figure 4 FIG. 11 is a schematic diagram of another address mapping table provided by an embodiment of the present application, showing the update situation of the address mapping table when the data block with LBA 0x15 is the same as the data block with LBA 0x11. Specifically, instead of writing the data block with LBA 0x15 to a new physical block address, the PBA corresponding to the LBA of 0x15 is updated to 0x21. By doing so, it is not necessary to divide a new physical block storage area to repeatedly store the data block with LBA 0x15 having the same content, realizing data deduplication, which is beneficial to saving storage space. At the same time, for the LBA of 0x13, its next deduplicated LBA is 0x15; for the LBA of 0x15, its previous deduplicated LBA is 0x13 (there is no next deduplicated LBA, which is represented by the invalid value 0xFFFFFFFF).

[0056] Further, in step S300, replacing the physical block address in the address mapping table that is the same as the valid physical block address with the first physical block address specifically includes: determining all logical block addresses pointing to the valid physical block address according to the previous deduplicated logical block address and the next deduplicated logical block address in the address mapping table; replacing the valid physical block addresses corresponding to all logical block addresses with the first physical block address.

[0057] In one example, based on Figure 4 the above,[[]]END]] Figure 5Another schematic diagram of the address mapping table provided by the embodiment of the present application shows the update situation of the address mapping table when the data block with PBA of 0x21 is moved to the new physical block address 0x30 (i.e., the first physical block address). For example, when the nth scan is performed (n is an integer greater than or equal to 2), when the valid data block with PBA of 0x21 and LBA of 0x11 is scanned again, the current PBA is equal to the PBA returned by the fingerprint management unit, that is, both are 0x21. Then, the data block stored at PBA of 0x21 will be written to the new PBA, that is, 0x30, for data migration. At this time, according to the mapping relationship between the previous deduplicated LBA and the next deduplicated LBA in the address mapping table, it can be known that the PBA of 0x21 corresponds to three LBAs, that is, 0x11, 0x13, and 0x15. At this time, the PBA information of the three places is updated from 0x21 to 0x30.

[0058] In this embodiment, by performing scanning and data migration during the data migration process, invalid data blocks in the scanned area are screened out, and for valid data blocks with duplicate content, they are only actually written once. Data indexing is performed by multiple LBAs corresponding to one PBA in the address mapping table to achieve offline deduplication of data, minimizing the performance impact of the deduplication operation on foreground reading and writing as much as possible, and improving the service quality for upper-layer applications. At the same time, valid data blocks are centrally stored in a new storage area. After the storage area that has completed data migration is erased, new data can be written, saving storage space and improving storage space utilization.

[0059] Optionally, Figure 6 Another flowchart of the offline deduplication method provided by the embodiment of the present application. The offline deduplication method provided by this embodiment further includes:

[0060] S210. Receive the invalid physical block address returned by the fingerprint management unit; wherein, the invalid physical block address is returned when there is no record of the data fingerprint of the valid data block in the fingerprint management unit;

[0061] S220. Move the valid data block to the second physical block address, record the data fingerprint and the second physical block address of the valid data block in the fingerprint management unit, and map the logical block address of the valid data block in the address mapping table to the second physical block address.

[0062] Specifically, when the fingerprint management unit does not record the data fingerprint, it means that the valid data block is scanned for the first time. Write the data block to the new physical block address (i.e., the second physical block address). At the same time, the fingerprint management unit records the data fingerprint and the corresponding second physical block address for subsequent fingerprint comparison of scanned data blocks. In addition, map the logical block address of the valid data block in the address mapping table to the second physical block address for the foreground to access the data block stored at the corresponding PBA through the LBA.

[0063] Further, in step S100, obtaining the data fingerprints of the valid data blocks in the current scanned area during the data migration process includes: determining the valid data blocks in the current scanned area, sending the valid data blocks to the fingerprint calculation unit; and receiving the data fingerprints of the valid data blocks returned by the fingerprint calculation unit.

[0064] Exemplarily, a fingerprint calculation unit for calculating data fingerprints according to data blocks is internally configured in the storage device. A fixed-length data block, such as the size of one hard disk sector, which is 4KB, is sent to the fingerprint calculation unit. After calculating the corresponding fingerprint, the fingerprint calculation unit returns the data fingerprint. Among them, the fingerprint calculation unit can be a general-purpose CPU, or a dedicated hardware device such as an FPGA or an ASIC. Setting a dedicated fingerprint calculation unit to accelerate the calculation of data fingerprints is beneficial to improving the efficiency of data offline deduplication.

[0065] Optionally, in step S100, in a feasible way to determine the current scanned area, according to the scanning unit, the physical storage area is divided into multiple areas to be scanned. Among them, the scanning unit can be the minimum erasure unit of the storage device, such as 1024KB. The physical storage area of the storage device is divided into multiple areas to be scanned of 1024KB. Then, in the order of the physical block address, the areas to be scanned are sequentially used as the current scanned area for scanning and data migration. After the migration is completed, the current scanned area is erased for writing new data.

[0066] In another feasible way to determine the current scanned area, after the physical storage area is divided into multiple areas to be scanned according to the scanning unit, the proportion of valid data blocks in the multiple areas to be scanned is statistically calculated, and each area to be scanned is sequentially used as the current scanned area in the order from low to high proportion. Specifically, the proportion of valid data blocks in multiple areas to be scanned of 1024KB is statistically calculated, and the areas to be scanned are sequentially used as the current scanned area for scanning and data migration in the order from low to high proportion. Since there are fewer valid data blocks in the areas to be scanned, the data migration process takes a short time, and thus the storage space of this scanned area can be quickly released, improving the speed of data offline deduplication.

[0067] Further, in an example, when there is a write operation on the front end, the data block is written according to the normal write process (that is, the data block is written on a new PBA), and the corresponding address mapping table is updated. Specifically, on the basis of Figure 5 and Figure 7 This is a schematic diagram of another address mapping table provided by the embodiment of the present application, showing the actual situation of the address mapping table after the front end updates a data block that originally met the deduplication condition. As Figure 7As shown in the figure, the data block with LBA of 0x13 is updated, and a new PBA of 0x31 is allocated for the newly written data block. At this time, there is no corresponding previous deduplicated LBA and next deduplicated LBA for the LBA of 0x13, while the next deduplicated LBA corresponding to the LBA of 0x11 is updated to 0x15, and the previous deduplicated LBA corresponding to the LBA of 0x15 is updated to 0x11.

[0068] Next, in combination with the structure of the storage device, an offline deduplication method will be exemplarily described with a specific embodiment.

[0069] Figure 8 The figure is a flowchart of another offline deduplication method provided by the embodiment of the present application. Optionally, the storage controller inside the storage device includes a fingerprint calculation unit for obtaining data fingerprints based on data blocks and a fingerprint management unit for recording data fingerprints. The fingerprint calculation unit and the fingerprint management unit are managed and scheduled by the driver. When calculating the data fingerprint, the driver of the storage device sends a fixed-length data block, such as the size of a hard disk sector, which is 4KB, to the fingerprint calculation unit. After the fingerprint calculation unit calculates the corresponding fingerprint, it returns the fingerprint to the driver of the device. The fingerprint calculation unit can be a general-purpose CPU or a dedicated hardware device such as an FPGA or ASIC. In the fingerprint management unit, the paired fingerprints and PBAs are stored. During the fingerprint search process, the corresponding PBA can be obtained by finding the matching fingerprint. The driver of the storage device is responsible for maintaining the mapping table of LBA and PBA, and this mapping table supports the mapping of multiple LBAs to one PBA.

[0070] The deduplication operation of the internal data of the storage device is offline deduplication, which occurs when data migration is performed in the background of the storage device. In the background operation of the storage device, the data deduplication operation is performed according to the following steps:

[0071] (1) The device driver sequentially scans the physical space area where data migration is about to occur;

[0072] (2) For each valid data block in the scanned area, the driver sends it to the data fingerprint calculation unit, and the data fingerprint calculation unit returns the corresponding data fingerprint;

[0073] (3) The driver sends the obtained data fingerprint to the fingerprint management unit, and the fingerprint management unit checks whether the data fingerprint already exists; if it exists, it returns the corresponding PBA to the driver; if it does not exist, it returns an invalid PBA to the driver;

[0074] (4) The driver makes the following judgments on the return value of the fingerprint management unit:

[0075] If the returned PBA is valid, that is, the data fingerprint already exists in the fingerprint management unit, the driver determines whether the original PBA of the data block is equal to the returned PBA.

[0076] If they are equal, the data block is written to the new PBA in the storage medium, and all mapping relationships in the address mapping table that point to the original PBA are updated with the new PBA; if they are not equal, the driver updates the address mapping table according to the returned PBA and the LBA of the data block, and the data block will not be rewritten to the storage medium;

[0077] If the returned PBA is invalid, that is, the data fingerprint does not exist in the fingerprint management unit, the driver first writes the data block to the storage medium, and then resends the fingerprint and the new PBA occupied by the corresponding data block to the fingerprint management unit for the fingerprint management unit to store the fingerprint and PBA; then the driver updates the address mapping table according to the LBA and PBA of the data block;

[0078] (5) Until the scanning of the data migration area ends, erase the scanned area and release the storage space.

[0079] In this embodiment, through the data fingerprints of the valid data blocks in the current scanned area during the data migration process, the valid physical block address recorded by the fingerprint management unit for the data fingerprint is obtained; the valid physical block address is compared with the current physical block address of the valid data block; if they are the same, the valid data block is migrated to the first physical block address, and the fingerprint management unit and the address mapping table are synchronously updated; otherwise, the valid data block is not migrated, and the logical block address of the valid data block in the address mapping table is mapped to the valid physical block address; when the migration of the valid data blocks in the current scanned area is completed, the current scanned area is erased. The above solution performs offline deduplication of data during the background data migration process, avoiding online deduplication of data when writing data in the foreground, thereby reducing the impact on the foreground read and write performance and improving the service quality of upper-layer applications.

[0080] Embodiment 2

[0081] Figure 9 It is a schematic structural diagram of an offline deduplication device provided by an embodiment of the present application. The device includes:

[0082] An acquisition module 10, configured to acquire the data fingerprints of the valid data blocks in the current scanned area during the data migration process and send them to the fingerprint management unit; the fingerprint management unit records the valid physical block addresses of the valid data blocks corresponding to each data fingerprint;

[0083] A processing module 20, configured to compare the valid physical block address corresponding to the valid data block returned by the fingerprint management unit with the current physical block address of the valid data block;

[0084] The processing module 20 is further configured to move the valid data block to the first physical block address if the addresses are the same, record the data fingerprint of the valid data block and the first physical block address in the fingerprint management unit, and replace the physical block address in the address mapping table that is the same as the valid physical block address with the first physical block address; the address mapping table includes the mapping relationship between the logical block address and the physical block address of each data block; otherwise, map the logical block address of the valid data block in the address mapping table to the valid physical block address.

[0085] The erasing module 30 is configured to erase the data blocks in the currently scanned area.

[0086] Specifically, the storage device performs offline deduplication during the background data migration process, such as during garbage collection or wear leveling operations in the background. Compared with online deduplication of data in the foreground, it reduces the impact on the I / O performance of the storage device and ensures the service quality of upper-layer applications.

[0087] In a feasible implementation manner, the triggering execution of the offline deduplication operation can be self-started, which is more convenient for device management. Specifically, for example, it can be self-started when the foreground read / write pressure is small and the remaining storage space of the storage device is lower than a preset value; it can also be self-started after a preset time when the foreground read / write pressure is small; it can also be self-started at a fixed time preset by the user, such as a certain time point every day or a certain day of the week or a certain day of the month, etc., when the foreground read / write pressure is small. In another feasible implementation manner, the triggering execution of the offline deduplication operation can also be started after receiving a deduplication instruction from the foreground, which is more flexible. Specifically, for example, it is started based on the user's operation instruction, such as when it is found that the storage space of the storage device is insufficient or a space shortage warning sent by the storage device is received, the user actively issues a deduplication instruction.

[0088] Among them, when the background performs the offline deduplication operation, the foreground can perform read / write operations simultaneously. Compared with directly performing online deduplication when writing data in the foreground, it greatly reduces the impact on the I / O performance of the storage device. When the background performs the offline deduplication operation, the foreground can also not perform read / write operations. At this time, data deduplication does not affect the read / write performance of the foreground. In the actual application process, when the requirements for the I / O performance of the storage device and the service quality of upper-layer applications are not high, or when the I / O performance configuration of the storage device is very high, it is possible to select parallel foreground read / write and background deduplication, which is beneficial to improving the storage space release speed and utilization rate.

[0089] Further, the current scanning area is a physical space area on the storage device where data migration is about to occur. Data blocks are stored on the physical space area, and each data block corresponds to a physical block address (PBA). Exemplarily, the data blocks are processed sequentially according to the PBA. For valid data blocks, the data fingerprint of the valid data block is obtained and sent to the fingerprint management unit. It should be noted that, relative to the concept of valid data blocks, invalid data blocks can refer to data such as documents or pictures deleted by foreground operations. The techniques involved in identifying valid data blocks and invalid data blocks can refer to related technologies and will not be specifically introduced here.

[0090] Further, the data fingerprint is used to identify the data block, and data blocks with the same content have the same data fingerprint. The fingerprint management unit is used to record the data fingerprint and the corresponding valid physical block address. When the data fingerprint of the valid data block is recorded in the fingerprint management unit, the fingerprint management unit returns the recorded corresponding valid physical block address. Among them, when the data fingerprint of the valid data block is stored in the fingerprint management unit, it indicates that the data block may be a duplicate data block, that is, data blocks stored at different physical block addresses but with the same content are scanned and deduplication is required; it may also not be a duplicate data block, that is, the physical block address of the scanned data block is the same as the physical block address recorded by the fingerprint management unit and no deduplication is required. Therefore, it is necessary to further compare the valid physical block address returned by the fingerprint management unit with the current physical block address of the valid data block.

[0091] Further, when the valid physical block address is the same as the current physical block address, it indicates that the data block is an original data block rather than a duplicate data block, and no deduplication is performed during data migration. Specifically, the data block is written to a new physical block address (i.e., the first physical block address), and at the same time, the valid physical block address corresponding to the data fingerprint in the fingerprint management unit is updated to the first physical block address, and the address mapping table is updated. When the valid physical block address is different from the current physical block address, it indicates that the data block is a duplicate data block, and deduplication is performed during data migration. Specifically, the data block is not written to the new physical block address, and only the address mapping table is updated.

[0092] The following is an example to illustrate the update process of the address mapping table.

[0093] Exemplarily, Figure 3 is a schematic diagram of an address mapping table provided by an embodiment of the present application. The address mapping table includes the mapping relationship between the logical block address and the physical block address of each data block. As Figure 3As shown, each LBA corresponds to a PBA. Among them, the data block with LBA of 0x13 has the same content as the data block with LBA of 0x11. The fingerprint management unit records the data fingerprint of the data block with LBA of 0x11 and the corresponding valid physical block address of 0x21. Therefore, when the data block with LBA of 0x13 is scanned, its corresponding PBA is updated to 0x21, and there is no need to allocate a new physical block address for the data block with LBA of 0x13, saving storage space.

[0094] Furthermore, the address mapping table further includes the previous deduplicated logical block address and the next deduplicated logical block address corresponding to the logical block address; among them, the previous deduplicated logical block address is the previous logical block address that points to the same physical block address as the current logical block address; the next deduplicated logical block address is the next logical block address that points to the same physical block address as the current logical block address.

[0095] As Figure 3 shown, each LBA also corresponds to a previous deduplicated LBA and a next deduplicated LBA, which are used to concatenate multiple LBAs mapped to the same PBA. For the data block with LBA of 0x11, its corresponding PBA is 0x21; for the data block with LBA of 0x13, its corresponding PBA is also 0x21. At this time, for the LBA of 0x11, its next deduplicated LBA is 0x13 (there is no previous deduplicated LBA, which is represented by the invalid value 0xFFFFFFFF), and for the LBA of 0x13, its previous deduplicated LBA is 0x11 (there is no next deduplicated LBA).

[0096] In one example, on the basis of Figure 3 , Figure 4 This is a schematic diagram of another address mapping table provided by the embodiment of the present application, showing the update situation of the address mapping table when the data block with LBA of 0x15 has the same content as the data block with LBA of 0x11. Specifically, the data block with LBA of 0x15 is not written to a new physical block address, but the PBA corresponding to the LBA of 0x15 is updated to 0x21. By doing so, there is no need to divide a new physical block storage area to repeatedly store the data block with LBA of 0x15 with the same content, realizing data deduplication, which is beneficial to saving storage space. At the same time, for the LBA of 0x13, its next deduplicated LBA is 0x15; for the LBA of 0x15, its previous deduplicated LBA is 0x13 (there is no next deduplicated LBA, which is represented by the invalid value 0xFFFFFFFF).

[0097] Optionally, the processing module 20 is specifically configured to determine all logical block addresses pointing to the valid physical block address according to the previous deduplication logic block address and the next deduplication logic block address in the address mapping table; the processing module 20 is further specifically configured to replace the valid physical block addresses corresponding to all logical block addresses with the first physical block address.

[0098] In one example, based on Figure 4 , Figure 5 FIG. 7 is another schematic diagram of the address mapping table provided by the embodiment of the present application, showing the update situation of the address mapping table when the data block with PBA of 0x21 is moved to the new physical block address 0x30 (i.e., the first physical block address). For example, when the nth scan is performed (n is an integer greater than or equal to 2), when the valid data block with PBA of 0x21 and LBA of 0x11 is scanned again, the current PBA is equal to the PBA returned by the fingerprint management unit, that is, both are 0x21, then the data block stored at 0x21 of the PBA will be written to the new PBA, that is, 0x30, for data migration. At this time, according to the mapping relationship between the previous deduplication LBA and the next deduplication LBA in the address mapping table, it can be known that the PBA of 0x21 corresponds to three LBAs, that is, 0x11, 0x13, and 0x15. At this time, the PBA information of the three places is updated from 0x21 to 0x30.

[0099] In this embodiment, by performing scanning and data migration during the data migration process, invalid data blocks in the scanned area are screened out, and for valid data blocks with duplicate content, only one substantial write is performed. Data indexing is performed by mapping multiple LBAs in the address mapping table to one PBA, realizing offline deduplication of data, minimizing the performance impact of the deduplication operation on the foreground reading and writing as much as possible, and improving the service quality for upper-layer applications. At the same time, the valid data blocks are centrally stored in the new storage area, and the storage area that has completed the data migration can be erased and rewritten with data, saving storage space and improving the storage space utilization rate.

[0100] Further, the processing module 20 is further configured to receive the invalid physical block address returned by the fingerprint management unit; wherein, the invalid physical block address is returned when there is no record of the data fingerprint of the valid data block in the fingerprint management unit; the processing module 20 is further configured to move the valid data block to the second physical block address, record the data fingerprint and the second physical block address of the valid data block in the fingerprint management unit, and map the logical block address of the valid data block in the address mapping table to the second physical block address.

[0101] Specifically, when the fingerprint management unit does not record the data fingerprint, it indicates that the valid data block is scanned for the first time. Write the data block to a new physical block address (i.e., the second physical block address). Meanwhile, the fingerprint management unit records the data fingerprint and the corresponding second physical block address for subsequent fingerprint comparison of scanned data blocks. Also, map the logical block address of the valid data block in the address mapping table to the second physical block address for the foreground to access the data block stored in the corresponding PBA through LBA.

[0102] Optionally, the acquisition module 10 is specifically configured to determine valid data blocks within the current scanned area and send the valid data blocks to the fingerprint calculation unit; the acquisition module 10 is also specifically configured to receive the data fingerprints of the valid data blocks returned by the fingerprint calculation unit.

[0103] Exemplarily, a fingerprint calculation unit for calculating data fingerprints based on data blocks is internally configured in the storage device. Send a fixed-length data block, such as the size of a hard disk sector, 4KB, to the fingerprint calculation unit. After calculating the corresponding fingerprint, the fingerprint calculation unit returns the data fingerprint. Among them, the fingerprint calculation unit can be a general-purpose CPU or a dedicated hardware device such as an FPGA or ASIC. Setting a dedicated fingerprint calculation unit to accelerate the calculation of data fingerprints is beneficial to improving the efficiency of data deduplication.

[0104] Optionally, in a feasible way to determine the current scanned area, the physical storage area is divided into multiple areas to be scanned according to the scanning unit. Among them, the scanning unit can be the minimum erasure unit of the storage device, such as 1024KB. Divide the physical storage area of the storage device into multiple 1024KB areas to be scanned. Then, sequentially use the areas to be scanned as the current scanned area for scanning and data migration in the order of physical block addresses. After the migration is completed, erase the data in the current scanned area for writing new data.

[0105] In another feasible way to determine the current scanned area, after dividing the physical storage area into multiple areas to be scanned according to the scanning unit, count the proportion of valid data blocks in the multiple areas to be scanned, and sequentially use each area to be scanned as the current scanned area in ascending order of the proportion. Specifically, count the proportion of valid data blocks in multiple 1024KB areas to be scanned, and sequentially use the areas to be scanned as the current scanned area for scanning and data migration. Since there are fewer valid data blocks in the areas to be scanned, the data migration process takes less time, and thus the storage space of the scanned area can be quickly released, improving the speed of data offline deduplication.

[0106] In an example, when there is a write operation at the foreground, write the data block according to the normal write process (i.e., write the data block to a new PBA), and update the corresponding address mapping table.Figure 5 Based on Figure 7 Figure 7 is a schematic diagram of another address mapping table provided by the embodiment of the present application, showing the actual situation of the address mapping table after the current station updates a data block that originally met the deduplication condition. Specifically, the data block with LBA of 0x13 is updated, and a new PBA of 0x31 is allocated for the newly written data block. At this time, there is no corresponding previous deduplicated LBA and next deduplicated LBA for the LBA of 0x13, while the next deduplicated LBA corresponding to the LBA of 0x11 is updated to 0x15, and the previous deduplicated LBA corresponding to the LBA of 0x15 is updated to 0x11.

[0107] Exemplarily, Figure 8 Figure 8 is a flowchart of another offline deduplication method provided by the embodiment of the present application. Optionally, the storage controller inside the storage device includes a fingerprint calculation unit for obtaining data fingerprints based on data blocks and a fingerprint management unit for recording data fingerprints. The fingerprint calculation unit and the fingerprint management unit are managed and scheduled by the driver. When calculating the data fingerprint, the driver of the storage device sends a fixed-length data block, such as the size of a hard disk sector, 4KB, to the fingerprint calculation unit. After the fingerprint calculation unit calculates the corresponding fingerprint, it returns the fingerprint to the driver of the device. The fingerprint calculation unit can be a general-purpose CPU or a dedicated hardware device such as an FPGA or ASIC. In the fingerprint management unit, the paired fingerprints and PBAs are stored. During the fingerprint search process, the corresponding PBA can be obtained by finding the matching fingerprint. The driver of the storage device is responsible for maintaining the mapping table between LBA and PBA, and this mapping table supports the mapping of multiple LBAs to one PBA.

[0108] The deduplication operation of the data inside the storage device is offline deduplication, which occurs when the data migration is performed in the background of the storage device. In the background operation of the storage device, the data deduplication operation is performed according to the following steps:

[0109] (1) The device driver sequentially scans the physical space area where the data migration is about to be performed;

[0110] (2) For each valid data block in the scanned area, the driver sends it to the data fingerprint calculation unit, and the data fingerprint calculation unit returns the corresponding data fingerprint;

[0111] (3) The driver sends the obtained data fingerprint to the fingerprint management unit, and the fingerprint management unit checks whether the data fingerprint already exists; if it exists, it returns the corresponding PBA to the driver; if it does not exist, it returns an invalid PBA to the driver;

[0112] (4) The driver makes the following judgments on the return value of the fingerprint management unit:

[0113] If the returned PBA is valid, that is, the data fingerprint already exists in the fingerprint management unit, the driver determines whether the original PBA of the data block is equal to the returned PBA.

[0114] If they are equal, write the data block to the new PBA in the storage medium, and update all the mapping relationships in the address mapping table that point to the original PBA with the new PBA; if they are not equal, the driver updates the address mapping table according to the returned PBA and the LBA of the data block, and the data block will not be rewritten to the storage medium;

[0115] If the returned PBA is invalid, that is, the data fingerprint does not exist in the fingerprint management unit, the driver first writes the data block to the storage medium, then resends the fingerprint and the new PBA occupied by the corresponding data block to the fingerprint management unit, and the fingerprint management unit stores the fingerprint and the PBA; then the driver updates the address mapping table according to the LBA and PBA of the data block;

[0116] (5) Until the scanning of the data migration area is completed, erase the scanned area and release the storage space.

[0117] The acquisition module 10 in this embodiment is used to acquire the data fingerprints of the valid data blocks in the current scanned area during the data migration process and send them to the fingerprint management unit; the fingerprint management unit records the valid physical block addresses of the valid data blocks corresponding to each data fingerprint; the processing module 20 is used to compare the valid physical block address returned by the fingerprint management unit with the current physical block address of the valid data block; the processing module 20 is also used to, if the addresses are the same, move the valid data block to the first physical block address, record the data fingerprint and the first physical block address of the valid data block in the fingerprint management unit, and replace the physical block address in the address mapping table that is the same as the valid physical block address with the first physical block address; the address mapping table includes the mapping relationship between the logical block address and the physical block address of each data block; otherwise, map the logical block address of the valid data block in the address mapping table to the valid physical block address. The erasing module 30 is used to erase the data blocks in the current scanned area. The above solution performs offline deduplication of data during the background data migration process, avoiding online deduplication of data when writing data in the foreground, thereby reducing the impact on the foreground read and write performance and improving the service quality of upper-layer applications.

[0118] Embodiment III

[0119] Figure 10 It is a schematic structural diagram of an electronic device provided by an embodiment of the present application, as Figure 10 shown, the electronic device includes:

[0120] The electronic device includes a processor 291 and a memory 292. It may also include a communication interface 293 and a bus 294. Among them, the processor 291, the memory 292, and the communication interface 293 can communicate with each other through the bus 294. The communication interface 293 can be used for information transmission. The processor 291 can call the logical instructions in the memory 292 to execute the method of the above embodiments.

[0121] In addition, when the logical instructions in the above-mentioned memory 292 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.

[0122] The memory 292, as a computer-readable storage medium, can be used to store software programs and computer-executable programs, such as the program instructions / modules corresponding to the methods in the embodiments of the present application. The processor 291 executes functional applications and data processing by running the software programs, instructions, and modules stored in the memory 292, that is, to implement the methods in the above method embodiments.

[0123] The memory 292 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system and application programs required for at least one function; the data storage area can store data created according to the use of the terminal device, etc. In addition, the memory 292 may include high-speed random access memory and may also include non-volatile memory.

[0124] The embodiments of the present application also provide a computer-readable storage medium, in which computer-execution instructions are stored. When the computer-execution instructions are executed by a processor, they are used to implement the method provided in Embodiment 1.

[0125] The embodiments of the present application also provide a computer program product, including a computer program. When the computer program is executed by a processor, it implements the method provided in the above Embodiment 1.

[0126] After considering the specification and practicing the invention disclosed herein, those skilled in the art will readily think of other implementation schemes of the present application. The present application aims to cover any variations, uses, or adaptive changes of the present application. These variations, uses, or adaptive changes follow the general principles of the present application and include the common general knowledge or conventional technical means in the technical field not disclosed in the present application. The specification and the embodiments are only regarded as exemplary, and the true scope and spirit of the present application are pointed out by the following claims.

[0127] It should be understood that the present application is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present application is only limited by the appended claims.

Claims

1. An offline deduplication method, characterized in that, Including: Obtain the data fingerprint of the valid data block in the current scanned area during the data migration process, and send it to the fingerprint management unit; The fingerprint management unit records the valid physical block address of the valid data block corresponding to each data fingerprint; According to the valid physical block address corresponding to the valid data block returned by the fingerprint management unit, compare the valid physical block address with the current physical block address of the valid data block; If the addresses are the same, move the valid data block to the first physical block address, record the data fingerprint and the first physical block address of the valid data block in the fingerprint management unit, and replace the physical block address in the address mapping table that is the same as the valid physical block address with the first physical block address; the address mapping table includes the mapping relationship between the logical block address and the physical block address of each data block; otherwise, map the logical block address of the valid data block in the address mapping table to the valid physical block address; After the migration of the valid data blocks in the current scanned area is completed, erase the data blocks in the current scanned area.

2. The method according to claim 1, characterized in that The method further includes: Receive the invalid physical block address returned by the fingerprint management unit; wherein, the invalid physical block address is returned when the fingerprint management unit does not record the data fingerprint of the valid data block; Move the valid data block to the second physical block address, record the data fingerprint and the second physical block address of the valid data block in the fingerprint management unit, and map the logical block address of the valid data block in the address mapping table to the second physical block address.

3. The method according to claim 2, wherein The obtaining the data fingerprint of the valid data block in the current scanned area during the data migration process includes: Determine the valid data blocks in the current scanned area, and send the valid data blocks to the fingerprint calculation unit; Receive the data fingerprint of the valid data block returned by the fingerprint calculation unit.

4. The method according to claim 2, wherein The address mapping table further includes the previous deduplicated logical block address and the next deduplicated logical block address corresponding to the logical block address; wherein, the previous deduplicated logical block address is the previous logical block address that points to the same physical block address as the current logical block address; the next deduplicated logical block address is the next logical block address that points to the same physical block address as the current logical block address; The replacing the physical block address in the address mapping table that is the same as the valid physical block address with the first physical block address includes: According to the previous deduplicated logical block address and the next deduplicated logical block address in the address mapping table, determine all the logical block addresses that point to the valid physical block address; Replace the valid physical block address corresponding to all the logical block addresses with the first physical block address.

5. An offline duplicate removal device, characterized in that, Including: An obtaining module, configured to obtain the data fingerprint of the valid data block in the current scanned area during the data migration process, and send it to the fingerprint management unit; The fingerprint management unit records the valid physical block address of the valid data block corresponding to each data fingerprint; A processing module, configured to compare the valid physical block address corresponding to the valid data block returned by the fingerprint management unit with the current physical block address of the valid data block; The processing module is further configured to, if the addresses are the same, move the valid data block to the first physical block address, record the data fingerprint of the valid data block and the first physical block address in the fingerprint management unit, and replace the physical block address in the address mapping table that is the same as the valid physical block address with the first physical block address; the address mapping table includes the mapping relationship between the logical block address and the physical block address of each data block; otherwise, map the logical block address of the valid data block in the address mapping table to the valid physical block address; An erasing module, configured to erase the data blocks in the current scanned area.

6. The apparatus according to claim 5, wherein The processing module is further configured to receive the invalid physical block address returned by the fingerprint management unit; wherein, the invalid physical block address is returned when the data fingerprint of the valid data block is not recorded in the fingerprint management unit; The processing module is further configured to move the valid data block to the second physical block address, record the data fingerprint of the valid data block and the second physical block address in the fingerprint management unit, and map the logical block address of the valid data block in the address mapping table to the second physical block address.

7. The apparatus according to claim 6, wherein The obtaining module is specifically configured to determine the valid data blocks in the current scanned area and send the valid data blocks to the fingerprint calculation unit; The obtaining module is specifically further configured to receive the data fingerprint of the valid data block returned by the fingerprint calculation unit.

8. The device according to claim 6, wherein The address mapping table further includes the previous deduplicated logical block address and the next deduplicated logical block address corresponding to the logical block address; wherein, the previous deduplicated logical block address is the previous logical block address that points to the same physical block address as the current logical block address; the next deduplicated logical block address is the next logical block address that points to the same physical block address as the current logical block address; The processing module is specifically configured to determine all the logical block addresses pointing to the valid physical block address according to the previous deduplicated logical block address and the next deduplicated logical block address in the address mapping table; The processing module is specifically further configured to replace the valid physical block addresses corresponding to all the logical block addresses with the first physical block address.

9. An electronic device, characterized in that, Comprising: A processor and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1-4.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the method according to any one of claims 1-4.

11. A computer program product, characterized in that, Comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1-4.

Citation Information

Patent Citations

  • Data integrity and loss resistance in high performance and high capacity storage deduplication

    CN105843551A

  • Applying deduplication digests to avoid same-data writes

    US20200133547A1