IP Library › Granted Patent US 12,008,263
Granted Patent B2
US 12,008,263 · App. 17/183,657 · Granted Jun 11, 2024

Garbage collection and data storage method and apparatus, and storage system

Inventors: Ying Wang (Beijing, CN); Xiaobao Zhao (Beijing, CN)
Assignee: HUAWEI TECHNOLOGIES CO., LTD.
G06F3/0659G06F3/0619G06F3/0673G06F11/1469G11B20/1217H03M13/154G06F2201/82G11B2020/1238G11B2020/1292
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,008,263
App. No.
17/183,657
Granted
Jun 11, 2024
Kind
B2
Abstract

A data storage method and apparatus, and a storage system are provided. The method is applied to a storage system. The storage system includes at least one first memory and a second memory. The at least one first memory includes a plurality of storage areas. Garbage collection is performed based on each of the plurality of storage areas. In the method, a time length between the earliest expiration time and the latest expiration time in expiration time of valid data stored in a target storage area is limited to be less than or equal to a preset time length, so that the expiration time of the valid data stored in the target storage area is comparatively centralized.

Claims (30)

1. A data storage method comprising:

after a data failure occurs in a second memory, recovering first data associated with the second memory of a storage system to obtain the first data, and obtaining an expiration time of the recovered first data associated with the second memory of the storage system;

selecting, based on the expiration time of the recovered first data, a target storage area from a plurality of storage areas, wherein the plurality of storage areas belong to at least one first memory of the storage system; and

sending at least a portion of the recovered first data to a first memory in which the target storage area is located, wherein

after the at least a portion of the recovered first data is stored in the target storage area, the expiration time of the at least a portion of the recovered first data is between an earliest expiration time and a latest expiration time in expiration time of old data stored in the target area.

2. The method according to claim 1 , wherein after the at least a portion of the recovered first data is stored in the target storage area, the expiration time of the recovered first data matches an expiration time of other data stored in the target storage area.

3. The method according to claim 1 , wherein data stored in the plurality of storage areas is written in a sequential write manner.

4. The method according to claim 1 , wherein the at least one first memory and the second memory are shingled magnetic recording (SMR) hard disks, and each of the plurality of storage areas is a sequential zone (Szone).

5. The method according to claim 1 , wherein the at least one first memory is a solid-state drive (SSD), and each of the plurality of storage areas is a block.

6. The method according to claim 1 , wherein the method further comprises:

determining a storage sequence of the recovered first data based on the expiration time of the recovered first data; and

selecting the target storage area from the plurality of storage areas, and storing in the target storage area, of at least a portion of the recovered first data comprises:

selecting the target storage area from the plurality of storage areas and storing the at least a portion of the recovered first data in the target storage area according to the storage sequence.

7. The method according to claim 1 , further comprising: determining valid data stored in the target storage area wherein the valid data comprises the at least a portion of the recovered first data and/or other data, and the other data comprises data stored in the target storage area before the at least a portion of the recovered first data is stored in the target storage area, and/or data stored in the target storage area after the at least a portion of the recovered first data is stored in the target storage area.

8. The method according to claim 1 , wherein the expiration time of any piece of the recovered first data is stored in metadata of a data slice corresponding to the any piece of the recovered first data, and the any piece of the recovered first data and the data slice corresponding to the any piece of the recovered first data are generated by performing erasure code encoding on raw data.

9. The method according to claim 1 , wherein the expiration time is represented by a life cycle of data and write time of the data.

10. A storage system, the storage system comprising a processor configured to:

after a data failure occurs in a second memory, obtain an expiration time of first data associated with the second memory of a storage system, and recover the first data associated with the second memory of a storage system;

select, based on the expiration time of the recovered first data, a target storage area from a plurality of storage areas, wherein the plurality of storage areas belong to at least one first memory of the storage system; and

send at least a portion of the recovered first data to a first memory in which the target storage area is located, wherein

after the at least a portion of the recovered first data is stored in the target storage area, the expiration time of the at least a portion of the recovered first data is between an earliest expiration time and a latest expiration time in expiration time of old data stored in the target storage area.

11. The system according to claim 10 , wherein after the at least a portion of the recovered first data is stored in the target storage area, the expiration time of the recovered first data matches an expiration time of other data stored in the target storage area.

12. The system according to claim 10 , wherein data stored in the plurality of storage areas is written in a sequential write manner.

13. The system according to claim 10 , wherein the first memory and the second memory are shingled magnetic recording (SMR) hard disks, and each of the plurality of storage areas is a sequential zone (Szone).

14. The system according to claim 10 , wherein the at least one first memory is a solid-state drive (SSD), and each of the plurality of storage areas is a block.

15. The system according to claim 10 , wherein the processor is further configured to:

determine a storage sequence of the recovered first data based on the expiration time of the recovered first data; and

select the target storage area from the plurality of storage areas and store the at least a portion of the recovered first data in the target storage area according to the storage sequence.

16. The system according to claim 10 , wherein the expiration time of any piece of the recovered first data is stored in metadata of a data slice corresponding to the any piece of the recovered first data, and the any piece of the recovered first data and the data slice corresponding to the any piece of the recovered first data are generated by performing erasure code encoding on raw data.

17. A non-transitory computer-readable medium, wherein the computer-readable medium stores computer program code, and when the computer program code is run on a computer, the computer is enabled to perform the method according to claim 1 .

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Apr 26, 2024
From: WANG, YING; ZHAO, XIAOBAO
To: HUAWEI TECHNOLOGIES CO., LTD.
Reel/Frame 067233/0615 →
Priority Claims (1)
CN 201810983555.0 · Aug 27, 2018 · national
Continuity (2)
Continuation PCTCN2019098256 · Jul 30, 2019
Related Publication 20210181992A1 · Jun 17, 2021