JP5164506B2 - Flash memory management device, flash memory management method, and program - Google Patents

Flash memory management device, flash memory management method, and program Download PDF

Info

Publication number
JP5164506B2
JP5164506B2 JP2007258209A JP2007258209A JP5164506B2 JP 5164506 B2 JP5164506 B2 JP 5164506B2 JP 2007258209 A JP2007258209 A JP 2007258209A JP 2007258209 A JP2007258209 A JP 2007258209A JP 5164506 B2 JP5164506 B2 JP 5164506B2
Authority
JP
Japan
Prior art keywords
data
block
written
page
flash memory
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2007258209A
Other languages
Japanese (ja)
Other versions
JP2009087173A (en
Inventor
良三 清原
Original Assignee
三菱電機株式会社
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 三菱電機株式会社 filed Critical 三菱電機株式会社
Priority to JP2007258209A priority Critical patent/JP5164506B2/en
Publication of JP2009087173A publication Critical patent/JP2009087173A/en
Application granted granted Critical
Publication of JP5164506B2 publication Critical patent/JP5164506B2/en
Application status is Expired - Fee Related legal-status Critical
Anticipated expiration legal-status Critical

Links

Images

Description

  The present invention relates to an auxiliary storage device of a built-in small information processing device such as a mobile phone, and more particularly to a management device and management method such as writing / erasing of a flash memory device (hereinafter also simply referred to as a flash memory).

One of the information processing storage devices is a flash memory device, which is used in a built-in device such as a mobile phone.
This flash memory is erased in units of blocks and written in units of pages, as disclosed in, for example, the document “Practical application of memory ICs” (▲ Masahiko Nono: CQ Publishing Co., Ltd.). It is a feature.
A block is a unit in which a plurality of pages are collected, and is characterized in that there is a limit that can be guaranteed in the number of erases.

If the memory is used without worrying about the limit of the number of erasures, and there is a bias in the number of erasures of the memory, there is a problem that an unusable area appears.
In order to solve these problems, for example, in JP-A-6-124596 and JP-A-8-273390, an erase count management table is provided for each block, and when writing to a block exceeding a certain number of times, another minimum The method of changing to the writing of the number of erasures to the block is taken, and the solution is to make the number of erasures of each block uniform.
However, there is a problem that it does not touch the characteristics of the data of the page in the block, and if a part of the block needs to be rewritten, it may be completely rewritten.

Japanese Patent Laid-Open No. 10-091535 discloses a method of replacing a block with the maximum number of erases with a block with the minimum number of erases at a fixed timing.
However, this also does not touch the characteristics of the data in the page as described above, and there is a problem that if a part of the block needs to be rewritten, it may be completely rewritten.

  Japanese Patent Application Laid-Open No. 2002-8379 discloses whether to actually rewrite or write in a correction area according to the amount of rewritten data at the time of rewriting, and discloses the concept of summarization processing in consideration of the characteristics of data in a page. However, it is only an integral process and is not an essential solution.

Japanese Patent Laid-Open No. 2001-318829 relates to a cache system for increasing the access speed of a flash ROM (Read Only Memory).
It discloses a technique that can shorten the time when rewriting occurs by deleting from the flash ROM when cached.
However, in this method, the case where the power supply state is lost is not taken into consideration, and it is difficult to actually use it.
Although time management is performed, it is only used to determine whether or not to erase the cache based on the number of accesses within a certain time.

  Japanese Patent Application Laid-Open No. 2000-20252 discloses a technique for achieving equalization of access by moving a portion having a high rewrite frequency.

In Japanese Patent Laid-Open No. 2002-318729, in a method in which erase blocks are managed in smaller units and some of the deteriorated parts are avoided, those that have been in a certain time after such a state are preferentially re-used. A technique of configuring is disclosed.
JP-A-6-124596 JP-A-8-273390 Japanese Patent Laid-Open No. 10-091535 JP 2002-8379 A JP 2001-318829 A JP 2000-20252 A JP 2002-318729 A

  The conventional erase block management method as described above has a problem that the number of data rewrites per block is not reduced or insufficient, and the frequency of unnecessary rewrites is still high.

  One of the main objects of the present invention is to solve the above-described problems, and a data write destination block is determined based on the possibility of rewriting for each data and the number of data erasures for each block. Thus, the main object is to make the number of data erases uniform for each block, reduce the number of block rewrites as a whole of the flash memory, and suppress the occurrence of useless rewrites.

A flash memory management device according to the present invention includes:
A flash memory management device that manages a flash memory having a plurality of blocks that perform data writing in units of pages and erase data in units of blocks composed of a plurality of pages,
For each block, a data erasure count management unit that manages the number of data erasures in the block,
For each page, a page elapsed time management unit that manages an elapsed time from the writing time of data written to the page;
A block selection unit that selects one or more blocks as write target candidate blocks from the plurality of blocks based on the number of times of data erasure in each block and the elapsed time from the write time of the data of each page;
And a data writing unit for writing the write target data to any of the write target candidate blocks selected by the block selection unit.

  According to the present invention, the write target candidate block suitable for writing the write target data is selected based on the relationship between the number of data erases per block and the elapsed time from the data write time for each page. Since data is written, data with a high possibility of data erasure can be distributed to blocks with a small number of data erasures that have a margin up to the upper limit of the number of data erasures. Can be avoided, and as a result, the number of data erasures between blocks can be made uniform, and the life of the flash memory can be extended.

Embodiment 1 FIG.
This embodiment introduces the concept of generation focusing on the possibility that data will be rewritten in the future, and it is possible to erase data in block units by using the property that older generation data is more likely to live longer The processing time perceived by the user is shortened by reducing the performance, making the number of erasures uniform, and distributing the processing itself.

  FIG. 1 shows a hardware configuration example of a flash memory management device 100 according to the present embodiment. The flash memory management device 100 is mounted on an information processing device such as a mobile phone, a PHS (Personal Handy-phone System) (registered trademark) terminal, or a PDA (Personal Digital Assistant) (registered trademark) terminal.

In FIG. 1, 11 is a CPU (Central Processing Unit) for executing various instructions.
Reference numeral 12 denotes a memory area for storing a program that specifies what the CPU should do, and data is not lost even when the power is turned off.
Reference numeral 13 denotes a flash memory device for storing various data, which is characterized in that data is not lost even when the power is turned off.
Reference numeral 14 denotes a non-volatile memory area for storing various data, which does not lose data even when the power is turned off, but has a characteristic that data is lost when the battery is discharged.
Reference numeral 15 denotes a data area that is temporarily used for execution, and has a feature that data is lost when the power is turned off.
Reference numeral 16 denotes a bus for connecting the elements 11 to 15 and distributing data between the elements.

When the flash memory management device 100 is mounted on a mobile phone, a PHS (Personal Handy-phone System) (registered trademark) terminal, a PDA (Personal Digital Assistant) (registered trademark) terminal, or the like, the CPU 11 uses the bus 16. For example, a display device such as an LCD (Liquid Crystal Display), a communication board, a numeric keypad, a microphone, a speaker, a keyboard, a non-contact IC card, a camera, a vibrator, an acceleration sensor, etc. are connected to control these hardware devices. You may make it do.
The communication board 915 may have an interface corresponding to wireless LAN (Local Area Network), infrared communication, Bluetooth (registered trademark) communication, etc. in addition to public wireless network communication.

  Various programs shown in FIG. 3 are stored in the program storage memory 12. Details of the program of FIG. 3 will be described later.

In addition, the flash memory 13, the nonvolatile memory 14, and the execution RAM 15 are selected in the following description by selecting “determination of”, “calculation of”, “comparison of”, “extraction of”, and “to”. ”,“ Specifying ”,“ setting of ”,“ registration of ”, etc., information, data, signal values, variable values, and parameters indicating the results of the processing are“ It is stored as each item of “database”.
Information, data, signal values, variable values, and parameters stored in the flash memory 13, nonvolatile memory 14, and execution RAM 15 are read out by the CPU 11 via a read / write circuit, and extracted, searched, referenced, compared, calculated, Used for CPU operations such as calculation, processing, editing, output, and display.
Information, data, signal values, variable values, and parameters during the CPU operation of extraction / search / reference / compare / calculation / processing / editing / output / display are, for example, registers in the CPU 11, cache memory, buffer memory Etc. may be temporarily stored.
In addition, the arrows in the flowcharts described below mainly indicate input / output of data and signals. The data and signal values are, for example, registers in the CPU 11, cache memory, buffer memory, etc., flash memory 13, nonvolatile memory 14. Are recorded in the execution RAM 15. Data and signals may be transmitted online via a bus 912, signal lines, cables, or other transmission media.

  The flash memory management device 100 shown in the present embodiment and the following embodiments includes a CPU as a processing device, a program storage memory as a storage device, a flash memory, a nonvolatile memory, an execution RAM, etc., a numeric keypad as an input device, and a keyboard , A communication board, a display device that is an output device, a communication board, a non-contact IC card, and the like, and the functions indicated as “to part” in FIG. 3 using these processing devices, storage devices, input devices, and output devices. It is realized.

FIG. 2 illustrates the flash memory 13 in FIG. 1 in detail, and 21 indicates a block which is a unit for erasing data. Reference numeral 22 denotes a page which is a unit for writing data.
The block 21 includes a plurality of pages 22.
Here, the flash memory 13 has a feature that the number of data erasures is guaranteed only to a certain number.

  The flash memory includes a NAND flash memory and a NOR flash memory, but the flash memory management device 100 according to the present embodiment is applicable to any flash memory.

FIG. 3 shows a software configuration implemented on the hardware configuration described in FIGS.
Specifically, each element shown in FIG. 3 is stored in the program storage memory 12 of FIG. 1 before startup, loaded into the execution RAM 15 at startup, read out by the CPU 11 and executed. The

A flash memory write / erase management unit 31 manages blocks for writing and erasing data and performs optimal arrangement.
The flash memory write / erase management unit 31 writes the write target data to any of the write target candidate blocks selected by the all block data life expectancy management unit 34 described later.
The flash memory write / erase management unit 31 is an example of a data write unit.

  Reference numeral 32 denotes an all data generation management unit, which manages which data belongs to which generation as a whole.

Reference numeral 33 denotes a life expectancy management unit for each block, which manages the life expectancy of the block and exists corresponding to all blocks.
In other words, the block life expectancy management unit 33 manages the number of data erases in the block (hereinafter also simply referred to as the number of erases) for each block, and grasps the life expectancy of the block according to the number of data erases.
In this embodiment, there are as many block life management units 33 as the number of blocks included in the flash memory.
The block life expectancy management unit 33 is an example of a data erasure count management unit.

Reference numeral 34 denotes an all-block data life management unit that manages the overall situation such as where the long life is as a whole and where the short life is.
The all block data life expectancy management unit 34 selects one or more blocks from among a plurality of blocks based on the number of times data is erased in each block and the elapsed time from the data write time of each page. Select as.
More specifically, the all block data life expectancy management unit 34 determines the number of data erasures in each block and the group classification result for each written page (page in which data has already been written) by the page data generation management unit 35 described later. Based on (generation classification result), one or more blocks are selected from among a plurality of blocks as write target candidate blocks. Upon selection, the all-block data life expectancy management unit 34 sequentially extracts the blocks having the smallest number of data erasures from the plurality of blocks, and when the data is not written in the extracted blocks, the extracted blocks are the candidates for writing Select as a block. In addition, when data is already written in the extracted block, it is determined whether or not there is a free page in which no data is written in the extracted block. If there is no free page, the extracted block Is selected as a candidate block to be written, and when there are empty pages, it is determined to which group (generation) the written pages included in the extracted block are classified. When it is classified into a short group (new generation), the extracted block is selected as a writing target candidate block.
The all block data life expectancy management unit 34 is an example of a block selection unit.

A page data generation management unit 35 exists corresponding to each page, and manages to which generation the data on the page belongs.
That is, for each page, the page data generation management unit 35 manages the elapsed time from the writing time of the data written to the page, and the page in which the data has been written corresponds to the elapsed time from the writing time of the data. And classify it into one of multiple groups (multiple generations) and manage the data generation for each written page.
There are as many page data generation management units 35 as the number of blocks or the number of pages included in the flash memory.
The page data generation management unit 35 is an example of a page elapsed time management unit.

Next, the principle of flash memory management of the flash memory management device 100 according to the present embodiment will be described.
FIG. 15 is a diagram conceptually illustrating the principle of flash memory management of the flash memory management device 100.
In the block group of the flash memory, the update frequency is higher as the number of erases is smaller, and the data write destination is controlled and the data is transferred between the blocks so that the generation of each page is new.
In other words, data update is prioritized over blocks with a small number of erasures, thereby concentrating data erasure opportunities on blocks with a small number of erasures, thereby suppressing an increase in the number of erasures of blocks with a large number of erasures . As a result, the number of erases between blocks is made uniform.
In addition, data (preset files, etc.) with an older generation (longer elapsed time since writing) has been stored for a long time without being erased or updated, so it is considered that the possibility of erasing and updating will be low in the future. It is considered that data that is new (the elapsed time from writing is short) (new mail, directory for file management, etc.) tends to be frequently deleted and updated.
For this reason, new generation data that is considered to have a high possibility of being erased and updated is stored in a block having a small number of times of erasure, and old data of a generation that is considered to have a low possibility of being erased and updated is to be erased frequently. By storing the data in the block, the opportunity of data erasure can be concentrated on the block with a small number of times of erasing, thereby suppressing an increase in the number of times of erasing of the block with a large number of erasures. As a result, the number of erases between blocks is made uniform.

  Next, an outline of the overall operation of the flash memory management device 100 according to the present embodiment will be described with reference to the flowchart of FIG.

First, the flash memory write / erase management unit 31 determines whether or not write target data to be written to the flash memory 13 has occurred (S101).
When data to be written has occurred (YES in S101), all the block data life expectancy management unit 34 prepares blocks in order from the smallest number of data erasures as a preparation stage for determining the write destination block of data to be written. A primary write candidate list is created in which the plurality of blocks are arranged in ascending order of the number of data erasures (S102). In the primary write candidate list, the block numbers of all blocks are arranged in ascending order of the number of data erases. The primary write candidate list is stored in a register, a buffer memory, or the like and used for the subsequent processing.

The data erase count of each block is counted by the block life managing unit 33 every time data is erased, and the data erase count is recorded in a specific area in the block as will be described later. In addition to the recording in the block, the number of erasures may be recorded in a data erasure number management table for managing the number of data erasures.
The all-block data life expectancy management unit 34 arranges a plurality of blocks in ascending order of erase counts counted in this way, and generates a primary write candidate list.

Next, the all block data life expectancy management unit 34 requests the corresponding page data generation management unit 35 to calculate the generation of each page included in each block in the order of the primary write candidate list, and the page data generation management unit 35. However, the generation of each page included in the corresponding block is calculated (S103) (page elapsed time management step).
The generation calculation procedure will be described in detail later. The page data generation management unit 35 manages the elapsed time from the writing time of the data written in the page to the current time for each page of the corresponding block. A page whose elapsed time is longer than a certain time is classified as, for example, an old generation, and a page whose elapsed time is less than a certain time is classified as, for example, a new generation. The number of generations is not limited to two (old generation, new generation), but may be three or more.
In this embodiment and the following embodiments, data for which a fixed time has not elapsed since the data write time, that is, relatively new data is called a new generation, and the fixed time has elapsed since the data write time. Data, that is, relatively old data is called the old generation. Therefore, in the following, the new generation and old generation terms are not limited to the case of classification into two generations, but are relatively new data and relatively old data among the data stored in the flash memory. Used in the sense.

  Next, the all-block data life expectancy management unit 34, in order of decreasing data erasure, uses each block in the primary write candidate list based on whether or not each block is used (whether data is written) and the page generation of each block. A secondary write candidate list is created by further selecting from the list (S104) (block selection step).

In the creation of the primary write candidate list, whether data has already been written in each block, whether there is an empty page in each block, and the generation of pages included in each block were not taken into consideration. A more appropriate writing candidate block is selected in consideration.
Although details of the processing will be described later, the all block data life expectancy management unit 34 extracts the blocks in the order of the primary write candidate list, that is, the order in which the number of data erasures is small, and the extracted blocks are unused (data is not written). ) Or if it has been used, it is determined whether there is no free page, or if there is a free page, all the generations of written pages are new generations. Then, an unused block, a block that has been used but has no free page, and a block in which a free page exists and all of the written pages are new generations are selected as write target candidate blocks, and these selected write target candidates A secondary write candidate list is generated in which blocks are shown in ascending order of the number of data erases.
In the secondary write candidate list, the block numbers of write target candidate blocks that meet the above selection conditions are arranged in ascending order of the number of data erasures. The secondary write candidate list is stored in a register, a buffer memory, or the like and used for the subsequent processing.

  Next, the flash memory write / erase management unit 31 writes the write target data to the write target candidate block according to the secondary write candidate list (S105) (data write step).

