JP4654531B2 - Block erase type storage medium management device - Google Patents

Block erase type storage medium management device Download PDF

Info

Publication number
JP4654531B2
JP4654531B2 JP2001123483A JP2001123483A JP4654531B2 JP 4654531 B2 JP4654531 B2 JP 4654531B2 JP 2001123483 A JP2001123483 A JP 2001123483A JP 2001123483 A JP2001123483 A JP 2001123483A JP 4654531 B2 JP4654531 B2 JP 4654531B2
Authority
JP
Japan
Prior art keywords
block
data
flag
small
erase
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2001123483A
Other languages
Japanese (ja)
Other versions
JP2002318733A (en
Inventor
啓一 青山
雄三 川原
義則 室井
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Panasonic Corp
Panasonic Electric Works Co Ltd
Original Assignee
Panasonic Corp
Matsushita Electric Works Ltd
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 Panasonic Corp, Matsushita Electric Works Ltd filed Critical Panasonic Corp
Priority to JP2001123483A priority Critical patent/JP4654531B2/en
Publication of JP2002318733A publication Critical patent/JP2002318733A/en
Application granted granted Critical
Publication of JP4654531B2 publication Critical patent/JP4654531B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

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

Description

【0001】
【発明の属する技術分野】
本発明は、フラッシュメモリに代表される不揮発性の記憶媒体であって、ブロック内の全ビットを2値の一方の値にする「消去」がブロック単位でのみ可能であり、ブロック内の各ビットの値を2値の他方の値にする「書込」がビット単位で可能であるブロック消去型記憶媒体の管理装置に関するものである。
【0002】
【従来の技術】
近年、記憶領域が複数のブロックに分割された不揮発性メモリであって、記憶されたデータがブロック単位でのみ消去可能であるフラッシュメモリが広く用いられている。ブロックとは複数バイトを一括した単位であって、たとえば528バイトを1ページとし、16ページを1ブロックとしたフラッシュメモリが提供されている。この種のブロック消去型記憶媒体には、ブロックの全ビットを2値の一方の値(たとえば、1)にする「消去」についてはブロック単位でのみ処理可能であり、ブロック内の各ビットの値を2値の他方の値(たとえば、0)にする「書込」についてはビット単位で処理可能としたものが提供されている。つまり、ブロック単位で「消去」を行うことによってブロック内の全ビットを同じ値にしておき、所要のビットの値を反転させる「書込」を行うことによって、ブロックにデータを書き込むのである。
【0003】
このように、ブロック単位での消去とビット単位での書込とを可能としたフラッシュメモリでは、ブロックにデータがすでに書き込まれているときに同じブロックに別のデータを書き込もうとすれば、そのブロックのデータを消去してからでなければ、新たなデータを書き込むことができない。そこで、すでに格納されているデータの一部をブロックよりも小さい単位で書き換える手順として以下の方法が考えられている。
【0004】
いま、データがすでに書き込まれているブロックに含まれる1つの小ブロック(たとえば、ページ)のデータのみを変更する場合について考える。ここで、データが変更される小ブロックを小ブロックA、データが変更されない小ブロックを小ブロックBとする。上述のように、データがすでに存在しているブロックの内容を変更するには、そのブロックのデータを消去する必要があるが、小ブロックBについてはデータを変更しないから、ブロックのデータを消去する前に小ブロックBのデータを他のブロックあるいは他の記憶媒体に一旦退避させる。つまり、小ブロックAのデータを変更するには、まず小ブロックBのデータを退避させ、次に元のブロックのデータを消去し、最後に小ブロックAの新たなデータと退避していた小ブロックBのデータとを元のブロックに書き込むことになる。さらに、小ブロックBのデータを同じフラッシュメモリの別のブロックに退避している場合には、小ブロックBのデータを元のブロックに書き込んだ後に小ブロックBを退避していたブロックのデータを消去することも必要になる。
【0005】
また、小ブロックAのデータを変更したブロックが元のブロックとは異なるブロックでもよい場合には、以下の手順を採用することも可能である。つまり、小ブロックBのデータを同じフラッシュメモリ内で元のブロックとは異なるブロックに転送するようにし、小ブロックBのデータを転送するブロックに小ブロックAの新たなデータも書き込み、最後に元のブロックのデータを消去するようにしてもよい。この方法を採用すれば、元のブロックに変更後のデータを書き込む場合に比較して手順が少なくなる。
【0006】
【発明が解決しようとする課題】
ところで、上述のように前者の手順に比較して後者の手順は処理数が少なくなるから、高速な処理が期待できる点で優れているものの、以下のような問題が生じる可能性がある。たとえば、小ブロックAの新たなデータをブロックに書き込んでいる期間、小ブロックBのデータを別のブロックに転送している期間、元のブロックのデータを消去している期間のいずれかの期間において、フラッシュメモリにデータの転送や消去を指示している管理装置の電源の遮断のように処理が中断する異常が生じたとすると、フラッシュメモリに不要なデータが残されることになる。つまり、小ブロックAのデータの更新処理を開始してから、元のブロックのデータを消去してしまうまでの間に処理が停止すると、2つのブロックに何らかのデータが存在することになり、両ブロックのどちらのデータが正しいデータであるかを判断することができなくなる可能性がある。
【0007】
一方、特開平11−53248号公報などに記載されているように、従来からフラッシュメモリの一部の領域にアロケーションテーブルとディレクトリとをまとめて記憶させることによって(以下では、この領域を「集中管理領域」と呼ぶ)、オペレーティングシステムの管理下においてディスク装置(フレキシブルディスクあるいはハードディスク)と等価に扱うことを可能にする技術が提案されている。この種の技術を採用すれば、ディレクトリには各ブロックのデータに対して行っている処理内容に応じたフラグが書き込まれるから、電源の遮断のような異常から復帰したときにフラグの情報を用いて、異常が生じる前の状態から処理を再開させることが可能になる。
【0008】
しかしながら、このような構成を採用したとしても、集中管理領域はフラッシュメモリに設けられているから、アロケーションテーブルやディレクトリをブロック単位で消去することになり、アロケーションテーブルやディレクトリを書き換える際にデータの変更時と同様の問題が生じる。つまり、アロケーションテーブルやディレクトリを変更する処理を行っている間に停電によって電源が遮断されるような異常が生じると、フラッシュメモリに残されたデータのどれが正しいデータかを判別することができず、異常から復帰したときに異常の発生前の状態に復帰できなくなる場合がある。
【0009】
本発明は上記事由に鑑みて為されたものであり、その目的は、データの更新処理の期間中に電源が遮断されるような処理の中断する異常が生じても異常からの復帰後には異常の発生前の状態から処理を確実に再開させることを可能にしたブロック消去型記憶媒体の管理装置を提供することにある。
【0010】
【課題を解決するための手段】
請求項1の発明は、ブロック内の全ビットを2値の一方の値に設定する消去がブロック単位でのみ可能であるとともにブロック内の各ビットの値を2値の他方の値に設定する書込がビット単位で可能であり、かつ各ブロック内にそれぞれ複数個の小ブロックが設定される不揮発性のブロック消去型記憶媒体に接続され、ブロック消去型記憶媒体の各ブロックのデータを消去する消去処理および各ブロックにデータを書き込む書込処理が可能な管理装置であって、前記小ブロックごとに、当該小ブロックへのデータの書込開始および書込終了をそれぞれ示す書込開始フラグおよび書込終了フラグと、当該小ブロックのデータが別のブロックから転送された場合にデータの転送が終了した元のブロックのデータの消去終了を示す消去終了フラグとを備えるフラグエリアが設けられ、ブロックのデータを変更する際にデータの変更が生じない小ブロックについては更新元のブロックから更新先のブロックに小ブロックごとにデータを転送し、データの変更が生じる小ブロックについては更新先のブロックの小ブロックに変更されたデータを書き込む書込処理部と、更新元のブロックにおける所要の小ブロックのデータが更新先のブロックに転送された後に更新元のブロックのデータを消去する消去処理部と、更新先の各小ブロックへのデータの書込の開始時および終了時と更新元のブロックのデータの消去の終了時に更新先のブロックの各小ブロックにおける書込開始フラグ、書込終了フラグ、消去終了フラグの値をそれぞれ反転させるフラグ書込部と、異常による処理中断からの復帰時にフラグエリアの内容を監視しフラグエリアの内容に応じた復帰処理を行う判定処理部とを備えるものである。この構成によれば、更新先へのデータの書込中や更新元のデータの消去中において、電源の遮断のような異常が生じて処理が中断しても、判定処理部が書込開始フラグ、書込終了フラグ、消去終了フラグの値を監視することによって、異常から復帰したときには異常の発生前における処理の進行状況を把握することができ、適切な復帰処理が可能になる。
【0011】
請求項2の発明は、請求項1の発明において、前記フラグエリアが各小ブロックに個別に設定された識別番号が書込可能である番号領域を含み、前記フラグ書込部が、書込開始フラグの値を反転させる際に、更新元のブロックがあれば更新元の小ブロックの識別番号を番号領域に書き込み、更新元のブロックがなければ規定値を番号領域に書き込む機能を有し、前記判定処理部では異常による処理中断からの復帰時に書込開始フラグが設定され書込終了フラグが設定されていないときに、番号領域を参照して抽出された更新元の小ブロックからデータの転送を再開させることを特徴とする。この構成によれば、異常からの復帰時に判定処理部が番号領域を確認することによって、更新元の小ブロックのうちデータの転送が未終了である小ブロックを容易に発見することができ、データの転送を容易に再開させることができる。
【0012】
請求項3の発明は、請求項1または請求項2の発明において、前記各ブロックに、当該ブロックの消去の開始時に値が反転されるブロック消去開始フラグと、当該ブロックの消去の終了時に値が反転されるブロック消去終了フラグとが小ブロックとは別に設けられ、前記判定処理部では異常による処理中断からの復帰時にブロック消去開始フラグの値が反転しブロック消去終了フラグの値が反転していないときに消去処理部に指示を与えて当該ブロックのデータを消去させることを特徴とする。この構成によれば、ブロックのデータを消去している間に電源の遮断のような異常が生じたとしても、ブロック消去開始フラグの値が反転しブロック消去終了フラグの値が反転していなければ、消去処理の途中で異常が生じたことを認識することができ、当該ブロックの消去処理をあらためて行うことができる。
【0013】
請求項4の発明は、請求項1の発明において、前記判定処理部では、異常による処理中断からの復帰時にいずれかの小ブロックにおいて書込開始フラグの値のみが反転しているときには、同じブロック内で書込開始フラグおよび書込終了フラグがともに反転している小ブロックが存在していれば、書込処理部に指示を与えて書込開始フラグおよび書込終了フラグがともに反転している小ブロックのデータを別のブロックに転送させた後に、消去処理部に指示を与えて当該ブロックのデータを消去させることを特徴とする。この構成によれば、一つのブロック内において書込が終了した小ブロックと書込が終了しておらずデータに欠損がある小ブロックとが混在しているときに、書込が終了した小ブロックのデータを別のブロックに転送することによって、欠損の生じているデータを消去しながらも、書込が終了した小ブロックについてはデータを活用することができ、データが無駄にならない。
【0014】
請求項5の発明は、ブロック内の全ビットを2値の一方の値に設定する消去がブロック単位でのみ可能であるとともにブロック内の各ビットの値を2値の他方の値に設定する書込がビット単位で可能であり、かつ各ブロック内にそれぞれ複数個の小ブロックが設定される不揮発性のブロック消去型記憶媒体に接続され、ブロック消去型記憶媒体の各ブロックのデータを消去する消去処理および各ブロックにデータを書き込む書込処理が可能な管理装置であって、前記各ブロックに、当該ブロックの消去の開始時に値が反転されるブロック消去開始フラグと、当該ブロックの消去の終了時に値が反転されるブロック消去終了フラグとが小ブロックとは別に設けられ、前記小ブロックごとに、当該小ブロックへのデータの書込開始および書込終了をそれぞれ示す書込開始フラグおよび書込終了フラグと、当該小ブロックのデータが別のブロックから転送された場合にデータの転送が終了した元のブロックのデータの消去終了を示す消去終了フラグと、各小ブロックに個別に設定された識別番号が書込可能である番号領域とを備えるフラグエリアが設けられ、ブロックのデータを変更する際にデータの変更が生じない小ブロックについては更新元のブロックから更新先のブロックに小ブロックごとにデータを転送し、データの変更が生じる小ブロックについては更新先のブロックの小ブロックに変更されたデータを書き込む書込処理部と、更新元のブロックにおける所要の小ブロックのデータが更新先のブロックに転送された後に更新元のブロックのデータを消去する消去処理部と、更新先の各小ブロックへのデータの書込の開始時および終了時と更新元のブロックのデータの消去の終了時に更新先のブロックの各小ブロックにおける書込開始フラグ、書込終了フラグ、消去終了フラグの値をそれぞれ反転させるフラグ書込部と、異常による処理中断からの復帰時にフラグエリアの内容を監視しフラグエリアの内容に応じた復帰処理を行う判定処理部とを備え、前記フラグ書込部が、書込開始フラグの値を反転させる際に、更新元のブロックがあれば更新元の小ブロックの識別番号を番号領域に書き込み、更新元のブロックがなければ規定値を番号領域に書き込む機能を有し、前記判定処理部では異常による処理中断からの復帰時に、ブロック消去開始フラグの値が反転しブロック消去終了フラグの値が反転していなければ消去処理部に指示を与えて当該ブロックのデータを消去させ、いずれかの小ブロックにおいて書込開始フラグの値のみが反転しているときには、同じブロック内で書込開始フラグおよび書込終了フラグがともに反転している小ブロックが存在していれば、書込処理部に指示を与えて書込開始フラグおよび書込終了フラグがともに反転している小ブロックのデータを別のブロックに転送させた後に、消去処理部に指示を与えて当該ブロックのデータを消去させ、かつ番号領域を参照して抽出された更新元の小ブロックから前記別のブロックにデータを転送させることを特徴とする。この構成によれば、更新先へのデータの書込中や更新元のデータの消去中において、電源の遮断のような異常が生じて処理が中断しても、判定処理部が書込開始フラグ、書込終了フラグ、消去終了フラグの値を監視することによって、異常から復帰したときには異常の発生前における処理の進行状況を把握することができ、適切な復帰処理が可能になる。また、ブロックのデータを消去している間に電源の遮断のような異常が生じたとしても、ブロック消去開始フラグの値が反転しブロック消去終了フラグの値が反転していなければ、消去処理の途中で異常が生じたことを認識することができ、当該ブロックの消去処理をあらためて行うことができる。しかも、ブロックのデータを消去している間に電源の遮断のような異常が生じたとしても、ブロック消去開始フラグの値が反転しブロック消去終了フラグの値が反転していなければ、消去処理の途中で異常が生じたことを認識することができ、当該ブロックの消去処理をあらためて行うことができる。さらに、一つのブロック内において書込が終了した小ブロックと書込が終了しておらずデータに欠損がある小ブロックとが混在しているときに、書込が終了した小ブロックのデータを別のブロックに転送することによって、欠損の生じているデータを消去しながらも、書込が終了した小ブロックについてはデータを活用することができ、データが無駄にならない。
【0015】
【発明の実施の形態】
以下に説明する発明の実施の形態では、説明を簡単にするために、ブロックのデータが消去された状態でブロック内の全ビットが1になり、書込に際してはビット単位でビット値を0に変更できるものとする。また、ブロック内には2個の小ブロックが存在するものとする。ただし、ブロック内の小ブロックが3個以上であっても本発明の技術思想は適用可能である。
【0016】
(第1の実施の形態)
本実施形態では、図3に示すように、フラッシュメモリ1(図1参照)の2個のブロックB1,B2に着目し、各ブロックB1,B2がそれぞれ2個ずつの.小ブロック(たとえば、ページ)P11,P12、P21,P22を備えるものとする。また、初期状態では図3(a)のようにブロックB1における小ブロックP11,P12にそれぞれデータD1,データD2が格納されており、最終的には図3(d)のようにブロックB2における小ブロックP21,P22にそれぞれデータD3,データD2を格納するものとする。要するに、小ブロックP11のデータD1をデータD3に変更するとともに、ブロックB1からブロックB2にデータを転送したことになる。以下では、ブロックB1を更新元と呼び、ブロックB2を更新先と呼び、更新先のブロックB2にデータが書き込まれた後には更新元のブロックB1のデータは消去されるものとする。
【0017】
更新先のブロックB2において小ブロックP21に書き込まれるデータD3は、更新元のブロックB1には存在しなかったデータであるから、ブロックB2があらかじめ消去されていれば、ブロックB2に書き込むことができる。一方、小ブロックP22に書き込まれるデータD2は、更新元のブロックB1における小ブロックP12に格納されているデータであるから、ブロックB1からブロックB2に転送されることになる。つまり、手順としては、図3(a)の状態から図3(b)のようにブロックB2の小ブロックP21にデータD3を書き込むとともに、図3(c)のようにブロックB1の小ブロックP12からブロックB2の小ブロックP22にデータD2を転送し、最後に図3(d)のようにブロックB1のデータを消去することになる。この手順は従来構成として説明した手順と同様である。
【0018】
ところで、本実施形態は、各小ブロックP11,P12、P21,P22ごとにそれぞれフラグエリアFを設定した点が従来構成と相違する。各フラグエリアFは3ビットであって、図4に示すように、書込開始フラグf1、書込終了フラグf2、消去終了フラグf3を備える。いずれもビット値が0である状態がフラグの設定された状態であって、ビット値が0であるフラグについてはその処理が行われたことを意味する。書込開始フラグf1はデータの更新先のブロックB2における小ブロックP21,P22においてデータの書込開始前に設定され、各小ブロックP21,P22においてデータの書込が終了した時点で、その小ブロックP21,P22に対して書込終了フラグf2が設定される。消去終了フラグf3の機能については後述する。また、フラグエリアFは小ブロックP11,P12、P21,P22の適宜箇所に設けることができるが、通常は小ブロックP11,P12、P21,P22の先頭アドレスからフラグエリアFが設定される。
【0019】
図3の処理を例にして具体的に説明する。初期状態ではブロックB2は消去されているから、図3(a)の状態では、書込開始フラグf1=1、書込終了フラグf2=1、消去終了フラグf3=1である。データD3の書込が開始される前には書込開始フラグf1が0に設定されるから、書込開始フラグf1=0、書込終了フラグf2=1、消去終了フラグf3=1になり、その後、図3(b)のようにデータD3が小ブロックP21に書き込まれることになる。また、小ブロックP21へのデータD3の書込が終了すると書込終了フラグf2が0に設定されるから、書込開始フラグf1=0、書込終了フラグf2=0、消去終了フラグf3=1になる。要するに、小ブロックP21のフラグエリアFの内容は、図3(b)の前後において、「f1=0、f2=1、f3=1」から、「f1=0、f2=0、f3=1」になる。
【0020】
同様にして、図3(c)のようにデータD2をブロックB2の小ブロックP22に書き込む際に、小ブロックP22のフラグエリアFの内容は、当初は「f1=1、f2=1、f3=1」であるが、データD2の転送を開始する前に「f1=0、f2=1、f3=1」に設定され、データD2の転送が終了すれば「f1=0、f2=0、f3=1」に設定される。つまり、図3(c)の前後においては、小ブロックP22のフラグエリアFの内容が、「f1=0、f2=1、f3=1」から、「f1=0、f2=0、f3=1」になる。
【0021】
上述のようにしてブロックB2に所要のデータD2,D3が書き込まれた後には、図3(d)のように、ブロックB1のデータD1,D2が消去されるのであって、更新元のブロックB1のデータD1,D2の消去後には、更新先のブロックB2の小ブロックP21,P22における消去終了フラグf3がともに0にされる。ここに、更新元のブロックB1の小ブロックP11,P12においては、消去によってフラグエリアFのすべてのフラグが1になるから、再書込が可能な状態を示すことになる。
【0022】
上述した処理手順を図2にまとめる。すなわち、データの更新処理を開始すると、まず書込対象である更新先のブロックB2の小ブロックP21,P22のフラグエリアFに書込開始フラグf1が設定され(S1)、データが書き込まれる(S2)。1つの小ブロックP21,P22へのデータの書込が終了すれば(S3)、その小ブロックP21,P22に書込終了フラグf2が設定され(S4)、所要の小ブロックP21,P22へのデータの書込が終了すれば(S5)、次には更新元のブロックB1のデータの消去が開始され(S6)、更新元のブロックB1のデータが消去されると(S7)、更新先のブロックB1のすべての小ブロックP21,P22に消去終了フラグf3が設定される。
【0023】
上述の動作は、図1に示すように、フラッシュメモリ1に接続した管理装置2が行っている。管理装置2は、マイクロプロセッサあるいは専用のハードウェアにより構成され、小ブロック間でのデータの転送を行うとともに各小ブロックへのデータの書込を行う書込処理部21と、ブロック単位でデータを消去する消去処理部22とを備えるほか、フラグエリアFへのフラグの書込を行うフラグ処理部23と、処理の進行状況を監視するとともにデータの更新処理を行うための指示を与える判定処理部20とを備える。判定処理部20では、データの更新処理の指示を外部から受けると、書込処理部21、消去処理部22、フラグ書込部23に指示を与えて図2に示した手順で小ブロックのデータを操作する。また、判定処理部20は、異常からの復帰時にフラグエリアFの内容に基づいて以下に説明する処理を行う機能も備える。
【0024】
上述した構成では、フラッシュメモリ1においてビット単位での書込が可能なことを利用して、フラグエリアFに処理の進行状況を表すビット単位のフラグを処理の各段階ごとに書き込むから、いずれかの段階において電源が遮断されるような処理の中断する異常が生じたとしても、フラグエリアFの内容を参照することによって、異常の発生前の状態に復帰させる復帰処理が可能になる。復帰処理は、フラグエリアFの内容に応じて選択される。つまり、フラグエリアFの内容を参照することによって、データの更新処理を行っている期間におけるどの段階で電源の遮断などの異常が生じたかを判断することができるから、各段階に対応した復帰処理を行うことになる。
【0025】
つまり、異常から復帰した時点で、各小ブロックのフラグエリアの内容を参照したときに、フラグエリアFのすべてのフラグが0であれば、データの変更に関する処理がすべて終了したことを意味し、フラグエリアfのすべてのフラグが1であれば、その小ブロックはデータが消去され書込が可能であることを意味することになる。一方、3個のフラグのうちのいずれかが他のフラグと異なっていれば、電源の遮断のような異常の発生時にデータの更新処理が途中であったことが把握できる。したがって、判定処理部20ではフラグの内容を監視することによって、データの転送先が書込可能であることを把握したり、異常からの復帰時に異常の発生前の処理を継続させたりすることが可能になる。
【0026】
ところで、小ブロックPへの書込が開始され、書込が終了するまでに異常が生じたときには、その小ブロックPのフラグエリアFは「f1=0、f2=1、f3=1」になっている。つまり、フラグエリアFの内容が「f1=0、f2=1、f3=1」である小ブロックPは、データの書込の途中で異常が生じたことがわかる。言い換えると、この小ブロックPのデータは一部が欠損していることになる。ただし、欠損したデータを含むブロックB内の他の小ブロックPについては、データに欠損がない可能性がある。
【0027】
そこで、図5に示すように、異常から復帰したときには、まずフラッシュメモリ1のすべての小ブロックPにおけるフラグエリアFを参照し、フラグエリアFの内容が「f1=0、f2=1、f3=1」である小ブロックPをすべて抽出する(S1〜S3)。次に、抽出された小ブロックPを含むブロックB内でフラグエリアFの内容が「f1=1、f2=1、f3=1」である小ブロックPが存在するか否かを検出し(S4)、一つのブロックBにデータが正常である小ブロックPと異常である小ブロックPとが混在するときには、データが正常である小ブロックPのデータを別のブロックに転送する(S5)。データの転送後に当該ブロックBのデータを消去すれば(S6)、欠損のあるデータのみが消去され、欠損のあったデータを適宜の小ブロックPに書き込む処理から再開させることができる。このような処理を行えば、消去するデータ量を少なくすることができ、比較的短時間で復帰させることが可能になる。
【0028】
(第2の実施の形態)
本実施形態は、図6に示すように、フラグエリアFに番号領域f4を追加したものである。本実施形態では、各小ブロックに識別番号が付与されていることを前提にしている。しかして、小ブロック間でのデータの転送時に転送先の番号領域f4に転送元の小ブロックの識別番号が書き込まれる。番号領域f4への識別番号の書込は、書込開始フラグf1の設定時と同じタイミングになっている。したがって、小ブロックへのデータの書込が開始されるときには、小ブロック間でのデータの転送であれば転送元が番号領域f4に書き込まれる。その結果、データの転送中の期間に電源が遮断されるような異常が生じても、番号領域f4によって転送元を知ることができ、正常なデータの所在を知ることによってデータの転送を再開させることができる。
【0029】
図3に示した例で説明すれば、図3(b)(c)のようにブロックB1の小ブロックP12からブロックB2の小ブロックP22にデータを転送するにあたって、小ブロックP12の識別番号が02であるとすれば、フラグエリアFの内容が、「f1=1、f2=1、f3=1、f4=FF」の状態から「f1=0、f2=1、f3=1、f4=02」に変更される。したがって、データの転送中に電源が遮断されるような異常が生じたとしても番号領域f4の値である02を見ることによって、小ブロックP12には元のデータが残っていることを知ることができる。なお、小ブロックに書き込まれるデータが他の小ブロックから転送されるものでないときには、小ブロックの識別番号に用いられていない規定値(たとえば、0)を番号領域f4に設定する。
【0030】
(第3の実施の形態)
上述した実施形態では、更新先のブロックB2にデータを書き込んだ後に更新元のブロックB1のデータを消去する例を示しており、書込終了フラグf2の設定から消去終了フラグf3の設定までの期間を消去処理の期間とみなしている。しかしながら、データが格納されているブロックについてデータの消去のみを行う場合には、データの消去処理を開始した時点を知ることができない。したがって、消去処理の期間において電源が遮断されるような異常が生じた場合には、消去終了フラグf3が0に保たれていることがあり、一部が消去されたデータか正常なデータかの判別ができなくなる可能性が生じる。
【0031】
本実施形態では、図7に示すように、ブロックBごとに小ブロックPとは別の領域にそれぞれ1ビットであるブロック消去開始フラグf5とブロック消去終了フラグf6とを設けることにより、ブロック単位での消去の開始と終了とを示すようにしたものである。ブロック消去開始フラグf5はブロックBについて消去処理を開始する直前に0に設定され、ブロック消去終了フラグf6は消去処理が終了すると0に設定される。
【0032】
したがって、データが格納されているか否かにかかわらず正常なブロックBでは「f5=1、f6=0」であり、消去処理が開始されると「f5=0、f6=0」になる。その後、ブロックBのデータがすべて消去されると「f5=1、f6=1」になり、消去処理が終了すればブロック消去終了フラグf6が設定されて、「f5=1、f6=0」になる。
【0033】
このように、消去処理が正常に行われたブロックB(フラッシュメモリ1の使用開始時の初期化による消去処理でも同様)では「f5=1、f6=0」であるから、ブロック消去開始フラグf5とブロック消去終了フラグf6との値が上述の関係以外のときには消去処理中に異常が生じたと判断することができる。本実施形態では、異常からの復帰時に、ブロック消去開始フラグf5およびブロック消去終了フラグf6の値を判定処理部20において監視し、「f5=1、f6=0」ではないブロックBについては消去処理部22に対して消去処理を指示する。他の構成および動作は第1ないし第2の実施の形態と同様である。
【0034】
本実施形態における消去処理を図8にまとめる。すなわち、消去処理が指示されると、まず消去対象であるブロックBのブロック消去開始フラグf5が設定され(S1)、ブロックBの消去が開始される(S2)。ブロックBの消去が終了すれば(S3)、消去対象であるブロックBにブロック消去終了フラグf6が設定されるのである。
【0035】
本実施形態のように各ブロックBにブロック消去開始フラグf5およびブロック消去終了フラグf6を用いる構成を、第2の実施の形態のように各小ブロックPにそれぞれ番号領域f4を付与する構成と併用すれば、異常からの復帰時において消去すべきデータが残っているか否かを判断することができ、そのようなデータが残っているブロックに対して消去処理を施すことが可能になる。
【0036】
たとえば、ブロックBの消去処理の期間において異常が生じたとすると、異常からの復帰時にはブロックBの消去が完了していないから、不完全なデータが残されることになる。また、第1の実施の形態のようにデータの更新処理の際に、更新先のブロックB2の一部の小ブロックP21,P22へのデータの書込が終了したものの、他の小ブロックP21,P22へのデータの書込が終了する前に異常が生じることがある。つまり、ブロックB1の消去処理が予定されている状態で消去処理の前に異常が生じることがある。ここで、書込の終了したデータが更新元から更新先に転送されたものであるときには、更新元のブロックB1と更新先のブロックB2とに同じデータの2つの小ブロックが存在することになる。また、この場合には書込が終了していない小ブロックP21,P22のデータには欠損が生じていることになる。
【0037】
このように消去処理中や消去処理が予定されている状態での異常により欠損の生じたデータは異常からの復帰時に消去することが必要であり、消去処理中あるいは消去処理が予定されていたブロックは異常からの復帰後にデータを消去しなければならない。
【0038】
図9を用いて動作を簡単に説明する。上述したように、ブロックBの消去処理の期間において異常が生じたときには、「f5=0、f6=0」であるから、異常からの復帰時に各ブロックBのブロック消去開始フラグf5とブロック消去終了フラグf6との組を検索して「f5=0、f6=0」であれば、ブロックBの消去処理が正常に終了していないものと判断し、判定処理部20から消去処理部22に対して当該ブロックBのデータを消去するように指示する(S1)。
【0039】
一方、データの更新処理に際して、更新先のブロックB2の一部の小ブロックP21へのデータの書込後で、他の小ブロックP22へのデータの書込中に異常が生じたときには、更新先のブロックB2における小ブロックP21のフラグエリアFの内容は「f1=0、f2=0、f3=1、f4=3」であり、小ブロックP22のフラグエリアFの内容は「f1=0、f2=1、f3=1、f4=4」になっている。そこで、異常からの復帰時に各小ブロックP11,P12,P21,P22のフラグエリアFの内容を検索して「f1=0、f2=1、f3=1」である小ブロックが抽出されたときには(S2〜S4)、同じブロックB2内に「f1=0、f2=0、f3=1」である小ブロックP21が含まれるか否かを検証する(S5)。ここでは、ブロックB2において、書込が終了した小ブロックP21と書込中の小ブロックP22とが混在していると想定しており、このような場合には、異常からの復帰時の復帰処理において、すでに書込が終了した小ブロックP21を活用するために、書込が終了した小ブロックP21のデータについては別のブロックBに転送する(S6)。つまり、書込が終了した小ブロックP21のデータを退避したことになり、データの退避が終了した後にブロックB2の消去処理を行えば、欠損の生じているデータを消去することができる(S7)。このとき、番号領域f4を利用することによって、欠損の生じているデータを保有していた小ブロックP22を特定することができるから、ブロックB2のデータを消去した後、小ブロックP22への書込を予定していたデータを、小ブロックP21のデータを転送したブロックにおける小ブロックに書き込むようにすればよい(S8)。その後、すべての小ブロックへのデータの書込が終了すれば、更新元のブロックB1のデータを消去する(S9)。この処理によって、更新元と更新先との2つの小ブロックが同じデータを持つことを回避することができる。
【0040】
フラグエリアFの内容を検索したときに、「f1=0、f2=1、f3=1」である小ブロックが抽出されなければ、データに欠損の生じている小ブロックは存在しないから、異常が生じる前の処理から継続することによって、データの更新処理を正常に終了させることが可能になる。他の構成および動作は第1の実施の形態と同様である。
【0041】
【発明の効果】
請求項1の発明では、更新先へのデータの書込中や更新元のデータの消去中において電源の遮断のような異常が生じて処理が中断しても、判定処理部が書込開始フラグ、書込終了フラグ、消去終了フラグの値を監視することによって、異常から復帰したときには異常の発生前における処理の進行状況を把握することができ、適切な復帰処理が可能になる。
【0042】
請求項2の発明では、請求項1の発明の効果に加えて、異常からの復帰時に判定処理部が番号領域を確認することによって、更新元の小ブロックのうちデータの転送が未終了である小ブロックを容易に発見することができ、データの転送を容易に再開させることができる。
【0043】
請求項3の発明では、請求項1または請求項2の発明の効果に加えて、ブロックのデータを消去している間に電源の遮断のような異常が生じたとしても、ブロック消去開始フラグの値が反転しブロック消去終了フラグの値が反転していなければ、消去処理の途中で異常が生じたことを認識することができ、当該ブロックの消去処理をあらためて行うことができる。
【0044】
請求項4の発明では、請求項1の発明の効果に加えて、一つのブロック内において書込が終了した小ブロックと書込が終了しておらずデータに欠損がある小ブロックとが混在しているときに、書込が終了した小ブロックのデータを別のブロックに転送することによって、欠損の生じているデータを消去しながらも、書込が終了した小ブロックについてはデータを活用することができ、データが無駄にならない。
【0045】
請求項5の発明では、更新先へのデータの書込中や更新元のデータの消去中において、電源の遮断のような異常が生じて処理が中断しても、判定処理部が書込開始フラグ、書込終了フラグ、消去終了フラグの値を監視することによって、異常から復帰したときには異常の発生前における処理の進行状況を把握することができ、適切な復帰処理が可能になる。また、ブロックのデータを消去している間に電源の遮断のような異常が生じたとしても、ブロック消去開始フラグの値が反転しブロック消去終了フラグの値が反転していなければ、消去処理の途中で異常が生じたことを認識することができ、当該ブロックの消去処理をあらためて行うことができる。しかも、ブロックのデータを消去している間に電源の遮断のような異常が生じたとしても、ブロック消去開始フラグの値が反転しブロック消去終了フラグの値が反転していなければ、消去処理の途中で異常が生じたことを認識することができ、当該ブロックの消去処理をあらためて行うことができる。さらに、一つのブロック内において書込が終了した小ブロックと書込が終了しておらずデータに欠損がある小ブロックとが混在しているときに、書込が終了した小ブロックのデータを別のブロックに転送することによって、欠損の生じているデータを消去しながらも、書込が終了した小ブロックについてはデータを活用することができ、データが無駄にならない。
【図面の簡単な説明】
【図1】本発明の実施の形態を示すブロック図である。
【図2】本発明の第1の実施の形態を示す動作説明図である。
【図3】同上の動作説明図である。
【図4】同上におけるフラグエリアの説明図である。
【図5】同上の復帰処理を示す動作説明図である。
【図6】本発明の第2の実施の形態におけるフラグエリアの説明図である。
【図7】本発明の第3の実施の形態におけるブロックの説明図である。
【図8】同上の動作説明図である。
【図9】同上の復帰処理を示す動作説明図である。
【符号の説明】
1 フラッシュメモリ
2 管理装置
20 判定処理部
21 書込処理部
22 消去処理部
23 フラグ書込部
B ブロック
B1,B2 ブロック
F フラグ
f1 書込開始フラグ
f2 書込終了フラグ
f3 消去終了フラグ
f4 番号領域
f5 ブロック消去開始フラグ
f6 ブロック消去終了フラグ
P 小ブロック
P11,P12 小ブロック
P21,P22 小ブロック
[0001]
BACKGROUND OF THE INVENTION
The present invention is a non-volatile storage medium typified by a flash memory, and “erase” that makes all bits in a block one of two values is possible only in units of blocks. The present invention relates to a block erasing type storage medium management apparatus that can perform “write” in units of bits to make the value of the other one of the two values.
[0002]
[Prior art]
In recent years, a flash memory that is a nonvolatile memory in which a storage area is divided into a plurality of blocks and in which stored data can be erased only in units of blocks has been widely used. A block is a unit in which a plurality of bytes are batched. For example, a flash memory in which 528 bytes are one page and 16 pages are one block is provided. In this type of block erasure type storage medium, “erase” that sets all bits of a block to one of two values (for example, 1) can be processed only in units of blocks, and the value of each bit in the block As for “write” which makes the other value of the binary value (for example, 0), one that can be processed bit by bit is provided. In other words, all the bits in the block are set to the same value by performing “erasing” in units of blocks, and data is written to the block by performing “writing” that inverts the value of a required bit.
[0003]
As described above, in the flash memory capable of erasing in blocks and writing in bits, if data is already written in the block and another data is written in the same block, the block New data cannot be written until the data is erased. Therefore, the following method is considered as a procedure for rewriting a part of already stored data in a unit smaller than a block.
[0004]
Consider a case where only the data of one small block (for example, a page) included in a block in which data has already been written is changed. Here, a small block whose data is changed is a small block A, and a small block whose data is not changed is a small block B. As described above, in order to change the contents of a block in which data already exists, it is necessary to erase the data in that block. However, since data is not changed in the small block B, the data in the block is erased. Before, the data of the small block B is temporarily saved in another block or another storage medium. In other words, in order to change the data of the small block A, the data of the small block B is first saved, then the original block data is erased, and finally the new data of the small block A and the small block that was saved B data is written into the original block. Further, when the data of the small block B is saved in another block of the same flash memory, the data of the block in which the small block B has been saved is erased after the data of the small block B is written in the original block. It is also necessary to do.
[0005]
Further, when the block in which the data of the small block A is changed may be a block different from the original block, the following procedure can be adopted. That is, the data of the small block B is transferred to a block different from the original block in the same flash memory, the new data of the small block A is written in the block to which the data of the small block B is transferred, and finally the original data is written. You may make it erase the data of a block. If this method is adopted, the number of procedures is reduced as compared with the case where the changed data is written in the original block.
[0006]
[Problems to be solved by the invention]
Incidentally, as described above, since the number of processes in the latter procedure is smaller than that in the former procedure, it is excellent in that high-speed processing can be expected, but the following problems may occur. For example, in a period in which new data of the small block A is written in the block, a period in which the data in the small block B is transferred to another block, or a period in which the data in the original block is erased If an abnormality that interrupts the processing occurs, such as a power-off of a management apparatus that instructs the flash memory to transfer or erase data, unnecessary data is left in the flash memory. That is, if the processing is stopped between the start of the update process of the data of the small block A and the deletion of the data of the original block, some data exists in the two blocks, and both blocks It may not be possible to determine which data is correct.
[0007]
On the other hand, as described in Japanese Patent Application Laid-Open No. 11-53248 and the like, conventionally, an allocation table and a directory are collectively stored in a partial area of the flash memory (hereinafter, this area is referred to as “centralized management”). A technology has been proposed that enables the disk device (flexible disk or hard disk) to be handled equivalently under the management of the operating system. If this kind of technology is adopted, a flag is written in the directory according to the contents of processing performed on the data of each block, so the flag information is used when recovering from an abnormality such as a power shutdown. Thus, it is possible to resume the process from the state before the abnormality occurred.
[0008]
However, even if such a configuration is adopted, since the central management area is provided in the flash memory, the allocation table and directory will be erased in units of blocks, and data will be changed when the allocation table or directory is rewritten. A problem similar to time arises. In other words, if an abnormality occurs that causes the power to be cut off due to a power failure while processing to change the allocation table or directory, it is impossible to determine which of the data remaining in the flash memory is correct. When returning from an abnormality, it may not be possible to return to the state before the occurrence of the abnormality.
[0009]
The present invention has been made in view of the above-described reasons, and its purpose is to provide an abnormality after returning from the abnormality even if an abnormality that interrupts the process occurs such that the power is shut off during the data update process. It is an object of the present invention to provide a block erasure type storage medium management apparatus that can reliably resume processing from a state before occurrence of the occurrence of the problem.
[0010]
[Means for Solving the Problems]
According to the first aspect of the present invention, erasure that sets all bits in a block to one of the two values is possible only in units of blocks, and the value of each bit in the block is set to the other value of the two values. Erase to erase the data of each block of the block erasure type storage medium that is connected to a non-volatile block erasure type storage medium that can be bit by bit and each block has a plurality of small blocks. A management apparatus capable of processing and writing data to each block, wherein for each small block, a write start flag and a write indicating the start and end of writing data to the small block, respectively An end flag, and an erasure end flag indicating the end of erasure of the data of the original block whose data has been transferred when the data of the small block is transferred from another block For small blocks that are provided with a flag area and data changes do not occur when the block data is changed, the data is transferred from the update source block to the update destination block for each small block, and the data changes. For the block, the write processing unit that writes the changed data to the small block of the update destination block, and the data of the update source block after the required small block data in the update source block is transferred to the update destination block Erasure processing unit for erasing data, and writing at each small block of the update destination block at the start and end of data writing to each update destination small block and at the end of erasure of data of the update source block Flag writing unit that inverts the values of the flag, write end flag, and erase end flag, respectively, and when returning from processing interruption due to an error Monitoring the contents of the flag area in which and a determination processing unit that performs the return processing according to the content of flag area. According to this configuration, even when data is being written to the update destination or when the update source data is being erased, even if an abnormality such as a power interruption occurs and the process is interrupted, the determination processing unit displays the write start flag. By monitoring the values of the write end flag and the erase end flag, the progress of the process before the occurrence of the abnormality can be grasped when returning from the abnormality, and an appropriate return process can be performed.
[0011]
According to a second aspect of the present invention, in the first aspect of the invention, the flag area includes a number area in which an identification number individually set for each small block can be written, and the flag writing unit starts writing When inverting the value of the flag, if there is an update source block, the identification number of the update source small block is written in the number area, and if there is no update source block, the specified value is written in the number area, The judgment processing unit transfers data from the update source small block extracted by referring to the number area when the write start flag is set and the write end flag is not set when returning from processing interruption due to an error. It is characterized by resuming. According to this configuration, when the determination processing unit confirms the number area when returning from an abnormality, it is possible to easily find a small block in which data transfer has not been completed among the update-source small blocks. Can be easily resumed.
[0012]
According to a third aspect of the present invention, in the first or second aspect of the present invention, each block has a block erase start flag whose value is inverted at the start of the erase of the block, and a value at the end of the erase of the block. A block erase end flag to be inverted is provided separately from the small block. In the determination processing unit, the value of the block erase start flag is inverted and the value of the block erase end flag is not inverted when returning from the processing interruption due to the abnormality. In some cases, an instruction is given to the erasure processing unit to erase the data of the block. According to this configuration, even if an abnormality such as a power interruption occurs while erasing the block data, the value of the block erase start flag is inverted and the value of the block erase end flag is not inverted. Thus, it is possible to recognize that an abnormality has occurred during the erasing process, and the erasing process for the block can be performed again.
[0013]
According to a fourth aspect of the present invention, in the first aspect of the invention, in the determination processing unit, when only the value of the write start flag is inverted in any small block when returning from the processing interruption due to abnormality, the same block If there is a small block in which both the write start flag and the write end flag are inverted, an instruction is given to the write processing unit, and both the write start flag and the write end flag are inverted. After the small block data is transferred to another block, an instruction is given to the erasure processing unit to erase the data of the block. According to this configuration, when a small block for which writing has been completed and a small block for which writing has not been completed and data is missing are mixed in one block, the small block for which writing has been completed. By transferring this data to another block, it is possible to use the data for the small block for which writing has been completed while erasing the data in which the loss has occurred, and the data is not wasted.
[0014]
According to the invention of claim 5, the erasure for setting all the bits in the block to one of the two values is possible only in units of the block, and the value for each bit in the block is set to the other of the two values. Erase to erase the data of each block of the block erasure type storage medium that is connected to a non-volatile block erasure type storage medium that can be bit by bit and each block has a plurality of small blocks. A management device capable of processing and writing data to each block, wherein each block has a block erase start flag whose value is inverted at the start of erase of the block, and at the end of erase of the block A block erasure end flag whose value is inverted is provided separately from the small block, and for each small block, data writing to the small block starts and ends. A write start flag and a write end flag, respectively, an erase end flag indicating the end of erasure of the data of the original block where the data transfer is completed when the data of the small block is transferred from another block, and A flag area is provided that includes a number area in which an identification number set individually for each small block is writable. For small blocks that do not change data when changing block data, start from the update source block Data is transferred to the update-destination block for each small block, and for a small block in which the data changes, a write processing unit that writes the changed data to the small block of the update-destination block and a required block in the update-source block An erasure processing unit that erases the data of the update source block after the small block data is transferred to the update destination block, and the update At the start and end of data writing to each small block, and at the end of erasure of data in the update source block, the write start flag, write end flag, and erase end flag in each small block of the update destination block A flag writing unit that inverts each of the values, and a determination processing unit that monitors the contents of the flag area upon return from processing interruption due to an abnormality and performs a return process according to the contents of the flag area, the flag writing unit However, when inverting the value of the write start flag, if there is an update source block, the identification number of the update source small block is written in the number area, and if there is no update source block, the specified value is written in the number area. The determination processing unit reverses the value of the block erase start flag when returning from the processing interruption due to an abnormality, and the value of the block erase end flag is not inverted when returning from the processing interruption due to an abnormality. When an instruction is given to the management unit to erase the data of the block and only the value of the write start flag is inverted in any small block, both the write start flag and the write end flag are set in the same block. If there is an inverted small block, after giving an instruction to the write processing unit and transferring the data of the small block whose write start flag and write end flag are both inverted to another block The erasure processing unit is instructed to erase the data of the block, and the data is transferred from the update-source small block extracted with reference to the number area to the other block. According to this configuration, even when data is being written to the update destination or when the update source data is being erased, even if an abnormality such as a power interruption occurs and the process is interrupted, the determination processing unit displays the write start flag. By monitoring the values of the write end flag and the erase end flag, the progress of the process before the occurrence of the abnormality can be grasped when returning from the abnormality, and an appropriate return process can be performed. Even if an abnormality such as a power interruption occurs while erasing the block data, if the block erase start flag value is inverted and the block erase end flag value is not inverted, the erase process It is possible to recognize that an abnormality has occurred on the way, and to erase the block again. Moreover, even if an abnormality such as a power interruption occurs while erasing the block data, if the value of the block erase start flag is inverted and the value of the block erase end flag is not inverted, the erase process It is possible to recognize that an abnormality has occurred on the way, and to erase the block again. Furthermore, when a small block for which writing has been completed and a small block for which writing has not been completed and data is missing in one block are mixed, the data of the small block for which writing has been completed are separated. By transferring to this block, it is possible to utilize the data for the small block for which writing has been completed while erasing the data in which the loss has occurred, and the data is not wasted.
[0015]
DETAILED DESCRIPTION OF THE INVENTION
In the embodiment of the invention described below, for the sake of simplicity, all the bits in the block are set to 1 when the block data is erased, and the bit value is set to 0 in units of bits at the time of writing. It can be changed. It is assumed that there are two small blocks in the block. However, the technical idea of the present invention can be applied even when there are three or more small blocks in the block.
[0016]
(First embodiment)
In the present embodiment, as shown in FIG. 3, attention is paid to the two blocks B1 and B2 of the flash memory 1 (see FIG. 1), and each of the blocks B1 and B2 has two blocks. Assume that small blocks (for example, pages) P11, P12, P21, and P22 are provided. In the initial state, data D1 and data D2 are respectively stored in the small blocks P11 and P12 in the block B1 as shown in FIG. 3A, and finally the small blocks in the block B2 as shown in FIG. 3D. Assume that data D3 and data D2 are stored in blocks P21 and P22, respectively. In short, the data D1 of the small block P11 is changed to the data D3, and the data is transferred from the block B1 to the block B2. In the following, it is assumed that the block B1 is called an update source, the block B2 is called an update destination, and the data in the update source block B1 is erased after the data is written in the update destination block B2.
[0017]
Since the data D3 written in the small block P21 in the update destination block B2 is data that did not exist in the update source block B1, if the block B2 has been erased in advance, it can be written in the block B2. On the other hand, since the data D2 written to the small block P22 is data stored in the small block P12 in the update source block B1, it is transferred from the block B1 to the block B2. That is, as a procedure, the data D3 is written from the state of FIG. 3A to the small block P21 of the block B2 as shown in FIG. 3B, and from the small block P12 of the block B1 as shown in FIG. 3C. The data D2 is transferred to the small block P22 of the block B2, and finally the data of the block B1 is erased as shown in FIG. This procedure is the same as the procedure described as the conventional configuration.
[0018]
By the way, this embodiment is different from the conventional configuration in that a flag area F is set for each of the small blocks P11, P12, P21, and P22. Each flag area F is 3 bits and includes a write start flag f1, a write end flag f2, and an erase end flag f3 as shown in FIG. In any case, a state in which the bit value is 0 is a state in which a flag is set, and a flag having a bit value of 0 means that the processing has been performed. The write start flag f1 is set before the start of data writing in the small blocks P21 and P22 in the data update destination block B2, and when the data writing is completed in each of the small blocks P21 and P22, the small block is set. A write end flag f2 is set for P21 and P22. The function of the erasure end flag f3 will be described later. Further, the flag area F can be provided at appropriate positions of the small blocks P11, P12, P21, and P22. Usually, the flag area F is set from the head address of the small blocks P11, P12, P21, and P22.
[0019]
The processing in FIG. 3 will be specifically described as an example. Since the block B2 is erased in the initial state, in the state of FIG. 3A, the write start flag f1 = 1, the write end flag f2 = 1, and the erase end flag f3 = 1. Since the write start flag f1 is set to 0 before the writing of the data D3 is started, the write start flag f1 = 0, the write end flag f2 = 1, and the erase end flag f3 = 1. Thereafter, the data D3 is written into the small block P21 as shown in FIG. When the writing of the data D3 to the small block P21 is completed, the write end flag f2 is set to 0, so that the write start flag f1 = 0, the write end flag f2 = 0, and the erase end flag f3 = 1. become. In short, the contents of the flag area F of the small block P21 are changed from “f1 = 0, f2 = 1, f3 = 1” to “f1 = 0, f2 = 0, f3 = 1” before and after FIG. 3B. become.
[0020]
Similarly, when the data D2 is written to the small block P22 of the block B2 as shown in FIG. 3C, the contents of the flag area F of the small block P22 are initially “f1 = 1, f2 = 1, f3 = 1 ”is set to“ f1 = 0, f2 = 1, f3 = 1 ”before starting the transfer of the data D2, and“ f1 = 0, f2 = 0, f3 ”when the transfer of the data D2 is completed. = 1 ". That is, before and after FIG. 3C, the contents of the flag area F of the small block P22 are changed from “f1 = 0, f2 = 1, f3 = 1” to “f1 = 0, f2 = 0, f3 = 1”. "become.
[0021]
After the required data D2 and D3 are written in the block B2 as described above, the data D1 and D2 in the block B1 are erased as shown in FIG. After the data D1 and D2 are erased, the erase end flag f3 in the small blocks P21 and P22 of the block B2 to be updated is both set to 0. Here, in the small blocks P11 and P12 of the update source block B1, all the flags in the flag area F are set to 1 by erasing, which indicates a state where rewriting is possible.
[0022]
The processing procedure described above is summarized in FIG. That is, when the data update process is started, first, the write start flag f1 is set in the flag area F of the small blocks P21 and P22 of the update destination block B2 to be written (S1), and the data is written (S2 ). When writing of data to one small block P21, P22 is completed (S3), a write end flag f2 is set to the small block P21, P22 (S4), and data to the required small blocks P21, P22 is set. Is completed (S5), data erasure of the update source block B1 is started (S6). When data of the update source block B1 is erased (S7), the update destination block The erase end flag f3 is set in all the small blocks P21 and P22 of B1.
[0023]
The above-described operation is performed by the management apparatus 2 connected to the flash memory 1 as shown in FIG. The management device 2 is constituted by a microprocessor or dedicated hardware, and transfers data between small blocks and writes data to each small block, and data in block units. In addition to an erasing processing unit 22 for erasing, a flag processing unit 23 for writing a flag to the flag area F, and a determination processing unit for monitoring the progress of the processing and giving an instruction for performing a data updating process 20. When the determination processing unit 20 receives an instruction to update the data from the outside, the determination processing unit 20 gives instructions to the writing processing unit 21, the erasing processing unit 22, and the flag writing unit 23, and the small block data in the procedure shown in FIG. To operate. The determination processing unit 20 also has a function of performing processing described below based on the contents of the flag area F when returning from an abnormality.
[0024]
In the configuration described above, a bit unit flag indicating the progress of processing is written in the flag area F at each stage of processing by utilizing the fact that writing in bit units is possible in the flash memory 1. Even if an abnormality that interrupts the processing such that the power is shut off at this stage occurs, a return process for returning to the state before the occurrence of the abnormality is possible by referring to the contents of the flag area F. The return process is selected according to the contents of the flag area F. That is, by referring to the contents of the flag area F, it is possible to determine at which stage an abnormality such as a power interruption has occurred in the period during which the data update process is being performed. Will do.
[0025]
In other words, when all the flags in the flag area F are 0 when referring to the contents of the flag area of each small block at the time of recovery from the abnormality, this means that all the processes related to the data change have been completed. If all the flags in the flag area f are 1, it means that the small block is erased and can be written. On the other hand, if any of the three flags is different from the other flags, it can be understood that the data update process was in progress when an abnormality such as a power interruption occurred. Therefore, the determination processing unit 20 can grasp that the data transfer destination is writable by monitoring the contents of the flag, or can continue the process before the occurrence of the abnormality when returning from the abnormality. It becomes possible.
[0026]
By the way, when the writing to the small block P is started and an abnormality occurs until the writing is completed, the flag area F of the small block P becomes “f1 = 0, f2 = 1, f3 = 1”. ing. That is, it can be seen that the small block P in which the contents of the flag area F are “f1 = 0, f2 = 1, f3 = 1” has an abnormality during the data writing. In other words, a part of the data of the small block P is missing. However, for other small blocks P in the block B including the missing data, there is a possibility that the data is not missing.
[0027]
Therefore, as shown in FIG. 5, when recovering from an abnormality, the flag area F in all the small blocks P of the flash memory 1 is first referred to, and the contents of the flag area F are “f1 = 0, f2 = 1, f3 = All small blocks P that are “1” are extracted (S1 to S3). Next, it is detected whether or not there is a small block P whose contents of the flag area F are “f1 = 1, f2 = 1, f3 = 1” in the block B including the extracted small block P (S4). ) When a small block P with normal data and a small block P with abnormal data coexist in one block B, the data of the small block P with normal data is transferred to another block (S5). If the data of the block B is erased after the data transfer (S6), only the missing data is erased, and the process of writing the missing data to the appropriate small block P can be resumed. By performing such processing, it is possible to reduce the amount of data to be erased and to restore it in a relatively short time.
[0028]
(Second Embodiment)
In the present embodiment, a number area f4 is added to the flag area F as shown in FIG. In the present embodiment, it is assumed that an identification number is assigned to each small block. Therefore, when transferring data between the small blocks, the identification number of the transfer-source small block is written in the transfer destination number area f4. The writing of the identification number into the number area f4 is at the same timing as when the writing start flag f1 is set. Therefore, when data writing to the small block is started, the transfer source is written to the number area f4 if the data is transferred between the small blocks. As a result, even if an abnormality occurs in which the power is shut off during the data transfer period, the transfer source can be known from the number area f4, and the data transfer is resumed by knowing the location of normal data. be able to.
[0029]
In the example shown in FIG. 3, when transferring data from the small block P12 of the block B1 to the small block P22 of the block B2 as shown in FIGS. 3B and 3C, the identification number of the small block P12 is 02. If the content of the flag area F is “f1 = 1, f2 = 1, f3 = 1, f4 = FF”, “f1 = 0, f2 = 1, f3 = 1, f4 = 02”. Changed to Therefore, even if an abnormality occurs such that the power supply is cut off during the data transfer, it is possible to know that the original data remains in the small block P12 by looking at the value 02 in the number area f4. it can. When data to be written in the small block is not transferred from another small block, a specified value (for example, 0) that is not used for the identification number of the small block is set in the number area f4.
[0030]
(Third embodiment)
In the embodiment described above, an example in which the data in the update source block B1 is erased after the data is written in the update destination block B2, and the period from the setting of the write end flag f2 to the setting of the erase end flag f3 is shown. Is regarded as the period of erasure processing. However, when only erasing data in a block in which data is stored, it is impossible to know the point in time when the data erasing process is started. Therefore, if an abnormality occurs such that the power is shut off during the erasing process, the erasure end flag f3 may be kept at 0, and whether the data is partially erased or normal data. There is a possibility that the determination cannot be performed.
[0031]
In this embodiment, as shown in FIG. 7, each block B is provided with a block erase start flag f5 and a block erase end flag f6 each having 1 bit in an area different from the small block P, so that each block B has a block unit. The start and end of erasing are indicated. The block erase start flag f5 is set to 0 immediately before starting the erase process for the block B, and the block erase end flag f6 is set to 0 when the erase process is finished.
[0032]
Therefore, “f5 = 1, f6 = 0” is normal in the block B regardless of whether data is stored, and “f5 = 0, f6 = 0” when the erasing process is started. Thereafter, when all the data in the block B is erased, “f5 = 1, f6 = 1” is set. When the erase process is completed, the block erase end flag f6 is set, and “f5 = 1, f6 = 0” is set. Become.
[0033]
As described above, in the block B in which the erasure process is normally performed (the same applies to the erasure process by the initialization at the start of use of the flash memory 1), “f5 = 1, f6 = 0”, and therefore the block erasure start flag f5 When the values of the block erase end flag f6 are not in the above relationship, it can be determined that an abnormality has occurred during the erase process. In the present embodiment, the values of the block erase start flag f5 and the block erase end flag f6 are monitored by the determination processing unit 20 at the time of recovery from the abnormality, and the block B that is not “f5 = 1, f6 = 0” is erased. The erasure process is instructed to the unit 22. Other configurations and operations are the same as those in the first and second embodiments.
[0034]
The erasing process in this embodiment is summarized in FIG. That is, when an erasure process is instructed, the block erasure start flag f5 of the block B to be erased is first set (S1), and the erasure of the block B is started (S2). When the erasure of the block B is completed (S3), the block erasure end flag f6 is set for the block B to be erased.
[0035]
The configuration using the block erase start flag f5 and the block erase end flag f6 for each block B as in the present embodiment is used in combination with the configuration in which the number area f4 is assigned to each small block P as in the second embodiment. Thus, it is possible to determine whether or not data to be erased remains at the time of recovery from an abnormality, and it is possible to perform an erasure process on a block in which such data remains.
[0036]
For example, if an abnormality occurs during the period of the block B erasing process, incomplete data is left because the erasing of the block B is not completed when returning from the abnormality. In addition, in the data update process as in the first embodiment, the writing of data to some of the small blocks P21 and P22 of the update destination block B2 is completed, but the other small blocks P21 and P21, Abnormality may occur before the writing of data to P22 is completed. That is, an abnormality may occur before the erasure process in a state where the erasure process of the block B1 is scheduled. Here, when the written data is transferred from the update source to the update destination, two small blocks of the same data exist in the update source block B1 and the update destination block B2. . In this case, the data of the small blocks P21 and P22 that have not been written are missing.
[0037]
In this way, data that has been lost due to an abnormality during the erasing process or a state in which the erasing process is scheduled must be erased when returning from the abnormality, and the block that was being erased or was scheduled to be erased The data must be erased after returning from the abnormality.
[0038]
The operation will be briefly described with reference to FIG. As described above, when an abnormality occurs during the erasing process of the block B, since “f5 = 0, f6 = 0”, the block erasure start flag f5 of each block B and the block erasure end when returning from the abnormality If the combination with the flag f6 is searched and “f5 = 0, f6 = 0”, it is determined that the erasure processing of the block B has not been completed normally, and the determination processing unit 20 determines to the erasure processing unit 22 The block B is instructed to erase data (S1).
[0039]
On the other hand, in the data update process, if an abnormality occurs during the writing of data to another small block P22 after the data has been written to some of the small blocks P21 of the update destination block B2, the update destination The contents of the flag area F of the small block P21 in the block B2 are “f1 = 0, f2 = 0, f3 = 1, f4 = 3”, and the contents of the flag area F of the small block P22 are “f1 = 0, f2”. = 1, f3 = 1, f4 = 4 ”. Therefore, when the contents of the flag area F of each of the small blocks P11, P12, P21, and P22 are retrieved upon recovery from the abnormality and a small block with “f1 = 0, f2 = 1, f3 = 1” is extracted ( S2 to S4), it is verified whether or not the same block B2 includes the small block P21 with “f1 = 0, f2 = 0, f3 = 1” (S5). Here, in block B2, it is assumed that the small block P21 for which writing has been completed and the small block P22 for which writing is being performed are mixed. In such a case, return processing upon return from abnormality is performed. In order to utilize the small block P21 for which writing has already been completed, the data of the small block P21 for which writing has been completed is transferred to another block B (S6). That is, the data of the small block P21 for which writing has been completed is saved, and if the block B2 is erased after the data saving is completed, the missing data can be erased (S7). . At this time, by using the number area f4, it is possible to identify the small block P22 that has lost data. Therefore, after erasing the data of the block B2, writing to the small block P22 May be written in the small block in the block to which the data of the small block P21 is transferred (S8). Thereafter, when the writing of data to all the small blocks is completed, the data of the update source block B1 is erased (S9). By this processing, it is possible to avoid that the two small blocks of the update source and the update destination have the same data.
[0040]
If the small block with “f1 = 0, f2 = 1, f3 = 1” is not extracted when the contents of the flag area F are searched, there is no small block in which data is missing, so there is an abnormality. By continuing from the previous process, the data update process can be normally terminated. Other configurations and operations are the same as those of the first embodiment.
[0041]
【The invention's effect】
According to the first aspect of the present invention, even if the processing is interrupted due to an abnormality such as power interruption during the writing of data to the update destination or the deletion of the data of the update source, the determination processing unit sets the write start flag. By monitoring the values of the write end flag and the erase end flag, the progress of the process before the occurrence of the abnormality can be grasped when returning from the abnormality, and an appropriate return process can be performed.
[0042]
According to the second aspect of the invention, in addition to the effect of the first aspect of the invention, the transfer of data in the small block of the update source is not completed by the determination processing unit confirming the number area when returning from the abnormality. Small blocks can be easily found and data transfer can be easily resumed.
[0043]
In the invention of claim 3, in addition to the effect of the invention of claim 1 or claim 2, even if an abnormality such as power interruption occurs while erasing the block data, the block erase start flag If the value is inverted and the value of the block erase end flag is not inverted, it can be recognized that an abnormality has occurred during the erase process, and the erase process for the block can be performed again.
[0044]
In the invention of claim 4, in addition to the effect of the invention of claim 1, a small block in which writing is completed and a small block in which writing is not completed and data is missing are mixed in one block. By transferring the data of a small block that has been written to another block, the data for the small block that has been written can be used while erasing the missing data. And data is not wasted.
[0045]
According to the fifth aspect of the present invention, the determination processing unit starts writing even when processing is interrupted due to an abnormality such as power interruption during writing of data to the update destination or erasure of data of the update source. By monitoring the values of the flag, the write end flag, and the erase end flag, the progress of the process before the occurrence of the abnormality can be grasped when returning from the abnormality, and an appropriate return process can be performed. Even if an abnormality such as a power interruption occurs while erasing the block data, if the block erase start flag value is inverted and the block erase end flag value is not inverted, the erase process It is possible to recognize that an abnormality has occurred on the way, and to erase the block again. Moreover, even if an abnormality such as a power interruption occurs while erasing the block data, if the value of the block erase start flag is inverted and the value of the block erase end flag is not inverted, the erase process It is possible to recognize that an abnormality has occurred on the way, and to erase the block again. Furthermore, when a small block for which writing has been completed and a small block for which writing has not been completed and data is missing in one block are mixed, the data of the small block for which writing has been completed are separated. By transferring to this block, it is possible to utilize the data for the small block for which writing has been completed while erasing the data in which the loss has occurred, and the data is not wasted.
[Brief description of the drawings]
FIG. 1 is a block diagram showing an embodiment of the present invention.
FIG. 2 is an operation explanatory diagram showing the first embodiment of the present invention.
FIG. 3 is an operation explanatory diagram of the above.
FIG. 4 is an explanatory diagram of a flag area in the same as above.
FIG. 5 is an operation explanatory view showing the return processing of the above.
FIG. 6 is an explanatory diagram of a flag area in the second embodiment of the present invention.
FIG. 7 is an explanatory diagram of blocks according to a third embodiment of the present invention.
FIG. 8 is an operation explanatory view of the above.
FIG. 9 is an operation explanatory view showing the return processing of the above.
[Explanation of symbols]
1 Flash memory
2 management devices
20 Judgment processing part
21 Write processing part
22 Erase processing section
23 Flag writing section
B block
B1, B2 block
F flag
f1 Write start flag
f2 Write end flag
f3 Erase end flag
f4 number area
f5 Block erase start flag
f6 Block erase end flag
P small block
P11, P12 small block
P21, P22 Small block

