Data storage device and data maintenance method thereof
First Claim
1. A data storage device, comprising:
- a flash memory, having a plurality of single-level cell (SLC)-spare blocks, a plurality of triple-level cell (TLC)-data blocks, and a plurality of TLC-spare blocks; and
a controller, equally distributing the TLC-data blocks into three regions having the same number of TLC-data blocks, and receiving a prewrite data sector and a logic address of the prewrite data sector, and obtaining a first sub-prewrite data sector, a second sub-prewrite data sector and a third sub-prewrite data sector according to the prewrite data sector and the logic address, wherein in a first stage, the controller further;
determining a first TLC-data block corresponding to the logic address of the prewrite data sector according to the logic address, defining the region that contains the first TLC-data block as a first region;
determining whether the first TLC-data block has valid data, selecting a TLC-data block with the lowest erase count from the first region to serve as a new first TLC-data block when the first TLC-data block has valid data;
selecting a second TLC-data block and a third TLC-data block from the regions other than the first region according to the new first TLC-data block;
respectively writing the first sub-prewrite data sector, the second sub-prewrite data sector and the third sub-prewrite data sector into the new first TLC-data block, the second TLC-data block and the third TLC-data block by a SLC storage mode; and
mapping the first new TLC-data block, the second TLC-data block, the third TLC-data block to the logic address.
1 Assignment
0 Petitions
Accused Products
Abstract
The present invention provides a data storage device including a flash memory and a controller. The controller distributes TLC-data blocks of the flash memory into three regions, obtains three sub-prewrite data sectors according to a prewrite data sector and a logic address, determines a first TLC-data block according to the logic address, selects a new first TLC-data block with the lowest erase count from the first region when the first TLC-data block has valid data, selects two TLC-data blocks according to the new first TLC-data block, writes the three sub-prewrite data sectors into the new first TLC-data block and the two selected TLC-data blocks, and maps the first new TLC-data block and the two selected TLC-data blocks to the logic address.
5 Citations
10 Claims
-
1. A data storage device, comprising:
-
a flash memory, having a plurality of single-level cell (SLC)-spare blocks, a plurality of triple-level cell (TLC)-data blocks, and a plurality of TLC-spare blocks; and a controller, equally distributing the TLC-data blocks into three regions having the same number of TLC-data blocks, and receiving a prewrite data sector and a logic address of the prewrite data sector, and obtaining a first sub-prewrite data sector, a second sub-prewrite data sector and a third sub-prewrite data sector according to the prewrite data sector and the logic address, wherein in a first stage, the controller further; determining a first TLC-data block corresponding to the logic address of the prewrite data sector according to the logic address, defining the region that contains the first TLC-data block as a first region; determining whether the first TLC-data block has valid data, selecting a TLC-data block with the lowest erase count from the first region to serve as a new first TLC-data block when the first TLC-data block has valid data; selecting a second TLC-data block and a third TLC-data block from the regions other than the first region according to the new first TLC-data block; respectively writing the first sub-prewrite data sector, the second sub-prewrite data sector and the third sub-prewrite data sector into the new first TLC-data block, the second TLC-data block and the third TLC-data block by a SLC storage mode; and mapping the first new TLC-data block, the second TLC-data block, the third TLC-data block to the logic address. - View Dependent Claims (2, 3, 4, 5)
-
-
6. A data maintenance method, applied to a data storage device having a plurality of single-level cell (SLC)-spare block, a plurality of triple-level cell (TLC)-data blocks and a plurality of TLC-spare blocks, the data maintenance method comprising:
-
receiving a prewrite data sector and a logic address of the prewrite data sector, and obtaining a first sub-prewrite data sector, a second sub-prewrite data sector and a third sub-prewrite data sector according to the prewrite data sector and the logic address; and writing the prewrite data sector into the data storage device according to the prewrite data sector and the logic address in a first stage, wherein the step of writing the prewrite data sector into the data storage device in the first stage further comprises; equally distributing the TLC-data blocks into three regions, wherein the regions have the same number of TLC-data blocks; determining a first TLC-data block corresponding to the logic address of the prewrite data sector according to the logic address, defining the region that contains the first TLC-data block as a first region; determining whether the first TLC-data block has valid data; selecting a TLC-data block with the lowest erase count from the first region to serve as a new first TLC-data block and selecting a second TLC-data block and a third TLC-data block from the regions other than the first region according to the new first TLC-data block when the first TLC-data block has valid data; respectively writing the first sub-prewrite data sector, the second sub-prewrite data sector and the third sub-prewrite data sector into the new first TLC-data block, the second TLC-data block and the third TLC-data block by a SLC storage mode; and mapping the first new TLC-data block, the second TLC-data block, the third TLC-data block to the logic address. - View Dependent Claims (7, 8, 9, 10)
-
Specification