Although details will be described later, the flash memory write / erase management unit 31 extracts the write target candidate blocks in the order shown in the secondary write candidate list, that is, in order from the write target candidate blocks with the smallest number of data erases. If data is not written, write target data is written to the extracted candidate block to be written. If data is already written to the extracted candidate block to be written, data is written to the extracted candidate block to be written. It is determined whether or not there is an empty page in which is not written. If there is a free page, write target data is written to the free page of the extracted candidate block to be written, and if there is no free page, the data written to the target candidate block is extracted to another memory. For example, the data saved in the non-volatile memory 14 is erased from the write candidate block and the write target data is written.
Further, the flash memory write / erase management unit 31 sets the data saved in the other memory as the write target data, and writes the data to the block having the data erase count of a specific number or more in preference to the other write target data.

  A block with a large number of data erasures is positioned rearward in the primary write candidate list and the secondary write candidate list, and therefore is less likely to become a write destination of write target data. When data is saved in another memory, that is, when there are no empty pages in the block, the data stored in the block is considered to be data that is less likely to fluctuate (update). Transfer to a block with a high number of data erasures that is less likely to be a write destination, and suppress data fluctuations (data erasure) in the transfer destination block. In this way, by transferring data with a low possibility of data fluctuation (update) to a block with a large number of data erasures, the transfer source block with a small number of data erasures is secured as a write destination for new data to be written. It is possible to equalize the number of data erasures during this period.

