MEMORY MANAGEMENT AND WRITING METHOD AND REWRITABLE NON-VOLATILE MEMORY CONTROLLER AND STORAGE SYSTEM USING THE SAME
First Claim
1. A memory management and writing method, for managing a plurality of physical units of a memory chip, the memory management and writing method comprising:
- configuring a plurality of logical units;
grouping the physical units into a first physical unit group and a second physical unit group;
grouping a portion of the physical units in the first physical unit group into a first data area and a first spare area corresponding to the first data area;
grouping a portion of the physical units in the second physical unit group into a second data area and a second spare area corresponding to the second data area;
mapping the logical units to the physical units in the first data area and the second data area;
recording erase counts corresponding to a plurality of the physical units in the first physical unit group and the second physical unit group;
calculating a first erase count of the first physical unit group and a second erase count of the second physical unit group according to the erase counts, and calculating an erase count difference between the first erase count and the second erase count; and
determining whether the erase count difference is larger than an erase count difference threshold when a write command corresponding to a first logical unit among the logical units and new data corresponding to the write command are received, wherein the first logical unit is mapped to a first physical unit among the physical units in the first data area,wherein a switched writing procedure is executed when the erase count difference is larger than the erase count difference threshold, and the switched writing procedure comprises;
getting a second physical unit from the physical units in the second spare area; and
writing the new data into the second physical unit.
1 Assignment
0 Petitions
Accused Products
Abstract
A memory management and writing method for managing a plurality of physical units of a memory chip is provided. The present method includes grouping the physical units into a first physical unit group and a second physical unit group, recording and calculating a first erase count of the first physical unit group and a second erase count of the second physical unit group, and calculating an erase count difference between the first erase count and the second erase count. The present method also includes determining whether the erase count difference is larger than an erase count difference threshold when a write command is received. The method further includes executing a switched writing procedure to write data corresponding to the write command into the memory chip when the erase count difference is larger than the erase count difference threshold. Thereby, the lifespan of the memory chip is effectively prolonged.
29 Citations
24 Claims
-
1. A memory management and writing method, for managing a plurality of physical units of a memory chip, the memory management and writing method comprising:
-
configuring a plurality of logical units; grouping the physical units into a first physical unit group and a second physical unit group; grouping a portion of the physical units in the first physical unit group into a first data area and a first spare area corresponding to the first data area; grouping a portion of the physical units in the second physical unit group into a second data area and a second spare area corresponding to the second data area; mapping the logical units to the physical units in the first data area and the second data area; recording erase counts corresponding to a plurality of the physical units in the first physical unit group and the second physical unit group; calculating a first erase count of the first physical unit group and a second erase count of the second physical unit group according to the erase counts, and calculating an erase count difference between the first erase count and the second erase count; and determining whether the erase count difference is larger than an erase count difference threshold when a write command corresponding to a first logical unit among the logical units and new data corresponding to the write command are received, wherein the first logical unit is mapped to a first physical unit among the physical units in the first data area, wherein a switched writing procedure is executed when the erase count difference is larger than the erase count difference threshold, and the switched writing procedure comprises; getting a second physical unit from the physical units in the second spare area; and writing the new data into the second physical unit. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9)
-
-
10. A rewritable non-volatile memory controller, for managing a plurality of physical units of a memory chip, the rewritable non-volatile memory controller comprising:
-
a microprocessor unit; a rewritable non-volatile memory interface unit, coupled to the microprocessor unit, for coupling to the memory chip; and a memory management unit, coupled to the microprocessor unit, wherein the memory management unit has a plurality of program codes, and the microprocessor unit executes the program codes to execute; configuring a plurality of logical units; grouping the physical units into a first physical unit group and a second physical unit group; grouping a portion of the physical units in the first physical unit group into a first data area and a first spare area corresponding to the first data area; grouping a portion of the physical units in the second physical unit group into a second data area and a second spare area corresponding to the second data area; mapping the logical units to the physical units in the first data area and the second data area; recording erase counts corresponding to a plurality of the physical units in the first physical unit group and the second physical unit group; calculating a first erase count of the first physical unit group and a second erase count of the second physical unit group according to the erase counts, and calculating an erase count difference between the first erase count and the second erase count; and determining whether the erase count difference is larger than an erase count difference threshold when a write command corresponding to a first logical unit among the logical units and new data corresponding to the write command are received, wherein the first logical unit is mapped to a first physical unit among the physical units in the first data area, wherein a switched writing procedure is executed when the erase count difference is larger than the erase count difference threshold, and the switched writing procedure comprises; getting a second physical unit from the physical units in the second spare area; and writing the new data into the second physical unit. - View Dependent Claims (11, 12, 13, 14)
-
-
15. A rewritable non-volatile memory storage system, comprising:
-
a connector; a memory chip, having a plurality of physical units; and a rewritable non-volatile memory controller, coupled to the memory chip and the connector, configured for executing; configuring a plurality of logical units; grouping the physical units into a first physical unit group and a second physical unit group; grouping a portion of the physical units in the first physical unit group into a first data area and a first spare area corresponding to the first data area; grouping a portion of the physical units in the second physical unit group into a second data area and a second spare area corresponding to the second data area; mapping the logical units to the physical units in the first data area and the second data area; recording erase counts corresponding to a plurality of the physical units in the first physical unit group and the second physical unit group; calculating a first erase count of the first physical unit group and a second erase count of the second physical unit group according to the erase counts, and calculating an erase count difference between the first erase count and the second erase count; and determining whether the erase count difference is larger than an erase count difference threshold when a write command corresponding to a first logical unit among the logical units and new data corresponding to the write command are received, wherein the first logical unit is mapped to a first physical unit among the physical units in the first data area, wherein a switched writing procedure is executed when the erase count difference is larger than the erase count difference threshold, and the switched writing procedure comprises; getting a second physical unit from the physical units in the second spare area; and writing the new data into the second physical unit. - View Dependent Claims (16, 17, 18, 19, 20, 21, 22, 23, 24)
-
Specification