Search

US-12619366-B2 - Storage apparatus and related partitioned data management method

US12619366B2US 12619366 B2US12619366 B2US 12619366B2US-12619366-B2

Abstract

A storage apparatus includes a controller and M storage blocks, and M is an integer greater than 0. The controller is configured to: determine region configuration information, where the region configuration information includes a quantity N of storage regions, sizes of the storage regions, and maximum data retention time periods corresponding to the storage regions, and N is an integer greater than 1; divide the M storage blocks into N storage regions based on the quantity N of storage regions and the sizes of the storage regions, where each of the N storage regions includes one or more blocks; and configure a maximum data retention time period for each of the N storage regions based on the region configuration information.

Inventors

  • Jie Shang
  • Jinwei Wang
  • Shaofeng Shen

Assignees

  • HUAWEI TECHNOLOGIES CO., LTD.

Dates

Publication Date
20260505
Application Date
20240904
Priority Date
20220307

Claims (20)

  1. 1 . A storage apparatus comprising: M storage blocks, wherein M is an integer greater than 0; and a controller configured to: obtain, from a host device, region configuration information, wherein the region configuration information is based on data features or retention time period requirements and comprises a quantity of storage regions, sizes of the storage regions, and maximum data retention time periods corresponding to the storage regions; divide the M storage blocks into N storage regions based on the quantity, the sizes, and the maximum data retention time periods in the region configuration information, wherein N is an integer greater than 1 and equal to the quantity and wherein each of the N storage regions comprises one or more storage blocks; and configure the N storage regions with the maximum data retention time periods in the region configuration information, wherein the maximum data retention time periods determine respective maximum quantities of program/erase cycles for the N storage regions.
  2. 2 . The storage apparatus of claim 1 , wherein the controller is further configured to receive the region configuration information from a host.
  3. 3 . The storage apparatus of claim 2 , wherein the controller is further configured to: generate region identifiers for the storage regions; and establish a mapping relationship between the maximum data retention time periods and the region identifiers.
  4. 4 . The storage apparatus of claim 2 , wherein the controller is further configured to: divide an available logical address space of a storage system into N logical address segments; and establish a mapping relationship between the maximum data retention time period of each of the N storage regions and the N logical address segments.
  5. 5 . The storage apparatus of claim 1 , wherein the controller is further configured to: receive, from a host, a write command comprising to-be-stored data and target region identification information of a target storage region, wherein the target storage region is one of the N storage regions; and write the to-be-stored data into the target storage region based on the target region identification information.
  6. 6 . The storage apparatus of claim 1 , wherein the controller is further configured to configure, based on the maximum data retention time periods, a maximum quantity of program/erase cycles of a storage block comprised in each of the N storage regions, wherein a shorter maximum data retention time period indicates a larger maximum quantity of program/erase cycles of the storage block.
  7. 7 . An apparatus comprising: a memory configured to store instructions; and a processor coupled to the memory and configured to execute the instructions to cause the apparatus to: generate, based on data features or retention time period requirements, region configuration information comprising a quantity of storage regions, sizes of the storage regions, and maximum data retention time periods corresponding to the storage regions; and send the region configuration information to a storage device, wherein the region configuration information is configured to enable the storage device to divide M storage blocks into N storage regions based on the quantity and the sizes and pre-assigned with the maximum data retention time periods, wherein the maximum data retention time periods determine respective maximum quantities of program/erase cycles for the N storage regions, and wherein M and N are integers greater than 1.
  8. 8 . The apparatus of claim 7 , wherein the processor is further configured to execute the instructions to cause the apparatus to: select a target storage region from the N storage regions based on requirement information of to-be-stored data, wherein the requirement information comprises a target retention time period associated with the to-be-stored data; and send, to the storage device, a write command comprising the to-be-stored data and target region identification information of the target storage region.
  9. 9 . The apparatus of claim 8 , wherein the processor is further configured to execute the instructions to cause the apparatus to determine, from the N storage regions, a storage region whose maximum data retention time period is greater than or equal to the target retention time period as the target storage region, wherein the maximum data retention time periods comprises the maximum data retention time period, and wherein the target region identification information comprises a target region identifier corresponding to the target storage region.
  10. 10 . The apparatus of claim 8 , wherein the processor is further configured to execute the instructions to cause the apparatus to: determine, from the N storage regions, a storage region whose maximum data retention time period is greater than or equal to the target retention time period as the target storage region; determine a target logical address segment corresponding to the target storage region; and select a target logical address from the target logical address segment, wherein the target region identification information comprises the target logical address.
  11. 11 . A method comprising: obtaining, from a host device, region configuration information, wherein the region configuration information is based on data features or retention time period requirements and comprises a quantity of storage regions, sizes of the storage regions, and maximum data retention time periods corresponding to the storage regions; dividing M storage blocks into N storage regions based on the quantity, the sizes, and the maximum data retention time periods in the region configuration information, wherein M is an integer greater than 0, wherein N is an integer greater than 1 and equal to the quantity, and wherein each of the N storage regions comprises one or more storage blocks; and configure the N storage regions with the maximum data retention time periods in the region configuration information, wherein the maximum data retention time periods determine respective maximum quantities of program/erase cycles for the N storage regions.
  12. 12 . The method of claim 11 , further comprising negotiating with the host for the region configuration information.
  13. 13 . The method of claim 12 , further comprising: generating region identifiers for the N storage regions; and establishing a mapping relationship between a maximum data retention time periods and the region identifiers.
  14. 14 . The method of claim 12 , further comprising: dividing an available logical address space of a storage system into N logical address segments; and establishing a mapping relationship between a maximum data retention time periods and the N logical address segments.
  15. 15 . The method of claim 11 , further comprising: receiving, from a host, a write command comprising to-be-stored data and target region identification information of a target storage region, wherein the target storage region is one of the N storage regions; and writing the to-be-stored data into the target storage region based on the target region identification information in the write command.
  16. 16 . The method of claim 11 , further comprising configuring, based on the maximum data retention time periods, a maximum quantity of program/erase cycles of a storage block comprised in each of the N storage regions, wherein a shorter maximum data retention time period indicates a larger maximum quantity of program/erase cycles of the storage block.
  17. 17 . A method comprising: generating, based on data features or retention time period requirements, region configuration information comprising a quantity of storage regions, sizes of the storage regions, and maximum data retention time periods corresponding to the storage regions; and sending the region configuration information to a storage device, wherein the region configuration information is configured to enable the storage device to divide M storage blocks into N storage regions based on the quantity and the sizes and pre-assigned with the maximum data retention time periods, wherein the maximum data retention time periods determine respective maximum quantities of program/erase cycles for the N storage regions, and wherein M is an integer greater than 1.
  18. 18 . The method of claim 17 , further comprising: selecting a target storage region from the N storage regions based on requirement information of to-be-stored data, wherein the requirement information comprises a target retention time period associated with the to-be-stored data; and sending, to the storage device, a write command comprising the to-be-stored data and target region identification information of the target storage region.
  19. 19 . The method of claim 18 , further comprising determining, from the N storage regions, a storage region whose maximum data retention time period is greater than or equal to the target retention time period as the target storage region, and wherein the target region identification information comprises a target region identifier corresponding to the target storage region.
  20. 20 . The method of claim 18 , further comprising: determining, from the storage regions, a storage region whose maximum data retention time period is greater than or equal to the target retention time period as the target storage region; determining a target logical address segment corresponding to the target storage region; and selecting a target logical address from the target logical address segment, wherein the target region identification information comprises the target logical address.

Description

CROSS-REFERENCE TO RELATED APPLICATIONS This is a continuation of International Patent Application No. PCT/CN2023/075459 filed on Feb. 10, 2023, which claims priority to Chinese Patent Application No. 202210223806.1 filed on Mar. 7, 2022. The disclosures of the aforementioned applications are hereby incorporated by reference in their entireties. TECHNICAL FIELD The present disclosure relates to the field of computer technologies, and in particular, to a storage apparatus and a related partitioned data management method. BACKGROUND Currently, mainstream storage devices of computer servers are classified into two types: hard disk drive (HDD) and solid-state disk (SSD). Both the solid state disk and the hard disk drive are essentially hardware for data storage, and differ in storage medium. A hard disk drive uses a mechanical disk as a storage medium, and stores and reads data based on a mechanical structure between an actuator arm, a magnetic head, and a disk. A solid state disk uses a non-volatile memory flash (e.g., Not AND (NAND) flash) as a storage medium, and reads and writes data based on a quantity of charges in the memory, that is, through cell power-on and power-off, to implement data storage. With miniaturization of the solid state disk and continuous improvement of cost performance, more enterprise consumers and individual consumers use solid state disks to store data. Currently, the industry has explored use of NAND flash memories to replace or offload some expensive memories. For example, data in a mobile phone memory is temporarily stored in an SSD by using an algorithm, to reduce overheads of the mobile phone memory. However, this also poses a challenge to a service life of the SSD. Based on a logical structure, the NAND flash may be divided into different blocks internally, and each block includes multiple pages. The NAND flash is read and written by pages, and is erased by blocks. That is, after a page in a block is written, the page cannot be directly erased. Instead, all data in the block that includes the page needs be erased before the page is written again. Therefore, in a garbage collection (GC) operation process of the NAND flash, data distribution needs to be managed on a flash translation layer (FTL), and valid data in a block is first backed up to another block before the block is erased. Data writing and erasing in this process increase hardware wear of the SSD, and reduce the service life of the SSD. SUMMARY A technical issue to be addressed in embodiments of the present disclosure is to provide a storage apparatus and a related partitioned data management method, to prolong a service life of a storage device. According to a first aspect, an embodiment of the present disclosure provides a storage apparatus. The storage apparatus includes a controller and M storage blocks, and M is an integer greater than 0. The controller is configured to: determine region configuration information, where the region configuration information includes a quantity N of storage regions, sizes of the storage regions, and maximum data retention time periods corresponding to the storage regions, and N is an integer greater than 1; divide the M storage blocks into N storage regions based on the quantity N of storage regions and the sizes of the storage regions, where each of the N storage regions includes one or more blocks; and configure a maximum data retention time period for each of the N storage regions based on the region configuration information. In this embodiment of the present disclosure, a controller of an external memory (for example, an SSD) partitions storage blocks in the external memory to obtain different storage regions, and causes the different storage regions to have different maximum data retention time periods through software configuration, so that data having different retention time period requirements can be stored based on a feature of difference (that is, a feature of different maximum data retention time periods) between multiple storage regions (for example, data that needs to be retained for a long time is stored in a storage region with a long maximum data retention time period, and data that needs to be stored only for a short time is stored in a storage region with a short maximum data retention time period), so that storage characteristics of all storage regions can be fully utilized for data storage in the entire external memory, effectively improving utilization and prolonging a service life of an external memory. Specifically, the controller first divides, based on the configuration information, multiple blocks in the external memory into N storage regions. Further, because a maximum data retention time period of a storage block may be directly configured by using a parameter, the controller in the external memory may directly configure, by using software, maximum data retention time periods of multiple storage blocks included in different storage regions, to impleme