Patent ID: 9116792
Filing Date: 2015-08-25
Classification: G06F

Abstract:
1. A data storage device, comprising: a flash memory, comprising a spare block pool and a data block pool, wherein the spare block pool comprises a plurality of spare blocks, and the data block pool comprises a plurality of data blocks; and a controller, determining a minimum erase count from the erase counts of the spare blocks and the data blocks, adding a second difference to the minimum erase count to obtain a jail threshold, comparing the erase counts of the spare blocks with the jail threshold to obtain a plurality of jail blocks with the erase counts greater than the jail threshold, confining the jail blocks to a jail pool, and avoiding using the jail blocks as a current data block to be written with data by not retrieving the jail blocks with the erase counts greater than the jail threshold for storing data; wherein the controller adds a first difference to the minimum erase count to obtain a hot threshold, compares the erase counts of the spare blocks with the hot threshold to obtain a plurality of hot blocks with the erase counts greater than the hot threshold, counts a number of the hot blocks to obtain a hot block number, and performs a wear-leveling process between the data blocks of the data block pool and the hot blocks when the hot block count is greater than zero; wherein the second difference is greater than the first difference.