IP Library Granted Patent US 8,275,931
Granted Patent B2
US 8,275,931 · App. 12/406,667 · Granted Sep 25, 2012

Block management method for flash memory, and storage system and controller using the same

Assignee: Phison Electronics Corp.
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 8,275,931
App. No.
12/406,667
Granted
Sep 25, 2012
Kind
B2
Abstract

A block management method for a flash memory of a storage system is provided, wherein the flash memory includes a plurality of physical blocks. The block management method includes grouping the physical blocks into a plurality of physical units, and grouping the physical units into a data area, a spare area, and a replacement area. The block management method further includes performing a first physical unit switch which switches the physical units between the data area and the spare area, and performing a second physical unit switch which switches the physical units between the spare area and the replacement area. Therefore, the block management method can uniformly use the physical blocks and thereby effectively prolong a lifespan of the storage system.

Claims (67)

1. A block management method for managing a plurality of physical blocks of a flash memory, the block management method comprising:

grouping the physical blocks into a plurality of physical units;

grouping the physical units into a data area, a spare area, and a replacement area;

performing a first physical unit switch which switches the physical units between the data area and the spare area; and

performing a second physical unit switch which switches the physical units between the spare area and the replacement area, wherein the second physical unit switch is to switch good physical units among the physical units between the spare area and the replacement area;

determining whether a damaged physical block occurs in the physical units of the data area or the spare area; and

when the damaged physical block occurs in the physical units of the data area or the spare area, selecting a usable physical block from the replacement area to replace the damaged physical block,

wherein the step of performing the first physical unit switch comprises: selecting a first physical unit from the physical units of the data area; selecting a second physical unit from the physical units of the spare area; copying data stored in the first physical unit to the second physical unit; linking the first physical unit to the spare area; and linking the second physical unit to the data area,

wherein the step of performing the second physical unit switch comprises: selecting a third physical unit from the physical units of the spare area; selecting a fourth physical unit from the physical units of the replacement area; linking the third physical unit to the replacement area; and linking the fourth physical unit to the spare area.

2. The block management method as claimed in claim 1 , wherein the step of performing the second physical unit switch which switches the physical units between the spare area and the replacement area comprises:

counting a number of times of executing an erasing command when executing the erasing command on the physical units; and

performing the second physical unit switch when the number of times of executing the erasing command is larger than a replacement-area-wear-leveling threshold value.

3. The block management method as claimed in claim 1 , wherein the step of performing the second physical unit switch which switches the physical units between the spare area and the replacement area comprises:

recording a first average erasing times of the physical units belonging to the data area and the spare area;

recording a second average erasing times of the physical units belonging to the replacement area; and

performing the second physical unit switch when a difference between the first average erasing times and the second average erasing times is larger than a difference threshold value.

4. The block management method as claimed in claim 1 , wherein the step of performing the second physical unit switch which switches the physical units between the spare area and the replacement area comprises:

recording a third average erasing times of the physical units belonging to the spare area;

recording a fourth average erasing times of the physical units belonging to the replacement area; and

performing the second physical unit switch when a difference between the third average erasing times and the fourth average erasing times is larger than a difference threshold value.

5. The block management method as claimed in claim 1 , further comprising maintaining a replacement physical unit table, wherein the replacement physical unit table records the physical units belonging to the replacement area.

6. The block management method as claimed in claim 1 , further comprising:

recording an erasing times values for each the physical unit; and

dividing the physical units of the spare area into a highly-erased area and a lowly-erased area according to the erasing times values,

wherein the step of selecting the third physical unit from the physical units of the spare area comprises selecting the third physical unit from the highly-erased area.

7. A flash memory controller for managing a plurality of physical blocks of a flash memory storage system, the flash memory controller comprising:

a microprocessor unit;

a flash memory interface module coupled to the microprocessor unit;

a host interface module coupled to the microprocessor unit;

a buffer coupled to the microprocessor unit; and

a memory management module coupled to the microprocessor unit, wherein the memory management module groups the physical blocks into a plurality of physical units and groups the physical units into a data area, a spare area, and a replacement area,

wherein the memory management module performs a first physical unit switch which switches the physical units between the data area and the spare area, and performs a second physical unit switch which switches the physical units between the spare area and the replacement area, wherein the second physical unit switch is to switch good physical units among the physical units between the spare area and the replacement area,

wherein the memory management module determines whether a damaged physical block occurs in the physical units of the data area or the spare area,

wherein when the damaged physical block occurs in the physical units of the data area or the spare area, the memory management module selects a usable physical block from the replacement area to replace the damaged physical block,

wherein the memory management module performs the first physical unit switch to select a first physical unit from the physical units of the data area, select a second physical unit from the physical units of the spare area, copy data stored in the first physical unit to the second physical unit, link the first physical unit to the spare area, and link the second physical unit to the data area,

wherein the memory management module performs the second physical unit switch to select a third physical unit from the physical units of the spare area, select a fourth physical unit from the physical units of the replacement area, link the third physical unit to the replacement area, and link the fourth physical unit to the spare area.

8. The flash memory controller as claimed in claim 7 , wherein the memory management module performs the second physical unit switch comprising:

the memory management module counts a number of times of executing an erasing command when executing the erasing command on the physical units, and

the memory management module performs the second physical unit switch when the number of times of executing the erasing command is larger than a replacement-area-wear-leveling threshold value.

9. The flash memory controller as claimed in claim 7 , wherein the memory management module performs the second physical unit switch comprising:

the memory management module records a first average erasing times of the physical units belonging to the data area and the spare area, and records a second average erasing times of the physical units belonging to the replacement area, and

the memory management module performs the second physical unit switch when a difference between the first average erasing times and the second average erasing times is larger than a difference threshold value.

10. The flash memory controller as claimed in claim 7 , wherein the memory management module performs the second physical unit switch comprising:

the memory management module records a third average erasing times of the physical units belonging to the spare area, and records a fourth average erasing times of the physical units belonging to the replacement area, and

the memory management module performs the second physical unit switch when a difference between the third average erasing times and the fourth average erasing times is larger than a difference threshold value.

11. The flash memory controller as claimed in claim 7 , wherein the memory management module records an erasing times values for each the physical unit and divides the physical units of the spare area into a highly-erased area and a lowly-erased area according to the erasing times values,

wherein the memory management module selects the third physical unit from the highly-erased area.

12. A flash memory storage system, comprising:

a flash memory chip has a plurality of physical blocks;

a connector; and

a flash memory controller coupled to the flash memory chip and the connector, wherein the flash memory controller groups the physical blocks into a plurality of physical units and groups the physical units into a data area, a spare area, and a replacement area,

wherein the flash memory controller performs a first physical unit switch which switches the physical units between the data area and the spare area, and performs a second physical unit switch which switches the physical units between the spare area and the replacement area, wherein the second physical unit switch is to switch good physical units among the physical units between the spare area and the replacement area,

wherein the flash memory controller determines whether a damaged physical block occurs in the physical units of the data area or the spare area,

wherein when the damaged physical block occurs in the physical units of the data area or the spare area, the flash memory controller selects a usable physical block from the replacement area to replace the damaged physical block,

wherein the flash memory controller performs the first physical unit switch to select a first physical unit from the physical units of the data area, select a second physical unit from the physical units of the spare area, copy data stored in the first physical unit to the second physical unit, link the first physical unit to the spare area, and link the second physical unit to the data area,

wherein the flash memory controller performs the second physical unit switch to select a third physical unit from the physical units of the spare area, select a fourth physical unit from the physical units of the replacement area, link the third physical unit to the replacement area, and link the fourth physical unit to the spare area.

13. The flash memory storage system as claimed in claim 12 , wherein the flash memory controller performs the second physical unit switch comprising:

the flash memory controller counts a number of times of executing an erasing command when executing the erasing command on the physical units, and

the flash memory controller performs the second physical unit switch when the number of times of executing the erasing command is larger than a replacement-area-wear-leveling threshold value.

14. The flash memory storage system as claimed in claim 12 , wherein the flash memory controller performs the second physical unit switch comprising:

the flash memory controller records a first average erasing times of the physical units belonging to the data area and the spare area, and records a second average erasing times of the physical units belonging to the replacement area, and

the flash memory controller performs the second physical unit switch when a difference between the first average erasing times and the second average erasing times is larger than a difference threshold value.

15. The flash memory storage system as claimed in claim 12 , wherein the flash memory controller performs the second physical unit switch comprising:

the flash memory controller records a third average erasing times of the physical units belonging to the spare area, and records a fourth average erasing times of the physical units belonging to the replacement area, and

the flash memory controller performs the second physical unit switch when a difference between the third average erasing times and the fourth average erasing times is larger than a difference threshold value.

16. The flash memory storage system as claimed in claim 12 , wherein the number of the physical blocks belonging to the replacement area is larger than 2000.

17. The flash memory storage system as claimed in claim 12 , wherein the flash memory chip comprises at least four flash memory modules.

Assignments (2)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Feb 18, 2016
From: PHISON ELECTRONICS CORP.
To: EMTOPS ELECTRONICS CORP.
Reel/Frame 037759/0378 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Mar 18, 2009
From: YEH, CHIH-KANG
To: PHISON ELECTRONICS CORP.
Reel/Frame 022419/0736 →
Priority Claims (1)
TW 98101398 A · Jan 15, 2009 · national
Continuity (1)
Related Publication 20100180069A1 · Jul 15, 2010