Next, when data is erased in any block, the block life management unit 33 counts the number of times of erasure and writes the number of data erasures in a specific area in the corresponding block (S106) (data erasure number management). Step), the process returns to S101.
If there is no data erased block, the process of S106 is omitted.
Note that the process of S106 may be performed simultaneously with the erasure of data.

In the flow of FIG. 4, the primary write candidate list and the secondary write candidate list are generated after the write target data is generated. However, before the write target data is generated, the primary write candidate list and the secondary write candidate list are generated in advance. A writing candidate list may be generated.
Specifically, as shown in FIG. 5, a primary write candidate list is generated before data to be written is generated (S102), and the generations of pages included in each block of the primary write candidate list are calculated ( S103) A secondary write candidate list is generated (S104), and the generated secondary write candidate list is stored in, for example, the nonvolatile memory 14 (S201).
If write target data is generated (YES in S101), the write target data is written to the corresponding block according to the stored secondary write candidate list (S105), and data is erased in any block. In this case, the erase count is counted, and the data erase count is written in a specific area in the corresponding block (S106).
Note that the processing of S101 to S106 is the same as that described with reference to FIG.
FIG. 5 is the same as FIG. 4 except that the primary write candidate list and the secondary write candidate list are generated in advance and the secondary write candidate list is stored before the generation of the write target data.

Here, a specific example of recording the number of data erasures in each block of the flash memory 13 will be described.
For example, the block size in FIG. 2 is n, and the page size is m. If q is the number of pages in the block, then n = m * q.
Here, assuming that a partial area in the page is a data management area and m = m1 + c, the effective data size as a block is eventually n1 = m1 * q.
The number of times of erasing the block is written in the part c.
Alternatively, the number of erasures may be written in a partial area of the first page of each block.

  Further, as described above, the timing for erasing data is set immediately before the data is written, and an area that always holds the erase count of the flash memory before the data is written (when the primary write candidate list is generated). When the data is written after erasure, the data counted up once is written at the same time.

  Next, details of each process shown in FIGS. 4 and 5 will be described with reference to FIGS.

  First, a procedure for creating a primary write candidate list by the all block data life expectancy management unit 34 will be described with reference to FIG.

In S700, the creation flow of the primary writing candidate list is started.
The start of this flow may be called at regular time intervals by the timer function or the like in the example of FIG. 5 in addition to the case where the write target data is generated as shown in FIG. The timing at which data is erased may be used.

Then, the all-block data life expectancy management unit 34 examines the data erase count of each block written in each block or the data erase count of each block written in the data erase count management table and puts it in the primary write candidate list. Among the blocks that are not included, the block with the smallest erase count is extracted and placed in the primary write candidate list (S701).
Next, the all block data life expectancy management unit 34 checks whether or not all the blocks are put in the primary write candidate list (S702), and if there is a block not in the primary write candidate list, the process returns to S701.
By repeating such operations in order, a primary write candidate list that can be selected in order from the block with the smallest erase count is created.
Finally, the process ends in S703.

In the example of FIG. 9, all the blocks of the flash memory are included in the primary write candidate list, but the blocks included in the primary write candidate list may be a part of the blocks.
For example, only ½ of all blocks in order from the block with the smallest erase count may be included in the primary write candidate list, or less than a certain erase count (for example, the guaranteed erase count is 100,000 Only a block of less than 10,000 times in one flash memory may be included in the primary write candidate list.

Next, with reference to FIG. 11, the extraction procedure of the primary write candidate list and the creation process of the secondary write candidate list by the all block data life expectancy management unit 34 will be described.
In S900, extraction of the primary writing candidate list and creation flow of the secondary writing candidate list are started.
First, the all block data life expectancy management unit 34 extracts a block with the smallest number of erasures from the primary write candidate list (S901).
Next, the all-block data life expectancy management unit 34 determines whether the extracted block is in use (whether data has been written) (S902). If not in use (NO in S902), the block is put in the secondary write candidate list (S907), and it is determined whether or not processing has been performed on all blocks in the primary write candidate list (S908). If the process is being performed on the block (YES in S908), the process is completed in S903. If there is a block that has not been processed, the process returns to S901 to continue the processing.

On the other hand, if it is in use in the determination in S902 (YES in S902), the all block data life expectancy management unit 34 determines whether there is a free page in the extracted block (S904).
If there is no empty page (NO in S904), this block is put in the secondary write candidate list (S907), and the process proceeds to S908.
If there is an empty page (YES in S904), the all-block data life expectancy management unit 34 acquires generation information of the page in use in this block (S905). Specifically, the all-block data life expectancy management unit 34 requests the page data generation management unit 35 that manages the block to calculate the generation of the page in use, and the page data generation management unit 35 generates a generation. Get information.
Details of generation calculation processing by the page data generation management unit 35 will be described later.
After acquiring the generation information from the page data generation management unit 35, the all-block data life expectancy management unit 34 determines whether all the generations of pages in use in the target block are new generations (S906). ).
If all the used pages are the new generation (YES in S906), this block is put in the secondary write candidate list (S907), and the process proceeds to S908.
On the other hand, if all the used pages are not the new generation, the process returns to S901, the next block is selected in the primary write candidate list, and the processing from S902 is repeated again.

  In this way, by removing blocks that are not in the new generation from all secondary pages from the secondary write candidate list, the write target data (new generation) is written to the block in which the old generation data is stored, and the new generation Data and old generation data are not mixed in one block.