Claims (5)

ブロック内の全ビットを2値の一方の値に設定する消去がブロック単位でのみ可能であるとともにブロック内の各ビットの値を2値の他方の値に設定する書込がビット単位で可能であり、かつ各ブロック内にそれぞれ複数個の小ブロックが設定される不揮発性のブロック消去型記憶媒体に接続され、ブロック消去型記憶媒体の各ブロックのデータを消去する消去処理および各ブロックにデータを書き込む書込処理が可能な管理装置であって、前記小ブロックごとに、当該小ブロックへのデータの書込開始および書込終了をそれぞれ示す書込開始フラグおよび書込終了フラグと、当該小ブロックのデータが別のブロックから転送された場合にデータの転送が終了した元のブロックのデータの消去終了を示す消去終了フラグとを備えるフラグエリアが設けられ、ブロックのデータを変更する際にデータの変更が生じない小ブロックについては更新元のブロックから更新先のブロックに小ブロックごとにデータを転送し、データの変更が生じる小ブロックについては更新先のブロックの小ブロックに変更されたデータを書き込む書込処理部と、更新元のブロックにおける所要の小ブロックのデータが更新先のブロックに転送された後に更新元のブロックのデータを消去する消去処理部と、更新先の各小ブロックへのデータの書込の開始時および終了時と更新元のブロックのデータの消去の終了時に更新先のブロックの各小ブロックにおける書込開始フラグ、書込終了フラグ、消去終了フラグの値をそれぞれ反転させるフラグ書込部と、異常による処理中断からの復帰時にフラグエリアの内容を監視しフラグエリアの内容に応じた復帰処理を行う判定処理部とを備えることを特徴とするブロック消去型記憶媒体の管理装置。Erasing to set all bits in a block to one of the two values is possible only in units of blocks, and writing to set the value of each bit in the block to the other of the two values is possible in units of bits There is also a non-volatile block erasure type storage medium in which a plurality of small blocks are set in each block, and erase processing for erasing data of each block of the block erasure type storage medium and data in each block A management device capable of writing processing, wherein for each small block, a writing start flag and a writing end flag respectively indicating a writing start and a writing end of data in the small block, and the small block A flag area having an erasure end flag indicating the end of erasure of the data of the original block for which the data transfer has been completed when the data is transferred from another block. For small blocks that do not change data when changing block data, transfer data from the update source block to the update destination block for each small block, and for small blocks that change data A write processing unit that writes the changed data to the small block of the update destination block, and erases the data of the update source block after the required small block data in the update source block is transferred to the update destination block An erase processing unit, a write start flag in each small block of the update destination block, at the start and end of data writing to each small block of the update destination, and at the end of data erase of the update source block, A flag writer that inverts the values of the ending flag and erasing end flag, and the flag area when returning from processing interruption due to an error. Management device block erase type storage medium characterized by comprising a determination unit which performs the return processing according to the content of flag area monitor. 前記フラグエリアが各小ブロックに個別に設定された識別番号が書込可能である番号領域を含み、前記フラグ書込部が、書込開始フラグの値を反転させる際に、更新元のブロックがあれば更新元の小ブロックの識別番号を番号領域に書き込み、更新元のブロックがなければ規定値を番号領域に書き込む機能を有し、前記判定処理部では異常による処理中断からの復帰時に書込開始フラグが設定され書込終了フラグが設定されていないときに、番号領域を参照して抽出された更新元の小ブロックからデータの転送を再開させることを特徴とする請求項1記載のブロック消去型記憶媒体の管理装置。The flag area includes a number area in which an identification number set individually for each small block can be written, and when the flag writer reverses the value of the write start flag, the update source block If there is an update source, the identification number of the small block of the update source is written in the number area, and if there is no update source block, the specified value is written in the number area. 2. The block erase according to claim 1, wherein when the start flag is set and the write end flag is not set, data transfer is resumed from the update-source small block extracted with reference to the number area. Type storage medium management device. 前記各ブロックに、当該ブロックの消去の開始時に値が反転されるブロック消去開始フラグと、当該ブロックの消去の終了時に値が反転されるブロック消去終了フラグとが小ブロックとは別に設けられ、前記判定処理部では異常による処理中断からの復帰時にブロック消去開始フラグの値が反転しブロック消去終了フラグの値が反転していないときに消去処理部に指示を与えて当該ブロックのデータを消去させることを特徴とする請求項1または請求項2記載のブロック消去型記憶媒体の管理装置。Each block is provided with a block erase start flag whose value is inverted at the start of the erase of the block and a block erase end flag whose value is inverted at the end of the erase of the block separately from the small block, In the judgment processing unit, when the value of the block erase start flag is reversed and the value of the block erase end flag is not reversed when returning from the processing interruption due to the abnormality, the erase processing unit is instructed to erase the data of the block. The block erasure type storage medium management device according to claim 1 or 2, 前記判定処理部では、異常による処理中断からの復帰時にいずれかの小ブロックにおいて書込開始フラグの値のみが反転しているときには、同じブロック内で書込開始フラグおよび書込終了フラグがともに反転している小ブロックが存在していれば、書込処理部に指示を与えて書込開始フラグおよび書込終了フラグがともに反転している小ブロックのデータを別のブロックに転送させた後に、消去処理部に指示を与えて当該ブロックのデータを消去させることを特徴とする請求項1記載のブロック消去型記憶媒体の管理装置。In the determination processing unit, when only the value of the write start flag is inverted in any small block at the time of return from processing interruption due to abnormality, both the write start flag and the write end flag are inverted in the same block. If there is a small block, the instruction is given to the write processing unit to transfer the data of the small block whose write start flag and write end flag are both inverted to another block. 2. The block erasure type storage medium management device according to claim 1, wherein an instruction is given to the erasure processing unit to erase the data of the block. ブロック内の全ビットを2値の一方の値に設定する消去がブロック単位でのみ可能であるとともにブロック内の各ビットの値を2値の他方の値に設定する書込がビット単位で可能であり、かつ各ブロック内にそれぞれ複数個の小ブロックが設定される不揮発性のブロック消去型記憶媒体に接続され、ブロック消去型記憶媒体の各ブロックのデータを消去する消去処理および各ブロックにデータを書き込む書込処理が可能な管理装置であって、前記各ブロックに、当該ブロックの消去の開始時に値が反転されるブロック消去開始フラグと、当該ブロックの消去の終了時に値が反転されるブロック消去終了フラグとが小ブロックとは別に設けられ、前記小ブロックごとに、当該小ブロックへのデータの書込開始および書込終了をそれぞれ示す書込開始フラグおよび書込終了フラグと、当該小ブロックのデータが別のブロックから転送された場合にデータの転送が終了した元のブロックのデータの消去終了を示す消去終了フラグと、各小ブロックに個別に設定された識別番号が書込可能である番号領域とを備えるフラグエリアが設けられ、ブロックのデータを変更する際にデータの変更が生じない小ブロックについては更新元のブロックから更新先のブロックに小ブロックごとにデータを転送し、データの変更が生じる小ブロックについては更新先のブロックの小ブロックに変更されたデータを書き込む書込処理部と、更新元のブロックにおける所要の小ブロックのデータが更新先のブロックに転送された後に更新元のブロックのデータを消去する消去処理部と、更新先の各小ブロックへのデータの書込の開始時および終了時と更新元のブロックのデータの消去の終了時に更新先のブロックの各小ブロックにおける書込開始フラグ、書込終了フラグ、消去終了フラグの値をそれぞれ反転させるフラグ書込部と、異常による処理中断からの復帰時にフラグエリアの内容を監視しフラグエリアの内容に応じた復帰処理を行う判定処理部とを備え、前記フラグ書込部が、書込開始フラグの値を反転させる際に、更新元のブロックがあれば更新元の小ブロックの識別番号を番号領域に書き込み、更新元のブロックがなければ規定値を番号領域に書き込む機能を有し、前記判定処理部では異常による処理中断からの復帰時に、ブロック消去開始フラグの値が反転しブロック消去終了フラグの値が反転していなければ消去処理部に指示を与えて当該ブロックのデータを消去させ、いずれかの小ブロックにおいて書込開始フラグの値のみが反転しているときには、同じブロック内で書込開始フラグおよび書込終了フラグがともに反転している小ブロックが存在していれば、書込処理部に指示を与えて書込開始フラグおよび書込終了フラグがともに反転している小ブロックのデータを別のブロックに転送させた後に、消去処理部に指示を与えて当該ブロックのデータを消去させ、かつ番号領域を参照して抽出された更新元の小ブロックから前記別のブロックにデータを転送させることを特徴とするブロック消去型記憶媒体の管理装置。Erasing to set all bits in a block to one of the two values is possible only in units of blocks, and writing to set the value of each bit in the block to the other of the two values is possible in units of bits There is also a non-volatile block erasure type storage medium in which a plurality of small blocks are set in each block, and erase processing for erasing data of each block of the block erasure type storage medium and data in each block A management device capable of writing and writing, wherein each block has a block erase start flag whose value is inverted at the start of the erase of the block and a block erase whose value is inverted at the end of the erase of the block. An end flag is provided separately from the small block, and for each small block, writing indicating the start and end of data writing to the small block. Start flag, write end flag, erase end flag that indicates the end of data erasure of the original block that has been transferred when the data of the small block is transferred from another block, and each small block individually A flag area having a number area in which the identification number set in can be written is provided, and for a small block whose data does not change when the block data is changed, the update source block to the update destination block Data is transferred to each small block, and for a small block that changes data, a write processing unit that writes the changed data to the small block of the update destination block, and the data of the required small block in the update source block To the erasure processing unit that erases the data of the update source block after it is transferred to the update destination block, and to each small block of the update destination Inverts the values of the write start flag, write end flag, and erase end flag in each small block of the update destination block at the start and end of data writing and at the end of data erasure of the update source block. A flag writing unit, and a determination processing unit that monitors the contents of the flag area upon return from processing interruption due to an abnormality and performs return processing according to the contents of the flag area. When there is an update source block, the identification number of the update source small block is written in the number area, and if there is no update source block, the specified value is written in the number area. When the processing unit returns from processing interruption due to an error, if the value of the block erase start flag is reversed and the value of the block erase end flag is not reversed, an instruction is given to the erase processing unit. When the data of the block is erased and only the value of the write start flag is inverted in any of the small blocks, there is a small block in which both the write start flag and the write end flag are inverted in the same block. If it exists, after giving an instruction to the write processing unit to transfer the data of the small block whose write start flag and write end flag are both inverted to another block, An apparatus for managing a block erasure type storage medium, wherein the data of the block is erased and the data is transferred from the update source small block extracted by referring to the number area to the other block.
JP2001123483A 2001-04-20 2001-04-20 Block erase type storage medium management device Expired - Fee Related JP4654531B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2001123483A JP4654531B2 (en) 2001-04-20 2001-04-20 Block erase type storage medium management device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2001123483A JP4654531B2 (en) 2001-04-20 2001-04-20 Block erase type storage medium management device

