Search

CN-121979456-A - Data storage method and data storage device

CN121979456ACN 121979456 ACN121979456 ACN 121979456ACN-121979456-A

Abstract

A data storage method and a data storage apparatus are provided, the method including determining whether a first resource pool corresponding to a lifecycle level of data to be written is included in a plurality of resource pools based on a received write request, wherein the data to be written corresponds to the received write request, each of the plurality of resource pools includes at least one block group and the plurality of resource pools respectively correspond to different lifecycle levels, and allocating a free block of one or more block groups included in the first resource pool to the data to be written to store the data to be written into a physical block corresponding to the free block in a Flexible Data Placement (FDP) Solid State Drive (SSD) based on determining that the first resource pool is included in the plurality of resource pools, wherein the free block includes a reclaimed block.

Inventors

  • HE XING
  • YAN HAO
  • QI HUI

Assignees

  • 三星(中国)半导体有限公司
  • 三星电子株式会社

Dates

Publication Date
20260505
Application Date
20260116

Claims (16)

  1. 1. A data storage method, comprising: Determining whether a plurality of resource pools, each of which includes at least one block group and corresponds to a different lifecycle level, includes a first resource pool corresponding to a lifecycle level of data to be written based on a received write request, and Allocating free blocks in one or more block groups included in a first resource pool to the data to be written based on determining that the first resource pool is included in the plurality of resource pools to store the data to be written into physical blocks corresponding to the free blocks in a flexible data placement FDP solid state drive SSD, Wherein the free block comprises a reclamation block.
  2. 2. The method of claim 1, wherein assigning free blocks of one or more block groups included in a first resource pool to the data to be written based on determining that the first resource pool is included in the plurality of resource pools comprises: Determining whether the first resource pool comprises at least one block group capable of being used for storing the data to be written, and The free blocks in the at least one block group capable of storing the data to be written are allocated to the data to be written based on a determination that the at least one block group capable of storing the data to be written is included in the first resource pool.
  3. 3. The method of claim 2, wherein assigning free blocks of one or more block groups included in a first resource pool to the data to be written based on determining that the first resource pool is included in the plurality of resource pools further comprises: Adding a free block group to the first resource pool based on determining that the first resource pool does not include at least one block group available for storing the data to be written, and And allocating the free blocks in the free block group added to the first resource pool to the data to be written.
  4. 4. The method of claim 2, the step of allocating free blocks in at least one block group to the data to be written comprising: selecting a first block group of the at least one block group based on information of the reclaimed blocks in each of the at least one block group, and And distributing the idle blocks in the first block group to the data to be written.
  5. 5. The method of claim 1, further comprising: Based on determining that the first resource pool is not included in the plurality of resource pools, establishing the first resource pool based on one or more free block groups, and And allocating the free blocks in the block group included in the established first resource pool to the data to be written.
  6. 6. The method of claim 2, wherein determining whether the first resource pool includes at least one block group available for storing the data to be written comprises: determining a remaining storage capacity of each of one or more block groups included in the first resource pool, and When at least one block group with the remaining storage capacity larger than the size of the data to be written is included in the first resource pool, it is determined that at least one block group capable of being used for storing the data to be written is included in the first resource pool.
  7. 7. The method of claim 4, wherein selecting the first block group of the at least one block group based on information of the reclaimed blocks in each of the at least one block group comprises: determining, for each of the at least one block group, a ratio of a square of a number of reclaimed blocks in each block group to a number of free blocks in each block group, and A block group corresponding to the maximum value in the ratio among at least one block group is selected as a first block group.
  8. 8. The method of claim 4, wherein allocating the free blocks in the first block group to the data to be written comprises: determining at least one allocation mode for allocating the free block fragments in the first block group to the data to be written; determining the number of remaining free block fragments in the first block group after allocation of free block fragments in each of the at least one allocation, and And distributing the free block fragments in the first block group to the data to be written according to the distribution mode corresponding to the maximum value in the number of the remaining free block fragments.
  9. 9. The method of claim 8, wherein determining at least one allocation of free block fragments in a first block group to the data to be written comprises: determining at least one free block fragment in the first block group having a storage capacity greater than or equal to the size of the data to be written, and The at least one allocation is determined from at least one free block fragment.
  10. 10. The method of claim 1, further comprising: Grouping the reclaimed block shards in each of the plurality of resource pools into a plurality of time windows based on a generation time of each of the reclaimed block shards in each of the plurality of resource pools; ordering the plurality of time windows according to a life upgrade time of each of the plurality of time windows, wherein the life upgrade time of each time window is equal to a generation time of a reclaimed block fragment having an earliest generation time within each time window plus a time length for each resource pool, and One or more TRIM commands for one or more reclaimed block fragments in a time window of the plurality of time windows having an earlier life upgrade time are sent preferentially based on the ordered sequence of the plurality of time windows.
  11. 11. The method of claim 10, wherein a length of time for each resource pool is equal to a lifecycle of a corresponding lifecycle level indication for each resource pool.
  12. 12. The method of claim 10, wherein the plurality of resource pools includes a first resource pool and a second resource pool, the step of grouping the reclaimed block shards in each resource pool into a plurality of time windows based on a generation time of each of the reclaimed block shards in each of the plurality of resource pools comprising: grouping reclaimed block fragments in a first resource pool into a first plurality of time windows, and The reclaimed block shards in the second resource pool are grouped into a second plurality of time windows.
  13. 13. The method of claim 12, wherein the number of time windows in the first plurality of time windows and the number of time windows in the second plurality of time windows are N1 and N2, respectively, wherein N1 and N2 are preconfigured or changed based on the first user input, and/or Each time window of the first plurality of time windows includes at most n1 reclaimed block fragments and each time window of the second plurality of time windows includes at most n2 reclaimed block fragments, wherein n1 and n2 are preconfigured or changed based on a second user input.
  14. 14. A data storage device, comprising: A memory storing computer code, and A processor configured to access the memory and execute the computer code to cause the processor to implement a determination module configured to determine, based on a received write request, whether a first resource pool corresponding to a lifecycle level of data to be written is included in a plurality of resource pools, wherein the data to be written corresponds to the received write request, each resource pool of the plurality of resource pools includes at least one block group and the plurality of resource pools correspond to different lifecycle levels, respectively, and An allocation module configured to allocate free blocks in one or more block groups included in a first resource pool to the data to be written to store the data to be written into physical blocks corresponding to the free blocks in a flexible data placement FDP solid state drive SSD based on determining that the first resource pool is included in the plurality of resource pools, wherein the free blocks include reclamation blocks.
  15. 15. An electronic device, comprising: processor, and A memory storing computer readable instructions that, when executed by the processor, cause the processor to implement the data storage method of any of claims 1-13.
  16. 16. A computer readable storage medium storing a computer program, wherein the computer program, when executed by a processor, causes the processor to implement the data storage method of any one of claims 1-13.