In FIG. 11, the example in which the page generation is classified into two generations has been described. However, the page generation may be classified into three or more generations.
In the case of classification into three generations or more, for example, the block may be added to the secondary write candidate block only when all the pages in use are, or all the pages in use are the latest The block may be added to the secondary write candidate block only when it is the generation and the second newest generation.
In this case, the latest generation, or the newest generation and the second newest generation correspond to the new generation of FIG.

  Next, a generation calculation procedure by the page data generation management unit 35 will be described with reference to FIG.

Generation calculation by the page data generation management unit 35 starts at S600 when a request for generation calculation is received from the all block data life expectancy management unit 34, and the page data generation management unit 35 stores each page in use in that page. Get the date (write time) when the data is created. For example, if data is created in a file format, information that is usually added to the file information is used. If it is not a file but a simple character string or binary data, the data creation date is entered as one of its management information.
Date information may be entered from the clock function of the system, or may be specified or entered by the user.
Also, the date information at the time the page was created from the physical unit of the page to be written, not the logical unit of the file, is stored in the page management area on the flash memory or the table related to the page on the nonvolatile memory. In addition, date information in logical data units may be created therefrom.

Next, the page data generation management unit 35 calculates the data generation of the page in use (S602).
In the example of FIG. 8, the data is created and divided into three generations (short-lived generation, average generation, semi-permanent generation) within 24 hours, within one week, or more, and the page data generation management unit 35 The date acquired in S601 is compared with the current time to determine the generation for each page (S603). For example, the method of dividing e-mail is as described above, but the method of dividing the address book may be divided according to the application, such as within one week, within one month, or more. It doesn't matter.
In the above example, the generation is determined in units of days, but other time units, for example, seconds, minutes, hours, weeks, months, years, etc. may be used.
Moreover, it may be divided into generations other than three regardless of the example of FIG.
In addition, the generation may be determined using an elapsed time criterion for generation determination that is different for each application program in which data is used.

  Finally, the page data generation management unit 35 returns the calculation result of generation information to the all block data life expectancy management unit 34 that is the request source (S604), and the process ends in S605.

  Next, with reference to FIG. 10, the procedure of the secondary write candidate list extraction and write processing by the flash memory write / erase management unit 31 will be described.

After the secondary write candidate list is created by the procedure described with reference to FIG. 11, the flash memory write / erase management unit 31 extracts one candidate block in the order of the secondary write candidate list (S801).
Then, the flash memory write / erase management unit 31 determines whether this block is a currently used block, that is, whether data has been written (S802).
This determination may be made based on the management information in the block, or may be made based on table information on the nonvolatile memory 14.

If the block is not used (NO in S802), the flash memory write / erase management unit 31 writes data to the first page of the block (S803), and determines whether all the data has been written (S803). If all data has been written (YES in S807), the process ends in S804.
If writing of all data has not been completed (NO in S807), the same flow is repeated again from S801.

On the other hand, if the block is being used in the determination in S802 (YES in S802), the flash memory write / erase management unit 31 determines whether or not there is an empty page (a page in which no data is written) in the block. Judgment is made (S805).
If there is a free page (YES in S805), the flash memory write / erase management unit 31 writes data in the free page (S806), and proceeds to S807.

On the other hand, if it is determined in S805 that there is no empty page (NO in S805), the flash memory write / erase management unit 31 reads all the data of the block and temporarily writes the read data to the nonvolatile memory 14. All data of the block is saved in the nonvolatile memory 14 (S808).
Next, the flash memory write / erase management unit 31 erases the data saved in the non-volatile memory 14 and writes the write target data in the block after data erase (S809).
Next, the flash memory write / erase management unit 31 sets the data saved in the nonvolatile memory 14 as write target data (S810), and proceeds to S801.
Here, the writing of the first saved data is completed, and then the remaining writing target data writing process is started. In other words, the saved data is preferentially written over the other write target data.
As described above, the operation is repeated as long as the block of the used area appears, and the process ends when the unused area comes out last.

  Next, with reference to FIG. 12, the procedure of the process of transferring the data temporarily saved in the nonvolatile memory 14 to another block and writing it will be described.

  When the data is temporarily saved in the nonvolatile memory 14 by the flash memory write / erase management unit 31, the all block data life expectancy management unit 34 creates a transfer destination candidate list (S1201).

The transfer destination candidate list is a list of blocks that are candidates for storage destinations of data temporarily saved in the non-volatile memory 14, and is a list in which blocks that are equal to or greater than a specific erase count are arranged in ascending order of erase count. is there. For example, in a flash memory with a guaranteed erase count of 100,000, blocks with an erase count of 50,000 or more are arranged in ascending order of erase count.
As described above, since a block with a large number of data erasures is positioned rearward in the primary write candidate list and the secondary write candidate list, there is little possibility of being a write destination of write target data. Data saved in the non-volatile memory 14 is data stored in a block having no empty page, and is regarded as data with a low possibility of fluctuation (update), and data with a low possibility of being a write destination of data to be written Transfer to a block with a large number of erasures to suppress data fluctuation (data erasure) in the transfer destination block. As a result, the number of data erasures between blocks can be equalized.

For example, when all the blocks of the flash memory 13 are included in the primary write candidate list (FIG. 9), the all block data life expectancy management unit 34 (for example, 50,000 blocks) more than a specific number of times in the primary write candidate list. It is possible to take out a block of more than the number of times and make a transfer destination candidate list.
When the blocks included in the primary write candidate list are only blocks with a small number of erasures (for example, less than 10,000 times), the all block data life expectancy management unit 34 performs the same procedure as in FIG. A transfer destination candidate list can be generated by extracting blocks whose erase count is greater than or equal to a specific count in ascending order of erase count.
The all block data life expectancy management unit 34 can also set an upper limit of the number of times of erasing blocks to be included in the transfer destination candidate list. For example, in a flash memory having a guaranteed erase count of 100,000 times, it is possible to target only blocks having an erase count of 50,000 times or more and less than 70,000 times.

After the transfer destination candidate list is created, the flash memory write / erase management unit 31 extracts one candidate block in the order of the transfer destination candidate list (S1201).
Then, the flash memory write / erase management unit 31 determines whether this block is a currently used block, that is, whether data has been written (S1203).
This determination may be made based on the management information in the block, or may be made based on table information on the nonvolatile memory 14.

If the block is not used (NO in S1203), the flash memory write / erase management unit 31 writes the saved data to the first page of the block (S803) and determines whether all the data has been written. If all the data has been written (YES in S1207), the saved data on the nonvolatile memory 14 is erased.
On the other hand, if the writing of all data has not been completed (NO in S1207), the same flow is repeated again from S1202.

On the other hand, if the block is in use in the determination in S1203 (YES in S1203), the flash memory write / erase management unit 31 determines whether or not there is an empty page (a page in which no data is written) in the block. Judgment is made (S1205).
If there is an empty page (YES in S1205), the flash memory write / erase management unit 31 writes data to the empty page (S1206), and the process proceeds to S1207.

  On the other hand, if it is determined in S1205 that there is no empty page (NO in S1205), the flash memory write / erase management unit 31 returns to S1202, extracts the next candidate block in the transfer destination candidate list, and performs the processing from S1203 onward. repeat.

  If other write target data exists after the transfer of the saved data is completed as described above, the flash memory write / erase management unit 31 performs the process shown in FIG. 10 on the remaining write target data. I do.

  The flash memory write / erase management unit 31 may write the write time of the write target data to the write destination page when writing the write target data. Further, the page data generation management unit 35 may classify generations according to the elapsed time from the write time written in the page by the flash memory write / erase management unit 31 in this way.

Next, a procedure for managing the number of data erasures will be described with reference to FIG.
For convenience of explanation, a part of FIG. 6 shows a process that overlaps the process shown in FIG. 10, but this is a result of capturing the same process from different aspects. There is no contradiction with the process of 10.

First, the flash memory write / erase management unit 31 acquires a write candidate page of write target data (S401).
For example, if the write destination block is unused as shown in S803 of FIG. 10 or S1204 of FIG. 12, the head data of the block becomes the page of the write candidate, and S806 of FIG. As shown in S1206 of FIG. 12, if the write destination block has been used, a free page becomes a write candidate page.

Next, when a write candidate page is found, the flash memory write / erase management unit 31 checks whether the page is the first page in the block (S402).
If it is the first page, it is further checked whether or not the current writing is the first writing for the block (S403). For example, as shown in S809 in FIG. 10, when a block in which data temporarily saved in the nonvolatile memory is stored becomes a write destination block, the first page becomes a write candidate page. In this case, the current write is not the first write for the block.
This check may be determined from the initial state of the flash memory. For example, if it cannot be determined, initialization may be performed first and the initial value of the number of erases of the flash memory may be set to -1.

  In the case of the first writing and the first page (YES in both S402 and S403), the flash memory write / erase management unit 31 writes data in order from the first page, and the block life expectancy management unit 33 corresponding to the block stores the management area. 0 is written in a place indicating the number of times of erasure (S404), and the process ends in S405.

If the page is not the first page in the determination in S403 (that is, if the block has been written in the past) (NO in S403) or if it cannot be determined and has been initialized, The corresponding block life management unit 33 reads the number of erasures of the first page (S407), and the flash memory write / erase management unit 31 erases the data of the block (S408).
Then, the flash memory write / erase management unit 31 writes data in order from the first page, and the block remaining life management unit 33 corresponding to the block adds a value obtained by adding 1 to the number of erases read into the management area of the first page of the block. Write (S409), and the process ends in S405.

  On the other hand, if it is determined in S402 that the candidate page for writing is a page that is not the head of the block (YES in S402), it is not the first writing in the block, so there is no need to erase the data (thus erasing). The flash memory write / erase management unit 31 normally writes data (S406), and the data write ends in S405.

  Here, it is judged whether it is the first writing in the block depending on whether it is the first page of the block, but here it is because it is assumed that pages are used in order in the block, If not, it is determined whether it is the first page used in the block.

  When writing is not performed in the order of page arrangement, for example, a 1-bit flag indicating whether the page is used for the management area in each page is prepared for the first page to be written in the block. Thus, a method of determining the page to be written first is conceivable.

  Next, referring to FIG. 7, in a situation where the block life expectancy management unit 33 holds a table for counting the number of block erases in the nonvolatile memory 14, the all block data life expectancy management unit 34 performs the entire system. An example of managing life expectancy will be described.

As a premise, it is assumed that the block life management unit 33 holds a data erase count management table in the nonvolatile memory 14 for counting the data erase count of the corresponding block.
Further, the all block data life management unit 34 integrates the data erase times shown in the data erase number management table managed by each block life management unit 33 to integrate the data erase times of all blocks included in the flash memory 13. Has an integrated data erasure count management table.
Further, it is assumed that the number of data erasures is stored in the management area in the block according to the flow of FIG.
This has the advantage that the number of data erases in the block of the flash memory can be used when the contents of the nonvolatile memory disappear due to discharge or the like, but if the discharge is not a concern, the flash memory management in the flow of FIG. It is not necessary to store the erase count in the area.

In FIG. 7, the process starts at S500.
For example, when the block life expectancy management unit 33 manages the erase count for each block in a data erase count management table called a block number and erase count pair, the erase count is set based on the block number. The number of times of erasure of the corresponding block is acquired using the table search as obtained (S501).
The table is placed on the non-volatile memory 14, information of each block is managed by the block life expectancy management unit 33 as each element of the table, and the entire table is managed by the all block data life expectancy management unit 34.

Next, the all block data remaining life management unit 34 determines whether or not the number of data erasures is also managed on the flash memory 13 (S502), and if the system does not hold the data erasure times in the management area in the flash memory 13. For example, the process proceeds to S503, where the data erase count of a specific block in the integrated data erase count management table is updated to the data erase count shown in the corresponding data erase count management table (S503), and the process ends in S504.
If the flash memory 13 is configured to store the number of data erases in the management area, the all block data life expectancy management unit 34 uses the number of data erases in the data erase number management table in the nonvolatile memory 14 and the number of data erases in the flash memory 13. Are matched (S505). If they are matched (YES in S505), the processing from step 503 is performed.
If they do not match (NO in S505), it is assumed that there is a failure such as the power being turned off for some reason immediately after updating the flash memory, so the contents of the integrated data erasure count management table are stored on the flash memory. The data erase count is corrected, and the process ends in S504.

  In this way, by matching the data erase count stored in each block of the flash memory and managing the data erase count with a table on the memory other than the flash memory, when searching for the data erase count (less frequent) High-speed processing can be performed at the time of rearranging the order.

  As described above, in the flash memory management device according to the present embodiment, the block life expectancy management unit that manages the number of erases for each block, the all block data life expectancy management unit that manages the entire block, and the data generation management A data generation management unit that manages the generation of data on each page and a page data generation management unit that manages the generation of data on each page. There is an effect that writing of data on the top is distributed, and as a result, the lifetime of the flash memory is extended.

In other words, it is considered that data with a short elapsed time after generation is likely to be updated frequently, so it is stored in a block with a small number of data erasures, and data with a long elapsed time is less likely to be updated thereafter. Since it is conceivable, the data is stored in a block having a large number of data erases.
As a result, data with a high possibility of data erasure can be distributed to blocks with a small number of data erasures that have a margin up to the upper limit of the number of data erasures. As a result, the number of data erasures between blocks can be made uniform, and the life of the flash memory can be extended.

  In addition, by changing the reference of the elapsed time of generation calculation for each application, it is possible to classify the optimum data according to the characteristics of the application, and there is an effect that the life of the flash memory is also prolonged.

Embodiment 2. FIG.
In the first embodiment, an example is described in which control is performed so that newly written data is written in order from the block with the smallest number of data erasures. However, in the present embodiment, data with an elapsed time from writing over a certain time (old generation) An example of transferring data to a block with a large number of data erasures will be described.

  A hardware configuration example and a software configuration example of the flash memory management device 100 according to the present embodiment are the same as those described in the first embodiment.

13 and 14 are flowcharts showing an operation example of the flash memory management device 100 according to the present embodiment.
FIG. 13 shows a process of selecting a transfer target block including transfer target data to be transferred.
FIG. 14 shows a process of deleting the transfer target data from the transfer target block and transferring the transfer target data to the transfer destination.

First, the process of FIG. 13 will be described.
As a premise, it is assumed that the primary writing candidate list has been generated prior to the designation of the transfer target block.
The primary write candidate list generation process itself is as shown in FIG.
The primary write candidate list may be generated after the write target data is generated as shown in FIG. 4 or may be generated when the write target data is not generated as shown in FIG. The primary write candidate list used in 1 may be generated by either flow of FIG. 4 and FIG.
In addition, although the designation of the transfer target block in FIG. 13 is independent of the generation of the secondary writing candidate list, the designation of the transfer target block and the generation of the secondary writing candidate list may be performed simultaneously.

