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
良三 清原
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric Corp
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 Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
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
Expired - Fee Related legal-status Critical Current
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).

情報処理の記憶装置の一つとしてフラッシュメモリ装置があり、携帯電話などの組み込み型の装置に使われている。
このフラッシュメモリは例えば文献「メモリICの実践活用法」(▲くわ▼野雅彦:CQ出版株式会社)に開示されているように、ブロックという単位で消去し、ページという単位で書込みを行うことを特徴としている。
ブロックはページが複数集まった単位であり、消去の回数に保証できる限界があることが特徴である。
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.

この消去の回数の限界を気にせずにメモリを利用し、メモリの消去回数に偏りがあると、利用できなくなる領域が出てくるという問題がある。
これらの問題を解決するために例えば特開平6−124596号公報や特開平8−273390号公報ではブロックごとの消去回数管理テーブルを設け、一定の回数を超えたブロックへの書込み時には、別の最小の消去回数のブロックへの書込みに変えるという手法をとり、各ブロックの消去回数の均質化を図るという解決策をとっている。
しかしながら、ブロック内のページのデータの特徴に触れていず、ブロックの一部でも書き換えが必要なら全部書き換えるということになりかねないという課題がある。
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.

また、特開平10−091535号公報では、消去最大回数のブロックを一定のタイミングで最小消去回数のブロックと入れ替える方法が開示されている。
しかし、これも前記と同様にページ内のデータの特徴に触れていず、ブロックの一部でも書き換えが必要なら全部書き換えるということになりかねないという課題がある。
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.

また、特開2002−8379号公報では書き換え時の書き換えデータの量によって実際に書き換えるのか修正領域に書き込むのかを分けており、ページ内のデータの特性を考慮したまとめ処理の概念が開示されているが、処理をまとめて行うというだけであり、本質的な解決にはなっていない。   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.

特開2001−318829号公報は、フラッシュROM(Read Only Memory)のアクセス速度を高速にするためのキャッシュ方式に関するものである。
キャッシュしたときにはフラッシュROMから削除しておくことにより、書き換え発生時の時間を短縮することができる技術に関して開示している。
しかし、本方式では給電状態ではなくなった場合のことが考慮されておらず現実に利用することが困難である。
時間管理は行っているが、一定時間内でのアクセスの回数でキャッシュを消すかどうかという判定に利用しているに過ぎない。
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.

特開2000−20252号公報では、書き換え頻度の高い部分を移動することによりアクセスの均等化を図ろうという技術が開示されている。   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.

特開2002−318729号公報では、消去ブロックをより小さな単位で管理し、一部の劣化部分を避けて使うような方式において、このような状態になってから一定時間たったものは優先的に再構成するという技術が開示されている。
特開平6−124596号公報 特開平8−273390号公報 特開平10−091535号公報 特開2002−8379号公報 特開2001−318829号公報 特開2000−20252号公報 特開2002−318729号公報
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.

実施の形態1.
本実施の形態では、データが将来書き換えられる可能性に着目した世代という考え方を導入し、世代の古いデータほどより長く生きる可能性が高いという性質を利用してブロック単位でのデータの消去の可能性を低くし、消去回数も均質化し、処理そのものも実行を分散することによりユーザの感じる処理時間をも短くする。
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.

図1は、本実施の形態に係るフラッシュメモリ管理装置100のハードウェア構成例を示す。フラッシュメモリ管理装置100は、例えば、携帯電話機、PHS(Personal Handy−phone System)(登録商標)端末、PDA(Personal Digital Assistant)(登録商標)端末等の情報処理機器に搭載される。   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.

図1において、11は、様々な命令を実行するためのCPU(Central Processing Unit)である。
12は、CPUが何をするべきかを指定するプログラムを格納するメモリ領域であり電源が切れてもデータを消失しない。
13は、様々なデータを保存するためのフラッシュメモリ装置であり、電源が切れてもデータを消失しないという特徴がある。
14は、様々なデータを保存するための不揮発性メモリ領域であり、電源が切れてもデータを消失しないが、バッテリーが放電してしまうとデータが消失してしまうという特徴がある。
15は、実行にテンポラリに利用するデータ領域で、電源が切れるとデータも消えるという特徴がある。
16は、11〜15の各要素を接続し、各要素間でデータを流通させるためのバスである。
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.

また、フラッシュメモリ管理装置100が携帯電話機、PHS(Personal Handy−phone System)(登録商標)端末、PDA(Personal Digital Assistant)(登録商標)端末等に搭載される場合は、CPU11は、バス16を介して、例えば、LCD(Liquid Crystal Display)等の表示装置、通信ボード、テンキー、マイク、スピーカー、キーボード、非接触ICカード、カメラ、バイブレータ、加速度センサ等に接続され、これらのハードウェアデバイスを制御するようにしてもよい。
通信ボード915は、公衆無線網通信の他、無線LAN(Local Area Network)、赤外線通信、ブルートゥース(登録商標)通信等に対応するインタフェースを有していてもよい。
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.

プログラム格納用メモリ12には、図3に示す各種プログラムが格納されている。図3のプログラムの詳細は後述する。   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.

また、フラッシュメモリ13、不揮発性メモリ14、実行用RAM15には、以下の説明において、「〜の判断」、「〜の計算」、「〜の比較」、「〜の抽出」、「〜の選択」、「〜の指定」、「〜の設定」、「〜の登録」等として説明している処理の結果を示す情報やデータや信号値や変数値やパラメータが、「〜ファイル」や「〜データベース」の各項目として記憶される。
フラッシュメモリ13、不揮発性メモリ14、実行用RAM15に記憶された情報やデータや信号値や変数値やパラメータは、読み書き回路を介してCPU11により読み出され、抽出・検索・参照・比較・演算・計算・処理・編集・出力・表示などのCPUの動作に用いられる。
抽出・検索・参照・比較・演算・計算・処理・編集・出力・表示のCPUの動作の間、情報やデータや信号値や変数値やパラメータは、例えばCPU11内のレジスタ、キャッシュメモリ、バッファメモリ等に一時的に記憶されてもよい。
また、以下にて説明するフローチャートの矢印の部分は主としてデータや信号の入出力を示し、データや信号値は、例えばCPU11内のレジスタ、キャッシュメモリ、バッファメモリ等又はフラッシュメモリ13、不揮発性メモリ14、実行用RAM15に記録される。また、データや信号は、バス912や信号線やケーブルその他の伝送媒体によりオンライン伝送される場合がある。
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.

本実施の形態及び以降の実施の形態に示すフラッシュメモリ管理装置100は、処理装置たるCPU、記憶装置たるプログラム格納用メモリ、フラッシュメモリ、不揮発性メモリ、実行用RAM等、入力装置たるテンキー、キーボード、通信ボード等、出力装置たる表示装置、通信ボード、非接触ICカード等を備え、図3の「〜部」として示された機能をこれら処理装置、記憶装置、入力装置、出力装置を用いて実現するものである。   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.

図2は、図1におけるフラッシュメモリ13を詳細に説明したもので、21はデータを消去する単位であるブロックを示す。22は、データを書き込む単位であるページを示している。
ブロック21は、複数のページ22からなる。
ここで、フラッシュメモリ13では、データの消去回数が一定の回数までしか保障されないという特徴がある。
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.

また、フラッシュメモリには、NAND型フラッシュメモリとNOR型フラッシュメモリとがあるが、本実施の形態に係るフラッシュメモリ管理装置100は、いずれのフラッシュメモリにも適用可能である。   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.

図3に図1、図2に説明したハードウェア構成上に実装するソフトウェア構成を示す。
具体的には、図3に示す各要素は、起動前は図1のプログラム格納用メモリ12に格納されており、起動の際に、実行用RAM15にロードされ、CPU11により読み出されて実行される。
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

31はフラッシュメモリ書込み消去管理部であり、データを書き込みや消去するブロックを管理し最適配置を行う。
フラッシュメモリ書込み消去管理部31は、後述する全ブロックデータ余命管理部34により選択された書込み対象候補ブロックのいずれかに書込み対象データを書き込む。
フラッシュメモリ書込み消去管理部31は、データ書込み部の例である。
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.

32は全データ世代管理部であり、どのデータがどの世代に属しているのかを全体として管理する。   Reference numeral 32 denotes an all data generation management unit, which manages which data belongs to which generation as a whole.

33は個々のブロックの余命管理部であり、そのブロックの余命がどの程度かを管理しており、全ブロックに対応して存在する。
つまり、ブロック余命管理部33は、ブロックごとに、当該ブロックにおけるデータ消去回数(以下、単に消去回数ともいう)を管理し、データ消去回数に応じてブロックの余命を掌握する。
ブロック余命管理部33は、本実施の形態では、フラッシュメモリに含まれるブロックの数と同数存在する。
ブロック余命管理部33は、データ消去回数管理部の例である。
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.

