JP3978720B2 - Data storage method - Google Patents
Data storage method Download PDFInfo
- Publication number
- JP3978720B2 JP3978720B2 JP2002136600A JP2002136600A JP3978720B2 JP 3978720 B2 JP3978720 B2 JP 3978720B2 JP 2002136600 A JP2002136600 A JP 2002136600A JP 2002136600 A JP2002136600 A JP 2002136600A JP 3978720 B2 JP3978720 B2 JP 3978720B2
- Authority
- JP
- Japan
- Prior art keywords
- data
- state
- information
- area
- unit
- 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
Links
- 238000000034 method Methods 0.000 title claims description 84
- 238000013500 data storage Methods 0.000 title claims description 20
- 238000007726 management method Methods 0.000 claims description 71
- 230000015654 memory Effects 0.000 claims description 38
- 238000011084 recovery Methods 0.000 claims description 13
- 238000013502 data validation Methods 0.000 claims description 2
- 238000010586 diagram Methods 0.000 description 9
- 238000010200 validation analysis Methods 0.000 description 5
- 230000008569 process Effects 0.000 description 4
- 230000008859 change Effects 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 230000006870 function Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
Images
Landscapes
- Techniques For Improving Reliability Of Storages (AREA)
- Read Only Memory (AREA)
Description
【0001】
【発明の属する技術分野】
本発明は、データ記憶装置において、記憶領域の一部を使用して書き込み途中の状態を保持することによって書き込み中断があった場合でもデータを保護することを可能にする方法の改良に関する。
【0002】
【従来の技術】
携帯情報端末や携帯電話機などにおいては、電話帳や予定表など様々な情報を格納するために、フラッシュメモリを使用することが多い。さらに、それぞれの情報を管理するために、何らかのファイルシステムを使用することが一般的である。尚、フラッシュメモリ等では、最小記憶単位であるビットの複数の集合で記憶単位であるバイトを構成し、複数バイト(数万バイト)で構成されたページが最小の消去単位として一括して扱われる。
【0003】
情報記憶の管理形態として、例えばFAT ファイルシステム(ISO/ICE9293)を適用する場合、ファイルの管理情報とデータを別々のページに格納するため、どちらか一方を書き込んだ時点で電源の供給が絶たれるとファイルシステムの一貫性が維持され得ず、データの喪失が発生することがあった。
【0004】
特に、携帯情報端末や携帯電話機では、一般の据え置き型の電子機器に比較し落下の衝撃などによって不用意に電源の供給が絶たれる危険性が高い。このため、電源の供給が絶たれることによる書き込みの中断から情報を保護するため、何らかの方策が必要になる。
【0005】
従来より、突如電源が断たれてからの回復時にファイルの管理情報とデータを照合し、矛盾があったら修正するという技術がある。しかしながらこの従来技術の場合、書き込み途中のページがわからないため、全てのページを照合の対象にせねばならず修正に時間がかかる上、書き込み前の情報が残っていないため全ての情報を確実に修正できるとは限らない。
【0006】
停電時のデータ回復動作を自動的に行い、データ回復時間を短縮するために、外部記憶装置内の複数のフラッシュメモリにホストからのデータと、ホストからのアクセスするアドレスとデータが書込まれているか、エラーの発生した物理セクタでないか、また無効なデータを格納していないかを判定するデータ無効フラグをもつ物理セクタ管理領域の2つの構成からなる物理セクタと、エラーの発生したアドレスを格納するエラー発生物理セクタアドレス管理領域と、フラッシュメモリ番号,ステータステーブル,フラッシュメモリ消去回数,ステータス無効フラグからなるフラッシュメモリ管理領域を、フラッシュメモリ内に持つようにした方法が提案されている(特開平11−272569号公報)。
【0007】
また、電源の遮断がフラッシュメモリのデータの消去単位であるブロックの消去後に発生すると、ブロックが消去されているにも拘わらず、FAT及びディレクトリ領域のデータが更新されず、そのまま電源を再起動して、更新後の該当ファイルの読み込みを試みると、消去状態のファイル(ブロックのファイル)が読み込まれてしまうといった問題に対処すべく、書込処理等の処理内容を示す識別コードを動作履歴記憶領域に保持し、その書込処理等が正常終了すると、その識別コードを消去するようにし、その後、動作履歴記憶領域に残されている識別コードを解析して、該当するデータ領域等に格納されているデータを復旧させる方法が提案されている(特開2001−84180号公報)。
【0008】
尚、フラッシュメモリのような一括消去型メモリを用いた情報記憶再生装置の記憶情報を管理する管理情報の部分的な変更を簡単に行う方法として、情報記憶再生装置に記憶しようとする一連の記憶情報を予め定められた単位フレームに分割し、分割した単位フレームの記憶情報と、この記憶情報に対応して設けた管理情報を一括消去単位であるブロックに共存するように記憶し、前記管理情報が予め定めた特定コードになったとき、この管理情報を初期状態と同等または無効または無効に準ずる機能にする予め定めたコードにして記憶情報を管理する管理情報を追加可能にし、記憶情報の一括消去動作を伴わずに管理情報の変更ができるようにする方法も提案されている(特開2000−67857号公報)。
【0009】
【発明が解決しようとする課題】
上述の既提案の何れの技術も、フラッシュメモリのような一括消去型メモリを用いた情報記憶再生装置に適合するものではあるが、データ領域に対するデータの書き込み動作が中断されてから復旧させるときの手順は未だ煩雑であり場合によっては処理に時間が掛かる虞れがある。
【0010】
そこで、本発明の目的は、データ領域に対するデータの書き込み動作が中断されても、簡素な手順で、より短時間で確実に、復旧させることができるデータ記憶方法を提供することにある。
【0011】
【課題を解決するための手段】
上述の課題を解決するため、本発明によるデータ記憶方法は、次のような特徴を備えている。
【0012】
(1)情報記憶媒体上において所定の最小記憶単位よりも大きい所定容量の領域を管理単位領域とする条件下で、同一の前記管理単位領域内に主情報たるデータを記憶するためのデータ領域と該データに係る管理情報を記憶するための管理情報領域とを設け、該管理情報領域には、データの無効状態、仮書き込み状態、有効状態を示す記憶状況情報を保持するための状態保持部と前記情報記憶媒体上に設定された前記各管理単位領域の一連の書き込み順位において自己が該当する書き込み順位によりも前に書き込まれた管理単位領域の書き込み順位を表す情報を保持するための先行順位保持部並びに該当するデータの所在位置を表すデータ位置情報を保持するためのデータ位置保持部とを含んでなる第一の状態記憶部と、前記状態保持部及び先行順位保持部を含んでなる第二の状態記憶部とを設定し、前記データ領域に対するデータの書き込み動作が中断されてから復旧させるときには、前記管理情報領域の状態保持部に保持された情報、先行順位保持部及びデータ位置保持部に保持された情報とを利用して、書き込みが中断されたデータを復旧させるデータ記憶方法。
【0013】
(2)前記情報記憶媒体としてフラッシュメモリを適用する上記(1)のデータ記憶方法。
【0014】
(3)前記状態保持部に、無効状態、仮書き込み状態、及び、有効状態の3状態が識別可能なように該3状態の何れにあるかを表す情報を保持する上記(1)のデータ記憶方法。
【0015】
(4)前記第一の状態記憶部と第二の状態記憶部とにおける情報の書き込みは独立に行ない得るようにする上記(1)のデータ記憶方法。
【0016】
(5)前記状態保持部に保持される3状態を表す情報を、2バイトの情報における一方の1バイトの情報の有無の状態と他方の1バイトの情報の有無の状態との組合わせによって表すようにする上記(1)のデータ記憶方法。
【0017】
(6)前記データ領域に対するデータの書き込み動作が中断されてから復旧させるに際しては、前記管理情報領域の状態保持部において前記無効状態にあることを表す情報が保持された前記管理単位領域に関して各管理単位領域の前記系列順位で当該中断が発生したときのデータ有効化操作の最終順位に該当する管理単位領域を検索し、該最終順位に該当する管理単位領域を起点として、各該当する前記管理情報領域の先行順位保持部に保持された情報に基づいて前記系列順位を遡及するようにして各該当する管理単位領域のデータを復旧させる上記(3)のデータ記憶方法。
【0019】
【発明の実施の形態】
以下、本発明によるデータ記憶方法の好適実施形態について図面を参照しながら詳細に説明する。
【0020】
図1は、本発明にも適用される情報記憶媒体の例としてのフラッシュメモリの構成を示す概念図である。このフラッシュメモリ1自体は一般的なものである。図示の例では、最小記憶単位であるビットの複数の集合で記憶単位であるバイトが構成され、数万バイトでページ2が構成され、このページ2が最小の消去単位として一括して扱われる。即ち、本例では、ページ2が管理単位領域を構成する。任意のバイトへはページ消去後一度だけ書き込むことができ、一度書き込んだバイトを変更する場合は、一旦ページごと消去する必要がある。尚、フラッシュメモリ1の任意のバイトは、いつでも読み出すことができる。
【0021】
図2は、図1のフラッシュメモリの各ページの記憶領域の区分の設定状況を示す図である。本実施形態においては、図示のようにフラッシュメモリ1の各ページ2をデータ領域3と管理情報領域4に区分する。データ領域3は、フラッシュメモリに本来記憶することを意図している例えば画像、音声、その他データ等の主情報たるデータを記憶するための領域である。管理情報領域4は、後に詳述するように、各ページの位置などデータ領域3に記憶されるデータに係る管理情報を記憶するための領域である。
【0022】
図3は、図2の管理情報領域4の構成を示す概念図である。管理情報領域4には、第一の状態記憶部5と、第二の状態記憶部6とを割り当てる。第一の状態記憶部5は、データの記憶状況を表す情報を保持するための状態保持部7と、該当するデータの所在位置を表すデータ位置情報を保持するためのデータ位置保持部(図中「データ位置」と表記)8と、前記各管理単位領域(ページ)の系列中において自己が該当する順位(自らのページ)に先行する管理単位領域の順位(ページ位置)を表す情報を保持するための先行順位保持部(図中「先行ページ位置」と表記)9を含む。状態保持部7は、「無効状態(I)」「仮書き込み状態(T)」「有効状態(V)」の3つの状態のいずれかを保持する。
【0023】
第二の状態記憶部6は、状態保持部7と同様の状態保持部10と、先行順位保持部9と同様の先行順位保持部(図中「先行ページ位置」と表記)11を含む。この状態保持部10も、「無効状態(I)」「仮書き込み状態(T)」「有効状態(V)」の3つの状態のいずれかを保持する。
初期状態においては、第一の状態記憶部5の状態保持部7、および第二の状態記憶部6の状態保持部10は「無効状態(I)」を保持している。
【0024】
本実施形態では、状態保持部7,10の情報を「無効状態(I)」から「仮書き込み状態(T)」へ、あるいは「仮書き込み状態(T)」から「有効状態(V)」へ変更する必要が生じる。これは、状態保持部2バイトを割り当て、両方のバイトともデータが書き込まれていなければ「無効状態(I)」、片方のバイトのみにデータが書き込まれていれば「仮書き込み状態(T)」、両方のバイトにデータが書き込まれていれば「有効状態(V)」を表現するようにすることで容易に実現可能である。
【0025】
状態保持部7,10に書き込み途中であることを意味する値の情報「仮書き込み状態(T)」を書き込むことで、書き込みが中断された場合にも、書き込み前の状態に戻すことが可能になる。さらに、データとその管理情報のようにひとまとまりに書き込む必要のあるデータを書き込む場合は、図7、8を用いて後に詳述するように、書き込みを行った一連のページを先行ページ番号に順番に記憶する。これにより、状態保持部を変更中に書き込みが中断された場合でも一連のページを検索し復旧処理を行うことができる。
【0026】
次に、本実施形態の動作について説明する。フラッシュメモリ1にデータを書き込む場合、データの一部分であるブロックAと、そのデータの位置Bの組が複数個与えられる。これらは、例えば、ファイルのインデックス情報とファイルの内容のデータであり、片方のみを書き込んだ段階で電源断などにより書き込みが中断してしまうとデータの一貫性が失われてしまう。本実施形態では、これらのデータをひとまとまりとして書き込む手順を提供する。
【0027】
図4は、フラッシュメモリ1にデータを書き込む手順を示すフローチャートである。データの書き込みにおいては、最初にフラッシュメモリを検索して、同じ位置のデータがすでに記憶されているかどうかを調べる(4-1)。
【0028】
図4における(4-1)の検索手順について詳細を図5に示す。同一部分の検索手順(4-1)では、フラッシュメモリの各ページ2の管理情報領域4を読み(5-1)、第一の状態記憶部5の状態保持部7が「無効状態(I)」以外であり(5-2)、かつ第二の状態記憶部6の状態保持部10が「無効状態(I)」であり(5-3)、かつ第一の状態記憶部5のデータ位置8が書き込むデータの位置Bと同一の値であるページを検索する(5-4)。前記手順により、同じ位置のデータが記憶されているページが検索される。
【0029】
以上、図5に基づいて述べた手順(4-1)によって、同じ位置のデータが記憶されたページが見つからなかった場合は、次に空きページの検索を行う(4-2)。
【0030】
図4における空きページ検索(4-2)の手順について詳細を図6に示す。空きページの検索手順(4-2)では、フラッシュメモリの各ページ2,2の管理情報領域4を読み(6-1)、第一の状態記憶部5の状態保持部7の情報が「無効状態(I)」であるページを検索する(6-2)。これにより、空きページが検索される。
【0031】
次に、空きページへの書き込みを行う(4-3)。空きページの書き込み手順では、データ領域3にブロックのデータAを書き込み、第一の状態記憶部5のデータ位置8に書き込むデータの位置Bを記憶し、先行ページ番号9に直前に書き込んだページの番号を記憶し、最後に状態保持部7に「仮書き込み状態(T)」を記憶する。ただし、一度の書き込み手順のうちの最初のブロックである場合は、先行ページ番号9には何も書き込まない。
【0032】
空きページの書き込み手順(4-3)について、手順実行後の管理情報領域4の状態の例を図7に示す。
【0033】
次に、図4に戻って、同一部分の検索手順(4-1)において同じ位置のデータが記憶されたページが見つかった場合の手順について説明する。この場合は、次にページ無効化を行う(4-4)。ページ無効化では、同一部分の検索手順(4-1)で検索されたページの第二の状態記憶部の先行ページ番号11に直前に書き込んだページの番号を記憶し、状態保持部10に「仮書き込み状態(T)」を記憶する。ただし、一度の書き込み手順のうちの最初のブロックである場合は、先行ページ番号11には何も書き込まない。ページ無効化の手順(4-4)を行った後、空きページの検索手順(4-2)、空きページの書き込み手順(4-3)を行う。
【0034】
これらのページ無効化の手順(4-4)を実行した後の管理情報領域4の状態の例を図8に示す。
【0035】
与えられた全てのブロックについて以上の手順を実行した後、次にページ有効化の手順(4-5)を実行する。ページ有効化の手順では、最初に書き込んだページから開始し、書き込んだ順に各ページを有効化する。ページの有効化では、第一の状態記憶部5および第二の状態記憶部6の状態保持部(7,10)を参照し、これが「仮書き込み状態(T)」であった場合に「有効状態(V)」に変更する。
【0036】
例として、図8の状態からページ有効化の手順(4-5)を実行した後の管理情報領域4の状態の例を図9に示す。
【0037】
最後に、ページ消去の手順(4-6)を実行する。
この手順では、第二の状態記憶部6の状態保持部10が「有効状態(V)」である全てのページを消去する。
【0038】
次にデータの読み込みの手順について説明する。図10はデータの読み込みの手順を示すフローチャートである。データの読み込みでは、目的の位置のブロックが書き込まれたページをフラッシュメモリから検索する。読み込み手順では、フラッシュメモリの各ページの管理情報領域4を読み(10-1)、第二の状態記憶部6の状態保持部10が「無効状態(I)」であり(10-2)、かつ第一の状態記憶部5の状態保持部7が「有効状態(V)」であり(10-3)、かつ第一の状態記憶部5のデータ位置8が目的のブロックの位置であるページを検索する(10-4)。これにより、目的のブロックのデータが記憶されているページが検索されるので、このページのデータ領域3からデータを読み出す。
【0039】
フラッシュメモリを組み込んだ装置において、フラッシュメモリへのデータ書き込み中に電源が切断されると、データを途中まで書き込んだ状態になってしまうことがある。この場合、データを書き込む前の状態に復旧させるために、データ復旧の手順を実行する。
【0040】
データ復旧の手順について図11のフローチャートに示す。
データ復旧においては、まず第一の状態記憶部5および第二の状態記憶部6の状態保持部(7,10)の情報を参照し、この情報が「仮書き込み状態(T)」であるページを検索する(11-1)。ページが見つからなかった場合は、空きページ復旧手順(11−4)へ進む。見つかった場合は、書き込みが完了しなかったことを意味しており、書き込み開始前の状態に戻す必要がある。このために、最終ページ検索(11-2)を行う。最終ページ検索は、書き込み処理において最後に書き込まれたページを検索する手順であり、各ページの管理情報領域4を調べることで容易に実現が可能である。最終ページが検索されたら、次にデータの書き込み手順において書き込みの途中であった一連のページを検索し復旧させる(11−3)。この手順においては、最終ページ検索(11-2)によって検索された最終ページを起点として、各ページの第一の状態記憶部5または第二の状態記憶部6にある先行ページ番号(9,11)を参照し、書き込んだ際とは逆の順番にページを手繰る、即ち、各該当する前記管理情報領域の先行順位保持部に保持された情報に基づいて前記系列順位(ページ番号)を遡及することによって実行する。
【0041】
このように検索された最終ページから系列順位(ページ番号)を遡及する手順の詳細を図12にフローチャートで示す。
まず、現在のページ(手順の最初では、最終ページを指す)の管理情報領域4を参照する(12-1)。第二の状態記憶部6の状態保持部10が「無効状態(I)」である場合(12-2)は、第二の状態記憶部6の先行ページ番号11を次のページ番号として記憶する(12-3)。さらに、書き込み手順と同じ手順で、現在のページのデータ領域3に書き込まれたデータを再度書き込む(12-4)。また、第二の状態記憶部6の状態保持部10が「無効状態(I)」でない場合は、第一の状態記憶部5の先行ページ番号9を次のページ番号として記憶する(12-5)。さらに、現在のページを消去する(12-6)。
【0042】
最終ページ検索(11-2)において、復旧すべきページが見つからなかった場合は、次に空きページの復旧を行う(11−4)。空きページの復旧は、書き込みが完了したものの、消去中に電源が断たれたことにより消去が完了しなかったページを復旧させる手順である。空きページ復旧(11−4)では、各ページの管理情報領域4を参照し、第二の状態記憶部6の状態保持部10が「有効状態(V)」であるページを消去する。
【0043】
本実施形態によれば、以上のようにして、書き込み手順を実行中に電源が断たれた場合でも、書き込み手順を完了するか、あるいは書き込み手順を実行する前の状態に戻すことができる。
【0044】
上述の本発明の実施形態の作用効果を要約するに、第一には、電源が断たれたことなどにより書き込み手順が中断されても、書き込み手順開始前の状態に戻すことができるという点である。これにより、ファイルの名前が書き込まれているが実際のデータが書き込まれていない、といったデータの一貫性が失われた状態が起こらなくなる。その理由は、2つの状態記憶部を持つ管理情報領域を設け、書き込み前の管理情報を残したまま書き込みを行っており、さらに先行順位保持部に保持された情報である先行ページ番号に基づいて状態保持部書き込み中にこの動作が中断された場合でも先行ページ番号をたどって書き込み途中のページを遡及するようにして検索できるようにしたためである。
【0045】
第二には、フラッシュメモリのように消去後一度しか書き込めない記憶装置でも、本方式が使用可能であるという点である。その理由は、管理情報領域に第一・第二の2つの状態記憶部を設けることにより、同じ場所への書き込みを1度だけにとどめることで、同じ領域への上書きを伴わずに書き込みを行うことができるためである。
【0046】
以上、本発明によるデータ記憶方法の好適実施形態の構成および動作を詳述した。しかし、斯かる実施形態は、本発明の単なる例示に過ぎず、何ら本発明を限定するものではない。本発明の要旨を逸脱することなく、特定用途に応じて種々の変形変更が可能であること、当業者には容易に理解できよう。
【0047】
【発明の効果】
以上説明したように、本発明のデータ記憶方法によれば、データ領域に対するデータの書き込み動作が中断されても、簡素な手順で、より短時間で確実に、復旧させることができるデータ記憶方法を提供することができる。
【図面の簡単な説明】
【図1】本発明にも適用される情報記憶媒体の例としてのフラッシュメモリの構成を示す概念図である。
【図2】図1のフラッシュメモリの各ページの記憶領域の区分の設定状況を示す図である。
【図3】図2の管理情報領域の構成を示す概念図である。
【図4】フラッシュメモリにデータを書き込む手順を示すフローチャートである。
【図5】図4における検索手順の詳細を示すフローチャートである。
【図6】図4における空きページ検索の手順の詳細を示すフローチャートである。
【図7】空きページの書き込み手順を実行した後の管理情報領域の状態の例を示す概念図である。
【図8】ページ無効化の手順を実行した後の管理情報領域の状態の例を示す概念図である。
【図9】図8の状態からページ有効化の手順を実行した後の管理情報領域の状態の例を示す概念図である。
【図10】データの読み込みの手順を示すフローチャートである。
【図11】データ復旧の手順を示すフローチャートである。
【図12】検索された最終ページから系列順位を遡及する手順の詳細を示すフローチャートである。
【符号の説明】
1 フラッシュメモリ
2 ページ
3 データ領域
4 管理情報領域
5 第一の状態記憶部
6 第二の状態記憶部
7 状態保持部
8 データ位置保持部
9 先行順位保持部
10 状態保持部
11 先行順位保持部[0001]
BACKGROUND OF THE INVENTION
The present invention relates to an improvement in a method for enabling data to be protected even when there is a write interruption by using a part of a storage area to maintain a state during writing in a data storage device.
[0002]
[Prior art]
In portable information terminals and mobile phones, flash memory is often used to store various information such as a telephone directory and a schedule. Furthermore, in order to manage each information, it is common to use some kind of file system. In a flash memory or the like, a byte that is a storage unit is configured by a plurality of sets of bits that are the minimum storage unit, and a page configured by a plurality of bytes (tens of thousands of bytes) is collectively handled as the minimum erase unit. .
[0003]
For example, when the FAT file system (ISO / ICE9293) is applied as a management mode of information storage, the file management information and data are stored in separate pages, so the power supply is cut off when either one is written. And file system consistency could not be maintained, and data loss could occur.
[0004]
In particular, in a portable information terminal and a mobile phone, there is a higher risk that power supply may be inadvertently cut off due to a drop impact or the like than a general stationary electronic device. For this reason, some measure is required to protect information from interruption of writing due to power supply being cut off.
[0005]
Conventionally, there is a technique in which file management information and data are collated at the time of recovery after a sudden power failure, and if there is a contradiction, it is corrected. However, in the case of this prior art, since the page in the middle of writing is not known, it is necessary to make all pages subject to collation, and it takes a long time to correct, and since there is no information before writing, all information can be corrected reliably. Not necessarily.
[0006]
Data from the host, addresses accessed from the host, and data are written to multiple flash memories in the external storage device to automatically perform data recovery operation in the event of a power failure and reduce data recovery time The physical sector consisting of two components of the physical sector management area with a data invalid flag that determines whether or not the physical sector has an error or whether invalid data is stored, and the address where the error occurred A method has been proposed in which a flash memory management area having an error occurrence physical sector address management area and a flash memory management area including a flash memory number, a status table, the number of flash memory erasures, and a status invalid flag is provided in the flash memory (Japanese Patent Laid-Open 11-272569).
[0007]
Also, if the power interruption occurs after erasing a block, which is the data erasure unit in the flash memory, the FAT and directory area data are not updated despite the block being erased, and the power supply is restarted. In order to cope with the problem that an erased file (block file) is read when an attempt is made to read the updated file, an operation history storage area is provided with an identification code indicating a processing content such as a writing process. When the writing process or the like is normally completed, the identification code is deleted, and then the identification code remaining in the operation history storage area is analyzed and stored in the corresponding data area or the like. A method for restoring existing data has been proposed (Japanese Patent Laid-Open No. 2001-84180).
[0008]
Note that a series of memories to be stored in the information storage / reproduction device is a simple method for partially changing the management information for managing the storage information of the information storage / reproduction device using a batch erasure type memory such as a flash memory. The information is divided into predetermined unit frames, and the storage information of the divided unit frames and the management information provided corresponding to the storage information are stored so as to coexist in the block that is a batch erasure unit, and the management information When the management code becomes a predetermined specific code, the management information can be added to the management code for managing the storage information as a predetermined code that makes this management information equivalent to the initial state or a function equivalent to invalidity or invalidity. A method for enabling management information to be changed without an erasing operation has also been proposed (Japanese Patent Laid-Open No. 2000-67857).
[0009]
[Problems to be solved by the invention]
Any of the above-described proposed techniques is suitable for an information storage / reproduction device using a batch erasure type memory such as a flash memory. However, when the data write operation to the data area is interrupted, recovery is performed. The procedure is still cumbersome and in some cases the process may take time.
[0010]
SUMMARY OF THE INVENTION An object of the present invention is to provide a data storage method that can be reliably restored in a shorter time with a simple procedure even if the data write operation to the data area is interrupted.
[0011]
[Means for Solving the Problems]
In order to solve the above-described problems, the data storage method according to the present invention has the following features.
[0012]
(1) A data area for storing data as main information in the same management unit area under the condition that a management unit area is an area having a predetermined capacity larger than a predetermined minimum storage unit on the information storage medium A management information area for storing management information relating to the data, and a state holding unit for holding storage status information indicating an invalid state, a temporary write state, and a valid state of the data in the management information area ; Preceding order holding for holding information indicating the writing order of the management unit area written earlier than the corresponding writing order in the series of writing order of each management unit area set on the information storage medium parts and corresponding to the first state storage unit comprising a data position holding unit for holding the data location information indicating a location of data, the state holding unit and Information sets the second state storage unit comprising a row rank holding unit, when the write operation of the data to recover from being interrupted for the data region, which is held in the state holding unit of the management information area, A data storage method for restoring data interrupted by writing using information held in a preceding rank holding unit and a data position holding unit .
[0013]
(2) The data storage method according to (1), wherein a flash memory is applied as the information storage medium.
[0014]
(3) The data storage according to (1), wherein the state holding unit holds information indicating which of the three states, ie, the invalid state, the temporary write state, and the valid state, can be identified. Method.
[0015]
(4) The data storage method according to (1) , wherein writing of information in the first state storage unit and the second state storage unit can be performed independently .
[0016]
(5) The information representing the three states held in the state holding unit is represented by a combination of the presence / absence state of one 1-byte information and the presence / absence state of the other 1-byte information in the 2-byte information. data storage method (1) to be so.
[0017]
(6) When recovery is performed after the data write operation to the data area is interrupted, each management unit area in which information indicating the invalid state is held in the state holding unit of the management information area The management unit area corresponding to the final rank of the data validation operation when the interruption occurs in the sequence rank of the unit area is searched, and each management information corresponding to the management information corresponding to the final rank is used as a starting point. (3) The data storage method according to (3) , wherein the data in each corresponding management unit area is recovered by retroactively tracking the sequence order based on information held in the preceding rank holding unit of the area .
[0019]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, preferred embodiments of a data storage method according to the present invention will be described in detail with reference to the drawings.
[0020]
FIG. 1 is a conceptual diagram showing a configuration of a flash memory as an example of an information storage medium applied to the present invention. The
[0021]
FIG. 2 is a diagram showing a setting state of the storage area classification of each page of the flash memory of FIG. In this embodiment, each
[0022]
FIG. 3 is a conceptual diagram showing the configuration of the management information area 4 of FIG. A first
[0023]
The second
In the initial state, the state holding unit 7 of the first
[0024]
In the present embodiment, the information in the
[0025]
By writing information “temporary writing state (T)” indicating that writing is in progress to the
[0026]
Next, the operation of this embodiment will be described. When data is written to the
[0027]
FIG. 4 is a flowchart showing a procedure for writing data into the
[0028]
FIG. 5 shows details of the search procedure (4-1) in FIG. In the search procedure (4-1) for the same part, the management information area 4 of each
[0029]
As described above, when a page storing data at the same position is not found by the procedure (4-1) described with reference to FIG. 5, a search for an empty page is performed next (4-2).
[0030]
FIG. 6 shows details of the empty page search (4-2) procedure in FIG. In the empty page search procedure (4-2), the management information area 4 of each
[0031]
Next, writing to an empty page is performed (4-3). In the empty page writing procedure, block data A is written in the
[0032]
FIG. 7 shows an example of the state of the management information area 4 after the execution of the procedure for the empty page writing procedure (4-3).
[0033]
Next, returning to FIG. 4, the procedure when a page storing data at the same position is found in the search procedure (4-1) for the same portion will be described. In this case, the page is invalidated next (4-4). In page invalidation, the number of the page written immediately before is stored in the preceding
[0034]
FIG. 8 shows an example of the state of the management information area 4 after executing these page invalidation procedures (4-4).
[0035]
After the above procedure is executed for all the given blocks, the page validation procedure (4-5) is executed next. In the page validation procedure, starting from the first written page, each page is validated in the written order. In the validation of the page, the status holding units (7, 10) of the first
[0036]
As an example, FIG. 9 shows an example of the state of the management information area 4 after the page validation procedure (4-5) is executed from the state of FIG.
[0037]
Finally, the page erase procedure (4-6) is executed.
In this procedure, the
[0038]
Next, the data reading procedure will be described. FIG. 10 is a flowchart showing a data reading procedure. In reading data, a page in which a block at a target position is written is searched from the flash memory. In the reading procedure, the management information area 4 of each page of the flash memory is read (10-1), the
[0039]
In a device incorporating a flash memory, if the power is turned off while data is being written to the flash memory, data may be partially written. In this case, a data recovery procedure is executed in order to recover the state before the data is written.
[0040]
The data recovery procedure is shown in the flowchart of FIG.
In data recovery, first, the information of the state holding units (7, 10) of the first
[0041]
FIG. 12 is a flowchart showing details of the procedure for retroactively retrieving the sequence rank (page number) from the last page searched in this way.
First, the management information area 4 of the current page (in the beginning of the procedure, indicates the last page) is referenced (12-1). When the
[0042]
In the final page search (11-2), when a page to be restored is not found, a free page is restored (11-4). Recovering a free page is a procedure for recovering a page that has been written but has not been erased due to a power failure during erasing. In the free page recovery (11-4), the management information area 4 of each page is referred to, and the
[0043]
According to the present embodiment, as described above, even when the power is turned off during execution of the write procedure, the write procedure can be completed or the state before the write procedure is executed can be restored.
[0044]
To summarize the operation and effect of the above-described embodiment of the present invention, first, even if the write procedure is interrupted due to the power being cut off, it is possible to return to the state before the start of the write procedure. is there. As a result, a state in which data consistency is lost such that the file name is written but the actual data is not written does not occur. The reason is that a management information area having two state storage units is provided, writing is performed while leaving the management information before writing, and based on the preceding page number which is information held in the preceding rank holding unit This is because even if this operation is interrupted during the writing of the state holding unit, the previous page number is traced so that the page being written can be retrieved retroactively.
[0045]
Second, the present system can be used even in a storage device such as a flash memory which can be written only once after erasure. The reason is that by providing the first and second state storage units in the management information area, writing to the same place is performed only once, and writing is performed without overwriting the same area. Because it can.
[0046]
The configuration and operation of the preferred embodiment of the data storage method according to the present invention have been described in detail above. However, such an embodiment is merely an example of the present invention and does not limit the present invention. Those skilled in the art will readily understand that various modifications and changes can be made according to a specific application without departing from the gist of the present invention.
[0047]
【The invention's effect】
As described above, according to the data storage method of the present invention, even if the data write operation to the data area is interrupted, the data storage method that can be reliably restored in a short time with a simple procedure. Can be provided.
[Brief description of the drawings]
FIG. 1 is a conceptual diagram showing a configuration of a flash memory as an example of an information storage medium applied to the present invention.
2 is a diagram showing a setting state of a storage area classification of each page of the flash memory of FIG. 1; FIG.
FIG. 3 is a conceptual diagram showing a configuration of a management information area in FIG. 2;
FIG. 4 is a flowchart showing a procedure for writing data to a flash memory.
FIG. 5 is a flowchart showing details of a search procedure in FIG. 4;
6 is a flowchart showing details of an empty page search procedure in FIG. 4;
FIG. 7 is a conceptual diagram illustrating an example of a state of a management information area after a free page writing procedure is executed.
FIG. 8 is a conceptual diagram illustrating an example of a state of a management information area after executing a page invalidation procedure.
9 is a conceptual diagram showing an example of a state of a management information area after executing a page validation procedure from the state of FIG.
FIG. 10 is a flowchart illustrating a data reading procedure.
FIG. 11 is a flowchart showing a data recovery procedure.
FIG. 12 is a flowchart showing details of a procedure for retroactively retrieving the sequence rank from the last page searched.
[Explanation of symbols]
DESCRIPTION OF
Claims (6)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2002136600A JP3978720B2 (en) | 2002-05-13 | 2002-05-13 | Data storage method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2002136600A JP3978720B2 (en) | 2002-05-13 | 2002-05-13 | Data storage method |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2003331586A JP2003331586A (en) | 2003-11-21 |
| JP3978720B2 true JP3978720B2 (en) | 2007-09-19 |
Family
ID=29698571
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2002136600A Expired - Fee Related JP3978720B2 (en) | 2002-05-13 | 2002-05-13 | Data storage method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP3978720B2 (en) |
Families Citing this family (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2005190288A (en) * | 2003-12-26 | 2005-07-14 | Tdk Corp | Memory controller, flash memory system therewith, and method for controlling flash memory |
| US7299314B2 (en) * | 2003-12-31 | 2007-11-20 | Sandisk Corporation | Flash storage system with write/erase abort detection mechanism |
| JP6112461B2 (en) * | 2012-08-07 | 2017-04-12 | パナソニックIpマネジメント株式会社 | Recording apparatus, access apparatus, recording system, and recording method |
-
2002
- 2002-05-13 JP JP2002136600A patent/JP3978720B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JP2003331586A (en) | 2003-11-21 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| KR100843543B1 (en) | System comprising flash memory device and data recovery method thereof | |
| CN1307554C (en) | Data recorder and method for recording data in flash memory | |
| JP4418439B2 (en) | Nonvolatile storage device and data writing method thereof | |
| US9483396B2 (en) | Control apparatus, storage device, and storage control method | |
| US20020085433A1 (en) | Data management system and data management method | |
| US20080028132A1 (en) | Non-volatile storage device, data storage system, and data storage method | |
| JP5874525B2 (en) | Control device, storage device, and storage control method | |
| US6839798B1 (en) | Flash memory capable of storing frequently rewritten data | |
| JP2002169729A (en) | Controller for nonvolatile memory unit, memory system having the controller, and method for controlling nonvolatile memory unit | |
| JP2005196736A (en) | Flash memory address mapping method, mapping information management method, and flash memory using these methods | |
| US20090313501A1 (en) | Method and arrangement for processing transactions in a flash type memory device | |
| KR100526178B1 (en) | Access apparatus and method using flash memory | |
| CN101334756A (en) | Control device of non-volatile memory, control method thereof, and storage device | |
| US10025706B2 (en) | Control device, storage device, and storage control method | |
| US20070294469A1 (en) | Integrated circuit chip, data reading method, and data writing method | |
| US20060059297A1 (en) | Memory control apparatus, memory control method and program | |
| US20100180072A1 (en) | Memory controller, nonvolatile memory device, file system, nonvolatile memory system, data writing method and data writing program | |
| US20050278480A1 (en) | Method of writing data into flash memory | |
| JP5057887B2 (en) | Data update device, data update method, and data update program | |
| CN109960611B (en) | Data recovery method and device, electronic equipment and machine-readable storage medium | |
| CN112214356A (en) | File data recovery method and device, computer equipment and storage medium | |
| US7836242B2 (en) | Method for page random write and read in blocks of flash memory | |
| JP3978720B2 (en) | Data storage method | |
| US20080294837A1 (en) | Memory controller for controlling a non-volatile semiconductor memory and memory system | |
| EP2267725A1 (en) | Memory device for managing the recovery of a non volatile memory |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20050422 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20070307 |
|
| A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20070507 |
|
| 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: 20070601 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20070614 |
|
| R150 | Certificate of patent or registration of utility model |
Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100706 Year of fee payment: 3 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110706 Year of fee payment: 4 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110706 Year of fee payment: 4 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120706 Year of fee payment: 5 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120706 Year of fee payment: 5 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130706 Year of fee payment: 6 |
|
| S111 | Request for change of ownership or part of ownership |
Free format text: JAPANESE INTERMEDIATE CODE: R313113 |
|
| R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
| LAPS | Cancellation because of no payment of annual fees |