Publications (2)

Publication Number Publication Date
JP2002318733A JP2002318733A (en) 2002-10-31
JP4654531B2 true JP4654531B2 (en) 2011-03-23

Family

ID=18973028

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2001123483A Expired - Fee Related JP4654531B2 (en) 2001-04-20 2001-04-20 Block erase type storage medium management device

Country Status (1)

Country Link
JP (1) JP4654531B2 (en)

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1607867B1 (en) * 2003-03-04 2016-07-13 Netac Technology Co., Ltd. Data management method for flash memory medium
DE102004005290B3 (en) * 2004-02-03 2005-07-21 Giesecke & Devrient Gmbh Securing data in non-volatile data memory divided into segments involves management data per segment containing further data element to determine age range of second segment data compared to first segment data for incomplete clearing
JP4534684B2 (en) * 2004-09-14 2010-09-01 株式会社デンソー Electronic control unit for vehicle air conditioning
JP4586469B2 (en) * 2004-09-15 2010-11-24 ソニー株式会社 MEMORY CONTROL DEVICE, MEMORY CONTROL METHOD, PROGRAM
JP2006085596A (en) * 2004-09-17 2006-03-30 Mitsubishi Electric Corp Information recording/reading device
JP2006268817A (en) * 2005-02-28 2006-10-05 Sony Corp Storage method, its device, and program
JP5066894B2 (en) * 2006-11-07 2012-11-07 富士ゼロックス株式会社 Storage medium control device
JP4521446B2 (en) * 2008-01-11 2010-08-11 株式会社沖データ Image processing device
JP5339817B2 (en) * 2008-08-23 2013-11-13 エイチジーエスティーネザーランドビーブイ Disk drive device supporting interface with data sectors of different sizes and data write method thereof
JP2011129192A (en) * 2009-12-16 2011-06-30 Samsung Electronics Co Ltd Semiconductor memory device
JP2013175126A (en) * 2012-02-27 2013-09-05 Toshiba Corp Ic card, and control program for the same
CN110795275A (en) * 2019-10-28 2020-02-14 深圳忆联信息***有限公司 Abnormal block identification method and device based on abnormal power failure process
CN112397128A (en) * 2020-11-19 2021-02-23 潍柴动力股份有限公司 Control method and device for Flash memory
CN113345505B (en) * 2021-05-28 2022-08-12 武汉新芯集成电路制造有限公司 Flash memory and working method thereof

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000222292A (en) * 1999-02-04 2000-08-11 Nec Saitama Ltd Data managing method utilizing flash memory
JP2001051889A (en) * 1999-05-31 2001-02-23 Sharp Corp File system using nonvolatile semiconductor storage device

Family Cites Families (2)

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

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000222292A (en) * 1999-02-04 2000-08-11 Nec Saitama Ltd Data managing method utilizing flash memory
JP2001051889A (en) * 1999-05-31 2001-02-23 Sharp Corp File system using nonvolatile semiconductor storage device

Also Published As

Publication number Publication date
JP2002318733A (en) 2002-10-31

Similar Documents

Publication Publication Date Title
JP4654531B2 (en) Block erase type storage medium management device
US6571312B1 (en) Data storage method and data processing device using an erasure block buffer and write buffer for writing and erasing data in memory
US6154808A (en) Method and apparatus for controlling data erase operations of a non-volatile memory device
EP0332210B1 (en) Backup control method and system in data processing system
US7408731B2 (en) Track allocation method of disk drive
JP4037605B2 (en) Nonvolatile memory unit controller, memory system having the controller, and nonvolatile memory unit control method
JP4031190B2 (en) MEMORY CARD, NONVOLATILE MEMORY, NONVOLATILE MEMORY DATA WRITE METHOD AND DATA WRITE DEVICE
US6883060B1 (en) Microcomputer provided with flash memory and method of storing program into flash memory
JP2001051889A (en) File system using nonvolatile semiconductor storage device
JP2003257132A (en) File management of one-time-programmable nonvolatile memory devices
JP2007156633A (en) Memory device and memory control method
JP6070360B2 (en) Information processing apparatus and processing method thereof
JP5874525B2 (en) Control device, storage device, and storage control method
JPH09115227A (en) Write-in method for variable length sequencial record
JP2010086009A (en) Storage device and memory control method
JP2008077669A (en) Recording method
JP2009116465A (en) Storage device and memory control method
US7257030B2 (en) Operating a storage component
JPH11282765A (en) External storage device using flash memory
TWI497345B (en) Methods of progress recording and recovering for encoding operation on storage device
JP6241373B2 (en) Storage device, flash memory control device, and program
JP2010176201A (en) Data loss prevention device for flash memory, and data loss prevention method for flash memory
CN105706067A (en) Microcomputer with built-in flash memory, method for writing data to built-in flash memory of microcomputer, and program for writing data to flash memory
JP2001312891A (en) Semiconductor storage device
JP6036618B2 (en) Electronic device and program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20071115

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20101116

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: 20101124

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20101207

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

Free format text: PAYMENT UNTIL: 20140107

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20140107

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees