A garbage collection method is provided and applied to a data storage device. The garbage collection method includes the following steps: selecting source blocks from data blocks, wherein a total number of valid data of the source blocks is larger than or equal to a predetermined data number of a block; copying valid data of a part of the source blocks into a destination block, wherein a total number of the valid data of the part of the source blocks is smaller than the predetermined data number; copying all or a part of valid data of remaining source blocks into the destination block; updating a logical to physical addresses mapping table based on a mapping information of the destination block; and recovering all or a part of the source blocks as spare blocks.
Legal claims defining the scope of protection, as filed with the USPTO.
2. The garbage collection method as claimed in claim 1, wherein a number of the source blocks is at least three.
3. The garbage collection method as claimed in claim 1, wherein a number of the part of the source blocks is at least two.
4. The garbage collection method as claimed in claim 1, wherein a number of the remaining source blocks is equal to one.
5. The garbage collection method as claimed in claim 1, wherein the step of selecting source blocks from data blocks further includes: selecting data blocks having a smaller amount of valid data as the source blocks.
6. The garbage collection method as claimed in claim 1, wherein the step of selecting source blocks from data blocks further includes: updating immediately an amount of valid data of each data block, and recording the amount of valid data of each data block into a system data block of each data block.
7. The garbage collection method as claimed in claim 1, wherein the destination block is selected from spare data blocks.
8. The garbage collection method as claimed in claim 1, wherein the data storage device includes the data blocks storing valid data and spare data blocks not storing valid data.
10. The data storage device as claimed in claim 9, wherein a number of the source blocks is at least three.
11. The data storage device as claimed in claim 9, wherein a number of the part of the source blocks is at least two.
12. The data storage device as claimed in claim 9, wherein a number of the remaining source blocks is equal to one.
13. The data storage device as claimed in claim 9, wherein the step of selecting source blocks from data blocks further includes: selecting data blocks having a smaller amount of valid data as the source blocks.
14. The data storage device as claimed in claim 9, wherein the step of selecting source blocks from data blocks further includes: updating immediately an amount of valid data of each data block, and recording the amount of valid data of each data block into a system data block of each data block.
15. The data storage device as claimed in claim 9, wherein the destination block is selected from spare data blocks.
16. The data storage device as claimed in claim 9, wherein the data storage device includes the data blocks storing valid data and spare data blocks not storing valid data.
Cooperative Patent Classification codes for this invention. Click any code to explore related patents in that topic.
September 25, 2020
September 27, 2022
Browse 5M+ US patents with plain-English claim translations and AI-generated analysis.