The present invention relates to a nonvolatile memory device such as a semiconductor memory card having a nonvolatile memory, a memory controller for controlling the nonvolatile memory, and a nonvolatile memory system configured by adding an access device as a component to the nonvolatile memory device.
A nonvolatile memory device having a rewritable nonvolatile memory is increasingly demanded mainly for a semiconductor memory card. The semiconductor memory card is high-price compared to an optical disk, media of tape, and the like, however, the demand is widely increasing as a memory medium for a portable apparatus such as a digital still camera and a mobile phone because of merits such as small-size, lightweight, vibration resistance, and easy handling. This semiconductor memory card includes a flash memory as a nonvolatile main memory and has a memory controller for controlling the memory. The memory controller controls the flash memory on the reading and writing of data in accordance with reading and writing commands from the access device such as a digital still camera or a personal computer.
Such semiconductor memory card is used after attached to an access device, for example, a digital still camera. The access device handles the semiconductor memory card as a removable disk and controls the card by using a file system, for example, a FAT file system. The FAT file system manages contents, for example, an image in units of clusters by using a file allocation table (hereinafter referred to as a FAT). When the file data is written to the nonvolatile memory device, for example, the semiconductor memory card, the FAT file system allocates the file data to an unused cluster on a logical address space, and further the access device transfers, to the nonvolatile memory device, the file data and a cluster number (a logical address) to which the file data is allocated. For example, Patent document 1 discloses a nonvolatile memory system using such FAT file system in detail. The allocation management using such FAT is referred to as a “file allocation management on a logical address space”.
The file data transferred by the access device is written to the flash memory by the memory controller in the nonvolatile memory device. The memory controller obtains an unused block to store the file data on the basis of a table retaining a correspondence relationship between a logical address and a physical address and states of physical blocks (hereinafter referred to as a logical-physical management table) and writes the file data to the obtained block, and further manages a correspondence relationship between a logical address transferred by the access device and a written block on the logical-physical management table. Such nonvolatile memory device is described in detail in Patent document 2, and the writing management for file data using the aforementioned logical-physical management table is referred to as a “logical mapping management on a physical address space”
Patent document 1: Japanese Unexamined Patent Publication No. 2001-188701
Patent document 2: Japanese Unexamined Patent Publication No. 2004-152331
However, in these years, capacity expansion of a semiconductor memory card is accelerated in accordance with needs for storing a high-definition image. For that reason, processing for specifying clusters constituting file data managed on the FAT or processing for searching an unused cluster to which the file data is newly allocated takes longer time than ever as described above, and it becomes a major problem to shorten the time.
For example, the FAT stores information showing a linkage of clusters constituting file data and information enabling use states to be identified in units of 16 bits or 32 bits. In order to specify an unused cluster, processing for extracting clusters retaining information specifying the unused cluster (for example, a numeral value of 0x0000 or 0x00000000 in hexadecimal) from a whole of the FAT is required. The FAT management such as this extraction of unused cluster is executed by a CPU included in an access device.
Thus, when a user takes a still image with, for example, a digital still camera, the FAT management has a problem of missing a photo-opportunity as a result because it takes longer time to judge whether or not a semiconductor memory card has an unused cluster able to store the still image and which cluster is allocated to file data corresponding to the still image on the FAT. The more a capacity of the semiconductor memory card expands, the more this problem becomes serious. A response of a nonvolatile memory system side able to start the writing immediately after such writing operation by a user is referred to as a recording response.
In consideration of the above mentioned problems, the present invention intends to provide a memory controller, a nonvolatile memory device, and a nonvolatile memory system which have the superior recording response without employing the “file allocation management on a logical address space” and with reducing time required to specify an unused cluster on an access device side.
To solve the problems, a memory controller according to the present invention which is connected to a nonvolatile memory, writes file data to said nonvolatile memory in accordance with a file ID designated from an outside, and reads file data from said nonvolatile memory, comprises: a file physical management part for relating said file ID to a unit region formed by dividing an inside region of said nonvolatile memory.
Said memory controller may detect a recordable capacity of said nonvolatile memory and further comprise a recordable capacity detection part for notifying the recordable capacity to an outside.
Said file physical management part may include a file physical management table for storing, for each unit region of said nonvolatile memory, at least a recorded file ID and a status of the region.
Said memory controller may comprise a file reading-writing control part for writing file data to said nonvolatile memory and reading file data from said nonvolatile memory on the basis of a writing or reading command from an outside, and wherein while said file reading-writing control part writes file data, the file physical management part may compare the file data with a file ID as to whether or not the file data is written for updating a file stored in said nonvolatile memory, and may set a status of the unit region retaining original file data in said file physical management table to be an unused region in the case of updating the file.
Said memory controller may further comprise: a recordable capacity detection part for detecting a recordable capacity and temporarily retaining the capacity; and a recording feasibility judgment part for, based on a file size of file data designated from an outside in writing said file data and on the recording capacity retained by said recordable capacity detection part, judging whether or not said nonvolatile memory has a region to which the file data can be written, and for notifying an outside of recording feasibility.
Said file physical management part may include a file physical management table for storing, for each unit region of said nonvolatile memory, at least a recorded file ID and a status of the region.
Said memory controller may comprise a file reading-writing control part for writing file data to said nonvolatile memory and reading file data from said nonvolatile memory on the basis of a writing or reading command from an outside, and wherein while said file reading-writing control part writes file data, the file physical management part may compare the file data with a file ID as to whether or not the file data is written for updating a file stored in said nonvolatile memory, and may set a status of the unit region retaining original file data in said file physical management table to be an unused region in the case of updating the file.
To solve the problems, a nonvolatile memory device according to the present invention comprises: a nonvolatile memory; and a memory controller which is connected to a nonvolatile memory, writes file data to said nonvolatile memory in accordance with a file ID designated from an outside, and reads file data from said nonvolatile memory, wherein said memory controller includes a file physical management part for at least relating said file ID to a unit region formed by dividing an inside region of said nonvolatile memory.
To solve the problem, a nonvolatile memory system according to the present invention comprises: an access device; a nonvolatile memory; and a memory controller, wherein said access device writes and reads file data by designating a file ID to said nonvolatile memory device, and said memory controller includes a file physical management part for at least relating said file ID to a unit region formed by dividing an inside region of said nonvolatile memory, and writes file data to the nonvolatile memory and reads file data from said nonvolatile memory in accordance with the file ID designated from said access device.
The present invention is based on a file level access method where an access device designates a file to be read or written to a nonvolatile memory device, and a file physical management part specifies correspondence relationship of a file ID designated by the access device with a data recording unit. Accordingly, the access device side is not required to search and map the management of unused clusters on a logical address space on the basis of the FAT, resulting in improvement of the recording response.
Additionally, when further comprising a recordable capacity detection part for detecting a recordable capacity and notifying the access device of the recordable capacity, or further comprising: a recordable capacity detection part for detecting a recordable capacity; and a recording feasibility judgment part for judging whether or not the nonvolatile memory has a region able to store file data on the basis of the recordable capacity and a file size of the file data designated by the access device in writing the file data and for notifying the access device of the feasibility of recording, the present invention can avoid a problem that a writing process of file data by the access device cannot be completed because of capacity shortage of the nonvolatile memory side, namely, a situation where a user is wastefully forced to wait.
The host interface (host IF) 101 is a block for receiving a command and a file ID both related to reading and writing of file data from the access device 150 and for transmitting and receiving the file data to and from the access device 150.
The reading-writing control part 103 writes data temporarily stored in the buffer 102 to the nonvolatile memory 110 and reads data stored in the nonvolatile memory 110 to store the data in the buffer 102.
The CPU 104 controls a whole of the memory controller 100A.
The file physical management part 105 determines and manages a physical block number of a writing target or reading target in the nonvolatile memory 110 on the basis of, for example, a command and a file ID both received from the access device 150, and includes a file physical management table 106 described later.
The recordable capacity detection part 107A counts the number of unused blocks on the basis of the file physical management table 106, detects a recordable capacity by multiplying a size of one block by the counted number, namely, a capacity of a region able to newly store file data in the nonvolatile memory 110, and further notifies the access device 150 of the recordable capacity.
The nonvolatile memory 110 is a flash memory, and has a size of, for example, 1 GB as a user region. Supposing an erasing unit is a physical block, the nonvolatile memory 110 is composed of a plurality of physical blocks.
The access device 150 writes and reads file data to and from the nonvolatile memory device 120A, and includes at least the display part 151 for displaying a recordable capacity. To simplify the description, a minimum unit of the file data is 256 kbytes same as the physical block size. For example, when a still image of 1 Mbytes is recorded, four physical blocks are used.
The nonvolatile memory system configured as described above according to the present invention will be explained separately divided into initialization processing in starting up a power source and reading-writing processing for file dada in a normal operation.
(Initialization Processing in Starting Up a Power Source)
When a power is supplied to the access device 150, the power is also supplied to the nonvolatile memory device 120A via an external bus and the memory device 120A enters the initialization processing.
Next, the CPU 104 passes a control to the recordable capacity detection part 107A. The recordable capacity detection part 107A detects the number of unused physical blocks on the basis of values representing a block status described below in the file physical management table 106, and calculates a recordable capacity by multiplying 256 kbytes by the counted number. Then, the recordable capacity detection part 107A temporarily retains the value, and notifies the access device 150 of the recordable capacity (S102). In this manner, the initialization processing in starting up a power completes.
The access device 150 recognizes a file size which can be stored in the nonvolatile memory device 120 on the basis of the notified recordable capacity and informs a user of the recordable capacity by displaying the recordable capacity on the display part 151 in the access device 150.
Then, a control is returned to the CPU 104, and the nonvolatile memory device enters a waiting state until the access device 150 transfers a reading or writing command via the host interface 101 (S103 and S104). When the writing or reading command is transferred, the nonvolatile memory device executes processing for writing file data (S105) and processing for reading file data (S106), respectively. After the writing of data, the recordable capacity of the nonvolatile memory 101 is reduced. Consequently, the recordable capacity detection part 107A detects the recordable capacity based on the file physical management table 106, internally retains the recordable capacity temporarily, and notifies the access device 150 of the recordable capacity (S107). After that, the processing returns to S103 again.
Here, referring to
The file physical management table 106 additionally includes the region 106d retaining block statuses. The block status indicates a state of each physical block by 2-bit data; value 0 represents a used block, value 1 represents an unused block (non-erased), value 2 represents a bad block, and value 3 represents an unused block (erased). In the extraction of unused blocks as S102, since a higher-order bit side in both of the values “1” and “3” is value “1” in a case of indicating the block status in 2-bit binary number, the total number of unused blocks can be detected only by searching the higher-order bit. Meanwhile, a symbol “*” indicates an arbitrary value and is actually determined to some number based on a past use state of the nonvolatile memory device 120A.
The file physical management part 105 creates the file physical management table 106 shown in
(Processing for Writing File Data in the Normal Operation)
Next, processing for writing file data in the normal operation will be explained.
In the writing of file data, as shown in
Next, the file physical management part 105 sends a physical block number of a writing target and management data, namely, the file name, the file size parameter, the file configuration order number, and the block status to the reading-writing control part 103 (S204). Subsequently, after erasing the writing-target physical block, the reading-writing control part 103 writes file data retained by the buffer 102 to a data region of the writing-target block. The control part simultaneously writes the file name, the file size parameter, the file configuration order number, and the block status to a management region of the writing-target block (S205).
Next, the file physical management part 105 searches whether the file name designated by the access device 150 has already been retained by the file physical management table 106, and sequentially compares the file name with file names retained by the file physical management table 106 (S206 and S207). This is carried out for judging whether the writing is a new writing or a rewriting, and if not the rewriting processing, the file physical management part 105 merely updates a block status of a new physical block to which data was written in the file physical management table 106 at step S209. In the aforementioned case, the file physical management table 106 is updated from the state of
And next, after the new writing of the file X, the file A is rewritten. Since the file A has a file size of 256 kbytes, the number N of the writing-target physical blocks will be a value “1” (S201). The file physical management part 105 obtains the PB6 as a rewriting target for the file A by searching unused blocks in ascending order from a position of the PB4 in the file physical management table 106 shown in
In the case of the rewriting of the file A, since the file A exists in the PB1 in the file physical management table 106 shown in
In the case where the command was determined as the rewriting, the file physical management part 105 changes a block status of a physical block of the value “0” (old physical block) in the table 106 retaining the file name designated by the access device 150 to be the value “1” at S208. Subsequently, the management part updates the file physical management table 106 so that the status values of physical blocks of the value “0” or “3” (new physical block) can be the value “0”, and the processing completes. In the case of rewriting the file A for example, the block status of the old physical block PB1 is changed to the value “1”, and the block status of the new physical block PB6 is changed to the value “0”. Meanwhile, the subsequent comparison of a file name sometimes takes comparatively long time. However, since the comparison of a file name can be carried out during the writing to the nonvolatile memory 110 by the reading-writing control part 103 (a program busy period of a flash memory) after transferring the writing-target physical block number and the management data at S204, the comparison does not affect a total processing speed of the nonvolatile memory device 120A.
(Processing for Reading File Data in the Normal Operation)
Next, the file physical management part 105 specifies a physical block number of a reading target on the basis of the offset and reading size designated by the access device 150 (S302), and sends the physical block number to the reading-writing control part 103 (S303). For example, in a case where the offset is a value “1” and the reading size is a value “1” in the reading of the file B, the reading-target physical block is PB10. In addition, the units of the offsets and reading sizes are not restricted to a physical block, and can be designated in a small unit, for example, in units of page sizes.
Then, the file physical management part 105 sends the reading-target physical block number to the reading-writing control part 103 (S303). After that, the reading-writing control part 103 reads file data from the physical block designated by the file physical management part 105 to store the data to the buffer 102 (S304). Subsequently, the CPU 104 sends the data from the buffer 102 to the access device 150 (S305).
As described above, in the nonvolatile memory system according to embodiment 1, the conventional “file allocation management on a logical address space” based on the FAT or the like is not employed. In the processing for writing or reading file data, the access device 150 designates a file ID, for example, a file name used for directly specifying file data to the nonvolatile memory device 120A and the file physical management part 105 in the nonvolatile memory device 120A reads and writes the file on the basis of the file physical management table 106. For that reason, the access device 150 is not required to detect an unused cluster on the conventional FAT, resulting in improvement of a response in recording data.
Furthermore, the recordable capacity detection part 107A notifies the access device 150 of a value, as a recordable capacity, obtained by multiplying the number of unused blocks detected on the basis of the block statuses by a size of one physical block. Thus, the present embodiment can be prevented from having a problem that a writing process of file data by the access device cannot be completed because of capacity shortage of the nonvolatile memory side, namely, a situation where a user is wastefully forced to wait.
In addition, in
Referring to
The recordable capacity detection part 107B counts the number of unused blocks on the basis of the file physical management table 106, detects a recordable capacity by multiplying a size of one block by the counted number, namely, a capacity of a region able to newly store file data in the nonvolatile memory 110, and retains the capacity.
The recording feasibility judgment part 108 judges whether or not file data of the file size can be stored, and notifies the access device 150 of a recording feasibility flag representing a feasibility judgment result.
Referring to flowcharts in
Referring to a flowchart in
In the case where the recording is possible, upon receiving the flag showing the possibility, the access device 150 sends the file data after that as shown in
In embodiment 2, since the recording feasibility judgment part 108 judges recording feasibility by comparing a recordable capacity with a file size designated by the access device 150, and notifies the access device 150 of the feasibility, the present embodiment can avoid a problem that a writing process of file data by the access device cannot be completed because of capacity shortage of the nonvolatile memory side, namely, a situation where a user is wastefully forced to wait.
In addition, the file physical management table 106 has a function for relating a file name to a physical block number, however, is not restricted to use the physical block number. A unit region formed by dividing a memory space into an arbitrary size, for example, a page number may be related to the file name. In this case, the file physical management part manages file data on the basis of the divided unit region.
Moreover, different from the flash memory, a memory which does not employ a concept of physical block, for example, a nonvolatile RAM such as a ferroelectric memory can be employed as the nonvolatile memory 110. In this case, by defining a unit region formed by dividing a memory space into a predetermined size, a file ID can be related to the unit region.
The present invention proposes a method for improving a response of a nonvolatile memory system in recording data, and is useful in a still image recording and reproducing apparatus and a mobile phone both using a nonvolatile memory device, for example, a semiconductor memory card.
Number | Date | Country | Kind |
---|---|---|---|
2006-246400 | Sep 2006 | JP | national |
Filing Document | Filing Date | Country | Kind | 371c Date |
---|---|---|---|---|
PCT/JP2007/067286 | 9/5/2007 | WO | 00 | 4/22/2009 |