JP2006126919A - Data management device for flash memory and control method of flash memory - Google Patents

Data management device for flash memory and control method of flash memory Download PDF

Info

Publication number
JP2006126919A
JP2006126919A JP2004310782A JP2004310782A JP2006126919A JP 2006126919 A JP2006126919 A JP 2006126919A JP 2004310782 A JP2004310782 A JP 2004310782A JP 2004310782 A JP2004310782 A JP 2004310782A JP 2006126919 A JP2006126919 A JP 2006126919A
Authority
JP
Japan
Prior art keywords
copy
data
entry
unit
sector
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.)
Pending
Application number
JP2004310782A
Other languages
Japanese (ja)
Inventor
Yukio Ueno
幸男 上野
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.)
Kyocera Corp
Original Assignee
Kyocera 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 Kyocera Corp filed Critical Kyocera Corp
Priority to JP2004310782A priority Critical patent/JP2006126919A/en
Publication of JP2006126919A publication Critical patent/JP2006126919A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Techniques For Improving Reliability Of Storages (AREA)
  • Memory System (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To enable restart, in the event of power supply interruption during garbage collection, from a point where abnormality occurred at the next starting. <P>SOLUTION: A flash memory 9 is composed of a data unit, a data management unit and a spare unit. A block copy flag is provided on the unit header of each unit, and the data management unit includes entry information, a sector copy flag, an entry copy flag and a validity/invalidity determination part. In recovery processing, whether garbage collection is in execution or not and whether copying is performed for the data unit or not are determined based on the value of the block copy flag. The previous interruption position is discriminated from the state of the sector copy flag, and copying is continued from this position. Since the previous interruption position can be found out from the state of the entry copy flag, copying is continued from this position. <P>COPYRIGHT: (C)2006,JPO&NCIPI

Description

本発明は、フラッシュメモリを備えた電子機器に係り、フラッシュメモリのデータ管理装置およびフラッシュメモリの制御方法に関する。   The present invention relates to an electronic device including a flash memory, and more particularly to a data management device for a flash memory and a control method for the flash memory.

従来からセクタ管理情報とブロック管理情報とに基づいてブロック単位でのデータの書き込み及びセクタ単位でのデータの一括消去を含むアクセス制御を行い、セクタ消去回数に基づいてデータの書き込み対象のセクタを選択するフラッシュメモリ制御方法が知られている(例えば、特許文献1参照)。フラグ値「セクタ消去開始(00000)」、「セクタ消去中(11111)」、および「ガーベッジコレクション中(00111)」は、セクタのデータの処理途中であり、データの真偽性が定かでないので、セクタのブロックデータ部の内容を再度消去する。
特開2000−330850号公報
Conventionally, access control including data writing in block units and batch data erasing in sector units is performed based on sector management information and block management information, and a sector to which data is to be written is selected based on the number of sector erasures A flash memory control method is known (for example, see Patent Document 1). The flag values “sector erase start (00000)”, “sector erase in progress (11111)”, and “garbage collection in progress (00111)” are in the middle of processing the sector data, and the authenticity of the data is not clear. The contents of the block data portion of the sector are erased again.
JP 2000-330850 A

しかしながら、特許文献1に示す制御方法にあっては、ガーベッジコレクションを起動すると、「セクタ消去開始」、「セクタ消去中」、および「ガーベッジコレクション中」状態に一時的になる。この状態でパワーロス(電源断)が発生した場合、データの真偽性が定かでないので、途中までデータコピーが完了しているセクタであっても、再度消去しなければならない。これは、システムにとって短くない時間を要してなされるセクタ消去を強いる結果となる。また、フラッシュメモリのセクタ消去回数を増やすことにもなり、デバイスの寿命を短縮してしまうという問題がある。   However, in the control method disclosed in Patent Document 1, when garbage collection is activated, the state is temporarily changed to “sector erase start”, “sector erase in progress”, and “garbage collection in progress” states. If a power loss (power interruption) occurs in this state, the authenticity of the data is not clear, so even a sector for which data copying has been completed must be erased again. This results in a sector erasure that takes a non-short time for the system. In addition, the number of sector erasures in the flash memory is increased, and there is a problem that the lifetime of the device is shortened.

本発明は、このような事情を考慮してなされたものであり、その目的は、ガーベッジコレクション中に電源断が発生しても、次回起動時に異常発生した箇所から継続することができるフラッシュメモリのデータ管理装置およびフラッシュメモリの制御方法を提供することにある。   The present invention has been made in consideration of such circumstances, and the purpose of the present invention is to provide a flash memory that can continue from the location where an abnormality occurs at the next startup even if a power failure occurs during garbage collection. A data management apparatus and a flash memory control method are provided.

本発明は、セクタ単位毎にデータをアクセスする複数のデータユニットと、該データユニットに記憶されているデータのエントリ情報を記憶するデータ管理ユニットとから構成されるフラッシュメモリのデータ管理装置であって、ガーベッジコレクション動作中におけるデータアクセス状況を記録するアクセス状況記録手段と、システム立上時に、前記データアクセス状況に基づいて、データアクセスの中断位置を認知し、該中断位置からデータアクセスを継続するデータアクセス制御手段とを備えたことを特徴とする。   The present invention is a data management device for a flash memory comprising a plurality of data units for accessing data for each sector unit and a data management unit for storing entry information of data stored in the data units. , An access status recording means for recording a data access status during a garbage collection operation, and data for recognizing a data access interruption position based on the data access status at the time of system startup and continuing data access from the interruption position And an access control means.

また本発明は、前記アクセス状況記録手段は、ガーベッジコレクション動作中におけるセクタコピーの中断位置を、前記データ管理ユニットに設けられたセクタコピーフラグの値として記録し、前記データアクセス制御手段は、システム立上時に、前記セクタコピーフラグの値に基づいて、セクタコピーの中断位置を認知し、該中断位置からセクタコピーを継続することを特徴とする。   According to the present invention, the access status recording means records a sector copy interruption position during a garbage collection operation as a value of a sector copy flag provided in the data management unit, and the data access control means At the time of the above, a sector copy interruption position is recognized based on the value of the sector copy flag, and sector copying is continued from the interruption position.

また本発明は、前記アクセス状況記録手段は、ガーベッジコレクション動作中におけるエントリコピーの中断位置を、前記データ管理ユニットに設けられたエントリコピーフラグの値として記録し、前記データアクセス制御手段は、システム立上時に、前記エントリコピーフラグの値に基づいて、エントリコピーの中断位置を認知し、該中断位置からエントリコピーを継続することを特徴とする。   According to the present invention, the access status recording means records an entry copy interruption position during a garbage collection operation as a value of an entry copy flag provided in the data management unit, and the data access control means At the time of the above, based on the value of the entry copy flag, the entry copy interruption position is recognized, and the entry copy is continued from the interruption position.

また本発明は、ガーベッジコレクション中におけるデータユニット間のコピー状態を、前記データユニットヘッダに設けられたブロックコピーフラグの値として記録するブロックコピー制御手段を具備し、前記データアクセス制御手段は、前記ブロックコピーフラグの値に基づいて、前記セクタコピーフラグの値に基づいて、中断位置からセクタコピーを継続するか、前記エントリコピーフラグの値に基づいて、中断位置からエントリコピーを継続するかを判断することを特徴とする。   The present invention further comprises block copy control means for recording a copy state between data units during garbage collection as a value of a block copy flag provided in the data unit header, wherein the data access control means comprises the block Based on the value of the copy flag, it is determined whether to continue sector copying from the interruption position based on the value of the sector copy flag or whether to continue entry copying from the interruption position based on the value of the entry copy flag. It is characterized by that.

また本発明は、セクタ単位毎にデータをアクセスする複数のデータユニットと、該データユニットに記憶されているデータのエントリ情報を記憶するデータ管理ユニットとから構成されるフラッシュメモリの制御方法であって、ガーベッジコレクション動作中におけるデータアクセス状況を記録し、システム立上時に、前記データアクセス状況に基づいて、データアクセスの中断位置を認知し、該中断位置からデータアクセスを継続することを特徴とする。   The present invention also provides a flash memory control method comprising a plurality of data units that access data for each sector unit, and a data management unit that stores data entry information stored in the data units. The data access situation during the garbage collection operation is recorded, and when the system is started, the data access interruption position is recognized based on the data access situation, and the data access is continued from the interruption position.

また本発明は、ガーベッジコレクション動作中におけるセクタコピーの中断位置を、前記データ管理ユニットに設けられたセクタコピーフラグの値として記録し、システム立上時に、前記セクタコピーフラグの値に基づいて、セクタコピーの中断位置を認知し、該中断位置からセクタコピーを継続することを特徴とする。   Further, the present invention records the sector copy interruption position during the garbage collection operation as the value of the sector copy flag provided in the data management unit. Based on the value of the sector copy flag at the time of system startup, It is characterized by recognizing a copy interruption position and continuing sector copying from the interruption position.

また本発明は、ガーベッジコレクション動作中におけるエントリコピーの中断位置を、前記データ管理ユニットに設けられたエントリコピーフラグの値として記録し、システム立上時に、前記エントリコピーフラグの値に基づいて、エントリコピーの中断位置を認知し、該中断位置からエントリコピーを継続することを特徴とする。   Further, the present invention records the entry copy interruption position during the garbage collection operation as the value of the entry copy flag provided in the data management unit. Based on the value of the entry copy flag when the system is started up, It is characterized by recognizing the copy interruption position and continuing the entry copy from the interruption position.

また本発明は、ガーベッジコレクション中におけるデータユニット間のコピー状態を、前記データユニットヘッダに設けられたブロックコピーフラグの値として記録し、前記ブロックコピーフラグの値に基づいて、前記セクタコピーフラグの値に基づいて中断位置からセクタコピーを継続するか、前記エントリコピーフラグの値に基づいて、中断位置からエントリコピーを継続するかを判断することを特徴とする。   Further, the present invention records a copy state between data units during garbage collection as a value of a block copy flag provided in the data unit header, and based on the value of the block copy flag, the value of the sector copy flag Whether to continue sector copying from the interruption position or to determine whether to continue entry copying from the interruption position based on the value of the entry copy flag.

本発明によれば、アクセス状況記録手段により、ガーベッジコレクション動作中におけるデータアクセス状況を記録し、データアクセス制御手段により、システム立上時に、前記データアクセス状況に基づいて、データアクセスの中断位置を認知し、該中断位置からデータアクセスを継続するようにしたため、ガーベッジコレクション中に電源断が発生しても、次回起動時に異常発生した箇所から継続することができるという利点が得られる。   According to the present invention, the access status recording means records the data access status during the garbage collection operation, and the data access control means recognizes the data access interruption position based on the data access status when the system is started up. Since the data access is continued from the interruption position, even if the power is cut off during the garbage collection, it is possible to continue from the location where the abnormality occurs at the next activation.

以下、本発明の一実施形態による電子機器を、図面を参照して説明する。
図1は、本発明の実施形態の構成を示すブロック図である。ここでは、電子機器の一例として、携帯電話端末を例にして説明する。図1において、符号1は、基地局との間で通信回線を確立して通信をする無線部である。符号2は、携帯電話端末の動作を統括して制御を行う制御部である。符号3は、ユーザ特有の情報やデータを一時的に記憶するRAM、および携帯電話端末を動作させるためのプログラム等が予め記憶されたROMである。符号5は、通話音声を集音するマイクと通話音声を発音させるスピーカである。符号6は、ダイヤルキーやファンクションキー等から構成されるキー操作部である。符号7は、液晶のディスプレイで構成される表示部である。符号8は、フラッシュメモリ9に対してデータのアクセスを行うフラッシュメモリドライバである。
Hereinafter, an electronic apparatus according to an embodiment of the present invention will be described with reference to the drawings.
FIG. 1 is a block diagram showing the configuration of the embodiment of the present invention. Here, a mobile phone terminal will be described as an example of an electronic device. In FIG. 1, reference numeral 1 denotes a wireless unit that establishes a communication line with a base station and performs communication. Reference numeral 2 denotes a control unit that performs overall control of the operation of the mobile phone terminal. Reference numeral 3 denotes a RAM that temporarily stores user-specific information and data, and a ROM that stores programs for operating the mobile phone terminal in advance. Reference numeral 5 denotes a microphone that collects the call voice and a speaker that generates the call voice. Reference numeral 6 denotes a key operation unit including dial keys, function keys, and the like. Reference numeral 7 denotes a display unit composed of a liquid crystal display. Reference numeral 8 denotes a flash memory driver for accessing data to the flash memory 9.

ここで、図2を参照して、図1に示すフラッシュメモリ9における記憶領域の構成を説明する。図2は、図1に示すフラッシュメモリ9の記憶領域の構成を示す説明図である。フラッシュメモリ9内は、ブロック消去単位毎にユニットに分かれている。ここでは、6つのデータユニットと、1つのデータ管理ユニット及び1つのスペアユニットから構成され、各ユニットは8kバイトの容量を有しているものとして説明する。データユニットは、名称のとおりデータを格納するユニットであり、各データユニットは64バイトで区切られたセクタを有している。このセクタがデータとしての書き込み単位となる。   Here, the configuration of the storage area in the flash memory 9 shown in FIG. 1 will be described with reference to FIG. FIG. 2 is an explanatory diagram showing the configuration of the storage area of the flash memory 9 shown in FIG. The flash memory 9 is divided into units for each block erase unit. Here, it is assumed that each unit is composed of six data units, one data management unit and one spare unit, and each unit has a capacity of 8 kbytes. The data unit is a unit for storing data as the name indicates, and each data unit has sectors separated by 64 bytes. This sector is a writing unit as data.

データ管理ユニットは、データユニットを管理するユニットであり、8バイト単位としてエントリ情報を有する。また、各ユニットの先頭1セクタ分にユニットヘッダを設けてある。このユニットヘッダには、ユニット識別マーク、ブロックイレーズカウンタ、および後述するブロックコピーフラグを設ける。ユニット識別マークは、そのユニットがデータ管理ユニットかスペアユニットか、あるいはデータユニットかを識別するために使用する。所定のブロックがその時点での用途により、このマークはその都度書き換えられる。フォーマット時には、データ管理ユニットは先頭ブロック、スペアユニットは末尾ブロックに割り当てられる。ブロックイレーズカウンタは、そのブロックが消去された回数を記録しておくものであり、フォーマット時は00hにする。各ユニットヘッダには、00hからFFhの値が格納され、制御によりFFhの次には00hに戻る。   The data management unit is a unit that manages data units and has entry information in units of 8 bytes. In addition, a unit header is provided for the first one sector of each unit. This unit header is provided with a unit identification mark, a block erase counter, and a block copy flag which will be described later. The unit identification mark is used to identify whether the unit is a data management unit, a spare unit, or a data unit. This mark is rewritten each time a predetermined block is used depending on the use at that time. At the time of formatting, the data management unit is assigned to the first block, and the spare unit is assigned to the last block. The block erase counter records the number of times the block has been erased, and is set to 00h during formatting. Each unit header stores a value from 00h to FFh, and returns to 00h after FFh by control.

スペアユニットは、ガーベッジコレクションやウエアレベリングの実行の際に使用するユニットである。データ管理ユニットのエントリ情報には、64バイトセクタの先頭アドレス、ユニット番号(データ格納のブロック番号)、セクタ番号、セクタコピーフラグ、エントリコピーフラグ、有効/無効の判別部、無効エントリのdirty/clean判別部を有する。有効/無効の判別部は、データ削除されたときに00hに上書きする。データは無効であるが、この時点では無効エントリのdirty/cleanの判別部がまだdirtyである。すなわち、フラッシュメモリシステム上、管理された無効セクタを示す。dirty/cleanの判別部は、ガーベッジコレクションされたときに00hに上書きする。すなわち、データは無効であり、かつ、cleanである。データ管理上、完全に削除された状態になる。エントリの更新は、新エントリを空き領域に書き込み、旧エントリを無効にすることにより行う。エントリ情報を含むデータ管理ユニットをガーベッジコレクションするときは、dirtyのエントリはスペアユニットにコピーするが、cleanのエントリのユニットは既にガーベッジコレクション済みであるためcleanのエントリはコピーしない。   The spare unit is a unit used when executing garbage collection or wear leveling. The entry information of the data management unit includes a 64-byte sector start address, unit number (block number for data storage), sector number, sector copy flag, entry copy flag, valid / invalid discriminator, dirty / clean of invalid entry It has a discrimination part. The valid / invalid determination unit overwrites 00h when data is deleted. Although the data is invalid, at this point, the dirty / clean discriminator of the invalid entry is still dirty. That is, it indicates an invalid sector managed on the flash memory system. The dirty / clean discriminating unit overwrites 00h when garbage is collected. That is, the data is invalid and clean. For data management, it is completely deleted. The entry is updated by writing the new entry into the empty area and invalidating the old entry. When the data management unit including the entry information is garbage collected, the dirty entry is copied to the spare unit, but the clean entry unit is already garbage collected, so the clean entry is not copied.

次に、ガーベッジコレクションについて説明する。ガーベッジコレクションとは、データを削除/編集等することによりデータユニットに無効セクタが生じ、それを除いて有効セクタのみをスペアユニットにコピーして、コピー元のユニットをブロックイレーズして、このイレーズしたユニットを次のスペアユニットとすることである。コピーすると同時に、新エントリ情報を書き込んで旧エントリ情報を無効化することにより、データ管理ユニットのエントリ情報も更新する。ガーベッジコレクションの対象ユニットは、最も無効セクタの多いユニットである。また、ガーベッジコレクションの起動条件は、書き込み時(書き込み前)にどのユニットも空きがないと判断したとき、あるいは、書き込み終了時/待機時に無効セクタ数が所定の閾値を超えたときである。   Next, garbage collection will be described. Garbage collection means that erased / edited data causes an invalid sector in the data unit. Except for this, only the valid sector is copied to the spare unit, and the source unit is block erased. The unit is to be the next spare unit. At the same time as copying, the entry information of the data management unit is also updated by writing new entry information and invalidating the old entry information. The target unit for garbage collection is the unit with the most invalid sectors. Also, the garbage collection start condition is when it is determined that no unit is empty at the time of writing (before writing), or when the number of invalid sectors exceeds a predetermined threshold at the time of completion of writing / waiting.

ガーベッジコレクションを実行する場合の手順は以下の通りとする。
(1)データ管理ユニットをサーチしてガーベッジコレクションの対象ブロックを選択する。
(2)有効セクタをスペアユニットにコピーする。
(3)上記(2)に連動して順次、新エントリをライトする。
(4)上記(2)、(3)に連動して順次、旧エントリを無効化する。
(5)不要となったブロックを消去する。
The procedure for executing garbage collection is as follows.
(1) Search the data management unit and select a target block for garbage collection.
(2) Copy the valid sector to the spare unit.
(3) Write new entries sequentially in conjunction with (2) above.
(4) The old entries are invalidated sequentially in conjunction with (2) and (3) above.
(5) Erase unnecessary blocks.

データ管理ユニットもガーベッジコレクションの対象になり、起動条件は、データ管理ユニットに追加可能な空きエントリー数がある一定値よりも少なくなったと判定したときである。動作は、エントリ上の有効/無効セクタをスペアユニットヘコピーし、clean部はコピーしない。そして、不要となった元のエントリのブロックを消去し、次のスペアユニットとする。   The data management unit is also subject to garbage collection, and the activation condition is when it is determined that the number of empty entries that can be added to the data management unit is less than a certain value. In the operation, valid / invalid sectors on the entry are copied to the spare unit, and the clean part is not copied. Then, the block of the original entry that is no longer needed is erased and used as the next spare unit.

データ管理ユニットのガーベッジコレクションを実行する場合の手順は以下の通りとする。
(1)データ管理ユニットに追加可能な空きエントリ数がある一定値よりも少なくなったことを判定する。
(2)エントリ上の有効/無効セクタをスペアユニットへコピーする(clean部はコピーしない)。
(3)上記(2)に連動して順次、エントリコピーフラグを操作する。
(4)不要となった元のブロックを消去する。
The procedure for executing data collection garbage collection is as follows.
(1) It is determined that the number of empty entries that can be added to the data management unit is less than a certain value.
(2) The valid / invalid sector on the entry is copied to the spare unit (the clean part is not copied).
(3) The entry copy flag is sequentially operated in conjunction with the above (2).
(4) Erase the original block that is no longer needed.

次に、ウエアレベリングについて説明する。ウエアレベリングは、消去回数が制限されるフラッシュメモリ9において、全てのブロックを平均的に使用するように管理することで、特定のブロックのみを繰り返し消去して先に寿命が尽きてしまうようなことがないように、メモリ全体を有効に活用するものである。ウエアレベリングの起動については、各ブロックイレーズカウンタをチェックし、ウエアレベリング起動の閾値以上になっていたら、そのカウンタ値が最小であるブロックを選定する。そして、このブロックの全データをスペアユニットにコピーすると同時に、新エントリ情報を書き込み、旧エントリ情報を無効化して、最後に、コピー元をブロック消去し、次のスペアユニットとする。各ブロックイレーズカウンタの値(最小と最大)が、ウエアレベリング起動の閾値以上に差が開くまでウエアレベリングを実行しない。   Next, wear leveling will be described. Wear leveling means that in the flash memory 9 in which the number of erasures is limited, all the blocks are managed so as to be used on average, so that only a specific block is erased repeatedly and the lifetime ends first. In order to avoid this, the entire memory is effectively used. For activation of wear leveling, each block erase counter is checked, and if it is equal to or greater than the threshold for wear leveling activation, the block having the smallest counter value is selected. Then, all the data in this block is copied to the spare unit, at the same time, new entry information is written, the old entry information is invalidated, and finally the copy source is erased to make the next spare unit. Wear leveling is not executed until the difference between each block erase counter value (minimum and maximum) exceeds the threshold for starting wear leveling.

ウエアレベリングの手順は以下の通りです。
(1)各ブロックイレーズカウンタをチェックし、ウエアレベリング起動閾値以上になっていたら、そのカウンタ値が最小のブロックを選定する。
(2)そのブロックの全データをスペアユニットにコピーする。
(3)コピー元とコピー先のユニット番号が分かるので、上記(2)に連動して新エントリをライトし、旧エントリを無効化する。
(4)コピー元をブロック消去する。
The procedure for wear leveling is as follows.
(1) Check each block erase counter. If the block erase counter is equal to or greater than the wear leveling activation threshold, select the block with the smallest counter value.
(2) Copy all data in the block to the spare unit.
(3) Since the copy source and copy destination unit numbers are known, the new entry is written in conjunction with the above (2), and the old entry is invalidated.
(4) Block erasing the copy source.

書き込み終了時/待機時に起動する、ガーベッジコレクションまたはウエアレベリングには、優先順位を設け、第1はデータ管理ユニットのガーベッジコレクション、第2はデータユニットのガーベッジコレクション、第3はウエアレベリングとする。1回の起動では、優先順位に従っていずれか1つを実行する。   Priorities are set for garbage collection or wear leveling that is activated at the end of writing / standby. The first is garbage collection of the data management unit, the second is garbage collection of the data unit, and the third is wear leveling. In one activation, any one is executed according to the priority order.

次に、図3を参照して、図1に示すフラッシュメモリドライバ8の構成を説明する。図3は、図1に示すフラッシュメモリドライバ8の構成を示すブロック図である。アプリケーションI/F部81は、アプリケーション側からの書き込み/読み出し要求等を受け付け、シーケンス制御部84に送る。シーケンス制御部84は、フラッシュメモリに対して実行したい操作、すなわち、アプリケーション側からの要求操作を順に手順を踏んでアクセス部を実行制御する。ユニットヘッダアクセス部85は、ユニットヘッダをアクセスするためのものであり、ユニット識別マーク、ブロックイレーズカウンタ、ブロックコピーフラグを書き込み/読み出す。実際のアクセスは、後述するデバイスI/F部89を実行することにより行われる。   Next, the configuration of the flash memory driver 8 shown in FIG. 1 will be described with reference to FIG. FIG. 3 is a block diagram showing a configuration of the flash memory driver 8 shown in FIG. The application I / F unit 81 receives a write / read request from the application side and sends it to the sequence control unit 84. The sequence control unit 84 executes and controls the access unit by sequentially performing an operation desired to be performed on the flash memory, that is, a request operation from the application side. The unit header access unit 85 is for accessing the unit header, and writes / reads a unit identification mark, a block erase counter, and a block copy flag. Actual access is performed by executing a device I / F unit 89 described later.

エントリアクセス部86は、ユニット番号、セクタ番号、有効/無効の判別部等を書き込み/読み出しする。実際のアクセスは、後述するデバイスI/F部89を実行することにより行われる。セクタデータアクセス部87は、64バイトセクタのデータを書き込み/読み出しするである。エントリ検索部88は、データ管理ユニットを検索して無効セクタ数が最大のユニットを取得するなど、エントリ情報を検索する。デバイスI/F部89は、直接フラッシュメモリに対して書き込み/読み出し等を実行する。   The entry access unit 86 writes / reads a unit number, sector number, valid / invalid discrimination unit, and the like. Actual access is performed by executing a device I / F unit 89 described later. The sector data access unit 87 is for writing / reading data of a 64-byte sector. The entry search unit 88 searches for entry information such as searching for a data management unit to obtain a unit having the largest number of invalid sectors. The device I / F unit 89 directly executes writing / reading with respect to the flash memory.

次に、本実施形態のフラッシュメモリシステムを復旧可能とする仕組みについて説明する。端末のシステム立上時に、フラッシュメモリの内容が正常な状態であるかをチェックする。もし、正常な状態でないならば、リカバリ処理を実行して復旧/修復を行う。   Next, a mechanism that enables the flash memory system of this embodiment to be recovered will be described. When the terminal system starts up, it is checked whether the contents of the flash memory are normal. If it is not normal, recovery processing is executed to perform recovery / restoration.

前回使用時において、ガーベッジコレクション中に電源断が発生した場合には、次回の端末電源起動時にフラッシュメモリの内容が不正であることが確認され、ガーベッジコレクションを再開して完了させる。そして、データ管理ユニットとデータ部とを正常な状態に戻す。   If the power interruption occurs during garbage collection during the previous use, it is confirmed that the contents of the flash memory are invalid when the terminal power is next activated, and garbage collection is resumed and completed. Then, the data management unit and the data part are returned to the normal state.

ユニットヘッダに設けるブロックコピーフラグは、ガーベッジコレクションやウエアレベリング時のブロックコピーを制御するために使用する。このブロックコピーフラグは、通常、FFhであるが、ブロックコピーが発生するときに上書きのかたちで使用する。ブロックコピーフラグの値とそのときの状態は次の通りである。   The block copy flag provided in the unit header is used to control block copy at the time of garbage collection or wear leveling. This block copy flag is normally FFh, but is used for overwriting when a block copy occurs. The value of the block copy flag and the state at that time are as follows.

FFh:ブロックコピーに関わりのないユニットである。
1Eh:ブロックコピー先のユニットでスペアユニットに相当する。
16h:コピーが終了した時点でコピー先のユニットの1Ehを16hに上書きする。
06h:コピー元ユニットをイレーズ(消去)後にコピー先ユニットを16hから06hにする。
04h:ブロックコピー元のユニットである(データ管理ユニットの場合)。
02h:ブロックコピー元のユニットである(データユニットの場合)。
FFh: A unit not involved in block copy.
1Eh: A block copy destination unit corresponding to a spare unit.
16h: When copying is completed, 1Eh of the copy destination unit is overwritten with 16h.
06h: After erasing (erasing) the copy source unit, the copy destination unit is changed from 16h to 06h.
04h: Block copy source unit (in the case of a data management unit).
02h: Block copy source unit (in the case of a data unit).

ブロックコピーフラグの設定順序は、
(1)スペアユニットをFFhから1Ehにする。
(2)コピー元ユニットをデータユニットの場合、02hに、データ管理ユニットの場合、04hにする(02h/04hに上書きしてからコピーを開始する)。
(3)スペアユニットを1Ehから16hにする(そのユニットの全データのコピーが終了した時点で16hに上書きする)。
(4)コピー元ユニットをイレーズ(消去)する。
(5)コピー先ユニットを16hから06hにする。
The order of setting the block copy flag is
(1) The spare unit is changed from FFh to 1Eh.
(2) When the copy source unit is a data unit, it is set to 02h, and when it is a data management unit, it is set to 04h (copying is started after overwriting on 02h / 04h).
(3) The spare unit is changed from 1Eh to 16h (overwriting to 16h when copying of all data of the unit is completed).
(4) Erase (erase) the copy source unit.
(5) The copy destination unit is changed from 16h to 06h.

ここで、図4は、ブロックコピーフラグの制御の一例を示す説明図である。図において、コピー元を「FF/06」と記述しているが、「FF」はフラッシュメモリがイレーズ後の初期状態であることを示し、「06」は以前のガーベッジコレクションで一度コピー先ブロックになっていることを示している。   FIG. 4 is an explanatory diagram showing an example of control of the block copy flag. In the figure, the copy source is described as “FF / 06”, but “FF” indicates that the flash memory is in the initial state after erasure, and “06” is once stored in the copy destination block in the previous garbage collection. It shows that it has become.

コピー先スペアユニットのブロックコピーフラグを1Ehにしている状態で電源断が発生したときのリカバリは、まだコピーを開始していないので何もしなくてよい。ブロックコピーフラグを1Ehにした後であるが、次回使用時に同じ値を上書きするためそのままでよい。   Recovery when a power failure occurs while the block copy flag of the copy destination spare unit is set to 1 Eh does not need to be performed because the copy has not yet started. After the block copy flag is set to 1Eh, the same value is overwritten when it is used next time.

コピー中の状態で電源断が発生したときのリカバリは、データ管理ユニットのエントリ情報をチェックすることで、どこまでコピーしたかを知ることが可能である。これにより、続きの処理を実行できる。なお、データユニットをコピー中のときはセクタコピーフラグを、データ管理ユニットをコピー中のときはエントリコピーフラグをチェックする。   Recovery when a power interruption occurs while copying is in progress can check how far the data has been copied by checking the entry information of the data management unit. Thereby, the subsequent processing can be executed. The sector copy flag is checked when the data unit is being copied, and the entry copy flag is checked when the data management unit is being copied.

コピー終了の状態で電源断が発生したときのリカバリは、コピーは終了したが無効となったブロックの消去がまだ実行されていないと認識する。そこで、コピー元ブロック、すなわちブロックコピーフラグが02hか04hのブロックの消去を実行できる。   Recovery when a power interruption occurs in the copy completed state recognizes that the block that has been copied but has been invalidated has not yet been erased. Therefore, the copy source block, that is, the block whose block copy flag is 02h or 04h can be erased.

コピー元ブロックを消去後の状態で電源断が発生したときのリカバリは、まず、コピー先のブロックコピーフラグが16hであるため、コピー元のそれが02hか04hのブロックを探す。しかし、コピー元は消去後であるため、ブロックコピーフラグが02hか04hのものは存在せず、既に消去済みと認識し、コピー先のブロックコピーフラグを06hにするだけでリカバリに対応できる。   In the recovery when the power interruption occurs in the state after erasing the copy source block, first, since the block copy flag of the copy destination is 16h, the block whose copy source is 02h or 04h is searched first. However, since the copy source is after erasure, there is no block copy flag of 02h or 04h, and it is possible to cope with recovery only by recognizing that the block has already been erased and setting the copy destination block copy flag to 06h.

データユニットをコピー中の時点でセクタコピーフラグを制御する。セクタコピーフラグは、データ管理ユニット中の各エントリに存在する。セクタコピーフラグの値とそのときの状態は次の通りである。   The sector copy flag is controlled at the time of copying the data unit. The sector copy flag is present in each entry in the data management unit. The value of the sector copy flag and the state at that time are as follows.

FFh:コピー元の1セクタからフラッシュメモリへライトする前の状態である。
0Fh:フラッシュメモリにライトする直前に0Fhにする。フラッシュメモリにライト中と見なせる。
03h:全バイトがフラッシュメモリへデータライト済み(コピー済み)になったら03hにする。
00h:古いエントリを無効とした後に、この新エントリのセクタコピーフラグを00hにする。
FFh: State before writing from one sector of the copy source to the flash memory.
0Fh: Set to 0Fh immediately before writing to the flash memory. It can be considered that the flash memory is being written.
03h: Set to 03h when all bytes have been written (copied) to the flash memory.
00h: After invalidating the old entry, the sector copy flag of this new entry is set to 00h.

ここで、図5は、セクタコピーフラグの制御の一例を示す説明図である。図において、旧エントリを「00/FF」と記述しているが、「FF」はフラッシュメモリがイレーズ後の初期状態であることを示し、「00」は以前のガーベッジコレクションで一度新エントリになったことを示している。   Here, FIG. 5 is an explanatory diagram showing an example of control of the sector copy flag. In the figure, the old entry is described as “00 / FF”, but “FF” indicates that the flash memory is in the initial state after erasure, and “00” once becomes a new entry in the previous garbage collection. It shows that.

ライト中の状態で電源断が発生したときのリカバリは、セクタコピーフラグが0Fh(エントリが指すセクタにコピー中)の新エントリを無効にし、新規にエントリを作り直してコピーを再開する。   When a power failure occurs while writing, the new entry whose sector copy flag is 0Fh (copying to the sector indicated by the entry) is invalidated, a new entry is newly created, and copying is resumed.

ライト終了の状態で電源断が発生したときのリカバリは、まずこの時点では2つのエントリが有効になっている。しかし、セクタコピーフラグは異なり、旧エントリでは00hで、新エントリでは03hである。つまり、セクタコピーフラグが03hであることを検出し、そのアドレスが分かり、同じアドレスの古いエントリが認識可能で、それを無効化できる。   For recovery when the power is cut off in the write end state, two entries are valid at this time. However, the sector copy flag is different and is 00h for the old entry and 03h for the new entry. That is, it is detected that the sector copy flag is 03h, the address is known, an old entry with the same address can be recognized, and it can be invalidated.

旧エントリ無効化後の状態で電源断が発生したときのリカバリは、新エントリのセクタコピーフラグを00hにするだけでよい。   Recovery when a power failure occurs in the state after invalidating the old entry only needs to set the sector copy flag of the new entry to 00h.

データ管理ユニットをコピー中の時点で、エントリコピーフラグを制御する。エントリコピーフラグは、データ管理ユニット中の各エントリに存在するフラグで、コピー元エントリ、またはコピー先エントリ上で操作する。エントリコピーフラグの値とそのときの状態は次の通りである。   When the data management unit is being copied, the entry copy flag is controlled. The entry copy flag is a flag existing in each entry in the data management unit, and is operated on the copy source entry or the copy destination entry. The value of the entry copy flag and the state at that time are as follows.

FFh:コピー前の状態である。
0Fh:コピー先へエントリライトする直前に旧エントリを0Fhにする。ライト開始となる。
CFh:コピー先へエントリライトする直前に新エントリをCFhにする。フラッシュにライト中と見なせる。
8Fh:コピー先へエントリライト終了後に新エントリを8Fhにする。
FFh: State before copying.
0Fh: The old entry is set to 0Fh immediately before the entry is written to the copy destination. Write starts.
CFh: The new entry is set to CFh immediately before the entry is written to the copy destination. It can be considered that the flash is being written.
8Fh: The new entry is set to 8Fh after the entry write to the copy destination is completed.

ここで、図6は、エントリコピーフラグの制御の一例を示す説明図である。図において、旧エントリを「FF/8F」と記述しているが、「FF」はフラッシュメモリがイレーズ後の初期状態であることを示し、「8F」はガーベッジコレクションで一度新エントリになったことを示している。   Here, FIG. 6 is an explanatory diagram showing an example of control of the entry copy flag. In the figure, the old entry is described as “FF / 8F”, but “FF” indicates that the flash memory is in the initial state after erasure, and “8F” is a new entry once in garbage collection. Is shown.

コピー前の状態で電源断が発生したときのリカバリは、最後に0Fhにした旧エントリを探し、あれば、その次のエントリからコピーする。   In the recovery when the power interruption occurs in the state before copying, the old entry last set to 0Fh is searched, and if there is, the next entry is copied.

ライト開始の状態で電源断が発生したときのリカバリは、旧エントリを0Fhにした直後であり、実際にはまだ書き込んでいないので、新エントリをコピー先の空き終端領域にライトする。   The recovery when the power interruption occurs in the write start state is immediately after the old entry is set to 0Fh, and since it has not been written yet, the new entry is written to the empty termination area of the copy destination.

ライト中の状態で電源断が発生したときのリカバリは、中途半端な新エントリを無効にする(この場合、厳密には新エントリはclean化が必要)。   Recovery when a power failure occurs while the data is being written invalidates the halfway new entry (in this case, it is strictly necessary to clean the new entry).

ライト終了の状態で電源断が発生したときのリカバリは、ライト終了したので、次のエントリコピーへ進む。   The recovery when the power is cut off in the write end state has completed the write, and the process proceeds to the next entry copy.

補足として、旧エントリのエントリコピーフラグを0Fhにしてからライト(コピー)するが、ライト直前の電源断ならば(すなわち、新エントリ側のフラグ値はFFh)、「真の」ライト中になっていない。つまり、新エントリのユニット番号はFFhである。このときは、新エントリはないので何も無効化にしてはいけない。ライト最中に電源断ならば(すなわち、新エントリ側のフラグ値はCFh)、ユニット番号はFFhでなく中途半端にライトされているので無効化する。   As a supplement, write (copy) is performed after the entry copy flag of the old entry is set to 0Fh. However, if the power is turned off immediately before writing (that is, the flag value on the new entry side is FFh), “true” writing is in progress. Absent. That is, the unit number of the new entry is FFh. At this time, there is no new entry, so nothing should be invalidated. If the power is cut off during writing (that is, the flag value on the new entry side is CFh), the unit number is invalidated because it is written halfway rather than FFh.

ガーベッジコレクション中に電源断した場合のリカバリに関しては次のようになる。ガーベッジコレクションでデータコピー中に電源断となると、次のパワーオン時、セクタコピーフラグが0Fh(エントリが指すセクタにコピー中)の新エントリを無効にし、新規にエントリを作り直してコピーを再開する。まず、ユニットヘッダにあるブロックコピーフラグをチェックして、コピー元ブロック(ブロックコピーフラグ:02h)とコピー先ブロック(ブロックコピーフラグ:1Eh)を確認する。ガーベッジコレクション中、セクタコピーと連動して新旧エントリの更新を行うので、コピー元ユニットのエントリがどこまで無効にされているかをチェックすることで続きのコピー対象セクタが分かる。   Regarding recovery when the power is cut off during garbage collection, it is as follows. If the power is cut off during data copy by garbage collection, the new entry whose sector copy flag is 0Fh (copying to the sector indicated by the entry) is invalidated at the next power-on, a new entry is recreated and copying is resumed. First, the block copy flag in the unit header is checked to confirm the copy source block (block copy flag: 02h) and the copy destination block (block copy flag: 1Eh). During garbage collection, new and old entries are updated in conjunction with sector copying, so it is possible to determine the sector to be copied continuously by checking how far the entry of the copy source unit has been invalidated.

データ管理ユニットのガーベッジコレクション中に電源断となると、次のパワーオン時、残りのエントリのユニット間コピーを実行し、ガーベッジコレクションを完了させる。まず、ユニットヘッダにあるブロックコピーフラグをチェックして、コピー元ブロック(ブロックコピーフラグ:04h)とコピー先ブロック(ブロックコピーフラグ:1Eh)を確認する。エントリコピーフラグによりコピー元ユニットのエントリがどこまでコピーされたか分かる(0Fhをチェック)。1エントリ(8バイト)分のコピーが途中まで実行され、コピーが終了していないエントリに対して、コピー先ユニットのその不完全なエントリを無効化(clean化)してから次の領域にコピーを行い、最終エントリまでコピーが終了したらコピー元ユニットを消去してガーベッジコレクションを完了させる。   If the power is cut off during the garbage collection of the data management unit, the next entry is copied between units at the next power-on to complete the garbage collection. First, the block copy flag in the unit header is checked to confirm the copy source block (block copy flag: 04h) and the copy destination block (block copy flag: 1Eh). The entry copy flag indicates how far the entry of the copy source unit has been copied (check 0Fh). Copying for one entry (8 bytes) is executed halfway, and for entries that have not been copied, the incomplete entry in the copy destination unit is invalidated (cleaned) and then copied to the next area. When copying is completed up to the final entry, the copy source unit is erased to complete garbage collection.

ウエアレベリング中に電源断した場合には、ガーベッジコレクション中の電源断と同様の処理になる。   When the power is turned off during wear leveling, the processing is the same as when the power is turned off during garbage collection.

次に、フラッシュメモリシステムの復旧方法の具体例について説明する。端末の電源を起動したときに実行される初期化処理の中で、フラッシュメモリシステムのリカバリ処理も実行する。ここで、図7ないし図9は、本実施形態によるリカバリ処理を説明するためのフローチャートである。   Next, a specific example of the flash memory system recovery method will be described. The flash memory system recovery process is also executed during the initialization process executed when the terminal power supply is activated. Here, FIG. 7 to FIG. 9 are flowcharts for explaining the recovery processing according to the present embodiment.

まず、ブロックコピーフラグ(BCF)をリードし(S10)、ユニットヘッダ内のブロックコピーフラグが02h、あるいは04hのユニットが存在するか否かを判断する(S12)。ここで、このようなユニットが存在する場合には、ガーベッジコレクション中に電源断が発生したことになる。そして、このようなユニットが存在しない場合には、通常処理へリターンする。   First, the block copy flag (BCF) is read (S10), and it is determined whether or not there is a unit whose block copy flag in the unit header is 02h or 04h (S12). Here, in the case where such a unit exists, it means that a power interruption has occurred during garbage collection. If no such unit exists, the process returns to the normal process.

一方、ブロックコピーフラグが02h、あるいは04hのユニットが存在した場合には、データユニットコピー中であるか、すなわち、ブロックコピーフラグが02hであるか、04hであるかを判断する(S14)。そして、ブロックコピーフラグが02hである場合には、データユニットのガーベッジコレクション再開復旧処理を実行し(S16)、ブロックコピーフラグが04hである場合には、データ管理ユニットのガーベッジコレクション再開復旧処理を実行する(S18)。   On the other hand, if there is a unit whose block copy flag is 02h or 04h, it is determined whether the data unit is being copied, that is, whether the block copy flag is 02h or 04h (S14). If the block copy flag is 02h, the data unit garbage collection restart recovery process is executed (S16). If the block copy flag is 04h, the data management unit garbage collection restart recovery process is executed. (S18).

上述したステップS14で、ブロックコピーフラグが02hである場合には、復旧処理として、その02hのユニットから1Ehのユニットにコピーする。どこまでセクタコピーが終了したかは、データ管理ユニットのコピー元ユニット番号を有するエントリがどこまで無効化されているか、セクタコピーフラグの状態で判断可能である。つまり、セクタコピーの中断位置が分かるので、その箇所から続きをコピーすればよく、コピー先ブロックを再度消去して最初からコピーする必要がない。以下、図8を参照して詳細に説明する。   If the block copy flag is 02h in step S14 described above, the unit is copied from the 02h unit to the 1Eh unit as the recovery process. The extent to which sector copying has been completed can be determined by the sector copy flag status to what extent the entry having the copy source unit number of the data management unit has been invalidated. That is, since the sector copy interruption position is known, it is only necessary to copy the continuation from that position, and it is not necessary to erase the copy destination block again and copy from the beginning. Hereinafter, this will be described in detail with reference to FIG.

図8に示すデータユニットのガーベッジコレクション再開復旧処理では、まず、セクタコピーフラグ(SCF)がライト中であるか否か、すなわちデータ管理ユニット内のセクタコピーフラグが0Fhのものがあるか否かを判断し(S30)、ライト中であれば、ライトされたエントリの指すデータが64バイトあるうち、全てのコピーが終了したわけではないので、一旦、その中断したセクタに対応するデータ管理ユニット内のエントリを無効化し(S32)、新規にエントリを作成し(S34)、セクタコピーを繰り返す(S40)。   In the garbage collection resumption recovery processing of the data unit shown in FIG. 8, first, it is determined whether or not the sector copy flag (SCF) is being written, that is, whether or not there is a sector copy flag in the data management unit of 0Fh. Judgment is made (S30), and if the data is being written, of the 64 bytes of data pointed to by the written entry, not all of the copying has been completed, so once the data in the data management unit corresponding to the interrupted sector is stored. The entry is invalidated (S32), a new entry is created (S34), and sector copying is repeated (S40).

一方、セクタコピーフラグが0Fhのものがないとき、ライト終了を意味しているので、旧エントリが無効化済みであるか否かを判断し(S36)、無効化済みであれば、そのままセクタコピーを繰り返す(S40)。また、旧エントリが無効化済みでなければ、それを無効化し(S38)、セクタコピーを繰り返す(S40)。   On the other hand, when there is no sector copy flag of 0Fh, it means the end of writing, so it is determined whether or not the old entry has been invalidated (S36). Is repeated (S40). If the old entry has not been invalidated, it is invalidated (S38), and sector copying is repeated (S40).

また、セクタコピーフラグが0Fhでユニット番号やセクタ番号がFFhであれば、データの実体はフラッシュ上のデータとして存在していないことになる。リカバリ処理として、データ管理ユニットのこのエントリを無効にするだけでよい。既存のエントリがそのまま有効になっている。   If the sector copy flag is 0Fh and the unit number or sector number is FFh, the data entity does not exist as data on the flash. As a recovery process, it is only necessary to invalidate this entry of the data management unit. Existing entries are still valid.

また、上述したステップS14で、ブロックコピーフラグが04hである場合には、データ管理ユニットのガーベッジコレクションとしてコピー実行中であることを示し、04hのユニットから1Ehのユニットにエントリコピーを再開する。どこまでエントリコピーが終了したかは、エントリコピーフラグを見て判断することが可能である。つまり、エントリコピーの中断位置が分かるので、その箇所から続きをコピーすればよく、コピー先ブロックを再度消去して最初からコピーする必要はない。以下、図9を参照して詳細に説明する。   If the block copy flag is 04h in step S14 described above, it indicates that copying is being performed as garbage collection of the data management unit, and entry copying is resumed from the unit of 04h to the unit of 1Eh. The extent to which entry copying has been completed can be determined by looking at the entry copy flag. That is, since the entry copy interruption position is known, it is only necessary to copy the continuation from that position, and it is not necessary to erase the copy destination block again and copy from the beginning. Hereinafter, this will be described in detail with reference to FIG.

図9に示すデータ管理ユニットのガーベッジコレクション再開復旧処理では、まず、エントリコピーフラグ(ECF)がライト開始時であるか否かを判断する(S50)。そして、エントリコピーフラグがライト開始時を示すときには、新エントリをライトし(S52)、エントリコピーを繰り返す(S60)。一方、エントリコピーフラグがライト開始時を示さないときは、エントリコピーフラグ(ECF)がライト中を示すか否かを判断する(S54)。そして、エントリコピーフラグがライト中を示すときには、中断されたエントリを無効化し(S56)、続きのエントリを作成し(S58)、エントリコピーを繰り返す(S60)。また、エントリコピーフラグがライト中を示さない場合、すなわち、ライト終了を示すときには、1つのエントリコピーが終結したことを意味するので、そのまま残りのエントリコピーを繰り返す(S60)。   In the garbage collection restart recovery process of the data management unit shown in FIG. 9, it is first determined whether or not the entry copy flag (ECF) is at the start of writing (S50). When the entry copy flag indicates the write start time, the new entry is written (S52), and the entry copy is repeated (S60). On the other hand, when the entry copy flag does not indicate the start of writing, it is determined whether or not the entry copy flag (ECF) indicates that writing is in progress (S54). When the entry copy flag indicates that writing is in progress, the suspended entry is invalidated (S56), a subsequent entry is created (S58), and entry copying is repeated (S60). If the entry copy flag does not indicate that writing is in progress, that is, indicates that writing has been completed, it means that one entry copy has been completed, so the remaining entry copies are repeated as they are (S60).

ここで、ブロックコピーフラグが1Ehでなく、16hであれば、そのユニットへのコピーは終了しているので、02hまたは04hのユニットをブロック消去する。   Here, if the block copy flag is not 1Eh but 16h, the copying to the unit is completed, and the unit of 02h or 04h is erased as a block.

上述した実施形態によれば、前回操作で不正終了することによりフラッシュメモリがメモリ管理上、破壊された状態になった場合でも、次回の端末起動時に復旧処理を実行することでフラッシュメモリを正常化することができる。また、ガーベッジコレクション中に電源断が発生しても、ブロックコピーを最初からでなく、異常が発生した途中から継続することができ、端末の起動時間も高速化することができる。また、最初からガーベッジコレクションを実行せずに途中からコピーを継続すればよいので、中途半端に書き込まれたブロックを消去する必要がなく、ブロック消去時間だけ待たされず、また、ブロック消去によるフラッシュメモリのデバイス寿命への悪影響を避けることができる。   According to the above-described embodiment, even if the flash memory is destroyed due to memory management due to an improper termination in the previous operation, the flash memory is normalized by executing recovery processing at the next terminal startup. can do. Even if the power is cut off during garbage collection, the block copy can be continued from the middle of occurrence of an abnormality, not from the beginning, and the startup time of the terminal can be increased. In addition, since it is only necessary to continue copying from the middle without executing garbage collection from the beginning, it is not necessary to erase the block written halfway, and it is not necessary to wait for the block erasing time. A negative impact on device life can be avoided.

また、図1における処理部の機能を実現するためのプログラムをコンピュータ読み取り可能な記録媒体に記録して、この記録媒体に記録されたプログラムをコンピュータシステムに読み込ませ、実行することによりフラッシュメモリ9制御処理を行ってもよい。なお、ここでいう「コンピュータシステム」とは、OSや周辺機器等のハードウェアを含むものとする。また、「コンピュータ読み取り可能な記録媒体」とは、フレキシブルディスク、光磁気ディスク、ROM、CD−ROM等の可搬媒体、コンピュータシステムに内蔵されるハードディスク等の記憶装置のことをいう。さらに「コンピュータ読み取り可能な記録媒体」とは、インターネット等のネットワークや電話回線等の通信回線を介してプログラムが送信された場合のサーバやクライアントとなるコンピュータシステム内部の揮発性メモリ(RAM)のように、一定時間プログラムを保持しているものも含むものとする。   Further, the program for realizing the function of the processing unit in FIG. 1 is recorded on a computer-readable recording medium, and the program recorded on the recording medium is read into the computer system and executed to control the flash memory 9. Processing may be performed. Here, the “computer system” includes an OS and hardware such as peripheral devices. The “computer-readable recording medium” refers to a portable medium such as a flexible disk, a magneto-optical disk, a ROM, and a CD-ROM, and a storage device such as a hard disk built in the computer system. Further, the “computer-readable recording medium” refers to a volatile memory (RAM) in a computer system that becomes a server or a client when a program is transmitted via a network such as the Internet or a communication line such as a telephone line. In addition, those holding programs for a certain period of time are also included.

また、上記プログラムは、このプログラムを記憶装置等に格納したコンピュータシステムから、伝送媒体を介して、あるいは、伝送媒体中の伝送波により他のコンピュータシステムに伝送されてもよい。ここで、プログラムを伝送する「伝送媒体」は、インターネット等のネットワーク(通信網)や電話回線等の通信回線(通信線)のように情報を伝送する機能を有する媒体のことをいう。また、上記プログラムは、前述した機能の一部を実現するためのものであっても良い。さらに、前述した機能をコンピュータシステムにすでに記録されているプログラムとの組み合わせで実現できるもの、いわゆる差分ファイル(差分プログラム)であっても良い。
また、システム立ち上げ時は、上述の実施形態では電源を起動した場合を説明したが、その他にリセット操作によってシステムがリセットされた場合も含まれる。
The program may be transmitted from a computer system storing the program in a storage device or the like to another computer system via a transmission medium or by a transmission wave in the transmission medium. Here, the “transmission medium” for transmitting the program refers to a medium having a function of transmitting information, such as a network (communication network) such as the Internet or a communication line (communication line) such as a telephone line. The program may be for realizing a part of the functions described above. Furthermore, what can implement | achieve the function mentioned above in combination with the program already recorded on the computer system, and what is called a difference file (difference program) may be sufficient.
In addition, when the system is started up, the case where the power supply is activated has been described in the above-described embodiment, but the case where the system is reset by a reset operation is also included.

本発明の実施形態の構成を示すブロック図である。It is a block diagram which shows the structure of embodiment of this invention. フラッシュメモリ9の記憶領域の構成を示す説明図である。3 is an explanatory diagram showing a configuration of a storage area of a flash memory 9. FIG. フラッシュメモリドライバ8の構成を示すブロック図である。3 is a block diagram showing a configuration of a flash memory driver 8. FIG. ブロックコピーフラグの制御の一例を示す説明図である。It is explanatory drawing which shows an example of control of a block copy flag. セクタコピーフラグの制御の一例を示す説明図である。It is explanatory drawing which shows an example of control of a sector copy flag. エントリコピーフラグの制御の一例を示す説明図である。It is explanatory drawing which shows an example of control of an entry copy flag. 本実施形態によるリカバリ処理を説明するためのフローチャートである。It is a flowchart for demonstrating the recovery process by this embodiment. 本実施形態によるリカバリ処理を説明するためのフローチャートである。It is a flowchart for demonstrating the recovery process by this embodiment. 本実施形態によるリカバリ処理を説明するためのフローチャートである。It is a flowchart for demonstrating the recovery process by this embodiment.

符号の説明Explanation of symbols

1・・・無線部、2・・・制御部、3・・・メモリ部、5・・・マイク/スピーカ、6・・・キー操作部、7・・・表示部、8・・・フラッシュメモリドライバ、9・・・フラッシュメモリ、81・・・アプリケーションI/F部、84・・・シーケンス制御部(データアクセス制御手段)、85・・・ユニットヘッダアクセス部(アクセス状況記録手段)、86・・・エントリアクセス部(アクセス状況記録手段)、87・・・セクタデータアクセス部(アクセス状況記録手段)、88・・・エントリ検索部、89・・・デバイスI/F部



DESCRIPTION OF SYMBOLS 1 ... Wireless part, 2 ... Control part, 3 ... Memory part, 5 ... Microphone / speaker, 6 ... Key operation part, 7 ... Display part, 8 ... Flash memory Driver 9, flash memory 81, application I / F section 84, sequence control section (data access control means) 85, unit header access section (access status recording means), 86 ..Entry access section (access status recording means), 87... Sector data access section (access status recording means), 88... Entry search section, 89... Device I / F section



Claims (8)

セクタ単位毎にデータをアクセスするデータユニットと、該データユニットに記憶されているデータのエントリ情報を記憶するデータ管理ユニットとから構成されるフラッシュメモリのデータ管理装置であって、
ガーベッジコレクション動作中におけるデータアクセス状況を記録するアクセス状況記録手段と、
システム立上時に、前記データアクセス状況に基づいて、データアクセスの中断位置を認知し、該中断位置からデータアクセスを継続するデータアクセス制御手段と
を備えたことを特徴とするフラッシュメモリのデータ管理装置。
A data management device for flash memory comprising a data unit for accessing data for each sector unit and a data management unit for storing entry information of data stored in the data unit,
Access status recording means for recording the data access status during the garbage collection operation;
A data management device for flash memory, comprising: a data access control means for recognizing a data access interruption position based on the data access status at the time of system startup and continuing data access from the interruption position .
前記アクセス状況記録手段は、ガーベッジコレクション動作中におけるセクタコピーの中断位置を、前記データ管理ユニットに設けられたセクタコピーフラグの値として記録し、
前記データアクセス制御手段は、システム立上時に、前記セクタコピーフラグの値に基づいて、セクタコピーの中断位置を認知し、該中断位置からセクタコピーを継続することを特徴とする請求項1記載のフラッシュメモリのデータ管理装置。
The access status recording means records the sector copy interruption position during the garbage collection operation as a value of a sector copy flag provided in the data management unit,
2. The data access control means according to claim 1, wherein when the system is started up, the sector copy flag is recognized based on the value of the sector copy flag, and the sector copy is continued from the interrupt position. Data management device for flash memory.
前記アクセス状況記録手段は、ガーベッジコレクション動作中におけるエントリコピーの中断位置を、前記データ管理ユニットに設けられたエントリコピーフラグの値として記録し、
前記データアクセス制御手段は、システム立上時に、前記エントリコピーフラグの値に基づいて、エントリコピーの中断位置を認知し、該中断位置からエントリコピーを継続することを特徴とする請求項1記載のフラッシュメモリのデータ管理装置。
The access status recording means records the entry copy interruption position during the garbage collection operation as a value of an entry copy flag provided in the data management unit,
2. The data access control unit according to claim 1, wherein when the system is started up, the entry copy interruption position is recognized based on the value of the entry copy flag, and the entry copy is continued from the interruption position. Data management device for flash memory.
ガーベッジコレクション中におけるデータユニット間のコピー状態を、前記データユニットヘッダに設けられたブロックコピーフラグの値として記録するブロックコピー制御手段を具備し、
前記データアクセス制御手段は、前記ブロックコピーフラグの値に基づいて、前記セクタコピーフラグの値に基づいて、中断位置からセクタコピーを継続するか、前記エントリコピーフラグの値に基づいて、中断位置からエントリコピーを継続するかを判断することを特徴とする請求項1記載のフラッシュメモリのデータ管理装置。
Block copy control means for recording a copy status between data units during garbage collection as a value of a block copy flag provided in the data unit header;
The data access control means continues the sector copy from the interruption position based on the value of the sector copy flag based on the value of the block copy flag or starts from the interruption position based on the value of the entry copy flag. 2. The data management apparatus for flash memory according to claim 1, wherein it is determined whether or not to continue entry copying.
セクタ単位毎にデータをアクセスする複数のデータユニットと、該データユニットに記憶されているデータのエントリ情報を記憶するデータ管理ユニットとから構成されるフラッシュメモリの制御方法であって、
ガーベッジコレクション動作中におけるデータアクセス状況を記録し、
システム立上時に、前記データアクセス状況に基づいて、データアクセスの中断位置を認知し、該中断位置からデータアクセスを継続することを特徴とするフラッシュメモリの制御方法。
A flash memory control method comprising a plurality of data units that access data for each sector unit and a data management unit that stores entry information of data stored in the data units,
Record the data access status during garbage collection,
A flash memory control method characterized by recognizing a data access interruption position based on the data access status at the time of system startup and continuing data access from the interruption position.
ガーベッジコレクション動作中におけるセクタコピーの中断位置を、前記データ管理ユニットに設けられたセクタコピーフラグの値として記録し、
システム立上時に、前記セクタコピーフラグの値に基づいて、セクタコピーの中断位置を認知し、該中断位置からセクタコピーを継続することを特徴とする請求項5記載のフラッシュメモリの制御方法。
The sector copy interruption position during the garbage collection operation is recorded as the value of the sector copy flag provided in the data management unit,
6. The flash memory control method according to claim 5, wherein when the system is started up, the sector copy interruption position is recognized based on the value of the sector copy flag, and sector copying is continued from the interruption position.
ガーベッジコレクション動作中におけるエントリコピーの中断位置を、前記データ管理ユニットに設けられたエントリコピーフラグの値として記録し、
電源起動時に、前記エントリコピーフラグの値に基づいて、エントリコピーの中断位置を認知し、該中断位置からエントリコピーを継続することを特徴とする請求項5記載のフラッシュメモリの制御方法。
The entry copy interruption position during the garbage collection operation is recorded as the value of the entry copy flag provided in the data management unit,
6. The flash memory control method according to claim 5, wherein when the power is turned on, the entry copy interruption position is recognized based on the value of the entry copy flag, and the entry copy is continued from the interruption position.
ガーベッジコレクション中におけるデータユニット間のコピー状態を、前記データユニットヘッダに設けられたブロックコピーフラグの値として記録し、
前記ブロックコピーフラグの値に基づいて、前記セクタコピーフラグの値に基づいて中断位置からセクタコピーを継続するか、前記エントリコピーフラグの値に基づいて、中断位置からエントリコピーを継続するかを判断することを特徴とする請求項5記載のフラッシュメモリの制御方法。


The copy status between data units during garbage collection is recorded as the value of the block copy flag provided in the data unit header,
Based on the value of the block copy flag, it is determined whether to continue sector copy from the interrupt position based on the value of the sector copy flag or to continue entry copy from the interrupt position based on the value of the entry copy flag 6. The flash memory control method according to claim 5, wherein:


JP2004310782A 2004-10-26 2004-10-26 Data management device for flash memory and control method of flash memory Pending JP2006126919A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004310782A JP2006126919A (en) 2004-10-26 2004-10-26 Data management device for flash memory and control method of flash memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004310782A JP2006126919A (en) 2004-10-26 2004-10-26 Data management device for flash memory and control method of flash memory

Publications (1)

Publication Number Publication Date
JP2006126919A true JP2006126919A (en) 2006-05-18

Family

ID=36721649

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004310782A Pending JP2006126919A (en) 2004-10-26 2004-10-26 Data management device for flash memory and control method of flash memory

Country Status (1)

Country Link
JP (1) JP2006126919A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010176268A (en) * 2009-01-28 2010-08-12 Yupiteru Corp Electronic apparatus and program
JP2011070675A (en) * 2009-09-28 2011-04-07 Samsung Sdi Co Ltd Battery pack, and method of controlling operation of data flash
US7971022B2 (en) 2007-05-29 2011-06-28 Samsung Electronics Co., Ltd. Apparatus and method of processing data of non-volatile memory using transaction block
JP2012243143A (en) * 2011-05-20 2012-12-10 Tokai Rika Co Ltd Flash memory device
WO2015170454A1 (en) * 2014-05-07 2015-11-12 ソニー株式会社 Memory control device, memory device and memory control method
JP2016505180A (en) * 2013-01-30 2016-02-18 ヒューレット−パッカード デベロップメント カンパニー エル.ピー.Hewlett‐Packard Development Company, L.P. Non-volatile memory writing mechanism
US10482008B2 (en) 2015-01-23 2019-11-19 Hewlett Packard Enterprise Development Lp Aligned variable reclamation

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11272569A (en) * 1998-03-19 1999-10-08 Hitachi Ltd Data restoration system for outer storage device using flash memory

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11272569A (en) * 1998-03-19 1999-10-08 Hitachi Ltd Data restoration system for outer storage device using flash memory

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7971022B2 (en) 2007-05-29 2011-06-28 Samsung Electronics Co., Ltd. Apparatus and method of processing data of non-volatile memory using transaction block
JP2010176268A (en) * 2009-01-28 2010-08-12 Yupiteru Corp Electronic apparatus and program
JP2011070675A (en) * 2009-09-28 2011-04-07 Samsung Sdi Co Ltd Battery pack, and method of controlling operation of data flash
JP2012243143A (en) * 2011-05-20 2012-12-10 Tokai Rika Co Ltd Flash memory device
JP2016505180A (en) * 2013-01-30 2016-02-18 ヒューレット−パッカード デベロップメント カンパニー エル.ピー.Hewlett‐Packard Development Company, L.P. Non-volatile memory writing mechanism
WO2015170454A1 (en) * 2014-05-07 2015-11-12 ソニー株式会社 Memory control device, memory device and memory control method
US9916103B2 (en) 2014-05-07 2018-03-13 Sony Corporation Memory control device, memory device, and memory control method
US10482008B2 (en) 2015-01-23 2019-11-19 Hewlett Packard Enterprise Development Lp Aligned variable reclamation

Similar Documents

Publication Publication Date Title
KR100843543B1 (en) System comprising flash memory device and data recovery method thereof
JP4536785B2 (en) Information processing apparatus, control unit for controlling data storage performed in information processing apparatus, and data storage control method
JP3977370B2 (en) Flash memory address mapping method, mapping information management method, and flash memory using these methods
US7558904B2 (en) Controller, data memory system, data rewriting method, and computer program product
JPH117505A (en) Card type storage medium
JP2008033788A (en) Nonvolatile storage device, data storage system, and data storage method
JP2013235531A (en) Control device, storage device, and storage control method
JP2006126919A (en) Data management device for flash memory and control method of flash memory
JP4175881B2 (en) Nonvolatile memory storage method and storage device
JP4731325B2 (en) Recording medium, data processing apparatus, and data processing method
JP4485231B2 (en) Electronics
JPH11272569A (en) Data restoration system for outer storage device using flash memory
JP4804101B2 (en) Firmware update method and information processing apparatus
JP5376551B2 (en) Flash memory system, electronic device, and portable terminal device
JP3376331B2 (en) Storage method using flash memory and storage medium storing storage control program
JP2001084180A (en) File managing device
JP3271935B2 (en) Control system
JP2008257584A (en) Ram disk processing method and system
JP2008191797A (en) File system
JP2005313568A (en) Printer, erasing method of data in printer, program and recording medium
JP3863479B2 (en) IC card
JP2003203007A (en) Nonvolatile area control method for memory of mobile phone
JP4580724B2 (en) Nonvolatile memory control method
JP3978720B2 (en) Data storage method
KR20010056423A (en) Restoring method for non-velatile data region using flash memory

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20070907

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20100831

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20110104