In FIG. 13, operations other than S1300 to S1302 are the same as the operations with the same reference numerals shown in FIG.
First, in S1300, a transfer target block designation flow starts.
Then, the all block data life expectancy management unit 34 extracts a block with the smallest number of erasures from the primary write candidate list (S901).
Next, the all-block data life expectancy management unit 34 determines whether the extracted block is in use (whether data has been written) (S902). If not in use (NO in S902), it is determined whether or not processing has been performed on all blocks in the primary write candidate list (S908). If processing has been performed on all blocks (YES in S908). ), The process is completed in S1302. If there is a block that has not been processed, the process returns to S901 to continue the processing.

On the other hand, if it is in use in the determination of S902 (YES in S902), the all block data life management unit 34 acquires generation information of the page in use in this block (S905). Specifically, the all-block data life expectancy management unit 34 requests the page data generation management unit 35 that manages the block to calculate the generation of the page in use, and the page data generation management unit 35 generates a generation. Get information.
The generation calculation processing by the page data generation management unit 35 is as shown in FIG.
After acquiring the generation information from the page data generation management unit 35, the all-block data life expectancy management unit 34 determines whether all the generations of pages in use in the target block are new generations (S906). ).
If all the used pages are the new generation (YES in S906), the process proceeds to S908.
On the other hand, if all the used pages are not the new generation, the all block data life management unit 34 designates the block as a transfer target block (S1301).
The case where all the used pages are not the new generation is a case where all the used pages are the old generation and a case where the pages of the old and new generations exist in one block.
The all block data life expectancy management unit 34 designates the block number of the transfer target block and the generation information indicating the generation of each page in use included in the transfer target block in a register, a buffer memory, etc. Store. Each process shown in FIG. 14 is performed using the block number and generation information of the transfer target block stored in a register, a buffer memory, or the like.
After designating the transfer target block, the process proceeds to S908.

Although FIG. 13 illustrates an example in which the page generation is classified into two generations, it may be classified into three or more generations.
If the pages are classified into three or more generations, for example, if all of the pages in use are not the latest generation, they may be made the transfer target block, or all of the pages in use are the latest generation or the second generation. If it is not a new generation, it may be a transfer target block.
In this case, the latest generation, or the newest generation and the second newest generation correspond to the new generation of FIG.

Next, in FIG. 14, the data transfer flow starts in S1400.
First, the flash memory write / erase management unit 31 saves the transfer target data written in the transfer target block to the nonvolatile memory 14 (S1401).
Next, the flash memory write / erase management unit 31 erases the transfer target data of the transfer target block after the data is saved (S1402).
Next, the block life management unit 33 that manages the transfer target block increments the data erasure count of the transfer target block, and writes the new data erasure count in the management area of the block (S1403).
Next, the flash memory write / erase management unit 31 determines the generation of the saved data (transfer target data), and performs the processing from S801 in FIG. 10 on the new generation data (S1404). That is, the new generation data is transferred to a block (a block with a small number of data erasures) whose number of data erasures is less than a predetermined number (for example, less than 10,000 times) according to the secondary write candidate list.
For data other than the new generation, the processing after S1201 in FIG. 12 is performed (S1405). That is, data other than the new generation is transferred to a block (a block with a large number of data erasures) having a data erasure count of a predetermined number or more (for example, 50,000 times or more) according to the transfer destination candidate list.
After the processes of S1404 and S1405, the data transfer process is terminated (S1406).
When the save data (transfer target data) is only data other than the new generation, only the processing of S1405 is performed.

  If the secondary write candidate list has not been created in the execution stage of S1404, the all block data life expectancy management unit 34 generates the secondary write candidate list according to the flow of FIG. Process.

  Through the above processing, common generation data is stored in the same block. That is, the new generation data is preferentially stored in a block with a small number of data erases, and the old generation data is preferentially stored in a block with a large number of data erases.

In the above description, all blocks of the flash memory are shown in the primary write candidate list in the order of the number of data erases, and it is determined whether or not all blocks are to be transferred in the order of the primary write candidate list. It was decided to do.
In this regard, for example, only ½ of all blocks in order from the block with the smallest number of erasures are included in the primary write candidate list, or less than a certain number of erasures (for example, the guaranteed number of erasures is 100,000). (Less than 10,000 times in the flash memory of the flash memory) is included in the primary write candidate list, and when these erased blocks contain pages of generations other than the new generation, they are designated as transfer target blocks. You may make it do.
Then, according to the flow of FIG. 14, the new generation data of the blocks to be transferred is a block whose data erase count is less than a predetermined number (for example, less than 10,000 times) according to the secondary write candidate list (block with a small data erase count). (S1404), and the old generation data is transferred to a block (a block with a large number of data erasures) having a number of data erasures of a predetermined number or more (for example, 50,000 times or more) according to the transfer destination candidate list.
Alternatively, all the data (including new generation data) of the transfer target block is the target of the processing in S1405, and all the data of the transfer target block has a data erasure count of a predetermined number or more according to the transfer destination candidate list. It may be transferred to a block (for example, a block having a large number of data erasures) (for example, 50,000 times or more).

As described above, according to the present embodiment, for the written data written in the flash memory, the optimum block is selected and selected from the relationship between the elapsed time since data generation and the number of data erases for each block. By transferring written data to the block, the lifetime of the flash memory can be extended.
In other words, by data transfer, data that has not passed much time since data generation is transferred to a block with a small number of data erasures, and data that has passed a certain time since data generation is transferred to a block with a large number of data erasures. The data of the same generation can be concentrated, and it is less likely that a part of the data is erased or left in the block, thereby prolonging the life of the flash memory.

  As described above, in the first and second embodiments, data can be written in units of pages, and in a flash memory device that can be erased in units of blocks with a plurality of pages as blocks, the data is erased after being created. The data generation management unit that manages generation information as an index for calculating the remaining life of each data, and the block life determined by the number of data erases for each block A block life management unit for managing the life expectancy as a count, an all block data life management unit for managing the number of times data is erased for all blocks, a page data generation management unit for managing the time since the creation of each page of data, and A flash memory write / erase tube for determining the optimum write block and page based on the information of each part. It has been described flash memory management apparatus comprising a part.

  In the first and second embodiments, the block life expectancy management unit manages the erase count of block data by writing the erase count to a part of the block every time data is erased. explained.

  Further, in the first and second embodiments, the flash memory management device can obtain the erase count of all blocks from the information of the erase count partially written in the block in the all block data life expectancy management section of the flash memory management device. Explained.

  In the first and second embodiments, the block life expectancy management unit includes a memory storage device that can store information in a nonvolatile manner other than at least the flash memory, and each time block data is erased in the memory storage device A flash memory management device that manages the number of times block data has been erased by writing data has been described.

  In the first and second embodiments, the all block data life expectancy management unit holds the number of erasures of all blocks in a table, and can know where the number of rewrites is small and the minimum number of times is. A flash memory management device has been described.

  In the first and second embodiments, the data generation management unit manages the generation information as an index indicating the progress from the date when the data was created to the current time and the generation calculation for calculating the generation. A flash memory management device having functions has been described.

  In the first and second embodiments, in the data generation management unit, the generation information is the number of days, and the generation information that indicates the number of days from the date / time information is the generation that has a large number of days, that is, the generation information that has a large generation information. The flash memory management device to be replaced with has been described.

  Also, in the first and second embodiments, the generation information is based on the number of days, and the flash memory management device that calculates and distinguishes the data immediately after the data is created, the data that is short-term, and the data that is long-term explained.

  In the first and second embodiments, the page data life management unit simultaneously writes information when writing information in a page in order to manage information on the time since the page was written as elapsed time or days. A flash memory management device for writing information has been described.

  In the first and second embodiments, in the page data generation management unit, a flash memory that manages information on the time since the page was written as progress information in a table on a nonvolatile memory other than the flash memory device The management device has been described.

  In the first and second embodiments, when the flash memory write / erase management unit performs writing including data rewriting, the flash memory management unit has means for writing data from the write candidate block whose priority is determined. The apparatus has been described.

  In the first and second embodiments, in the means for writing data from the write candidate block, a write / erase candidate block is listed as a list at the time of writing or erasing at a constant interval, and the list is sequentially used from this list. A flash memory management device has been described.

  In the first and second embodiments, the flash memory write / erase management unit, when data is erased, puts the block in a write candidate block and makes the candidate in the order of decreasing number of erase times. explained.

  In the first and second embodiments, the flash memory management unit for writing data by selecting candidates from the write candidate blocks when writing data in the flash memory write / erase management unit has been described.

  In the first and second embodiments, when the flash memory write / erase management unit rewrites data, all pages in the block are read, and the same generation of data is the same based on the information of the page data life management unit. A flash memory management device has been described in which blocks are used so as to be on the blocks, and if necessary, the data of one block can be divided into a plurality of blocks.

  In the first and second embodiments, the flash memory write / erase management unit reads and rewrites block data so that the generations of data in the block are the same at a fixed interval or at a specific timing. The apparatus has been described.

  In the first and second embodiments, the flash memory management device has been described in which the flash memory write / erase management unit sets the data read / write timing as a specific timing.

  In the present embodiment, the flash memory write / erase management unit has been described with respect to a flash memory management device that replaces blocks in order to avoid a decrease in the number of times of erasure only for blocks of the same generation.

  Further, in the first and second embodiments, the flash memory management device has been described in which the flash memory write / erase management unit uses a block with a smaller number of erasures obtained from the block life management unit in order periodically as a replacement candidate block.

  In the first and second embodiments, in the flash memory write / erase management unit, block replacement is performed by selecting the block with the highest erase count at the end of the write candidate block and writing to that block, and the erased block is the write candidate. The flash memory management device to be put in the block has been described.

