IP Library Granted Patent US 10,061,646
Granted Patent B2
US 10,061,646 · App. 15/137,145 · Granted Aug 28, 2018

Wear leveling method and apparatus and storage medium

Inventors: Xugang Feng (Shenzhen, CN); Yinhu Wang (Shenzhen, CN); Jianping Zhu (Shenzhen, CN)
Assignee: TENCENT TECHNOLOGY (SHENZHEN) COMPANY LIMITED
G06F11/1068G06F3/064G06F3/0619G06F3/0679G06F12/0246G11C29/52G06F2212/7209G06F2212/7211
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 10,061,646
App. No.
15/137,145
Granted
Aug 28, 2018
Kind
B2
Abstract

A wear leveling method and apparatus and a storage medium are disclosed, the method including: performing error correction on data read from a physical block to obtain corrected data, and counting corrected bits in the corrected data to obtain the number of the corrected bits, where the data as read may be previously written to the physical block in a dynamic wear leveling manner and/or a static wear leveling manner, and the number of the corrected bits is negatively correlated with a residual service life of the physical block; detecting whether the obtained number of the corrected bits is more than a preset bit-number threshold value; and transferring data stored in the physical block, if the number of corrected bits is detected as more than the preset bit-number threshold value.

Claims (44)

1. A wear leveling method, comprising:

reading a data stored in a physical block of a non-transitory computer readable medium;

performing error correction on the data read from the physical block to obtain a corrected data, and counting corrected bits in the corrected data to obtain a number of the corrected bits, wherein the data is previously written to the physical block in a dynamic wear leveling manner or a static wear leveling manner, and the number of the corrected bits is negatively correlated with a residual service life of the physical block;

detecting whether the obtained number of the corrected bits is more than a preset bit-number threshold value; and

transferring the data stored in the physical block to a free physical block of the non-transitory computer readable medium, if the number of the corrected bits is detected as more than the preset bit-number threshold value.

2. The wear leveling method of claim 1 , wherein after transferring the data stored in the physical block, the method further comprises:

erasing the data stored in the physical block; and

modifying an erase count of the physical block to be a maximal number among current erase counts of all physical blocks.

3. The wear leveling method of claim 2 , wherein before modifying the erase count of the physical block to be the maximal number among the current erase counts of all the physical blocks, the method further comprises:

obtaining a recorded erase count of the physical block,

detecting whether the recorded erase count of the physical block is less than an average erase count of all the physical blocks, and

if it is detected that the recorded erase count of the physical block is less than the average erase count of all the physical blocks, triggering modifying of the erase count of the physical block to be the maximal number among the current erase counts of all the physical blocks.

4. The wear leveling method of claim 1 , wherein before reading the data stored in the physical block, the method further comprises:

detecting whether an update period of the data is longer than a preset period threshold value; and

if the update period of the data is detected as longer than the preset period threshold value, writing the data to the physical block, the physical block being a free physical block that has a maximum erase count.

5. The wear leveling method of claim 4 , wherein the detecting whether the update period of the data is longer than the preset period threshold value comprises:

obtaining a type of the data;

detecting whether the type of the data is in a preset data type list; and

determining that the update period of the data is longer than the preset period threshold value if the type of the data is in the preset data type list.

6. A wear leveling apparatus, comprising:

a processor;

a non-transitory computer readable medium coupled to the processor; and

a plurality of program modules stored in the non-transitory computer readable medium to be executed by the processor, the plurality of program modules comprising:

a first obtaining module configured to perform error correction on a data read from a physical block to obtain a corrected data, and count corrected bits in the corrected data to obtain a number of the corrected bits, wherein the data is previously written to the physical block in a dynamic wear leveling manner or a static wear leveling manner, and the number of the corrected bits is negatively correlated with a residual service life of the physical block;

a first detecting module configured to detect whether the obtained number of corrected bits is more than a preset bit-number threshold value; and

a transferring module configured to transfer the data stored in the physical block to a free physical block, if the number of corrected bits is detected as more than the preset bit-number threshold value.

7. The wear leveling apparatus of claim 6 , further comprising:

an erasing module configured to erase the data stored in the physical block after the data is transferred from the physical block by the transferring module; and

a modifying module configured to, after the data in the physical block is erased by the erasing module, modify an erase count of the physical block to be a maximal number among current erase counts of all physical blocks.

8. The wear leveling apparatus of claim 7 , further comprising:

a second obtaining module configured to obtain a recorded erase count of the physical block before the modifying module modifies the erase count of the physical block to be the maximal number among the current erase counts of all the physical blocks;

a second detecting module configured to detect whether the recorded erase count of the physical block that is obtained by the second obtaining module is greater than an average erase count of all the physical blocks; and

a triggering module configured to, if the second detecting module detects that the obtained recorded erase count of the physical block is less than the average erase count of all the physical blocks, trigger the modifying module to modify the erase count of the physical block to be the maximal number among the current erase counts of all the physical blocks.

9. The wear leveling apparatus of claim 6 , further comprising:

a third detecting module configured to detect whether an update period of the data is longer than a preset period threshold value before the first obtaining module performs the error correction on the data read from the physical block to obtain the corrected data and counts the corrected bits in the corrected data to obtain the number of the corrected bits; and

a writing module configured to write the data to a free physical block that has a maximum erase count if the third detecting module detects that the update period of the data is longer than the preset period threshold value.

10. The wear leveling apparatus of claim 9 , further comprising:

an obtaining unit configured to obtain a type of the data;

a detecting unit configured to detect whether the type of the data that is obtained by the obtaining unit is in a preset data type list; and

a determining unit configured to determine that the update period of the data is longer than the preset period threshold value if the detecting unit detects that the type of the data is in the preset data type list.

11. A non-transitory computer readable medium containing computer-readable instructions, wherein the computer-readable instructions, when being executed by a computer processor, are configured to perform a wear leveling method comprising steps of:

performing error correction on a data read from a physical block to obtain a corrected data, and counting corrected bits in the corrected data to obtain a number of the corrected bits, wherein the data is previously written to the physical block in a dynamic wear leveling manner or a static wear leveling manner, and the number of the corrected bits is negatively correlated with the residual service life of the physical block;

detecting whether the obtained number of corrected bits is more than a preset bit-number threshold value; and

transferring the data stored in the physical block to a free physical block, if the number of corrected bits is detected as more than the preset bit-number threshold value.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Apr 25, 2016
From: FENG, XUGANG; WANG, YINHU; ZHU, JIANPING
To: TENCENT TECHNOLOGY (SHENZHEN) COMPANY LIMITED
Reel/Frame 038366/0495 →
Priority Claims (1)
CN 2013 1 0505230 · Oct 23, 2013 · national
Continuity (2)
Continuation PCTCN2014088755 · Oct 16, 2014
Related Publication 20160239383A1 · Aug 18, 2016