Flash eeprom management using ratio of used to unused sectors
First Claim
1. A flash ROM management apparatus comprising:
- management means for managing a plurality of blocks formed in a flash ROM, each of said blocks including a plurality of sectors and each of said sectors containing a data area and a management area corresponding to the data area, said management area storing a sector identifier and state information indicating at least three states, including an unused state indicating that a corresponding data area is writable, a busy state indicating that data written in the data area is valid, and a used state indicating that the data written in the data area is invalid;
writing means for receiving a write instruction containing a sector identifier which specifies a data write destination sector, searching for a sector having a management area whose state information indicates the unused state, writing the sector identifier and data in the management area and a corresponding data area, respectively, altering the state information from the unused state to the busy state in the management area in the found sector, and altering the state information from the busy state to the used state in the management area in the sector previously storing the specified sector identifier;
reading means for receiving a read instruction containing a sector identifier which specifies a data read source sector, accessing a sector having a management area in which the specified sector identifier is stored, and reading out data stored in a data area in the accessed sector;
counting means for counting total numbers of unused sectors and used sectors, respectively, in said flash ROM by counting down the total number of unused sectors and counting up the total number of used sectors when said writing means writes data in a sector;
determination means for determining whether a proportion of the total number of used sectors to the total number of unused sectors exceeds a predetermined value when said counting means updates the total numbers of unused sectors and the used sectors;
selection means for selecting an erase block to be erased from among said plurality of blocks in said flash ROM if the determined proportion exceeds the predetermined value;
moving means for retrieving all sectors whose state information indicates the busy state in the erase block and moving contents of the retrieved sectors to the outside of the erase block; and
erasing means for erasing the erase block after the execution of said moving means.
0 Assignments
0 Petitions
Accused Products
Abstract
A plurality of data areas and management areas corresponding to the data areas are formed in a flash ROM. The management area consists of a sector number, a busy state flag, and a used state flag. To write data, a write instruction having a logical sector number indicating a data write destination is received, the data is written in one of writable data areas, and the logical sector number is written in the corresponding management area. To read out data, a read instruction having a logical sector number indicating a data read source is received, a management area storing the logical sector number is retrieval-accessed, and data stored in a data area corresponding to the retrieval-accessed management area is read out. In this manner, a data read•write unit (storage unit) smaller than an erase unit can be managed in a flash ROM. This makes a flash ROM with a large erase unit compatible with a file system.
-
Citations
16 Claims
-
1. A flash ROM management apparatus comprising:
-
management means for managing a plurality of blocks formed in a flash ROM, each of said blocks including a plurality of sectors and each of said sectors containing a data area and a management area corresponding to the data area, said management area storing a sector identifier and state information indicating at least three states, including an unused state indicating that a corresponding data area is writable, a busy state indicating that data written in the data area is valid, and a used state indicating that the data written in the data area is invalid;
writing means for receiving a write instruction containing a sector identifier which specifies a data write destination sector, searching for a sector having a management area whose state information indicates the unused state, writing the sector identifier and data in the management area and a corresponding data area, respectively, altering the state information from the unused state to the busy state in the management area in the found sector, and altering the state information from the busy state to the used state in the management area in the sector previously storing the specified sector identifier;
reading means for receiving a read instruction containing a sector identifier which specifies a data read source sector, accessing a sector having a management area in which the specified sector identifier is stored, and reading out data stored in a data area in the accessed sector;
counting means for counting total numbers of unused sectors and used sectors, respectively, in said flash ROM by counting down the total number of unused sectors and counting up the total number of used sectors when said writing means writes data in a sector;
determination means for determining whether a proportion of the total number of used sectors to the total number of unused sectors exceeds a predetermined value when said counting means updates the total numbers of unused sectors and the used sectors;
selection means for selecting an erase block to be erased from among said plurality of blocks in said flash ROM if the determined proportion exceeds the predetermined value;
moving means for retrieving all sectors whose state information indicates the busy state in the erase block and moving contents of the retrieved sectors to the outside of the erase block; and
erasing means for erasing the erase block after the execution of said moving means. - View Dependent Claims (2, 3, 4, 5, 6, 7)
-
-
8. A flash ROM management method of forming a data area and a management area corresponding to the data area in a flash ROM, the management area storing state information indicating at least three states, including an unused state indicating that a corresponding data area is writable, a busy state indicating that data written in the data area is valid and a used state indicating that the data written in the data area is invalid, and controlling data storage of the flash ROM, said method comprising:
-
a writing step, of receiving a write instruction containing a sector identifier which specifies a data write destination sector, searching for a sector having a management area whose state information indicates the unused state, writing the sector identifier and data in the management area and a corresponding data area, respectively, altering the state information from the unused state to the busy state in the management area in the found sector, and altering the state information from the busy state to the used state in the management area in the sector previously storing the specified sector identifier and changing the state information of the management area to the busy state;
a reading step, of receiving a read instruction containing a sector identifier which specifies a data read source sector, accessing a sector having a management area in which the specified sector identifier is stored, and reading out data stored in a data area in the accessed sector;
a counting step, of counting total numbers of unused sectors and used sectors, respectively, in the flash ROM by counting down the total number of unused sectors and counting up the total number of used sectors when, in said writing step, data is written in a sector;
a determination step, of determining whether a proportion of the total number of used sectors to the total number of unused sectors exceeds a predetermined value when, in said counting step, the total numbers of unused sectors and the used sectors are updated;
a selection step, of selecting an erase block to be erased from among the plurality of blocks in the flash ROM if the determined proportion exceeds the predetermined value;
a moving step, of retrieving all sectors whose state information indicates the busy state in the erase block and moving contents of the retrieved sectors to the outside of the erase block; and
an erasing step, of erasing the erase block after the execution of said moving step.
-
-
9. A computer control apparatus for controlling a computer by reading out a predetermined program from a memory medium,
wherein said memory medium stores a control program which forms a plurality of blocks formed in a flash ROM, each of said blocks including a plurality of sectors and each of said sectors containing a data area and a management area corresponding to the data area, said management area storing a sector identifier and state information indicating at least three states including an unused state indicating that a corresponding data area is writable, a busy state indicating that data written in the data area is valid and a used state indicating that the data written in the data area is invalid, and wherein the control program comprises: -
code for a writing step, of receiving a write instruction containing a sector identifier which specifies a data write destination sector, searching for a sector having a management area whose state information indicates the unused state, writing the sector identifier and data in the management area and a corresponding data area, respectively, altering the state information from the unused state to the busy state in the management area in the found sector, and altering the state information from the busy state to the used state in the management area in the sector previously storing the specified sector identifier, and changing the state information of the management area to the busy state;
code for a reading step, of receiving a read instruction containing a sector identifier which specifies a data read source sector, retrieval-accessing a sector having a management area in which the specified sector identifier is stored, and reading out data stored in a data area in the accessed sector;
code for a counting step, of receiving a counting instruction for counting total numbers of unused sectors and used sectors, respectively, in the flash ROM by counting down the total number of unused sectors and counting up the total number of used sectors when said writing-step code writes data in a sector;
code for a determination step, for determining whether a proportion of the total number of used sectors to the total number of unused sectors exceeds a predetermined value when said counting-step code updates the total numbers of unused sectors and the used sectors;
code for a selection step, for selecting an erase block to be erased from among the plurality of blocks in the flash ROM if the determined proportion exceeds the predetermined value;
code for a moving step, of retrieving all sectors whose state information indicates the busy state in the erase block and moving contents of the retrieved sectors to the outside of the erase block; and
code for an erasing step, of erasing the erase block after the execution of the moving step.
-
-
10. An IC card apparatus which is attached to a host apparatus and to which a data write/read operation can be performed in accordance with a request from the host apparatus, comprising:
-
a flash ROM managed by forming a plurality of blocks formed in a flash ROM, each of said blocks including a plurality of sectors and each of said sectors containing a data area and a management area corresponding to the data area, said management area storing a sector identifier and state information indicating at least three states, including an unused state indicating that a corresponding data area is writable, a busy state indicating that data written in the data area is valid and a used state indicating that the data written in the data area is invalid;
writing means for receiving from the host apparatus a write instruction containing a sector identifier which specifies a data write destination sector, searching for a sector having a management area whose state information indicates the unused state, writing the sector identifier and data in the management area and a corresponding data area respectively, altering the state information from the unused state to the busy state in the management area in the found sector, and altering the state information from the busy state to the used state in the management area in the sector previously storing the specified sector identifier;
reading means for receiving from the host apparatus a read instruction containing a sector identifier which specifies a data read source sector, accessing a sector having a management area in which the specified sector identifier is stored, and reading out data stored in a data area in the accessed sector;
counting means for counting total numbers of unused sectors and used sectors, respectively, in said flash ROM by counting down the total number of unused sectors and counting up the total number of used sectors when said writing means writes data in a sector;
determination means for determining whether a proportion of the total number of used sectors to the total number of unused sectors exceeds a predetermined value when said counting means updates the total numbers of unused sectors and the used sectors;
selection means for selecting an erase block to be erased from among said plurality of blocks in said flash ROM if the determined proportion exceeds the predetermined value;
moving means for retrieving all sectors whose state information indicates the busy state in the erase block and moving contents of the retrieved sectors to the outside of the erase block; and
erasing means for erasing the erase block after the execution of said moving means. - View Dependent Claims (11, 12)
-
-
13. An electronic camera for storing data in a flash ROM, comprising:
-
a plurality of blocks formed in said flash ROM, each of said blocks including a plurality of sectors and each of said sectors containing a data area and a management area corresponding to the data area, said management area storing a sector identifier and state information indicating at least three states including an unused state indicating that a corresponding data area is writable, a busy state indicating that data written in the data area is valid, and a used state indicating that the data written in the data area is invalid;
writing means for receiving a write instruction containing a sector identifier which specifies a data write destination sector, searching for a sector having a management area whose state information indicates the unused state, writing the sector identifier and data in the management area and a corresponding data area, respectively, altering the state information from the unused state to the busy state in the management area in the found sector, and altering the state information from the busy state to the used state in the management area in the sector previously storing the specified sector identifier;
reading means for receiving a read instruction containing a sector identifier which specifies a data read source sector, accessing a sector having a management area in which the specified sector identifier is stored, and reading out data stored in a data area in the accessed sector;
counting means for counting total numbers of unused sectors and used sectors, respectively, in said flash ROM by counting down the total number of unused sectors and counting up the total number of used sectors when said writing means writes data in a sector;
determination means for determining whether a proportion of the total number of used sectors to the total number of unused sectors exceeds a predetermined value when said counting means updates the total numbers of unused sectors and the used sectors;
selection means for selecting an erase block to be erased from among said plurality of blocks in said flash ROM if the determined proportion exceeds the predetermined value;
moving means for retrieving all sectors whose state information indicates the busy state in the erase block and moving contents of the retrieved sectors to the outside of the erase block; and
erasing means for erasing the erase block after the execution of said moving means.
-
-
14. An electronic camera for storing data in a flash ROM, comprising:
-
a plurality of data areas and management areas corresponding to the data areas formed in the flash ROM, said management areas storing state information indicating at least three states, including an unused state indicating that a corresponding data area is writable, a busy state indicating that data written in the data area is valid, and a used state indicating that the data written in the data area is invalid;
writing means for receiving a write instruction containing specification information which specifies a data write destination, accessing a management area whose state information indicates the unused state, and writing the specification information and data in the accessed management area and a corresponding data area, respectively;
reading means for receiving a read instruction containing specification information which specifies a data read source, accessing a management area in which the specification information is stored, and reading out data stored in a data region corresponding to the accessed management area;
moving means for accessing all management areas whose state information indicates the busy state in an erase block as an erase unit of the flash ROM and moving contents of the accessed management areas and corresponding data areas to the outside of the erase block;
erasing means for erasing the erase block after the execution of said moving means;
control means for evaluating a storage efficiency of the flash ROM and controlling the execution of said moving means and said erasing means on the basis of the evaluation result; and
timer means for performing self-timer photography, and wherein said moving means and said erasing means are executed while said timer means is measuring a time.
-
-
15. An electronic camera for storing data in a flash ROM, comprising:
-
a plurality of data areas and management areas corresponding to the data areas formed in the flash ROM, said management areas storing state information indicating at least three states, including an unused state indicating that a corresponding data area is writable, a busy state indicating that data written in the data area is valid, and a used state indicating that the data written in the data area is invalid;
writing means for receiving a write instruction containing specification information which specifies a data write destination, accessing a management area whose state information indicates the unused state, and writing the specification information and data in the accessed management area and a corresponding data area, respectively;
reading means for receiving a read instruction containing specification information which specifies a data read source, accessing a management area in which the specification information is stored, and reading out data stored in a data region corresponding to the accessed management area;
moving means for accessing all management areas whose state information indicates the busy state in an erase block as an erase unit of the flash ROM and moving contents of the accessed management areas and corresponding data areas to the outside of the erase block;
erasing means for erasing the erase block after the execution of said moving means;
control means for evaluating a storage efficiency of the flash ROM and controlling the execution of said moving means and said erasing means on the basis of the evaluation result; and
power supply managing means for managing the use of a power supply, and wherein said power supply managing means allocates power of a power supply, which is used to perform at least one of charging of an electronic flash, driving of a mechanical portion, and driving of a charge-coupled device, to write access to the flash ROM. - View Dependent Claims (16)
-
Specification