白丝美女被狂躁免费视频网站,500av导航大全精品,yw.193.cnc爆乳尤物未满,97se亚洲综合色区,аⅴ天堂中文在线网官网

Write management of flash memory

專利號
US11175841B2
公開日期
2021-11-16
申請人
Silicon Motion, Inc.(TW Hsinchu County)
發(fā)明人
Jian-Dong Du; Chia-Jung Hsiao; Tsung-Chieh Yang
IPC分類
G06F3/06; G06F12/02
技術(shù)領(lǐng)域
erased,spare,pool,blocks,writing,controller,block,flash,command,in
地域: Hsinchu County

摘要

A method for use in management of a flash memory module is provided. The flash memory module has a plurality of blocks, wherein a portion of the blocks belong to a spare pool. The method includes: preserving at least one erased block in the spare pool for a write operation; monitoring an erasing period regarding the at least one erased block; and performing a replacement operation to replace the at least one erased block when the erase time exceeds a threshold.

說明書

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
BACKGROUND OF THE INVENTION 1. Field of the Invention

The present invention relates to a flash memory, and more particularly, to a method for managing blocks in a flash memory that are going to be written, and an associated controller and storage device.

2. Description of the Prior Art

In general, the flash memory controller searches for an available erased block in the flash memory according to the writing command delivered by the host, in order to perform data writing. However, if being under the erase state for too long, the flash memory unit may suffer from some unrecoverable physical damages. Therefore, there is a need for a novel writing management scheme to prevent the above problem.

SUMMARY OF THE INVENTION

In view of the above, an objective of the present invention is to provide a writing management scheme of a flash memory. The present invention uses a portion of blocks divided from a flash memory as a spare pool. The controller selects blocks from the spare pool for data writing in order to complete the writing command delivered by the host. Note that the aforementioned spare pool only preserves very a limited amount of erased blocks, and the rest of space are used to preserve written blocks (e.g. programmed blocks). When the controller receives writing commands from the host, the controller will search for erased blocks preserved in the spare pool in order to write data into them. After the writing is finished, the controller will perform erasing operations on one or more written blocks in the spare pool, and take them as new preserved blocks. In this way, the amount of erased blocks within the blocks of the flash memory can be decreased.

權(quán)利要求

1
What is claimed is:1. A method for managing a flash memory module, the flash memory module comprises a plurality of blocks, wherein a portion of the plurality of blocks belongs to a spare pool, and the method comprises:preserving at least one erased block in the spare pool, to facilitate a writing operation, wherein the spare pool comprises at least one erased block and a plurality of written blocks with invalid data, and a number of the written blocks is greater than a number of the at least one erased block;monitoring an erasing period of the at least one erased block; andwhen the erasing period exceeds a threshold, executing an alternative operation to replace the at least one erased block, comprising:choosing a first block among at least one written block in the spare pool, and performing an erasing operation on the first block;replacing the at least one erased block that has an erasing period exceeding the threshold with the first block; andadding a second block storing invalid data to the spare pool once the at least one erased block is replaced.2. The method of claim 1, wherein the step of monitoring the erasing period of the at least one erased block comprises:creating a timestamp associated with the at least one erased block; andperiodically performing comparison on the threshold according to time information in the timestamp.3. The method of claim 1, wherein the step of executing the alternative operation comprises:performing writing on the at least one erased block.4. The method of claim 3, wherein the step of performing writing on the at least one erased block comprises:performing a garbage collection operation on a plurality of blocks in the flash memory module; andutilizing recycled data outputted by the garbage collection operation to perform writing on the at least one erased block.5. The method of claim 1, further comprising:if an access command delivered by a host is not received, automatically reading specific data from the flash memory module, and writing the specific data back to the flash memory module.6. A controller for managing a flash memory module, wherein the flash memory module comprises a plurality of blocks, a portion of the plurality of blocks belongs to a spare pool, and the controller comprises:a storage unit, arranged to store a program code; anda processing unit, coupled to the storage unit, the processing unit arranged to read the program code from the storage unit in order to execute the program code to perform following operations:preserving at least one erased block in the spare pool to facilitate a writing operation, wherein the spare pool comprises at least one erased block and a plurality of written blocks with invalid data, and a number of the written blocks is greater than a number of the at least one erased block;monitoring an erasing period of the at least one erased block; andwhen the erasing period exceeds a threshold, executing an alternative operation to replace the at least one erased block, comprising:choosing a first block among at least one written block in the spare pool, and performing an erasing operation on the first block;replacing the at least one erased block that has an erasing period exceeding the threshold with the first block; andadding a second block storing invalid data to the spare pool once the at least one erased block is replaced.7. The controller of claim 6, wherein the processing unit executes the program code in order to create a timestamp associated with the at least one erased block; and the processing unit periodically performs comparison on the threshold according to time information in the timestamp.8. The controller of claim 6, wherein the processing unit executes the program code in order to perform writing on the at least one erased block to execute the alternative operation.9. The controller of claim 8, wherein the processing unit executes the program code in order to perform a garbage collection operation on a plurality of blocks in the flash memory module; and the processing unit utilizes recycled data outputted by the garbage collection operation to perform writing on the at least one erased block to execute the alternative operation.10. The controller of claim 6, wherein the controller is controlled by a host, and the processing unit executes the program code in order to automatically read specific data from the flash memory module when an access command delivered by the host is not received, and write the specific data back to the flash memory module.11. A storage device, comprising:a flash memory module, comprising a plurality of blocks, wherein a portion of the plurality of blocks belongs to a spare pool; anda controller, arranged to access the flash memory module, and comprising:a storage unit, arranged to store a program code; anda processing unit, coupled to the storage unit, wherein the processing unit is arranged to read the program code from the storage unit in order to execute the program code, and thereby perform following operations:preserving at least one erased block in the spare pool to facilitate a writing operation, wherein the spare pool comprises at least one erased block and a plurality of written blocks with invalid data, and a number of the written blocks is greater than a number of the at least one erased block;monitoring an erasing period of the at least one erased block; andwhen the erasing period exceeds a threshold, executing an alternative operation to replace the at least one erased block, comprising:choosing a first block among at least one written block in the spare pool, and performing an erasing operation on the first block;replacing the at least one erased block that has an erasing period exceeding the threshold with the first block; andadding a second block storing invalid data to the spare pool once the at least one erased block is replaced.12. The storage device of claim 11, wherein the controller is arranged to create a timestamp associated with the at least one erased block; and the controller periodically performs comparison on the threshold according to time information in the timestamp.13. The storage device of claim 11, wherein when the erasing period exceeds the threshold, the controller performs writing on the at least one erased block.14. The storage device of claim 13, wherein when the erasing period exceeds the threshold, the controller performs a garbage collection operation on a plurality of blocks in the flash memory module; and the controller utilizes recycled data outputted by the garbage collection operation to perform writing on the at least one erased block.15. The storage device of claim 11, wherein the controller is controlled by a host, and when an access command delivered by the host is not received, the controller automatically reads specific data from the flash memory module, and writes the specific data back to the flash memory module.
微信群二維碼
意見反饋