Block management method for flash memory, and storage system and controller using the same
AssigneePhison Electronics Corp.
InventorChih-Kang Yeh
Life of this patent
Estimating the term…
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.
Claims17
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.
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.
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.
Dependencies are inferred from the claim text.