Flash memory having data blocks, spare blocks, a map block and a header block and a method for controlling the same
First Claim
1. A method for controlling a flash memory having units wherein each of the units includes a plurality of data blocks for writing data, a plurality of spare blocks emptied for writing updated data of the data blocks, a map block for designating an actual location in which data is written with respect to a logical block number, and a header block for recording flash memory information and unit information, the method comprising steps of:
- controlling a mapping operation for mapping the data blocks within the flash memory, by using the map block to correlate the logical block number to the actual location in which data is written;
controlling an allocate operation for allocating the data blocks among the units;
controlling a read operation for reading the data in the data blocks;
controlling a delete operation for designating a data block as “
deleted”
;
controlling an update operation for updating data of the data block;
controlling a retrieve operation for restoring the unit to a reusable condition; and
controlling a restore operation for restoring normal controlling operations of the flash memory after an error occurs.
1 Assignment
0 Petitions
Accused Products
Abstract
A flash memory and a method for controlling the same are disclosed. The flash memory has units, each of which includes a plurality of data blocks for writing data; a plurality of spare blocks emptied for writing updated data of the data blocks; a map block for designating an actual location in which data is written; and a header block for recording flash memory information and unit information. The method, in the case of updating data of a data block, first writes update data into an empty spare block in the same unit, updates mapping information of the map block, and updates state information of a previous block, so that a user can have access to data by using the same address and there is no need of deleting a unit every time the block is updated. Therefore, the present invention enhances an efficiency of writing and updating data while reducing the number of delete times.
-
Citations
13 Claims
-
1. A method for controlling a flash memory having units wherein each of the units includes a plurality of data blocks for writing data, a plurality of spare blocks emptied for writing updated data of the data blocks, a map block for designating an actual location in which data is written with respect to a logical block number, and a header block for recording flash memory information and unit information, the method comprising steps of:
-
controlling a mapping operation for mapping the data blocks within the flash memory, by using the map block to correlate the logical block number to the actual location in which data is written;
controlling an allocate operation for allocating the data blocks among the units;
controlling a read operation for reading the data in the data blocks;
controlling a delete operation for designating a data block as “
deleted”
;
controlling an update operation for updating data of the data block;
controlling a retrieve operation for restoring the unit to a reusable condition; and
controlling a restore operation for restoring normal controlling operations of the flash memory after an error occurs. - View Dependent Claims (2, 3, 4, 5, 6)
searching a logical unit to which a logical block belongs;
searching a physical unit with respect to the logical unit; and
searching a physical block location with respect to the logical block in the map block of the physical unit.
-
-
3. The method for controlling a flash memory as claimed in claim 1, wherein the unit is used as a basic unit of a delete operation.
-
4. The method for controlling a flash memory as claimed in claim 1, wherein a logical unit number, a wear and tear degree, and block size information are recorded in the header blocks.
-
5. The method for controlling a flash memory as claimed in claim 1, wherein the logical block number, block state information, and updated block location information are recorded in the map block.
-
6. The method as claimed in claim 1, wherein the delete operation controlling step includes steps of:
-
searching a unit to which a corresponding data block belongs; and
updating a state of the corresponding data block written in the map block of the unit, wherein the delete operation controlling step is accomplished without deleting the data of the entire unit.
-
-
7. A method for controlling a flash memory having units wherein each of the units includes a plurality of data blocks for writing data, a plurality of spare blocks emptied for writing updated data of the data blocks, a map block for designating an actual location in which data is written, and a header block for recording flash memory information and unit information, the method comprising steps of:
-
controlling a mapping operation for mapping the data blocks within the flash memory;
controlling an allocate operation for allocating the data blocks among the units;
controlling a read operation for reading the data in the data blocks;
controlling a delete operation for designating a data block as “
deleted”
;
controlling an update operation for updating data of the data block;
controlling a retrieve operation for restoring the unit to a reusable condition; and
controlling a restore operation for restoring normal controlling operations of the flash memory after an error occurs, wherein the allocate operation controlling step includes steps of;
a) checking the map block of the unit to judge if there is a spare block in the unit;
b) performing a retrieve operation with respect to the unit if there is no spare block in the unit as a judgement result of step a);
c) checking the map block of a retrieved unit to judge if there is a spare block in the retrieved unit;
d) writing a logical block number and a state of a data block into the map block if step a) judges that the spare block exists in the unit or if step c) judges that the spare block exists in the retrieved unit; and
e) performing an error process if step c) judges that no spare block exists in the retrieved unit.
-
-
8. A method for controlling a flash memory having units wherein each of the units includes a plurality of data blocks for writing data, a plurality of spare blocks emptied for writing updated data of the data blocks, a map block for designating an actual location in which data is written, and a header block for recording flash memory information and unit information, the method comprising steps of:
-
controlling a mapping operation for mapping the data blocks within the flash memory;
controlling an allocate operation for allocating the data blocks among the units;
controlling a read operation for reading the data in the data blocks;
controlling a delete operation for designating a data block as “
deleted”
;
controlling an update operation for updating data of the data block;
controlling a retrieve operation for restoring the unit to a reusable condition; and
controlling a restore operation for restoring normal controlling operations of the flash memory after an error occurs, wherein the read operation controlling step includes steps of;
a) searching a unit to which a corresponding data block belongs, b) judging if the corresponding data block exists in the unit;
c) reading data in the corresponding data block if step b) judges that the corresponding data block exists in the unit; and
d) carrying out an error process if step b) judges that the corresponding data block does not exist in the unit.
-
-
9. A method for controlling a flash memory having units wherein each of the units includes a plurality of data blocks for writing data, a plurality of spare blocks emptied for writing updated data of the data blocks, a map block for designating an actual location in which data is written, and a header block for recording flash memory information and unit information, the method comprising steps of:
-
controlling a mapping operation for mapping the data blocks within the flash memory;
controlling an allocate operation for allocating the data blocks among the units;
controlling a read operation for reading the data in the data blocks;
controlling a delete operation for designating a data block as “
deleted”
;
controlling an update operation for updating data of the data block;
controlling a retrieve operation for restoring the unit to a reusable condition; and
controlling a restore operation for restoring normal controlling operations of the flash memory after an error occurs,wherein the update operation controlling step includes steps of;
a) determining a unit to which a corresponding data block belongs;
b) judging if the corresponding data block exists in the unit;
c) searching a map block and judging if a state of the corresponding data block is “
allocated”
if step b) judges that the corresponding data block exists in the unit;
d) if step c) judges that the corresponding data block is “
allocated”
, then the method includes the sub-steps of;
1) updating the state of the corresponding data block to “
writing”
;
2) storing data in the corresponding data block; and
3) updating the state of the corresponding data block to “
written”
;
e) if step c) judges that the corresponding data block is not “
allocated”
, then the method includes the steps of;
1) updating the corresponding data block to “
deleting”
;
2) searching a spare block in the unit to be allocated;
3) updating a state of a newly allocated block to “
writing”
;
4) storing position information of the newly allocated block in the map block;
5) storing data in the newly allocated block;
6) updating the state of the newly allocated block to “
written”
; and
7) updating the state of the corresponding data block to “
deleted”
; and
f) carrying out an error process if step b) judges that the corresponding data block does not exist in the unit.
-
-
10. A method for controlling a flash memory having units wherein each of the units includes a plurality of data blocks for writing data, a plurality of spare blocks emptied for writing updated data of the data blocks, a map block for designating an actual location in which data is written, and a header block for recording flash memory information and unit information, the method comprising steps of:
-
controlling a mapping operation for mapping the data blocks within the flash memory;
controlling an allocate operation for allocating the data blocks among the units;
controlling a read operation for reading the data in the data blocks;
controlling a delete operation for designating a data block as “
deleted”
;
controlling an update operation for updating data of the data block;
controlling a retrieve operation for restoring the unit to a reusable condition; and
controlling a restore operation for restoring normal controlling operations of the flash memory after an error occurs,wherein the retrieve operation controlling step includes steps of;
a) determining a retrieve unit and a move unit;
b) judging if a number of deletions of the move unit is beyond a critical value;
c) selecting a move unit having a lowest number of deletions if the number of deletions of the move unit is beyond the critical value as judged by step b);
d) updating a state of the retrieve unit to “
moving”
if the number of deletions of the move unit is not beyond the critical value as judged by step b), or if the move unit having the lowest number of deletions is selected in step c);
e) updating a state of either the move unit having the number of deletions not beyond the critical value or the move unit having the lowest number of deletions as selected in step c) to “
copying”
;
f) copying blocks and map block items in the states of “
writing” and
“
written” and
the number of deletions from the retrieve unit into the move unit;
g) updating a state of the move unit to “
valid”
;
h) deleting the retrieve unit;
i) reading and increasing the number of deletions of the retrieve unit copied into the move unit and then writing the number of deletions into the retrieve unit which is now deleted; and
j) updating a structure of materials including mapping information inside the flash memory.
-
-
11. A method for controlling a flash memory having units wherein each of the units includes a plurality of data blocks for writing data, a plurality of spare blocks emptied for writing updated data of the data blocks, a map block for designating an actual location in which data is written, and a header block for recording flash memory information and unit information, the method comprising steps of:
-
controlling a mapping operation for mapping the data blocks within the flash memory;
controlling an allocate operation for allocating the data blocks among the units;
controlling a read operation for reading the data in the data blocks;
controlling a delete operation for designating a data block as “
deleted”
;
controlling an update operation for updating data of the data block;
controlling a retrieve operation for restoring the unit to a reusable condition; and
controlling a restore operation for restoring normal controlling operations of the flash memory after an error occurs,wherein the restore operation controlling step, while deleting data of a data block, includes steps of;
a) if an error occurs while a first spare block is not “
allocated”
, allocating a second spare block in the same unit and writing the deleted data to the allocated second spare block from the data block;
b) if an error occurs while the first spare block is “
allocated”
, writing the deleted data to the allocated first spare block from the data block; and
c) if an error occurs while updated data is being written to the first spare block, deleting the updated data written in the first spare block, reallocating a third spare block in the same unit, and writing the deleted data to the reallocated third spare block from the data block.
-
-
12. A method for controlling a flash memory having units wherein each of the units includes a plurality of data blocks for writing data, a plurality of spare blocks emptied for writing updated data of the data blocks, a map block for designating an actual location in which data is written, and a header block for recording flash memory information and unit information, the method comprising steps of:
-
controlling a mapping operation for mapping the data blocks within the flash memory;
controlling an allocate operation for allocating the data blocks among the units;
controlling a read operation for reading the data in the data blocks;
controlling a delete operation for designating a data block as “
deleted”
;
controlling an update operation for updating data of the data block;
controlling a retrieve operation for restoring the unit to a reusable condition; and
controlling a restore operation for restoring normal controlling operations of the flash memory after an error occurs,wherein the restore operation controlling step, while transferring data of a retrieve unit, includes steps of;
a) re-executing a retrieve operation of the retrieve unit if an error occurs while the data is not being copied to a move unit; and
b) deleting the data copied to the move unit and re-executing the retrieve operation of the retrieve unit if an error occurs while the data is being copied to the move unit.
-
-
13. An apparatus for controlling a flash memory having units wherein each of the units includes a plurality of data blocks for writing data, a plurality of spare blocks emptied for writing updated data of the data blocks, a map block for designating an actual location in which data is written with respect to a logical block number, and a header block for recording flash memory information and unit information, the apparatus comprising:
-
means for controlling a mapping operation for mapping the data blocks within the flash memory, by using the map block to correlate the logical block number to the actual location in which data is written;
means for controlling an allocate operation for allocating the data blocks among the units;
means for controlling a read operation for reading the data in the data blocks;
means for controlling a delete operation for designating a data block as “
deleted”
;
means for controlling an update operation for updating data of the data block;
means for controlling a retrieve operation for restoring the unit to a reusable condition; and
means for controlling a restore operation for restoring normal controlling operations of the flash memory after an error occurs.
-
Specification