Description

Data storage method and data storage device Technical Field The present application relates to the field of data storage technologies, and in particular, to a data storage method and a data storage device. Background When a file is deleted at the EXT4 file system level, the logical blocks corresponding to the file are marked as free/available, but the host does not explicitly inform the FDP SSD that the data corresponding to the file has failed, so the actual physical data corresponding to the file remains in the NAND of the FDP SSD. Since the FDP SSD cannot recognize that data corresponding to the file in the reclamation unit (RECLAIMING UNIT, RU) is invalid data during garbage reclamation (Garbage Collection, GC), if a logical block marked free/available is not reassigned to a new file, unnecessary data duplication for the data during GC is caused, thereby increasing WAF. In addition, under the allocation rule of EXT4, the deleted space (i.e., free logical blocks) is reallocated to a new file at a different time. This results in data in the same RU having different lifecycles. In the reclamation process of one RU, the life cycle extended data will be considered valid data and copied to a new RU, resulting in a high WAF. To address this shortcoming, the Operating System (OS) may explicitly inform the FDP SSD of the logical block address containing invalid data based on the TRIM command to ensure that the actual lifecycle of the data coincides with the lifecycle of the OS-reported data. This notification eliminates the need for the FDP SSD to blindly replicate data blocks with invalid data during garbage collection, thereby reducing redundant write operations and their associated overhead. However, the delay caused by the TRIM command itself and the competition with the I/O operation as a system call may cause a significant loss of the memory performance of the device, so how to combine the write amplification and the memory performance of the device is a problem to be solved in the art. Disclosure of Invention An aspect of the present invention is to provide a data storage method and a data storage apparatus to solve at least the above-mentioned disadvantages of the related art. According to an aspect of one or more embodiments of the present invention, there is provided a data storage method including determining, based on a received write request, whether a first resource pool corresponding to a lifecycle level of data to be written is included in a plurality of resource pools, wherein the data to be written corresponds to the received write request, each of the plurality of resource pools including at least one block group and the plurality of resource pools corresponding to different lifecycle levels, respectively, and allocating, based on determining that the first resource pool is included in the plurality of resource pools, a free block in one or more block groups included in the first resource pool to the data to be written to store the data to be written in a physical block corresponding to the free block in a Flexible Data Placement (FDP) Solid State Drive (SSD), wherein the free block includes a reclaimed block. In some embodiments, the step of allocating free blocks of the one or more block groups included in the first resource pool to the data to be written based on determining that the first resource pool is included in the plurality of resource pools may include determining whether at least one block group capable of storing the data to be written is included in the first resource pool, and allocating the free blocks of the at least one block group capable of storing the data to be written to the data to be written based on determining that the at least one block group capable of storing the data to be written is included in the first resource pool. In some embodiments, the step of allocating free blocks of one or more block groups included in the first resource pool to the data to be written based on determining that the first resource pool includes the first resource pool may further comprise adding free block groups to the first resource pool based on determining that the first resource pool does not include at least one block group available for storing the data to be written, and allocating the free blocks of the free block groups added to the first resource pool to the data to be written. In some embodiments, the step of allocating free blocks in at least one block group to the data to be written comprises selecting a first block group of at least one block group based on information of reclaimed blocks in each of the at least one block group and allocating the free blocks in the first block group to the data to be written. In some embodiments, the method may further include establishing a first resource pool based on one or more free block groups based on determining that the first resource pool is not included in the plurality of resource pools, and allocating free blocks in a block