34は全ブロックデータ余命管理部であり、全体として余命の長いものはどこで、短いものはどこでといった全体の状況を管理している。
また、全ブロックデータ余命管理部34は、各ブロックにおけるデータ消去回数と、各ページのデータの書込み時刻からの経過時間とに基づき、複数のブロックの中から一つ以上のブロックを書込み対象候補ブロックとして選択する。
より具体的には、全ブロックデータ余命管理部34は、各ブロックにおけるデータ消去回数と、後述するページデータ世代管理部35による書込み済みページ(データが既に書き込まれているページ)ごとのグループ分類結果(世代の分類結果)とに基づき、複数のブロックの中から一つ以上のブロックを書込み対象候補ブロックとして選択する。選択にあたっては、全ブロックデータ余命管理部34は、複数のブロックのうちデータ消去回数が小さいブロックから順に抽出し、抽出したブロックにデータが書き込まれていない場合に、抽出した当該ブロックを書込み対象候補ブロックとして選択する。また、抽出したブロックに既にデータが書き込まれている場合に、抽出したブロックにデータが書き込まれていない空きページが存在するか否かを判断し、空きページが存在しない場合に、抽出した当該ブロックを書込み対象候補ブロックとして選択し、空きページが存在する場合に、抽出した当該ブロックに含まれる書込み済みページがいずれのグループ(世代)に分類されているかを判断し、書込み済みページが経過時間の短いグループ(新世代)に分類されている場合に、抽出した当該ブロックを書込み対象候補ブロックとして選択する。
全ブロックデータ余命管理部34は、ブロック選択部の例である。
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.

35は各ページに対応して存在するページデータ世代管理部35であり、そのページのデータがどの世代に属しているかを管理している。
つまり、ページデータ世代管理部35は、ページごとに、当該ページに書き込まれているデータの書込み時刻からの経過時間を管理し、データが書込み済みのページをデータの書込み時刻からの経過時間に応じて複数のグループ(複数の世代)のいずれかに分類して、書込み済みページごとにデータの世代を管理する。
ページデータ世代管理部35は、、フラッシュメモリに含まれるブロックの数又はページ数と同数存在する。
ページデータ世代管理部35は、ページ経過時間管理部の例である。
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.

次に、本実施の形態に係るフラッシュメモリ管理装置100のフラッシュメモリ管理の原理を説明する。
図15は、フラッシュメモリ管理装置100のフラッシュメモリ管理の原理を概念的に示す図である。
フラッシュメモリのブロック群において、消去回数が少ないブロックほど更新頻度が高くなり、また、各ページの世代が新しくなるように、データの書込み先の制御及びデータのブロック間の移管を行う。
つまり、データの更新を消去回数の少ないブロックから優先して行うことで、データ消去の機会を消去回数が少ないブロックに集中させ、これにより消去回数の多いブロックの消去回数の増加を抑えることができる。この結果、ブロック間の消去回数が均質化されることになる。
また、世代が古い(書込みからの経過時間が長い)データ(プリセットファイル等)は、消去、更新等がなく長時間保存されてきたため、今後も消去、更新の可能性が低いと考えられ、世代が新しい(書込みからの経過時間が短い)データ(新着メール等、ファイル管理のためのディレクトリ等)は、頻繁に消去、更新される傾向があると考えられる。
このため、消去、更新の可能性が高いと考えられる新しい世代のデータは、消去回数の少ないブロックに格納し、消去、更新が可能性の低いと考えられる世代の古いデータは、消去回数の多いブロックに格納して、データ消去の機会を消去回数が少ないブロックに集中させ、これにより消去回数の多いブロックの消去回数の増加を抑えることができる。この結果、ブロック間の消去回数が均質化されることになる。
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.

次に、本実施の形態に係るフラッシュメモリ管理装置100の全体としての動作の概要を図4のフローチャートに沿って説明する。   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.

先ず、フラッシュメモリ書込み消去管理部31により、フラッシュメモリ13に書き込むべき書込み対象データが発生したか否かが判断される(S101)。
書込み対象データが発生している場合(S101でYES)は、全ブロックデータ余命管理部34が、書込み対象データの書込み先のブロックを決定するための準備段階として、データ消去回数の少ない順にブロックを並べ、複数のブロックをデータ消去回数の少ない順に示す1次書込み候補リストを作成する(S102)。1次書込み候補リストでは、全ブロックのブロック番号がデータ消去回数の少ない順に並べられている。なお、1次書込み候補リストは、レジスタやバッファメモリ等に格納されて、以降の処理に用いられる。
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.

各ブロックのデータ消去回数は、データの消去がある度にブロック余命管理部33により計数され、後述するように、ブロック内の特定領域にデータ消去回数が記録される。また、ブロック内での記録とともに、データ消去回数の管理ためのデータ消去回数管理テーブルに消去回数を記録してもよい。
全ブロックデータ余命管理部34は、このようにして計数されている消去回数の小さい順に、複数のブロックを並べて、1次書込み候補リストを生成する。
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.

次に、全ブロックデータ余命管理部34は、1次書込み候補リストの順に、各ブロックに含まれる各ページの世代の算出を対応するページデータ世代管理部35に依頼し、ページデータ世代管理部35が、対応するブロックに含まれる各ページの世代の算出を行う(S103)(ページ経過時間管理ステップ)。
世代の算出手順は、後ほど詳述するが、ページデータ世代管理部35は、該当するブロックのページごとに、当該ページに書き込まれているデータの書込み時刻から現在時刻までの経過時間を管理し、経過時間が一定時間以上のページを例えば旧世代に分類し、経過時間が一定時間未満のページを例えば新世代に分類する。世代の分類数は2つ(旧世代、新世代)に限らず、3つ以上でもよい。
なお、本実施の形態及び以降の実施の形態において、データの書込み時刻から一定時間が経過していないデータ、つまり相対的に新しいデータを新世代と呼び、データの書込み時刻から一定時間が経過しているデータ、つまり相対的に古いデータを旧世代と呼ぶ。このため、以降において、新世代、旧世代の語は、2つの世代に分類するケースに限定する趣旨ではなく、フラッシュメモリに格納されているデータのうち相対的に新しいデータ、相対的に古いデータという意味で用いる。
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.

次に、全ブロックデータ余命管理部34は、データ消去回数の少ない順に、各ブロックの使用有無(データが書き込まれているか否か)、各ブロックのページの世代に基づき、1次書込み候補リストの中から更に選択して2次書込み候補リストを作成する(S104)(ブロック選択ステップ)。   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).

1次書込み候補リストの作成では、各ブロックにデータが既に書き込まれているか、各ブロックに空きページが存在するか否か、各ブロックに含まれるページの世代は考慮されていなかったので、これらを考慮してより適切な書込み候補ブロックを選択する。
処理の詳細は後述するが、全ブロックデータ余命管理部34は、1次書込み候補リストの順、すなわちデータ消去回数の少ない順にブロックを抽出し、抽出したブロックが未使用(データが書き込まれていない)であるか、使用済みのであった場合に空きページが存在しないか、空きページが存在する場合には書込み済みページの世代が全て新世代であるかを判断する。そして、未使用のブロック、使用済みであって空きページが存在しないブロック、空きページが存在し書込み済みページが全て新世代であるブロックが書込み対象候補ブロックとして選択され、これら選択された書込み対象候補ブロックがデータ消去回数の少ない順に示される2次書込み候補リストが生成される。
2次書込み候補リストでは、上記の選択条件に合致した書込み対象候補ブロックのブロック番号がデータ消去回数の少ない順に並べられている。なお、2次書込み候補リストは、レジスタやバッファメモリ等に格納されて、以降の処理に用いられる。
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.

次に、フラッシュメモリ書込み消去管理部31が、2次書込み候補リストに従って、書込み対象データを書込み対象候補ブロックに書き込む(S105)(データ書込みステップ)。   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).

詳細は後述するが、フラッシュメモリ書込み消去管理部31は、2次書込み候補リストに示されている順、すなわち、データ消去回数が小さい書込み対象候補ブロックから順に抽出し、抽出した書込み対象候補ブロックにデータが書き込まれていない場合は、抽出した当該書込み対象候補ブロックに書込み対象データを書き込み、抽出した当該書込み対象候補ブロックに既にデータが書き込まれている場合は、抽出した当該書込み対象候補ブロックにデータが書き込まれていない空きページが存在するか否かを判断する。空きページが存在する場合は、抽出した当該書込み対象候補ブロックの空きページに書込み対象データを書き込み、空きページが存在しない場合は、抽出した当該書込み対象候補ブロックに書き込まれているデータを他のメモリ(例えば、不揮発性メモリ14)に退避し、他のメモリに退避させたデータを当該書込み対象候補ブロックから消去して書込み対象データを書き込む。
また、フラッシュメモリ書込み消去管理部31は、他のメモリに退避したデータを、書込み対象データとし、他の書込み対象データに優先して、データ消去回数が特定数以上のブロックに書き込む。
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.

データ消去回数が多いブロックは、1次書込み候補リスト及び2次書込み候補リストにおいて後方に位置づけられるため、書込み対象データの書込み先になる可能性が少ない。他のメモリにデータを退避した場合、すなわち、ブロック内に空きページがない場合は、そのブロックに格納されているデータは変動(更新)の可能性が少ないデータと考えられるので、書込み対象データの書込み先になる可能性が少ないデータ消去回数の多いブロックに移管して、当該移管先のブロックでのデータの変動(データ消去)を抑える。このようにデータ変動(更新)の可能性の少ないデータをデータ消去回数の多いブロックに移管することで、データ消去回数の少ない移管元のブロックを新たな書込み対象データの書込み先として確保し、ブロック間のデータ消去回数の均等化を図ることができる。   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.

次に、いずれかのブロックでデータの消去があった場合は、ブロック余命管理部33が消去回数を計数し、該当するブロック内の特定領域にデータ消去回数を書き込み(S106)(データ消去回数管理ステップ)、S101に処理を戻す。
なお、データ消去のあったブロックがなければ、S106の処理は省略される。
なお、S106の処理は、データの消去と同時に行うようにしてもよい。
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.

また、図4のフローでは、書込み対象データが発生した後に、1次書込み候補リスト及び2次書込み候補リストを生成しているが、書込み対象データの発生前に予め1次書込み候補リスト及び2次書込み候補リストを生成していてもよい。
具体的には、図5に示すように、書込み対象データが発生する前に1次書込み候補リストを生成し(S102)、1次書込み候補リストの各ブロックに含まれるページの世代を算出し(S103)、2次書込み候補リストを生成し(S104)、生成した2次書込み候補リストを例えば不揮発性メモリ14に記憶する(S201)。
そして、書込み対象データが発生した場合(S101でYES)は、記憶している2次書込み候補リストに従って、書込み対象データを該当ブロックに書込み(S105)、いずれかのブロックでデータの消去があった場合は、消去回数を計数し、該当するブロック内の特定領域にデータ消去回数を書き込む(S106)。
なお、S101〜S106の処理は、図4について説明した内容と同じである。
図5では、書込み対象データの発生前に予め1次書込み候補リスト及び2次書込み候補リストを生成し、2次書込み候補リストを記憶している点以外は、図4と同じである。
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.

ここで、フラッシュメモリ13の各ブロックへのデータ消去回数の記録の具体例について説明する。
例えば、図2におけるブロックのサイズをnとし、ページのサイズをmとする。ブロック内のページの数をqとすると、n=m*qとなる。
ここで、ページ内の一部領域をデータの管理領域とし、m=m1+cとすると、結局ブロックとして有効なデータサイズは、n1=m1*qとなる。
このcの部分にそのブロックの消去回数を書きこんでおくことする。
また、単純に、各ブロックの先頭ページの一部の領域に消去回数を書き込むようにしてもよい。
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.

また、前述したように、データを消去するタイミングはデータを書く直前としておき、データを書き込む前に(1次書込み候補リストの生成の際に)必ずそのフラッシュメモリの消去回数を保持している領域を読むこととし、読みこんだ回数に1回分のカウントアップしたものを消去後にデータを書き込む際に同時に書くこととする。   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.

次に、図4及び図5に示した各処理の詳細を図6〜図12を用いて説明する。   Next, details of each process shown in FIGS. 4 and 5 will be described with reference to FIGS.

先ず、図9を参照して、全ブロックデータ余命管理部34による1次書込み候補リストの作成手順を説明する。   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.

S700で1次書込み候補リストの作成フローを開始する。
このフローの開始は、図4に示したように書込み対象データが発生した場合の他、例えば、図5の例では、タイマー機能などによって、一定時間間隔で呼ばれてもよい。またデータを消去したタイミングでもかまわない。
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.

そして、全ブロックデータ余命管理部34は、各ブロックに書き込まれている各ブロックのデータ消去回数又はデータ消去回数管理テーブルに書き込まれている各ブロックのデータ消去回数を調べ、1次書込み候補リストに入っていないブロックの中で消去回数が最小のものを抽出して、1次書込み候補リストに入れる(S701)。
次に、全ブロックデータ余命管理部34は、全ブロックを1次書込み候補リストに入れたかどうかを確認し(S702)、1次書込み候補リストに入っていないブロックがあれば、S701に戻る。
このような操作を順番に繰り返すことにより消去回数が最小のブロックから順に選び出すことのできる1次書込み候補リストを作成する。
最後にS703で終了する。
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.

なお、図9の例では、フラッシュメモリの全ブロックを1次書込み候補リストに入れることとしたが、1次書込み候補リストに入れるブロックを一部のブロックとしてもよい。
例えば、消去回数が最小のブロックから順に全ブロックの1/2の個数のブロックのみを1次書込み候補リストに入れるようにしてもよいし、一定の消去回数未満(例えば、保証消去回数が10万回のフラッシュメモリにおいて1万回未満)のブロックのみを1次書込み候補リストに入れるようにしてもよい。
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.

次に、図11を参照して、全ブロックデータ余命管理部34による1次書込み候補リストの抽出及び2次書込み候補リストの作成手順を説明する。
S900で1次書込み候補リストの抽出及び2次書込み候補リストの作成フローが開始する。
先ず、全ブロックデータ余命管理部34は、1次書込み候補リストから消去回数が最小のブロックを抽出する(S901)。
次に、全ブロックデータ余命管理部34は、抽出したブロックが使用中かどうか(データが書込み済みかどうか)を判定する(S902)。使用中でなければ(S902でNO)、そのブロックを2次書込み候補リストに入れ(S907)、1次書込み候補リストの全ブロックに対して処理を行ったか否かを判断し(S908)、全ブロックに対して処理を行っていれば(S908でYES)、S903で処理を完了する。処理を行っていないブロックが存在すれば、S901に戻って処理を続ける。
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.

他方、S902の判断において使用中であれば(S902でYES)、全ブロックデータ余命管理部34は、抽出したブロックに空きページがあるかないかを判定する(S904)。
空きページがなければ(S904でNO)このブロックを2次書込み候補リストに入れ(S907)、S908に移行する。
空きページがあれば(S904でYES)、全ブロックデータ余命管理部34は、このブロック内の使用中のページの世代情報を獲得する(S905)。具体的には、全ブロックデータ余命管理部34は、当該ブロックを管理対象としているページデータ世代管理部35に対して使用中のページの世代の算出を依頼し、ページデータ世代管理部35から世代情報を取得する。
ページデータ世代管理部35による世代の算出処理の詳細は、後述する。
ページデータ世代管理部35から世代情報を取得した後に、全ブロックデータ余命管理部34は、対象となっているブロックの使用中のページの世代が全て新世代であるか否かを判断する(S906)。
全ての使用中のページが新世代であれば(S906でYES)、このブロックを2次書込み候補リストに入れ(S907)、S908に移行する。
他方、全ての使用中のページが新世代でなければ、S901に戻り1次書込み候補リストにおいて次のブロックを選び再びS902以下の処理を繰り返す。
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.

このように、使用中のページが全て新世代でないブロックを2次書込み候補リストから除外することで、旧世代のデータが格納されているブロックに書込み対象データ(新世代)が書き込まれ、新世代のデータと旧世代のデータが一つのブロックで混在することを回避している。   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.

なお、図11では、ページの世代を2世代に分類している例を説明したが、3世代以上に分類していてもよい。
3世代以上に分類している場合に、例えば、使用中のページの全てがである場合のみ当該ブロックを2次書込み候補ブロックに追加するようにしてもよいし、使用中のページの全てが最新世代及び2番目に新しい世代である場合のみ当該ブロックを2次書込み候補ブロックに追加するようにしてもよい。
この場合は、最新世代、または最新世代と2番目に新しい世代が図11の新世代に該当する。
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.

次に、図8を参照して、ページデータ世代管理部35による世代計算の手順を説明する。   Next, a generation calculation procedure by the page data generation management unit 35 will be described with reference to FIG.

ページデータ世代管理部35による世代計算は全ブロックデータ余命管理部34から世代計算の依頼があった際にS600で開始し、ページデータ世代管理部35は使用中のページごとにそのページに格納されているデータの作成された日付(書き込み時刻)を獲得する。これは例えばデータをファイルの形式で作成していればファイルの情報に通常つけられる情報を利用する。ファイルではなく単なる文字列もしくは、バイナリデータである場合にはその管理情報の一つとしてデータの作成日付を入れておく。
日付情報はシステムの持つ時計機能から入れても良いし、ユーザが指定しても入力してもかまわない。
またファイルという論理的な単位ではなく、書き込むページという物理的な単位からそのページが作成された時点の日付情報をフラッシュメモリ上のページの管理領域や不揮発性メモリ上のページに関するテーブルなどに保持しておき、そこから論理的なデータ単位の日付情報を作成してもかまわない。
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.

次に、ページデータ世代管理部35は、使用中のページのデータの世代を計算する(S602)。
図8の例では、データが作成されて24時間以内か、1週間以内か、それ以上かの3つの世代(短命世代、平均世代、半永久世代)に分けており、ページデータ世代管理部35は、S601で取得した日付と現在時刻とを比較して、ページごとに世代を判定する(S603)。例えば、電子メールの分け方は上記のような分け方であるが、アドレス帳の分けかたは、作成して1週間以内、1ヶ月以内、それ以上というようにアプリケーションによって区別した分け方をしてもかまわない。
また、上記の例では、日を単位として世代を判定しているが、他の時刻単位、例えば秒、分、時間、週、月、年等を用いてもよい。
また、図8の例にかかわらず、3つ以外の世代に分けてもよい。
また、データが用いられるアプリケーションプログラムごとに異なる世代判定のための経過時間の基準を用いて世代を判定するようにしてもよい。
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.

最後に、ページデータ世代管理部35は、依頼元である全ブロックデータ余命管理部34に世代情報の計算結果を返信し(S604)、S605で終了する。   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.

次に、図10を参照して、フラッシュメモリ書込み消去管理部31による2次書込み候補リストの抽出及び書込み処理の手順を説明する。   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.

図11で説明した手順により2次書込み候補リストが作成された後に、フラッシュメモリ書込み消去管理部31は、2次書込み候補リストの順に、候補ブロックをひとつ取り出す(S801)。
そして、フラッシュメモリ書込み消去管理部31は、このブロックが現在使われているブロックかどうか、すなわち、データが書き込み済みであるかどうかを判断する(S802)。
この判断はブロック内の管理情報で判断しても良いし、不揮発性メモリ14上にあるテーブル情報で判断してもかまわない。
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.

当該ブロックが使用されていない場合(S802でNO)には、フラッシュメモリ書込み消去管理部31は、当該ブロックの先頭ページにデータの書込みを行い(S803)、全データが書き込めたかどうかを判断し(S807)、全データの書き込みが完了していたら(S807でYES)、S804で終了する。
全データの書き込みが完了していない場合(S807でNO)は、S801から再び同じフローを繰り返す。
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.

他方、S802の判断において当該ブロックが使用中である場合(S802でYES)は、フラッシュメモリ書込み消去管理部31は、当該ブロックに空きページ(データが書き込まれていないページ)があるか否かを判断する(S805)。
空きページがある場合(S805でYES)は、フラッシュメモリ書込み消去管理部31は、空きページにデータを書込み(S806)、S807に進む。
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.

他方、S805の判断において、空きページがない場合(S805でNO)は、フラッシュメモリ書込み消去管理部31は、当該ブロックの全データを読み込み、読み込んだデータを暫定的に不揮発性メモリ14に書込み、当該ブロックの全データを不揮発性メモリ14に退避させる(S808)。
次に、フラッシュメモリ書込み消去管理部31は、不揮発性メモリ14に退避させたデータを消去して、書込み対象データをデータ消去後のブロックに書き込む(S809)。
次に、フラッシュメモリ書込み消去管理部31は、不揮発性メモリ14に退避させたデータを書込み対象データとして(S810)、S801へ進む。
ここで、まず先に退避したデータの書込みを完了してから残りの書込み対象データの書込み処理に入る。つまり、退避したデータを他の書込み対象データに優先して書き込み処理を行う。
このように、使用されている領域のブロックが出てくる限り、操作を繰り返していき、最後に未使用領域が出た時点で終了となる。
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.

次に、図12を参照して、一時的に不揮発性メモリ14に退避したデータを他のブロックに移管して書き込む処理の手順を説明する。   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.

フラッシュメモリ書込み消去管理部31によりデータが一時的に不揮発性メモリ14に退避された場合に、全ブロックデータ余命管理部34は、移管先候補リストを作成する(S1201)。   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).

移管先候補リストとは、一時的に不揮発性メモリ14に退避されたデータの格納先の候補となるブロックのリストであり、特定の消去回数以上のブロックが消去回数の少ない順に並べられたリストである。例えば、保証消去回数が10万回のフラッシュメモリにおいて5万回以上の消去回数のブロックが消去回数が少ない順に並べられている。
前述したように、データ消去回数が多いブロックは、1次書込み候補リスト及び2次書込み候補リストにおいて後方に位置づけられるため、書込み対象データの書込み先になる可能性が少ない。不揮発性メモリ14に退避されたデータは空きページがないブロックに格納されていたデータであり、変動(更新)の可能性が少ないデータと捉え、書込み対象データの書込み先になる可能性が少ないデータ消去回数の多いブロックに移管して、当該移管先のブロックでのデータの変動(データ消去)を抑える。そして、これにより、ブロック間のデータ消去回数の均等化を図ることができる。
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.

全ブロックデータ余命管理部34は、例えば、フラッシュメモリ13の全ブロックが1次書込み候補リストに入っている場合(図9)に、1次書込み候補リストの特定回数以上のブロック(例えば、5万回以上のブロック)の部分を取り出して移管先候補リストとすることができる。
また、1次書込み候補リストに入っているブロックが消去回数の少ないブロック(例えば、1万回未満)のみである場合は、全ブロックデータ余命管理部34は、図9と同様の手順にて、消去回数が特定回数以上のブロックを消去回数が少ない順に抽出して移管先候補リストを生成することができる。
また、全ブロックデータ余命管理部34は、移管先候補リストに含ませるブロックの消去回数の上限を設定することも可能である。例えば、保証消去回数が10万回のフラッシュメモリにおいて5万回以上で7万回未満の消去回数のブロックのみを対象とすることが可能である。
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.

移管先候補リストが作成された後に、フラッシュメモリ書込み消去管理部31は、移管先候補リストの順に、候補ブロックをひとつ取り出す(S1201)。
そして、フラッシュメモリ書込み消去管理部31は、このブロックが現在使われているブロックかどうか、すなわち、データが書き込み済みであるかどうかを判断する(S1203)。
この判断はブロック内の管理情報で判断しても良いし、不揮発性メモリ14上にあるテーブル情報で判断してもかまわない。
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.

当該ブロックが使用されていない場合(S1203でNO)には、フラッシュメモリ書込み消去管理部31は、当該ブロックの先頭ページに退避したデータの書込みを行い(S803)、全データが書き込めたかどうかを判断し(S1207)、全データの書き込みが完了していたら(S1207でYES)、不揮発性メモリ14上の退避データを消去する。
一方、全データの書き込みが完了していない場合(S1207でNO)は、S1202から再び同じフローを繰り返す。
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.

他方、S1203の判断において当該ブロックが使用中である場合(S1203でYES)は、フラッシュメモリ書込み消去管理部31は、当該ブロックに空きページ(データが書き込まれていないページ)があるか否かを判断する(S1205)。
空きページがある場合(S1205でYES)は、フラッシュメモリ書込み消去管理部31は、空きページにデータを書込み(S1206)、S1207に進む。
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.

他方、S1205の判断において、空きページがない場合(S1205でNO)は、フラッシュメモリ書込み消去管理部31は、S1202に戻り、移管先候補リストの次の候補のブロックを抽出してS1203以降の処理を繰り返す。   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.

以上のようにして退避データの移管が終了した後に、他の書込み対象データが存在していれば、フラッシュメモリ書込み消去管理部31は、残存している書込み対象データに対して図10に示す処理を行う。   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.

なお、フラッシュメモリ書込み消去管理部31は、書込み対象データを書き込む際に、併せて、書込み先のページに書込み対象データの書込み時刻を書き込むようにしてもよい。また、ページデータ世代管理部35は、このようにしてフラッシュメモリ書込み消去管理部31によりページに書き込まれた書込み時刻からの経過時間に応じて世代の分類を行うようにしてもよい。   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.

次に、図6を参照して、データ消去回数の管理手順について説明する。
なお、説明の都合上、図6の一部において図10に示した処理と重複する処理が示されているが、これは同じ処理を異なる側面から捉えた結果であり、図6の処理と図10の処理とが矛盾するものではない。
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.

先ず、フラッシュメモリ書込み消去管理部31が、書込み対象データの書込み候補のページを獲得する(S401)。
これは、例えば、図10のS803又は図12のS1204に示されるように書込み先のブロックが未使用であれば、当該ブロックの先頭データが書込み候補のページとなり、また、図10のS806又は図12のS1206に示されるように書込み先のブロックが使用済みであれば、空きページが書込み候補のページとなる。
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.

次に、フラッシュメモリ書込み消去管理部31は、書き込み候補のページが見つかると、そのページがブロック内の先頭ページかどうかを確認する(S402)。
先頭ページであった場合は、さらに今回の書き込みがそのブロックにとって初めての書込みであるかどうかをチェックする(S403)。例えば、図10のS809に示されるように、一時的に不揮発性メモリに退避したデータが格納されているブロックが書込み先のブロックとなる場合には、先頭ページが書込み候補のページとなるが、この場合は、そのブロックにとって今回の書込みは初めての書込みではない。
また、このチェックはフラッシュメモリの初期状態から判断しても良い。例えば判断できない場合には、最初に初期化を行ってフラッシュメモリの消去回数の初期値を−1としておいてもかまわない。
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.

初めての書込みで、しかも先頭ページの場合(S402、S403ともにYES)は、フラッシュメモリ書込み消去管理部31が先頭ページから順にデータを書き込むとともに、当該ブロックに対応するブロック余命管理部33が管理領域の消去回数を示す場所に0を書き込み(S404)、S405で処理を終了する。   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.

また、S403の判断において、初めてのページでない場合(すなわち当該ブロックに過去に書込みがされている場合)(S403でNO)か、または判断できないため初期化してあるような場合には、当該ブロックに対応するブロック余命管理部33が先頭ページの消去回数を読み込み(S407)、フラッシュメモリ書込み消去管理部31が当該ブロックのデータを消去する(S408)。
そして、フラッシュメモリ書込み消去管理部31が先頭ページから順にデータを書き込むとともに、当該ブロックに対応するブロック余命管理部33が、ブロックの先頭ページの管理領域に読み込んだ消去回数に1を加えた値を書き込み(S409)、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.

他方、S402の判断において、書込み候補のページがブロックの先頭でないページであった場合(S402でYES)は、そのブロック内で初めての書込みではないため、データの消去の必要もなく(従って、消去回数のインクリメントも必要なく)、フラッシュメモリ書込み消去管理部31が普通にデータを書込み(S406)、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.

ページの配列順に書込みが行われない場合は、ブロック内で最初に書込みが行われるページに対して、例えば、各ページ内の管理領域に使われているかどうかを示す1ビットのフラグを用意することで、最初に書き込みが行われるページを判別するような方法が考えられる。   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.

次に、図7を参照して、ブロック余命管理部33がブロックの消去回数の計数のためのテーブルを不揮発性メモリ14で保持している状況で、全ブロックデータ余命管理部34がシステム全体として余命の管理を行う例を説明する。   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.

前提として、ブロック余命管理部33は、それぞれ対応するブロックのデータ消去回数を計数するためのデータ消去回数管理テーブルを不揮発性メモリ14に保持しているものとする。
また、全ブロックデータ余命管理部34は、各ブロック余命管理部33が管理しているデータ消去回数管理テーブルに示されるデータ消去回数を統合してフラッシュメモリ13に含まれる全てのブロックのデータ消去回数を管理するための統合データ消去回数管理テーブルを有する。
また、図6のフローに従ってブロック内の管理領域にデータ消去回数を保存されているものとする。
これは不揮発性メモリの内容が放電などにより消えたときにフラッシュメモリのブロック内のデータ消去回数を利用できる利点があるが、放電を気にしない場合は、図6のフロー内におけるフラッシュメモリの管理領域への消去回数の保存は行わなくてもよい。
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.

図7において、S500でスタートする。
例えば、ブロック余命管理部33が、ブロックの番号と消去回数のペアというデータ消去回数管理テーブルでブロックごとの消去回数を管理しているような場合には、ブロックの番号を元にその消去回数を得るようなテーブル検索を利用して該当するブロックの消去回数を獲得する(S501)。
前記テーブルは不揮発性メモリ14上に置き、各ブロックの情報がテーブルの各要素としてブロック余命管理部33に管理され、全体としてテーブルが全ブロックデータ余命管理部34に管理される。
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.

次に、全ブロックデータ余命管理部34が、フラッシュメモリ13上でもデータ消去回数を管理しているか否かを判断し(S502)、フラッシュメモリ13でデータ消去回数を管理領域に保持する仕組みでないならば、S503へ進み、統合データ消去回数管理テーブルの特定のブロックのデータ消去回数を、対応するデータ消去回数管理テーブルに示されているデータ消去回数に更新して(S503)、S504で終了する。
フラッシュメモリ13でデータ消去回数を管理領域に保持する仕組みならば、全ブロックデータ余命管理部34が、不揮発性メモリ14上のデータ消去回数管理テーブルにおけるデータ消去回数とフラッシュメモリ13上のデータ消去回数が整合しているかどうかをチェックし(S505)、整合しているならば(S505でYES)、ステップ503以下の処理となる。
整合していないならば(S505でNO)、フラッシュメモリをアップデート直後になんらかの理由で電源が切られるなど障害があったことが想定されるため、統合データ消去回数管理テーブルの内容をフラッシュメモリ上のデータ消去回数に修正して、S504で終了する。
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.

実施の形態2.
実施の形態1では、新規に書き込むデータをデータ消去回数の少ないブロックから順に書き込むように制御する例について述べたが、本実施の形態では、書込みからの経過時間が一定時間以上のデータ(旧世代のデータ)をデータ消去回数の多いブロックに移管する例について説明する。
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.

本実施の形態に係るフラッシュメモリ管理装置100のハードウェア構成例及びソフトウェア構成例は実施の形態1で説明したものと同様である。   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及び図14は、本実施の形態に係るフラッシュメモリ管理装置100の動作例を示すフローチャートである。
図13は、移管の対象となる移管対象データが含まれる移管対象ブロックを選択する処理を示している。
また、図14は、移管対象ブロックから移管対象データを消去し、移管対象データを移管先に移管する処理を示している。
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.

先ず、図13の処理について説明する。
前提として、移管対象ブロックの指定に先立ち、1次書込み候補リストが生成されているものとする。
1次書込み候補リストの生成処理自体は、図9に示す通りである。
1次書込み候補リストは、図4のように書込み対象データが発生した後に生成する場合と、図5のように書込み対象データが発生していない状態で生成する場合があるが、図13の処理で用いられる1次書込み候補リストは、図4及び図5のいずれのフローにより生成されたものであってもよい。
また、図13の移管対象ブロックの指定は、2次書き込み候補リストの生成と独立したものとしているが、移管対象ブロックの指定と2次書き込み候補リストの生成を同時に行ってもよい。
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.

図13において、S1300〜S1302以外の動作は、図11に示す同符号の動作と同じである。
先ず、S1300で移管対象ブロックの指定フローが開始する。
そして、全ブロックデータ余命管理部34は、1次書込み候補リストから消去回数が最小のブロックを抽出する(S901)。
次に、全ブロックデータ余命管理部34は、抽出したブロックが使用中かどうか(データが書込み済みかどうか)を判定する(S902)。使用中でなければ(S902でNO)、1次書込み候補リストの全ブロックに対して処理を行ったか否かを判断し(S908)、全ブロックに対して処理を行っていれば(S908でYES)、S1302で処理を完了する。処理を行っていないブロックが存在すれば、S901に戻って処理を続ける。
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.

他方、S902の判断において使用中であれば(S902でYES)、全ブロックデータ余命管理部34は、このブロック内の使用中のページの世代情報を獲得する(S905)。具体的には、全ブロックデータ余命管理部34は、当該ブロックを管理対象としているページデータ世代管理部35に対して使用中のページの世代の算出を依頼し、ページデータ世代管理部35から世代情報を取得する。
ページデータ世代管理部35による世代の算出処理は図8に示した通りである。
ページデータ世代管理部35から世代情報を取得した後に、全ブロックデータ余命管理部34は、対象となっているブロックの使用中のページの世代が全て新世代であるか否かを判断する(S906)。
全ての使用中のページが新世代であれば(S906でYES)、S908に移行する。
他方、全ての使用中のページが新世代でなければ、全ブロックデータ余命管理部34は、当該ブロックを移管対象ブロックに指定する(S1301)。
全ての使用中のページが新世代でない場合とは、全ての使用中のページが旧世代である場合と、新旧の世代のページが一つのブロックに存在している場合である。
なお、全ブロックデータ余命管理部34は、移管対象ブロックの指定に際して、移管対象ブロックのブロック番号と、移管対象ブロックに含まれる使用中の各ページの世代を示す世代情報をレジスタ、バッファメモリ等に格納する。図14に示す各処理は、レジスタ、バッファメモリ等に格納されている移管対象ブロックのブロック番号、世代情報を用いて行われる。
移管対象ブロックの指定後、S908に移行する。
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.

なお、図13では、ページの世代を2世代に分類している例を説明したが、3世代以上に分類していてもよい。
3世代以上に分類している場合に、例えば、使用中のページの全てが最新世代でなければ移管対象ブロックにするようにしてもよいし、使用中のページの全てが最新世代又は2番目に新しい世代でなければ移管対象ブロックにするようにしてもよい。
この場合は、最新世代、または最新世代と2番目に新しい世代が図13の新世代に該当する。
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.

次に、図14において、S1400でデータ移管フローが開始する。
先ず、フラッシュメモリ書込み消去管理部31が、移管対象ブロックに書き込まれている移管対象データを不揮発性メモリ14に退避させる(S1401)。
次に、フラッシュメモリ書込み消去管理部31は、データ退避後の移管対象ブロックの移管対象データを消去する(S1402)。
次に、移管対象ブロックを管理対象としているブロック余命管理部33が、移管対象ブロックのデータ消去回数をインクリメントして、当該ブロックの管理領域に新たなデータ消去回数を書き込む(S1403)。
次に、フラッシュメモリ書込み消去管理部31が、退避データ(移管対象データ)の世代を判別し、新世代のデータに対しては図10のS801以降の処理を行う(S1404)。つまり、新世代のデータは、2次書込み候補リストに従って、データ消去回数が所定数未満(例えば1万回未満)のブロック(データ消去回数が少ないブロック)に移管する。
新世代以外のデータに対しては図12のS1201以降の処理を行う(S1405)。つまり、新世代以外のデータは、移管先候補リストに従って、データ消去回数が所定数以上(例えば5万回以上)のブロック(データ消去回数が多いブロック)に移管する。
S1404及びS1405の処理の後、データ移管処理を終了する(S1406)。
退避データ(移管対象データ)が新世代以外のデータのみである場合は、S1405の処理だけが行われる。
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.

なお、S1404の実行段階で、2次書込み候補リストが未作成である場合は、全ブロックデータ余命管理部34が図9のフローにより2次書込み候補リストを生成した後、図10のS801以降の処理を行う。   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.

また、上記の説明では、フラッシュメモリの全ブロックがデータ消去回数の順に1次書込み候補リストに示され、1次書込み候補リストの順に全てのブロックに対して移管対象ブロックとするか否かを判断を行うこととした。
この点、例えば、消去回数の少ないブロックから順に全ブロックの1/2の個数のブロックのみを1次書込み候補リストに入れるようにし、または一定の消去回数未満(例えば、保証消去回数が10万回のフラッシュメモリにおいて1万回未満)のブロックのみを1次書込み候補リストに入れるようにし、これら消去回数の少ないブロックにおいて新世代以外の世代のページが含まれている場合に、移管対象ブロックとして指定するようにしてもよい。
そして、図14のフローに従って、移管対象ブロックのうちの新世代のデータを2次書込み候補リストに従って、データ消去回数が所定数未満(例えば1万回未満)のブロック(データ消去回数が少ないブロック)に移管し(S1404)、旧世代のデータを、移管先候補リストに従って、データ消去回数が所定数以上(例えば5万回以上)のブロック(データ消去回数が多いブロック)に移管する。
また、これに代えて、移管対象ブロックの全データ(新世代のデータを含む)をS1405の処理の対象とし、移管対象ブロックの全データを、移管先候補リストに従って、データ消去回数が所定数以上(例えば5万回以上)のブロック(データ消去回数が多いブロック)に移管するようにしてもよい。
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.

以上、実施の形態1、2では、データをページ単位に書込みを行うことができ、複数の前記ページをブロックとしてブロック単位で消去を行うことができるフラッシュメモリ装置において、データが作成されてから消えるまでの時間を寿命とし、各データの残りの寿命である余命を計算するための指標として世代情報を管理するデータ世代管理部と、各ブロックのデータの消去回数で決まるブロックの利用できる寿命である余命を回数として管理するブロック余命管理部と、全ブロックのデータの消去回数を管理する全ブロックデータ余命管理部と各ページのデータの作成されてからの時間を管理するページデータ世代管理部、および前記各部の情報を元に、最適書込みブロックおよびページを決定するためのフラッシュメモリ書込み消去管理部とからなるフラッシュメモリ管理装置について説明した。   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.

また、実施の形態1、2では、前記ブロック余命管理部において、データ消去するたびにそのブロック中の一部に消去回数を書きこんでおくことによりブロックデータの消去回数を管理するフラッシュメモリ管理装置について説明した。   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.

また、実施の形態1、2では、前記フラッシュメモリ管理装置の全ブロックデータ余命管理部において全ブロックの消去回数をブロック中の一部書かれた消去回数の情報から得ることができるフラッシュメモリ管理装置について説明した。   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.

また、実施の形態1、2では、前記ブロック余命管理部において、少なくとも前記フラッシュメモリ以外に不揮発で情報を記憶することのできるメモリ記憶装置を備え、該メモリ記憶装置にブロックデータを消去するたびに書きこんでおくことによりブロックデータの消去回数を管理するフラッシュメモリ管理装置について説明した。   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.

また、実施の形態1、2では、前記全ブロックデータ余命管理部において、全ブロックの消去回数をテーブルで保持し、書き換え回数が少ないブロックや最小の回数はどこかであるかを知ることができるフラッシュメモリ管理装置について説明した。   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.

また、実施の形態1、2では、前記データ世代管理部が、データが作成された日付から現時点の時間までの経過を示す指標としての世代情報を管理する世代管理機能と世代を計算する世代計算機能とを持つフラッシュメモリ管理装置について説明した。   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.

また、実施の形態1、2では、前記データ世代管理部において、世代情報は日数であり、日数の多いもの、すなわち世代情報の大きいものが古い世代であり、日時情報から日数情報を示す世代情報に置き換えるフラッシュメモリ管理装置について説明した。   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.

また、実施の形態1、2では、世代情報は日数を元に、データが作成された直後であるものと、短期であるものと、長期であるものとに計算し区別するフラッシュメモリ管理装置について説明した。   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.

また、実施の形態1、2では、前記ページデータ寿命管理部において、該ページが書き込まれてからの時間の情報を経過時間または日数として管理するためにページ内に情報を書込む時に同時に書込み時間情報を書き込むフラッシュメモリ管理装置について説明した。   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.

また、実施の形態1、2では、前記ページデータ世代管理部において、該ページが書き込まれてからの時間の情報を経過情報として該フラッシュメモリ装置以外の不揮発のメモリ上のテーブルで管理するフラッシュメモリ管理装置について説明した。   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.

また、実施の形態1、2では、前記フラッシュメモリ書込み消去管理部において、データの書き換えを含んで書込みを行う場合には、優先度を決めた書込み候補ブロックよりデータを書き込む手段を有するフラッシュメモリ管理装置について説明した。   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.

また、実施の形態1、2では、前記書込み候補ブロックよりデータを書き込む手段において、一定の間隔で書き込みや消去の際に、書込み消去候補ブロックをリストにしておき、このリストから順次選んで利用するフラッシュメモリ管理装置について説明した。   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.

また、実施の形態1、2では、前記フラッシュメモリ書込み消去管理部において、データを消去した際には、そのブロックを書込み候補ブロックに入れ、消去回数の少ない順の候補にするフラッシュメモリ管理装置について説明した。   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.

また、実施の形態1、2では、前記フラッシュメモリ書込み消去管理部において、データを書き込む際には、書込み候補ブロックから候補を選んでデータを書き込むフラッシュメモリ管理装置について説明した。   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.

また、実施の形態1、2では、前記フラッシュメモリ書込み消去管理部において、データを書き換える際には、そのブロック内の全ページを読み出し、ページデータ寿命管理部の情報に基づき同じ世代のデータが同一ブロック上に来るようにブロックを利用し、必要であれば元はひとつのブロックのデータが複数のブロックに分かれることがありうるフラッシュメモリ管理装置について説明した。   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.

また、実施の形態1、2では、前記フラッシュメモリ書込み消去管理部において、一定の間隔または特定のタイミングにおいて、ブロック内にあるデータの世代が同一になるようにブロックのデータを読み出し書き換えるフラッシュメモリ管理装置について説明した。   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.

また、実施の形態1、2では、前記フラッシュメモリ書込み消去管理部において、データの読み書きのタイミングを特定のタイミングとするフラッシュメモリ管理装置について説明した。   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.

また、実施の形態1、2では、前記フラッシュメモリ書込み消去管理部において、周期的に順にブロック余命管理部から得られる消去回数の少ないブロックを置き換え候補ブロックとするフラッシュメモリ管理装置について説明した。   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.

また、実施の形態1、2では、前記フラッシュメモリ書込み消去管理部において、ブロックの置き換えは、書込み候補ブロックの最後にある消去回数の多いものから選んでそのブロックに書込み、消去したブロックは書込み候補ブロックに入れるフラッシュメモリ管理装置について説明した。   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.

実施の形態1に係るフラッシュメモリ管理装置のハードウェア構成例を示す図。FIG. 3 is a diagram illustrating a hardware configuration example of the flash memory management device according to the first embodiment. 実施の形態1に係るフラッシュメモリのブロック構成、ページ構成の例を示す図。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. 実施の形態1に係るフラッシュメモリ管理装置のソフトウェア構成例を示す図。FIG. 3 is a diagram showing a software configuration example of the flash memory management device according to the first embodiment. 実施の形態1に係るフラッシュメモリ管理装置の全体の動作例を示すフローチャート図。FIG. 3 is a flowchart showing an example of the overall operation of the flash memory management device according to the first embodiment. 実施の形態1に係るフラッシュメモリ管理装置の全体の動作例を示すフローチャート図。FIG. 3 is a flowchart showing an example of the overall operation of the flash memory management device according to the first embodiment. 実施の形態1に係るフラッシュメモリ管理装置のデータ書き込み処理の例を示すフローチャート図。FIG. 3 is a flowchart showing an example of data write processing of the flash memory management device according to the first embodiment. 実施の形態1に係るフラッシュメモリ管理装置の消去回数管理処理の例を示すフローチャート図。FIG. 3 is a flowchart showing an example of erase count management processing of the flash memory management device according to the first embodiment. 実施の形態1に係るフラッシュメモリ管理装置のデータの世代情報の獲得処理の例を示すフローチャート図。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. 実施の形態1に係るフラッシュメモリ管理装置の1次書込み候補リストの作成処理の例を示すフローチャート図。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. 実施の形態1に係るフラッシュメモリ管理装置の2次書込み候補リストの抽出処理の例を示すフローチャート図。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. 実施の形態1に係るフラッシュメモリ管理装置の1次書込み候補リストの抽出処理の例を示すフローチャート図。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. 実施の形態1に係るフラッシュメモリ管理装置のデータ移管処理の例を示すフローチャート図。FIG. 3 is a flowchart showing an example of data transfer processing of the flash memory management device according to the first embodiment. 実施の形態2に係るフラッシュメモリ管理装置の移管対象ブロックの指定処理の例を示すフローチャート図。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. 実施の形態2に係るフラッシュメモリ管理装置のデータ移管処理の例を示すフローチャート図。FIG. 9 is a flowchart showing an example of data transfer processing of the flash memory management device according to the second embodiment. 実施の形態1、2に係るフラッシュメモリ管理装置によるブロック管理の概念を示す図。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 プログラム格納用メモリ、13 フラッシュメモリ、14 不揮発性メモリ、15 実行用RAM、16 バス、21 ブロック、22 ページ、31 フラッシュメモリ書込み消去管理部、32 全データ世代管理部、33 ブロック余命管理部、34 全ブロックデータ余命管理部、35 ページデータ世代管理部、100 フラッシュメモリ管理装置。   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)

ページ単位でデータの書き込みを行い、複数のページで構成されるブロック単位でデータの消去を行う複数のブロックを有するフラッシュメモリの管理を行うフラッシュメモリ管理装置であって、
ブロックごとに、当該ブロックにおけるデータ消去回数を管理するデータ消去回数管理部と、
ページごとに、当該ページに書き込まれているデータの書込み時刻からの経過時間を管理するページ経過時間管理部と、
各ブロックにおけるデータ消去回数と、各ページのデータの書込み時刻からの経過時間とに基づき、前記複数のブロックの中から一つ以上のブロックを、書込み対象データの書き込み先の候補である書込み対象候補ブロックとして選択するブロック選択部と、
前記ブロック選択部により選択された書込み対象候補ブロックのいずれかに書込み対象データを書き込むデータ書込み部とを有することを特徴とするフラッシュメモリ管理装置。
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.
前記ページ経過時間管理部は、
データが書き込まれている書込み済みページを、当該書込み済みページに書き込まれているデータの書込み時刻からの経過時間に応じて複数のグループのいずれかに分類し、
前記ブロック選択部は、
各ブロックにおけるデータ消去回数と、前記ページ経過時間管理部による書込み済みページごとのグループ分類結果とに基づき、前記複数のブロックの中から一つ以上のブロックを書込み対象候補ブロックとして選択することを特徴とする請求項1に記載のフラッシュメモリ管理装置。
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.
前記ブロック選択部は、
前記複数のブロックのうちデータ消去回数が小さいブロックから順に抽出し、
抽出したブロックに含まれる書込み済みページが経過時間の短いグループに分類されている場合に、抽出した当該ブロックを書込み対象候補ブロックとして選択することを特徴とする請求項2に記載のフラッシュメモリ管理装置。
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. .
前記ブロック選択部は、
前記複数のブロックのうちデータ消去回数が小さいブロックから順に抽出し、
抽出したブロックにデータが書き込まれていない場合に、抽出した当該ブロックを書込み対象候補ブロックとして選択し、
抽出したブロックに既にデータが書き込まれている場合に、抽出したブロックにデータが書き込まれていない空きページが存在するか否かを判断し、
空きページが存在しない場合に、抽出した当該ブロックを書込み対象候補ブロックとして選択し、
空きページが存在する場合に、抽出した当該ブロックに含まれる書込み済みページがいずれのグループに分類されているかを判断し、
書込み済みページが経過時間の短いグループに分類されている場合に、抽出した当該ブロックを書込み対象候補ブロックとして選択することを特徴とする請求項3に記載のフラッシュメモリ管理装置。
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.
前記ブロック選択部は、
抽出したブロックに空きページが存在する場合に、抽出した当該ブロックに含まれる書込み済みページがいずれのグループに分類されているかを判断し、
抽出した当該ブロックに含まれる全ての書込み済みページが経過時間の短いグループに分類されている場合に、抽出した当該ブロックを書込み対象候補ブロックとして選択することを特徴とする請求項4に記載のフラッシュメモリ管理装置。
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.
前記フラッシュメモリ管理装置は、
前記フラッシュメモリ以外の他のメモリを管理し、
前記データ書込み部は、
前記ブロック選択部により選択された書込み対象候補ブロックのうちデータ消去回数が小さいブロックから順に抽出し、
抽出した書込み対象候補ブロックにデータが書き込まれていない場合に、抽出した当該書込み対象候補ブロックに書込み対象データを書き込み、
抽出した当該書込み対象候補ブロックに既にデータが書き込まれている場合に、抽出した当該書込み対象候補ブロックにデータが書き込まれていない空きページが存在するか否かを判断し、
空きページが存在する場合に、抽出した当該書込み対象候補ブロックの空きページに書込み対象データを書き込み、
空きページが存在しない場合に、抽出した当該書込み対象候補ブロックに書き込まれているデータを前記他のメモリに退避し、
前記他のメモリに退避させたデータを当該書込み対象候補ブロックから消去して書込み対象データを書き込むことを特徴とする請求項1〜5のいずれかに記載のフラッシュメモリ管理装置。
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.
前記データ書込み部は、
前記他のメモリに退避したデータを、書込み対象データとし、
前記他のメモリに退避したデータを、データ消去回数が特定数以上のブロックに書き込むことを特徴とする請求項6に記載のフラッシュメモリ管理装置。
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.
前記データ書込み部は、
前記他のメモリに退避したデータを、他の書込み対象データに優先して、データ消去回数が特定数以上のブロックに書き込むことを特徴とする請求項7に記載のフラッシュメモリ管理装置。
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.
前記ページ経過時間管理部は、
データが書き込まれている書込み済みページを、当該書込み済みページに書き込まれているデータの書込み時刻からの経過時間に応じて複数のグループのいずれかに分類し、
前記ブロック選択部は、
データ消去回数が特定数未満のブロックを一つ以上抽出するとともに、抽出したブロックに含まれる書込み済みページが経過時間の短いグループに分類されていない場合に、抽出した当該ブロックをデータ移管対象ブロックとして選択し、
前記データ書込み部は、
前記ブロック選択部により選択された前記データ移管対象ブロックに書き込まれている移管対象データを、前記データ消去回数が前記特定数以上のいずれかのブロックに書き込むとともに、前記移管対象データを前記データ移管対象ブロックから消去することを特徴とする請求項1〜8のいずれかに記載のフラッシュメモリ管理装置。
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.
前記ブロック選択部は、
データ消去回数が前記特定数以上のブロックを移管先候補ブロックとして一つ以上選択し、
前記データ書込み部は、
前記ブロック選択部により選択された移管先候補ブロックを所定の順序で抽出し、
抽出した移管先候補ブロックにデータが書き込まれていない場合に、抽出した当該移管先候補ブロックに前記移管対象データを書き込み、
抽出した当該移管先候補ブロックに既にデータが書き込まれている場合に、抽出した当該移管先候補ブロックにデータが書き込まれていない空きページが存在するか否かを判断し、
空きページが存在する場合に、抽出した当該移管先候補ブロックの空きページに前記移管対象データを書き込み、
空きページが存在しない場合に、次の移管先候補ブロックを抽出することを特徴とする請求項9に記載のフラッシュメモリ管理装置。
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.
前記ページ経過時間管理部は、
データが書き込まれている書込み済みページを、当該書込み済みページに書き込まれているデータの書込み時刻からの経過時間に応じて複数のグループのいずれかに分類し、
前記ブロック選択部は、
各ブロックに対して、書込み済みページごとに、当該書込み済みページが前記ページ経過時間管理部によりいずれのグループに分類されているかを判断し、同じブロックに異なるグループに分類される二以上のページが存在する場合に、当該ブロックをデータ移管対象ブロックとして選択するとともに、データ移管対象ブロックに書き込まれている移管対象データの移管先となるブロックを移管先候補ブロックとして一つ以上選択し、
前記データ書込み部は、
前記移管対象データをいずれかの移管先候補ブロックに書き込むとともに、前記移管対象データを移管元であるデータ移管対象ブロックから消去することを特徴とする請求項1〜8のいずれかに記載のフラッシュメモリ管理装置。
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.
前記ブロック選択部は、
経過時間の短いグループに分類されているページに書き込まれている移管対象ページに対して、データ消去回数が少ないブロックを優先して前記移管先候補ブロックとして選択し、
経過時間の長いグループに分類されているページに書き込まれている移管対象ページに対して、データ消去回数が多いブロックを優先して前記移管先候補ブロックとして選択することを特徴とする請求項11に記載のフラッシュメモリ管理装置。
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.
前記ブロック選択部は、
共通するグループに属する二以上のページに書き込まれているデータが同じブロックに格納されるように、移管先候補ブロックを選択することを特徴とする請求項11又は12に記載のフラッシュメモリ管理装置。
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.
前記データ消去回数管理部は、
いずれかのブロックおいてデータが消去される度に、データが消去されたブロックにデータ消去回数を書き込み、前記フラッシュメモリにブロックごとにデータ消去回数を記憶させて、ブロックごとのデータ消去回数を管理することを特徴とする請求項1〜13のいずれかに記載のフラッシュメモリ管理装置。
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:
前記フラッシュメモリ管理装置は、
前記フラッシュメモリ以外の他のメモリを管理し、
前記データ消去回数管理部は、
ブロックごとのデータ消去回数を示すデータ消去回数管理テーブルを前記他のメモリに記憶させ、いずれかのブロックおいてデータが消去される度に、データが消去されたブロックのデータ消去回数を前記データ消去回数管理テーブルに書き込んで、ブロックごとのデータ消去回数を管理することを特徴とする請求項1〜14のいずれかに記載のフラッシュメモリ管理装置。
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.
前記ページ経過時間管理部は、
前記書込み済みページに書き込まれているデータが用いられるアプリケーションプログラムごとに異なる経過時間の基準を用いて、前記書込み済みページを複数のグループのいずれかに分類することを特徴とする請求項2に記載のフラッシュメモリ管理装置。
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.
前記データ書込み部は、
書込み対象データを書き込む際に、併せて、書込み先のページに書込み対象データの書込み時刻を書き込み、
前記ページ経過時間管理部は、
書込み済みページを、当該書込み済みページに書き込まれている書込み時刻からの経過時間に応じて複数のグループのいずれかに分類することを特徴とする請求項2に記載のフラッシュメモリ管理装置。
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.
ページ単位でデータの書き込みを行い、複数のページで構成されるブロック単位でデータの消去を行う複数のブロックを有するフラッシュメモリの管理を行うフラッシュメモリ管理方法であって、
ブロックごとに、当該ブロックにおけるデータ消去回数を管理するデータ消去回数管理ステップと、
ページごとに、当該ページに書き込まれているデータの書込み時刻からの経過時間を管理するページ経過時間管理ステップと、
各ブロックにおけるデータ消去回数と、各ページのデータの書込み時刻からの経過時間とに基づき、前記複数のブロックの中から一つ以上のブロックを、書込み対象データの書き込み先の候補である書込み対象候補ブロックとして選択するブロック選択ステップと、
前記ブロック選択ステップにより選択された書込み対象候補ブロックのいずれかに書込み対象データを書き込むデータ書込みステップとを有することを特徴とするフラッシュメモリ管理方法。
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.
ページ単位でデータの書き込みを行い、複数のページで構成されるブロック単位でデータの消去を行う複数のブロックを有するフラッシュメモリの管理を行うフラッシュメモリ管理装置に、
ブロックごとに、当該ブロックにおけるデータ消去回数を管理するデータ消去回数管理処理と、
ページごとに、当該ページに書き込まれているデータの書込み時刻からの経過時間を管理するページ経過時間管理処理と、
各ブロックにおけるデータ消去回数と、各ページのデータの書込み時刻からの経過時間とに基づき、前記複数のブロックの中から一つ以上のブロックを、書込み対象データの書き込み先の候補である書込み対象候補ブロックとして選択するブロック選択処理と、
前記ブロック選択処理により選択された書込み対象候補ブロックのいずれかに書込み対象データを書き込むデータ書込み処理とを実行させることを特徴とするプログラム。
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 (5)

* 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
KR102233808B1 (en) 2014-03-14 2021-03-30 삼성전자주식회사 Storage device and table management method thereof
KR102282962B1 (en) 2014-12-22 2021-07-30 삼성전자주식회사 Storage device and method for operating storage device
CN112181303A (en) * 2020-09-29 2021-01-05 广东艾科技术股份有限公司 Data storage method and device, computer equipment and storage medium

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
US11704239B2 (en) Garbage collection method for storage medium, storage medium, and program product
JP5164506B2 (en) FLASH MEMORY MANAGEMENT DEVICE, FLASH MEMORY MANAGEMENT METHOD, AND PROGRAM
US6862604B1 (en) Removable data storage device having file usage system and method
JP5708216B2 (en) Flash memory device, memory control device, memory control method, and storage system
JP2008242503A (en) Memory management apparatus and method, and program
JP2005242897A (en) Flash disk drive
JP2006235960A (en) Method for increasing speed of garbage collection
JP2008033788A (en) Nonvolatile storage device, data storage system, and data storage method
TW200919185A (en) Data storage device, memory system, and computing system using nonvolatile memory device
JP2007241576A (en) Nonvolatile storage device and data writing method
JP2008070975A (en) Data storage device and data storage method
JP2017123110A (en) Data storage device, data storage method, and program
JPWO2009107393A1 (en) Access device, information recording device, controller, and information recording system
JP6167646B2 (en) Information processing apparatus, control circuit, control program, and control method
WO2005098587A1 (en) Screen transition control device
JP5874525B2 (en) Control device, storage device, and storage control method
JP5183662B2 (en) Memory control device and memory control method
JP2009205689A (en) Flash disk device
JP2005322209A (en) Silicon storage medium control method, and silicon storage medium
JP2016062319A (en) Data reading device, program and data reading method
JP2006085342A (en) Memory controller, memory control method, and program
CN111427511B (en) Data storage method and device
JP4235646B2 (en) Memory controller and flash memory system
JP2006003966A (en) Write method for flash memory
JP2004062328A (en) Flash storage medium loading nand-type flash memory

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