FIG. 3 is a diagram illustrating a hardware configuration example of the flash memory management device according to the first embodiment. FIG. 3 is a diagram illustrating an example of a block configuration and a page configuration of the flash memory according to the first embodiment. FIG. 3 is a diagram showing a software configuration example of the flash memory management device according to the first embodiment. FIG. 3 is a flowchart showing an example of the overall operation of the flash memory management device according to the first embodiment. FIG. 3 is a flowchart showing an example of the overall operation of the flash memory management device according to the first embodiment. FIG. 3 is a flowchart showing an example of data write processing of the flash memory management device according to the first embodiment. FIG. 3 is a flowchart showing an example of erase count management processing of the flash memory management device according to the first embodiment. FIG. 3 is a flowchart showing an example of data generation information acquisition processing of the flash memory management device according to the first embodiment. FIG. 4 is a flowchart showing an example of a primary write candidate list creation process of the flash memory management device according to the first embodiment. FIG. 4 is a flowchart showing an example of secondary write candidate list extraction processing of the flash memory management device according to the first embodiment. FIG. 5 is a flowchart showing an example of a primary write candidate list extraction process of the flash memory management device according to the first embodiment. FIG. 3 is a flowchart showing an example of data transfer processing of the flash memory management device according to the first embodiment. FIG. 9 is a flowchart showing an example of transfer target block designation processing of the flash memory management device according to the second embodiment. FIG. 9 is a flowchart showing an example of data transfer processing of the flash memory management device according to the second embodiment. The figure which shows the concept of the block management by the flash memory management apparatus which concerns on Embodiment 1,2.

Explanation of symbols

  11 CPU, 12 Program storage memory, 13 Flash memory, 14 Non-volatile memory, 15 Execution RAM, 16 buses, 21 blocks, 22 pages, 31 Flash memory write / erase management unit, 32 All data generation management unit, 33 block life expectancy Management unit, 34 All block data life management unit, 35 Page data generation management unit, 100 Flash memory management device.

Claims (19)

  1. A flash memory management device that manages a flash memory having a plurality of blocks that perform data writing in units of pages and erase data in units of blocks composed of a plurality of pages,
    For each block, a data erasure count management unit that manages the number of data erasures in the block,
    For each page, a page elapsed time management unit that manages an elapsed time from the writing time of data written to the page;
    Based on the number of data erases in each block and the elapsed time from the data write time of each page, one or more blocks out of the plurality of blocks are written candidate write target candidates for write target data A block selector to select as a block;
    A flash memory management device comprising: a data writing unit for writing write target data to any of the write target candidate blocks selected by the block selection unit.
  2. The page elapsed time management unit
    Classify the written page where data is written into one of multiple groups according to the elapsed time from the write time of the data written to the written page,
    The block selection unit
    One or more blocks are selected as write target candidate blocks from the plurality of blocks based on the number of data erases in each block and a group classification result for each written page by the page elapsed time management unit. The flash memory management device according to claim 1.
  3. The block selection unit
    Extracting in order from the block with the smallest number of data erasures among the plurality of blocks,
    3. The flash memory management device according to claim 2, wherein when the written page included in the extracted block is classified into a group having a short elapsed time, the extracted block is selected as a write target candidate block. .
  4. The block selection unit
    Extracting in order from the block with the smallest number of data erasures among the plurality of blocks,
    When data is not written in the extracted block, select the extracted block as a candidate block to be written,
    If data has already been written to the extracted block, determine whether there is a free page that has not been written to the extracted block,
    If there is no empty page, select the extracted block as a candidate block for writing,
    If there are free pages, determine which group the written pages contained in the extracted block are classified into,
    4. The flash memory management device according to claim 3, wherein when the written page is classified into a group having a short elapsed time, the extracted block is selected as a write target candidate block.
  5. The block selection unit
    When there is a free page in the extracted block, determine which group the written page contained in the extracted block is classified into,
    5. The flash according to claim 4, wherein when all written pages included in the extracted block are classified into a group having a short elapsed time, the extracted block is selected as a candidate block to be written. Memory management device.
  6. The flash memory management device
    Manage other memory than the flash memory,
    The data writing unit
    Of the candidate blocks to be written selected by the block selector, sequentially extract from the block with the smallest number of data erase,
    When data is not written in the extracted writing target candidate block, the writing target data is written in the extracted writing target candidate block,
    When data has already been written to the extracted candidate block to be written, it is determined whether or not there is a free page in which data has not been written to the extracted candidate block to be written,
    When there is a free page, write the write target data to the free page of the extracted write target candidate block,
    When there is no empty page, save the data written in the extracted candidate block to be written to the other memory,
    6. The flash memory management device according to claim 1, wherein the data saved in the other memory is erased from the write candidate block and the write target data is written.
  7. The data writing unit
    The data saved in the other memory is set as write target data,
    7. The flash memory management device according to claim 6, wherein the data saved in the other memory is written into a block whose number of data erasures is equal to or greater than a specific number.
  8. The data writing unit
    8. The flash memory management device according to claim 7, wherein the data saved in the other memory is written to a block whose number of data erasures is equal to or greater than a specific number in preference to other data to be written.
  9. The page elapsed time management unit
    Classify the written page where data is written into one of multiple groups according to the elapsed time from the write time of the data written to the written page,
    The block selection unit
    Extract one or more blocks whose number of data erasures is less than a specific number, and if the written page included in the extracted block is not classified into a group with a short elapsed time, the extracted block is used as a data transfer target block Selected,
    The data writing unit
    The transfer target data written in the data transfer target block selected by the block selection unit is written in any block whose number of data erasures is equal to or more than the specific number, and the transfer target data is written in the data transfer target 9. The flash memory management device according to claim 1, wherein the flash memory management device is erased from the block.
  10. The block selection unit
    Select one or more blocks whose data erase count is more than the specified number as a transfer destination candidate block,
    The data writing unit
    Extract the transfer destination candidate blocks selected by the block selection unit in a predetermined order,
    When data is not written in the extracted transfer destination candidate block, the transfer target data is written in the extracted transfer destination candidate block,
    When data is already written in the extracted transfer destination candidate block, it is determined whether or not there is an empty page in which data is not written in the extracted transfer destination candidate block.
    If there is a free page, write the transfer target data to the free page of the extracted transfer destination candidate block,
    10. The flash memory management device according to claim 9, wherein when there is no empty page, the next transfer destination candidate block is extracted.
  11. The page elapsed time management unit
    Classify the written page where data is written into one of multiple groups according to the elapsed time from the write time of the data written to the written page,
    The block selection unit
    For each written page, for each written page, it is determined to which group the written page is classified by the page elapsed time management unit, and there are two or more pages classified into different groups in the same block. If it exists, select the block as a data transfer target block, and select at least one block as a transfer destination candidate block as a transfer destination of the transfer target data written in the data transfer target block,
    The data writing unit
    9. The flash memory according to claim 1, wherein the transfer target data is written in any transfer destination candidate block, and the transfer target data is erased from the data transfer target block which is a transfer source. Management device.
  12. The block selection unit
    For the transfer target page written on the page classified into the group with a short elapsed time, select a block with a small number of data erases as the transfer destination candidate block,
    12. The transfer destination candidate block is preferentially selected as a transfer destination candidate block with respect to a transfer target page written on a page classified into a group having a long elapsed time. The flash memory management device described.
  13. The block selection unit
    13. The flash memory management device according to claim 11, wherein the transfer destination candidate block is selected so that data written in two or more pages belonging to a common group is stored in the same block.
  14. The data erasure count management unit
    Each time data is erased in any block, the data erase count is written to the block from which data was erased, and the data erase count is stored in the flash memory for each block, thereby managing the data erase count for each block. The flash memory management device according to claim 1, wherein:
  15. The flash memory management device
    Manage other memory than the flash memory,
    The data erasure count management unit
    A data erasure count management table indicating the number of times data is erased for each block is stored in the other memory, and each time data is erased in any block, the data erase count of the block from which data has been erased is erased. 15. The flash memory management device according to claim 1, wherein the number of times of data erasure for each block is managed by writing to the number of times management table.
  16. The page elapsed time management unit
    3. The written page is classified into one of a plurality of groups by using an elapsed time criterion that is different for each application program in which data written on the written page is used. Flash memory management device.
  17. The data writing unit
    When writing the write target data, in addition, write the write time of the write target data to the write destination page,
    The page elapsed time management unit
    3. The flash memory management device according to claim 2, wherein the written page is classified into one of a plurality of groups according to an elapsed time from a writing time written in the written page.
  18. A flash memory management method for managing a flash memory having a plurality of blocks in which data is written in units of pages and data is erased in units of blocks composed of a plurality of pages,
    For each block, a data erase count management step for managing the data erase count in the block,
    For each page, a page elapsed time management step for managing the elapsed time from the writing time of data written to the page;
    Based on the number of data erases in each block and the elapsed time from the data write time of each page, one or more blocks out of the plurality of blocks are written candidate write target candidates for write target data A block selection step to select as a block;
    A flash memory management method comprising: a data write step of writing write target data to any of the write target candidate blocks selected in the block selection step.
  19. In a flash memory management device that manages a flash memory having a plurality of blocks that perform data writing in page units and erase data in block units composed of a plurality of pages.
    For each block, a data erasure count management process for managing the data erasure count in the block,
    For each page, a page elapsed time management process for managing the elapsed time from the writing time of data written to the page,
    Based on the number of data erases in each block and the elapsed time from the data write time of each page, one or more blocks out of the plurality of blocks are written candidate write target candidates for write target data Block selection processing to select as a block;
    A program for executing data write processing for writing write target data to any of the write target candidate blocks selected by the block selection processing.
JP2007258209A 2007-10-02 2007-10-02 Flash memory management device, flash memory management method, and program Expired - Fee Related JP5164506B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007258209A JP5164506B2 (en) 2007-10-02 2007-10-02 Flash memory management device, flash memory management method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007258209A JP5164506B2 (en) 2007-10-02 2007-10-02 Flash memory management device, flash memory management method, and program

Publications (2)

Publication Number Publication Date
JP2009087173A JP2009087173A (en) 2009-04-23
JP5164506B2 true JP5164506B2 (en) 2013-03-21

Family

ID=40660491

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007258209A Expired - Fee Related JP5164506B2 (en) 2007-10-02 2007-10-02 Flash memory management device, flash memory management method, and program

Country Status (1)

Country Link
JP (1) JP5164506B2 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011227802A (en) * 2010-04-22 2011-11-10 Funai Electric Co Ltd Data recording device
US9477590B2 (en) * 2011-09-16 2016-10-25 Apple Inc. Weave sequence counter for non-volatile memory systems
KR20150107401A (en) 2014-03-14 2015-09-23 삼성전자주식회사 Storage device and table management method thereof
KR20160077343A (en) 2014-12-22 2016-07-04 삼성전자주식회사 Storage device and method for operating storage device

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11259370A (en) * 1998-03-06 1999-09-24 Mitsubishi Electric Corp Data writing device and method therefor
JP4019306B2 (en) * 2001-11-08 2007-12-12 株式会社Ihi Recording method to EEPROM
JP2004151944A (en) * 2002-10-30 2004-05-27 Denso Corp Method for writing data in non-volatile storage device, its program and device, and onboard electronic controller

Also Published As

Publication number Publication date
JP2009087173A (en) 2009-04-23

Similar Documents

Publication Publication Date Title
EP1818829B1 (en) Apparatus for collecting garbage block of nonvolatile memory according to power state and method of collecting the same
TWI354996B (en) Wear leveling method and controller thereof
US6871259B2 (en) File system including non-volatile semiconductor memory device having a plurality of banks
KR100578143B1 (en) Storage system with scheme capable of invalidating data stored in buffer memory and computing system including the same
US7363421B2 (en) Optimizing write/erase operations in memory devices
US7844772B2 (en) Device driver including a flash memory file system and method thereof and a flash memory device and method thereof
WO2011033582A1 (en) Storage system for eliminating duplicated data
EP2423819A1 (en) Memory mapping techniques
US20110289266A1 (en) Garbage collection in storage devices based on flash memories
US8099545B2 (en) Wear leveling in storage devices based on flash memories and related circuit, system, and method
KR20100017094A (en) A method for efficient storage of metadata in flash memory
US7562202B2 (en) Systems, methods, computer readable medium and apparatus for memory management using NVRAM
JP2005196736A (en) Address mapping method of flash memory, mapping information management method, and flash memory using same methods
US8140746B2 (en) Intelligent memory data management
JP4812192B2 (en) Flash memory device and method for merging data stored therein
JP5970645B2 (en) Increasing spare area in memory to extend memory life
TWI359360B (en)
EP1923792A1 (en) Apparatus and method of managing nonvolatile memory
JP4122972B2 (en) Data recording apparatus and data writing method for flash memory
DE102011018558A1 (en) Method for data storage in a memory
KR100975825B1 (en) Memory device, Memory system, and Memory method
JP2013532853A (en) Storage apparatus and data control method
KR20090002839A (en) Indexing scheme for flash memory
WO2004001605A1 (en) Memory device, memory managing method and program
JP4766240B2 (en) File management method, apparatus, and program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20100908

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20120907

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20120911

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20120924

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20121120

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20121218

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20151228

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees