JP2749752B2 - Memory write control device - Google Patents

Memory write control device

Info

Publication number
JP2749752B2
JP2749752B2 JP2341893A JP2341893A JP2749752B2 JP 2749752 B2 JP2749752 B2 JP 2749752B2 JP 2341893 A JP2341893 A JP 2341893A JP 2341893 A JP2341893 A JP 2341893A JP 2749752 B2 JP2749752 B2 JP 2749752B2
Authority
JP
Japan
Prior art keywords
block
area
file
memory
rewrites
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
JP2341893A
Other languages
Japanese (ja)
Other versions
JPH06302194A (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.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP2341893A priority Critical patent/JP2749752B2/en
Publication of JPH06302194A publication Critical patent/JPH06302194A/en
Application granted granted Critical
Publication of JP2749752B2 publication Critical patent/JP2749752B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

【発明の詳細な説明】 【0001】 【産業上の利用分野】本発明は、電気的に書き換え可能
メモリへの書き込み回数を制御するメモリの書き込み
制御装置に関するものである。 【0002】 【従来の技術】従来のEEPROM(Electrical Erasa
ble and Programmable ROM)は、容量も少なく、また、
書き込むために必要な外部回路が多かった。さらに、チ
ップ内のすべてのデータを消去するモードしか有してい
なかった。最近は、容量も大きくなるとともに、外部回
路も殆ど必要なくCPUのアドレスバス,データバスに
結線できるようになり、またEEPROM内の1バイト
のデータのみの消去も可能となってきた。以上の改良に
より、使用目的によっては、従来のランダムアクセスメ
モリ(RAM)で構成していた機能の置換が可能となっ
た。 【0003】例えば、従来の小型パソコン,日本語ワー
プロで作成したプログラムや文章,外字等を保有してお
くためのメモリカードという記憶媒体がある。これは、
必要な時にパソコン,日本語ワープロ等の本体に差し込
んでプログラムや文章を記憶させ、本体から引き抜いて
も、そのデータを記憶しているように、メモリカード内
にはRAMと電池が搭載されていた。そこで、メモリカ
ードをEEPROMで構成することにより、電池をなく
すことができると考えられた。 【0004】 【発明が解決しようとする課題】ところが、EEPRO
Mでは従来のRAMのように自由に何度も書き換えられ
ない制約があり、すなわち、あらかじめ設定される書き
込み回数を越えて、メモリカードへの書き込みを行うこ
とにより、記憶しているはずのデータを消失させてしま
う等の問題点があった。 【0005】また、EEPROMに書き込まれたデータ
のうち、頻繁に書き換えられるデータと書き換え頻度の
少ないデータとが存在し、書き換え頻度の高いデータの
書き換え回数が所定値を越えると、EEPROMへの書
き換えが可能であるにも関わらず書き換え不能となる問
題点があった。 【0006】本発明は、上記の問題点を解消するために
なされたもので、複数の領域に分割されたメモリの各領
域に対する書き換え回数を判断して、補正手段が、各領
域の書き換え回数の少ない領域を優先的に使用するよう
に前記メモリの書き換えを制御することにより、書き込
み回数に制限があるメモリに対する書き込み寿命を大幅
に延長できるメモリの書き込み制御装置を提供すること
を目的とする。 【0007】 【課題を解決するための手段】本発明に係るメモリの書
き込み制御装置は、メモリに書き込まれた情報を電気的
に書き換えのできるメモリの書き込み制御装置であっ
て、複数の領域に分割されたメモリの各領域毎の書き換
え回数を記憶する記憶手段と、該記憶手段に記憶された
各領域毎の書き換え回数を判断する判断手段と、前記判
断手段により判断された各領域の書き換え回数に基づい
て、各領域の書き換え回数の差が少なくなるように、書
き換え回数の少ない領域を優先的に使用するように前記
メモリの書き換えを制御する補正手段とを有するもので
ある。 【0008】 【作用】本発明においては、該記憶手段に記憶された各
領域毎の書き換え回数を判断する判断手段により判断さ
れた各領域の書き換え回数に基づいて、補正手段が、書
き換え回数の少ない領域を優先的に使用するように前記
メモリの書き換えを制御して、各領域への書き込み頻度
を分散させる。 【0009】 【実施例】図1は本発明の一実施例を示すメモリの書き
込み制御装置を適用可能な情報処理装置の構成を説明す
るブロック図であり、11はCPUで、ROM11a,
RAM11bを有し、ROM11aに格納された図8,
図9に示すフローチャートに従うプログラムに応じて各
部を制御する。12は入力手段で、データ書き込み装置
13にセットされるプログラマブルリードオンリメモリ
手段としてのEEPROM1へのデータ書込みおよびデ
ータ消去を指示する。なお、CPU11にはデータの転
送を行うアキュムレータACC,BCCを有している。 【0010】このように構成されたメモリの書き込み制
御装置は、複数の領域に分割されたメモリ(EEPRO
M1)の各領域毎の書き換え回数(後述する書換え回数
WCNT)を記憶する記憶手段(EEPROM1の「0
〜1」番地に確保される)と、該記憶手段に記憶された
各領域毎の書き換え回数を判断する判断手段(CPU1
1がROM11a,RAM11bに格納されたプログラ
ムを実行して判断する)と、前記判断手段により判断さ
れた各領域の書き換え回数に基づいて、書き換え回数の
少ない領域を使用するように前記メモリへの書き込みを
補正する補正手段(CPU11がROM11a,RAM
11bに格納されたプログラムを実行して補正する)と
を有し、CPU11はEEPROM1の該書換え回数W
CNTに記憶された各領域毎の書き換え回数をに基づい
て、書き換え回数の少ない領域を使用するようにEEP
ROM1への書き込みを補正して、各領域への書き込み
頻度を分散させる。 【0011】図2は、図1に示したEEPROM1の
インタブロックのメモリマップを説明する模式図であ
る。この図に示されるEEPROM1は、例えば書込み
容量が3278バイト×8ビットで、書込み回数が1
万回に設定してあるものとする。また、EEPROM1
の一部の記憶領域は、ポインタブロック1aおよび予備
ポインタブロックSPB1〜SPB50より構成され
る。ポインタブロック1aは5アドレス(各1バイト)
で構成され、「0〜1」番地格納バイトで、書換え回数
WCNT、例えば「138816」を記憶している。ま
た、ポインタブロック1aの「2」番地の1バイトは、
ディレクトリDB、例えば「0116」を記憶している。
さらに、ポインタブロック1aの「3」番地の1バイト
は未使用のスタートブロック番号OSB、例えば「33
16」を記憶している。また、ポインタブロック1aの
「4」番地の1バイトは、未使用のエンドブロック番号
0EB、例えば「16」を記憶している。 【0012】図3は、EEPROM1の記憶領域を示す
模式図である。この図において、21はブロック番号で
あり、例えば127個のブロックBLOCK1〜BLO
CK127に分割されている。各ブロックは、例えば2
56バイトで構成され、先頭の2バイトで、そのブロッ
クが更新された回数、すなわち、後述する更新回数が記
憶されている。次に、続く253バイトは記憶データD
ATAが記憶されており、最後の1バイトは、記憶デー
タDATAがこのブロックに留まるか、または他のブロ
ックに及ぶかを示す継続ブロックエリアCBがあり、他
のブロックに記憶データDATAが及ぶ場合は、継続ブ
ロックエリアCBには、継続するブロック番号が記載さ
れ、他のブロックに記憶データDATAが及ばない場合
は、継続ブロックエリアCBには「FF16」が記憶され
ている。 【0013】図4は、図3に示した各ディレクトリブロ
ックの構造を説明する模式図である。この図において、
30は前記ディレクトリDBに指示されるディレクトリ
ブロック、31は前記ディレクトリブロック30の更新
カウンタで、例えば2バイトで構成される。32はファ
イル領域で、各ファイル名が12バイトで記憶される。
33はスタートブロック番号エリア(SB)で、例えば
1バイトで構成され、ファイルのスタートブロック番号
が記憶されている。34はエンドブロック番号エリア
(EB)で、例えば1バイトで構成され、ファイルのエ
ンドブロック番号が記憶されている。35はチェーンブ
ロックエリア(CB)で、ディレクトリブロック30に
継続するディレクトリブロックの有無を記憶する。例え
ばチェーンブロックエリア35が「FF16」となる。な
お、ディレクトリブロック30は、例えば18個のファ
イル領域32で構成される。 【0014】次に、図および図4を参照しながらEE
PROM1の構造について説明する。図に示すよう
に、ポインタプロック1aの書換え回数WCNTに、例
えば「138816」が記憶されているとすると、500
0回の更新が行われたことを示し、またディレクトリD
Bには「0116」が記憶されているので、ディレクトリ
DBに指示されるディレクトリブロック30のプロック
番号が「1」で、そのディレクトリプロック30の更新
カウンタ31には、「142F16」が記憶されている。
これは、このディレクトリプロック30を「5167」
回更新したことを示し、ファイル領域32のファイル
(File)1(ファイル名)はスタートプロック番号
エリア33が「0216」で、エンドプロック番号エリア
34が「0516」となっているため、プロックBLO
CK2から始まり、プロック BLOCK5で終ること
になる。また、ファイル領域32のファイル2は、スタ
ートプロック番号エリア33が「0A16」で、エンドプ
ロック番号エリア34が「0Al6」となっているた
め、プロックBLOCK10から始まり、プロック B
LOCK15で終ることになる。さらに、ファイル領域
32のファイル3(ファイル名)はスタートプロック番
号エリア33が「1516」で、エンドプロック番号エリ
ア34が「1816」となっているため、プロックBLO
CK21から始まり、プロック BLOCK24で終る
ことになる。また、ファイル領域32のファイル3の次
に「FF16」が書かれているので、このファイル領域3
2はファイル3で終了していることになる。 【0015】図5は未使用のEEPROM1の状態を説
明する模式図であり、図1,図4と同一のものには同じ
符号を付してある。この図に示すように、未使用のEE
PROM1のポインタブロック1aの書換え回数WCN
Tが「000116」、ディレクトリDBが「0116」、
未使用のスタートブロック番号OSBが「0216」、未
使用のエンドブロック番号OEBが「7F16」がそれぞ
れポインタブロック1aの0番地から4番地にそれぞれ
記憶されている。これにより、ディレクトリDBに指示
されるブロックBLOCK1を参照すると、更新カウン
タ31に「000116」が書き込まれているとともに、
ファイル領域32のファイル1に「FF16」が書き込ま
れており、さらに、チェーンブロックエリア35に「F
16」が書き込まれており、EEPROM1が未使用状
態であることを示している。 さらに、ポインタブロッ
ク1aのスタートブロック番号OSBおよびエンドブロ
ック番号OEBには、「0216」,「7F16」がそれぞ
れ書き込まれている。すなわち、ブロックBLOCK2
〜127には先頭の2バイトに「000116」が書き込
まれ、最終の1バイトに各後続のブロックの継続を示す
チェーンブロックエリア35には、ブロックBLOCK
2〜126に対して「03〜7F16」が書き込まれ、ブ
ロックBLOCK127のチェーンブロックエリア35
には「FF」が書き込まれている。このように、各ブロ
ックBLOCK2〜BLOCK127は、1つのチェイ
ン構造となる。 【0016】図6は、図1に示したEEPROM1への
書き込み動作を説明する模式図であり、図,図4と同
一のものには同一の符号を付してある。なお、書込み直
前は、第3図に示す状態であったものとする。先ず、各
ブロックBLOCKのファイル領域32の先頭が「00
16」のところを探し当てる。図4の場合は、ファイル2
とファイル3との間に「0016」があり、そこにファイ
ル4という名前を12バイトで書き込み、ポインタブロ
ック1aの未使用ブロックのスタートブロック番号OS
Bの指示するブロックBLOCK、すなわち、「
16」の先頭の2バイト情報、すなわち、更新カウンタ
31を「1」インクリメントし、その加算値が、例えば
1万回を越えているようであれば、そのブロックのチェ
ーンブロックエリア35が示すブロックBLOCKに対
して同様の操作を行い、更新カウンタ31が1万回以下
のブロックBLOCKを探し当てて、そのブロックBL
OCKの番号をポインタブロック1aのスタートブロッ
ク番号OSBに書き込むとともに、1万回以下であれば
ファイル4のデータをブロックBLOCK51(253
バイト)に書き込み、ブロックBLOCK51に溢れる
ようであれば、ブロックBLOCK51のチェーンブロ
ックエリア35の指示するブロックBLOCKの更新カ
ウンタ31を「1」インクリメントして加算値が、例え
ば1万回を越えているかどうかを調べ、指示されるブロ
ックBLOCKの更新カウンタ31が1万回を越えるよ
うであれば、更新回数が1万回以下のブロックBLOC
Kのチェーンブロックエリア35に書き込む。このよう
にして、データの書き込みが行われ、更新回数が1万回
を越えるブロックが排除されて行く。そして、書き込み
データがなくなるまで同様の操作を行い、最後に書き込
んだブロックBLOCKのチェーンブロックエリア35
に記憶されていた内容を新しい未使用のスタートブロッ
ク番号OSBに書き換え、ポインタブロック1aの書換
え回数WCNTを「1」インクリメントして「1389
16」となり、最後にデータを書き込んだブロックBLO
CKのチェーンブロックエリア35を「FF16」にす
る。そして、ディレクトリブロック30の最終ブロック
番号を記憶するエンドブロック番号エリア34に最後の
データを書き込んだブロックBLOCKの番号を書き込
むとともに、更新カウンタ31を「1」インクリメント
すると、図6の(b)に示すように、更新カウンタ31
が「143016」となり、ファイル4のスタートブロッ
ク番号エリア33が「3316」で、エンドブロック番号
エリア34が「3716」となる。 【0017】次に、図6を参照しながらEEPROM1
に書き込まれているファイル1の削除動作について説明
する。ディレクトリブロック30となるブロックBLO
CK1よりファイル1を探し、ファイル領域32の先頭
の2バイトを「0016」とする。次いで、ディレクトリ
ブロック30の更新カウンタ31を「1」インクリメン
トし、ファイル1のスタートブロック番号エリア33と
エンドブロック番号エリア34のデータを参照して、ポ
インタブロック1aのエンドブロック番号OEBが指示
するブロックのチェーンブロックエリア35の内容(削
除直前までは「FF16」であった)をスタートブロック
番号エリア33の内容に変更し、このブロックの更新カ
ウンタ31を「1」インクリメントする。すなわち、未
使用ブロックの最後に今削除したファイル4を接続する
わけである。このようにして、更新カウンタ31を進め
ながら何度もファイルの更新,削除を実行して行くうち
に、更新カウンタ31が1万回に接近する。 【0018】次に、ディレクトリブロックの更新カウン
タ31が1万回に到達した場合のアクセス処理について
説明する。先ず、ポインタブロック1aのスタートブロ
ック番号OSBの内容が示しているブロックBLOCK
のチェーンブロックエリア35の内容を新規のスタート
ブロック番号OSBとする。次いで、このブロック
ィレクトリブロック30の更新カウンタ31の情報以外
の内容を転送する。そして、ポインタブロック1のディ
レクトリDBに新規のディレクトリブロック番号を書き
込み、ポインタブロック1a書換え回数WCNTおよび
更新カウンタ31を「1」インクリメントする。 【0019】一方、ポインタブロック1aの書換え回数
WCNTが1万回を越えた場合は、予備ポインタブロッ
クSPB1〜SPB50のうち、一番近い予備ポインタ
ブロックへ書換え回数WCNTの情報以外のデータを転
送し、新規のポインタブロックの書換え回数WCNT
(000016)を「1」インクリメントして「0001
16」に設定する。この場合、破棄されたポインタブロッ
ク1aの書換え回数WCNTは1万回以上となり、真の
ポインタブロック1aの書換え回数WCNTは1万回以
下となる。このようにして、ディレクトリブロック30
およびポインタブロック1aの書込み/削除を管理す
る。また、削除されたファイルが使用していたブロック
は未使用ブロックの一番最後に回される。これは、未使
用ブロックの使用回数を平均化するためである。しか
し、使用されているファイルが更新されずにずっとその
ままであると、そのファイルが使用されているブロック
は更新回数がそのまま変化しない。例えば最初に作成さ
れたファイルがそのままずっと登録されたまま残ってい
ると、他のブロックは更新回数が5000回以上なの
に、このファイルだけは2回というようなアンバランス
が生じる。そこで、EEPROM1の使用状態を平均化
するための補正処理を行う。 【0020】なお、この実施例における補正処理起動条
件は、下記(a),(b)が成立する時点である。 (a)ポインタブロック1aの書換え回数WCNTの値
が256の整数倍となった時点。 (b)ファイルを構成するブロックの更新カウンタ31
の平均値が一番低い値と、未使用ブロックの更新カウン
タ31の平均値との差が256を越えた時点。 【0021】すなわち、新規のファイルを作成したり、
削除したりした後、ポインタブロック1aの書換え回数
WCNTを見て、丁度256の整数倍、2バイトの16
進数の下桁が「0016」になった時点で、ディレクトリ
ブロック30に登録されている順にファイルを検査して
行く。そして、ファイルを構成するブロックの更新カウ
ンタ31を加算し、さらに構成するブロック数で除して
更新平均値を算出する。次いで、次のファイルに対して
も同様の更新平均値を出して比較し、低いものをその比
較対照として残し、次のファイルの更新平均値と比較し
て行き、一番低い更新回数で構成されるファイルを探し
出す。そして、未使用のブロックの更新回数の平均を計
算し、平均更新回数の一番低いファイルとの差を算出す
る。 【0022】次に、図7を参照しながらこの発明に係る
情報処理装置における補正処理動作について説明する。
図7は本発明に係る情報処理装置における補正処理動作
を説明する模式図である。これらの図において、41は
ファイルで、ブロックBLOCK5〜BLOCK7で構
成され、平均更新回数が最も低いものである。42は未
使用ブロック群で、ポインタブロック1aの未使用スタ
ートブロック番号OSBで指示される。未使用ブロック
群42は、ブロックBLOCK50,10,11,1
8,55,80,81が1つのチェイン構造となってい
る。 【0023】先ず、ファイル41のスタートブロックを
未使用ブロック群42のブロックBLOCK81の後段
に接続させるため、同図(a)に示すようにブロックB
LOCK81のチェーンブロックエリア35の内容が
「FF16」から同図(b)に示すように、チェーンブロ
ックエリア35の内容が「0516」、すなわちファイル
41のブロックBLOCK5を指示させ、さらにファイ
ル41のブロックBLOCK5〜7(ファイル41のチ
ェーンブロックエリア35の内容が「FF16」になるま
で)を未使用ブロック群42のブロックBLOCK81
の後段に接続させ、同図(c)に示すように、ディレク
トリブロック30のファイル41のスタートポインタを
ブロックBLOCK50にするとともに、終了ポインタ
をブロックBLOCK11に変更する。次いで、未使用
ブロック群42の未使用のスタートブロック番号OSB
を「1216」、未使用のエンドブロック番号OEBを
「0B16」にする。これにより、登録されたファイルを
構成するブロックに対しても再度使用可能となり、EE
PROM1全体のブロックが平均的に使用,更新される
ことになる。 【0024】図8は本発明に係る情報処理装置におけ
るEEPROM1へのデータ書き換え制御処理手順の一
例を示すフローチャートである。なお、(1)〜(1
8)は各ステップを示す。先ず、ディレクトリブロック
30の空きエリアを探して、新規のファイル名を書き込
む(1)。次いで、未使用のスタートブロック番号OS
BをCPU11のアキュムレータACCに記憶させる
(2)。アキュムレータACCが指示するブロックの書
換え回数WCNTを「+1」更新する(3)。ここで、
書換え回数WCNTが「10000」を越えたかどうか
を判断し(4)、YESならばアキュムレータACCの
指示するブロックの継続ブロックエリアCBをアキュム
レータACCに記憶し(5)、ステップ(3)へ戻り、
NOならばディレクトリブロック30のスタートブロッ
ク番号エリア(SB)33にアキュムレータACCの内
容を書き込む(6)。次いで、アキュムレータACCが
指示するブロックのデータエリアにデータを書き込む
(7)。ここで、書込みデータが235バイトを越える
かどうかを判断し(8)、YESならばアキュムレータ
ACCが指示するブロックの継続ブロックエリアCBを
アキュムレータBCCに記憶させる(9)。次いで、ア
キュムレータBCCが指示するブロックの書換え回数W
CNTを「+1」更新する(10)。次いで、書換え回
数WCNTが「10000」を越えたかどうかを判断し
(11)、YESならばアキュムレータBCCの指示す
るブロックの継続ブロックエリアCBをアキュムレータ
BCCに記憶させ(12)、ステップ(10)に戻り、
NOならばアキュムレータACCが指示するブロックの
継続ブロックエリアCBにアキュムレータBCCの内容
を書き込み(13)、ステップ(7)に戻る。 【0025】一方、ステップ(8) の判断でNOの場合
は、アキュムレータACCが指示する継続ブロックエリ
アCBを未使用のスタートブロック番号OSBに書き込
む(14)。次いで、ポインタブロック1aの書換え回数W
CNTを「+1」更新する(15)。次いで、アキュムレー
タACCが指示するブロックの継続ブロックエリアCB
へ「FF16」を書き込む(16)。そして、ディレクトリブ
ロック30の新ファイル位置のエンドブロック番号エリ
ア34へアキュムレータACCの内容を書き込む(17)。
次いで、ディレクトリブロック30の書換え回数WCN
Tを更新する(18)。 【0026】図9は本発明に係る情報処理装置における
補正制御処理手順の一例を示すフローチャートである。
なお、(1) 〜(7) は各ステップを示す。先ず、ポインタ
ブロック1aの書換え回数WCNTが「256」の整数
倍であるかを判断し(1) 、NOならばリターンし、YE
Sならばディレクトリブロック30に登録された各ファ
イルを構成するブロックの更新カウンタ31の平均値を
算出して、最も更新回数が少ないファイルを探し出す
(2) 。次いで、未使用のブロックの更新回数の平均値を
算出する(3) 。次いで、未使用ブロックの更新カウンタ
の平均値からファイルを構成するブロックの更新カウン
タの平均値の最小値を減算し、さらに減算値から「25
6」を差し引いた値が正かどうかを判断し(4) 、NOな
らばリターンし、YESならば未使用ブロックの最後尾
に該当するファイルのヘッドを接続させる(5) 。次い
で、接続したファイルの内容を未使用ブロックへ転送さ
せ(6) 、ディレクトリブロック30にある接続したファ
イルのスタートポインタ,エンドポインタを変更し(7)
、リターンする。 【0027】 【発明の効果】以上説明したように、本発明によれば、
複数の領域に分割されたメモリの各領域毎の書き換え回
数を記憶する記憶手段に記憶された各領域毎の書き換え
回数を判断する判断手段により判断された各領域の書き
換え回数に基づいて、補正手段が、書き換え回数の少な
い領域を優先的に使用するように前記メモリの書き換え
を制御して、各領域への書き込み頻度を分散させること
ができ、メモリの書込み寿命を大幅に延長できるという
効果を奏する。 【0028】従って、プログラマブルリードオンリメモ
リ等のメモリ手段上へのデータ書き換えに伴うデータの
改変または消失を未然に防止できる効果を奏する。
Description: BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a method of controlling the number of times of writing to an electrically rewritable memory.
The present invention relates to a control device . 2. Description of the Related Art Conventional EEPROMs (Electrical Erasa
ble and Programmable ROM) has a small capacity,
There were many external circuits necessary for writing. Further, it has only a mode for erasing all data in the chip. Recently, as the capacity has increased, it has become possible to connect to the address bus and data bus of the CPU with almost no need for external circuits, and it has become possible to erase only 1-byte data in the EEPROM. With the above improvements, it has become possible to replace the function configured by the conventional random access memory (RAM) depending on the purpose of use. For example, there is a storage medium called a memory card for holding a program, a sentence, an external character, and the like created by a conventional small personal computer and a Japanese word processor. this is,
The RAM and battery were installed in the memory card so that the program and text were stored when inserted into the main body of a personal computer, Japanese word processor, etc. when necessary, and the data was stored even when the memory card was pulled out. . Therefore, it was considered that the battery could be eliminated by configuring the memory card with an EEPROM. [0004] However, EEPRO
M has a restriction that it cannot be freely rewritten many times unlike a conventional RAM. That is, by writing data to a memory card exceeding a preset number of times of writing, data to be stored can be stored. There were problems such as disappearing. [0005] Of the data written in the EEPROM, there are data that is frequently rewritten and data that is rewritten less frequently, and when the number of rewrites of frequently rewritten data exceeds a predetermined value, rewriting to the EEPROM is stopped. There has been a problem that rewriting is impossible even though it is possible. SUMMARY OF THE INVENTION The present invention has been made to solve the above-described problem, and determines the number of rewrites for each area of a memory divided into a plurality of areas. Use less space first
It is another object of the present invention to provide a memory write control device capable of greatly extending the write life of a memory having a limited number of write operations by controlling the rewriting of the memory. A memory write control device according to the present invention is a memory write control device capable of electrically rewriting information written in a memory, wherein the information is divided into a plurality of areas. Storage means for storing the number of rewrites for each area of the memory, determination means for determining the number of rewrites for each area stored in the storage means, and the number of rewrites for each area determined by the determination means. based, as the difference between the number of times of rewriting each region is reduced, writing
So that the area with the least number of replacements is preferentially used
Correction means for controlling rewriting of the memory . According to the present invention, the correction means determines the number of rewrites for each area, which is determined by the determination means for determining the number of rewrites for each area, stored in the storage means .
So that the area with the least number of replacements is preferentially used
By controlling the rewriting of the memory, the frequency of writing to each area is dispersed. FIG. 1 is a block diagram of a memory according to an embodiment of the present invention.
And FIG. 11 is a block diagram illustrating a configuration of an information processing device to which the embedded control device can be applied .
8 having a RAM 11b and stored in the ROM 11a,
Each unit is controlled according to a program according to the flowchart shown in FIG. Reference numeral 12 denotes input means for instructing data writing and data erasing in the EEPROM 1 as programmable read only memory means set in the data writing device 13. The CPU 11 has accumulators ACC and BCC for transferring data. [0010] The write control of the memory configured as described above.
The control device includes a memory (EEPRO) divided into a plurality of areas.
M1) Number of rewrites for each area (number of rewrites described later)
WCNT) (“0” of the EEPROM 1).
-1 "), and stored in the storage means.
Judging means for judging the number of rewrites for each area (CPU 1
1 is a program stored in the ROM 11a and the RAM 11b.
Is determined by executing the program).
Of the number of rewrites based on the
Write to the memory to use less space
Correction means for correcting (when the CPU 11 has the ROM 11a
11b by executing the program stored therein) and
And the CPU 11 performs the rewriting number W of the EEPROM 1
Based on the number of rewrites for each area stored in the CNT
EEP so that an area with a small number of rewrites is used.
Correct writing to ROM1 and write to each area
Disperse frequency. [0011] FIG. 2, port of EEPROM1 shown in FIG. 1
It is a schematic diagram explaining the memory map of an inter block . EEPROM1 shown in this figure, for example, writing capacity 327 6 8 bytes × 8 bits, the write count is 1
It is assumed that it has been set to 10,000 times. In addition, EEPROM1
Part of the storage area of, composed of the pointer blocks 1a and spare pointer block SPB1~SPB50. Pointer block 1a has 5 addresses (1 byte each)
The number of rewrites WCNT, for example, “1388 16 ” is stored in the address storage bytes “0 to 1”. One byte at the address “2” of the pointer block 1a is
A directory DB, for example, “01 16 ” is stored.
Further, one byte at address "3" of the pointer block 1a is an unused start block number OSB, for example, "33".
16 "is memorized. Also, 1-byte "4" address pointer block 1a stores unused end block number 0EB, for example, "7 A 16 '. [0012] Figure 3 is a schematic diagram showing a storage area of the E EPROM1. In this figure, reference numeral 21 denotes a block number, for example, 127 blocks BLOCK1 to BLOCK
CK127. Each block is, for example, 2
It is composed of 56 bytes, and the first two bytes store the number of times the block has been updated, that is, the number of updates described later. Next, the following 253 bytes are stored data D
ATA is stored, the last byte has a continuation block area CB indicating whether the storage data DATA stays in this block or extends to another block. If the storage data DATA extends to another block, In the continuation block area CB, a block number to be continued is described, and when the storage data DATA does not reach other blocks, “FF 16 ” is stored in the continuation block area CB. FIG. 4 is a schematic diagram for explaining the structure of each directory block shown in FIG. In this figure,
Reference numeral 30 denotes a directory block specified in the directory DB, and reference numeral 31 denotes an update counter of the directory block 30, which is composed of, for example, 2 bytes. Reference numeral 32 denotes a file area in which each file name is stored in 12 bytes.
A start block number area (SB) 33 is composed of, for example, 1 byte and stores a start block number of a file. Reference numeral 34 denotes an end block number area (EB), which is composed of, for example, 1 byte and stores the end block number of the file. Reference numeral 35 denotes a chain block area (CB) which stores the presence or absence of a directory block continuing from the directory block 30. For example, the chain block area 35 is “FF 16 ”. The directory block 30 is composed of, for example, 18 file areas 32. Next, referring to FIG. 2 and FIG.
The structure of the PROM 1 will be described. As shown in FIG. 2 , for example, if “1388 16 ” is stored in the number of rewrites WCNT of the pointer block 1a, 500
Indicates that 0 updates have been made, and directory D
Since “01 16 ” is stored in B, the block number of the directory block 30 specified in the directory DB is “1”, and “142F 16 ” is stored in the update counter 31 of the directory block 30. ing.
This means that this directory block 30 is "5167"
In the file (File) 1 (file name) of the file area 32, the start block number area 33 is “02 16 ” and the end block number area 34 is “0516”.
It starts with CK2 and ends with block BLOCK5. The file 2 file area 32, a start Proc number area 33 "0A 16", since the end Proc number area 34 is "0Al6" begins Proc BLOCK10, Proc B
It ends with LOCK15. Further, since the start block number area 33 of the file 3 (file name) of the file area 32 is “15 16 ” and the end block number area 34 is “18 16 ”, the block BLO
It starts with CK21 and ends with block BLOCK24. Since “FF 16 ” is written after file 3 in file area 32, this file area 3
2 ends with file 3. FIG. 5 is a schematic diagram for explaining the state of the unused EEPROM 1, and the same components as those in FIGS. 1 and 4 are denoted by the same reference numerals. As shown in this figure, the unused EE
Number of rewrites WCN of pointer block 1a of PROM1
T is “0001 16 ”, directory DB is “01 16 ”,
The unused start block number OSB “02 16 ” and the unused end block number OEB “7F 16 ” are stored at addresses 0 to 4 of the pointer block 1a, respectively. Thereby, referring to the block BLOCK1 specified in the directory DB, “0001 16 ” is written in the update counter 31, and
“FF 16 ” is written in the file 1 of the file area 32, and “F 16 ” is further written in the chain block area 35.
F 16 ”has been written, indicating that the EEPROM 1 is in an unused state. Further, “02 16 ” and “7F 16 ” are written in the start block number OSB and the end block number OEB of the pointer block 1a, respectively. That is, the block BLOCK2
27127, “0001 16 ” is written in the first two bytes, and the block BLOCK is stored in the chain block area 35 indicating the continuation of each succeeding block in the last one byte.
“03 to 7F 16 ” is written to the blocks 2 to 126, and the chain block area 35 of the block BLOCK 127 is written.
Is written with "FF". Thus, each of the blocks BLOCK2 to BLOCK127 has a single chain structure. FIG. 6 is a schematic diagram for explaining a write operation to the EEPROM 1 shown in FIG. 1, and the same components as those in FIGS. 2 and 4 are denoted by the same reference numerals. It is assumed that the state immediately before the writing is as shown in FIG. First, the start of the file area 32 of each block BLOCK is "00".
16 ". In the case of FIG. 4, file 2
There is "00 16 " between the file 3 and the file 3, and the name of the file 4 is written in 12 bytes there, and the start block number OS of the unused block of the pointer block 1a is written.
B indicates the block BLOCK, that is, “ 3
The 2 bytes information at the head of " 3 16 ", that is, the update counter 31 is incremented by "1", and if the added value exceeds, for example, 10,000 times, the block indicated by the chain block area 35 of that block. The same operation is performed on BLOCK, and the update counter 31 finds a block BLOCK of 10,000 or less, and checks the block BL.
The number of the OCK is written in the start block number OSB of the pointer block 1a. If the number is 10,000 or less, the data of the file 4 is written in the block BLOCK 51 (253).
Byte), and if the block BLOCK 51 overflows, the update counter 31 of the block BLOCK indicated by the chain block area 35 of the block BLOCK 51 is incremented by “1”, and the added value exceeds 10,000 times, for example. It is checked whether the update counter 31 of the designated block BLOCK exceeds 10,000 times, and the block BLOC whose update count is 10,000 times or less is checked.
Write to the K chain block area 35. In this way, data is written, and blocks whose update count exceeds 10,000 are eliminated. The same operation is performed until there is no more write data, and the chain block area 35 of the last written block BLOCK is written.
Is rewritten to a new unused start block number OSB, and the number of rewrites WCNT of the pointer block 1a is incremented by “1” to “1389”.
16 ", and the block BLO to which data was last written
The CK chain block area 35 is set to “FF 16 ”. Then, when the number of the block BLOCK in which the last data has been written is written in the end block number area 34 storing the last block number of the directory block 30 and the update counter 31 is incremented by "1", the result is shown in FIG. So, the update counter 31
Becomes “1430 16 ”, the start block number area 33 of the file 4 becomes “33 16 ”, and the end block number area 34 becomes “37 16 ”. Next, referring to FIG.
The operation of deleting the file 1 written in the file 1 will be described. Block BLO that becomes directory block 30
File 1 is searched from CK1, and the first two bytes of the file area 32 are set to “00 16 ”. Then, the update counter 31 of the directory block 30 is incremented by "1", and the data of the start block number area 33 and the end block number area 34 of the file 1 are referred to, and the data of the block indicated by the end block number OEB of the pointer block 1a is referred to. The contents of the chain block area 35 (which was "FF 16 " until immediately before deletion) is changed to the contents of the start block number area 33, and the update counter 31 of this block is incremented by "1". That is, the file 4 just deleted is connected to the end of the unused block. In this way, the update counter 31 approaches 10,000 times while updating and deleting the file many times while moving the update counter 31 forward. Next, an access process when the directory block update counter 31 reaches 10,000 times will be described. First, the block BLOCK indicated by the contents of the start block number OSB of the pointer block 1a
The content of the chain block area 35 is a new start block number OSB. Then transfers the contents other than the information of the update counter 31 de <br/> I recto Li block 30 to the block. Then, a new directory block number is written to the directory DB of the pointer block 1, and the pointer block 1a rewrite count WCNT and the update counter 31 are incremented by "1". On the other hand, when the number of rewrites WCNT of the pointer block 1a exceeds 10,000, data other than the information of the number of rewrites WCNT is transferred to the nearest spare pointer block among the spare pointer blocks SPB1 to SPB50. Number of rewrites WCNT of new pointer block
(0000 16 ) is incremented by “1” to “0001”
16 ". In this case, the number of rewrites WCNT of the discarded pointer block 1a becomes 10,000 or more, and the number of rewrites WCNT of the true pointer block 1a becomes 10,000 or less. Thus, the directory block 30
And the writing / deletion of the pointer block 1a. Also, the blocks used by the deleted file are turned to the end of unused blocks. This is to average the number of times unused blocks are used. However, if the used file remains unchanged without being updated, the block in which the file is used remains unchanged in the update count. For example, if the initially created file remains registered as it is, the imbalance occurs such that the other block has been updated 5000 times or more, but this file alone is 2 times. Therefore, a correction process for averaging the usage state of the EEPROM 1 is performed. The condition for starting the correction process in this embodiment is the time when the following conditions (a) and (b) are satisfied. (A) When the value of the number of rewrites WCNT of the pointer block 1a becomes an integral multiple of 256. (B) Update counter 31 of a block constituting a file
At the time point when the difference between the lowest value of the average value and the average value of the update counter 31 of the unused block exceeds 256. That is, a new file is created,
After deletion, the number of rewrites WCNT of the pointer block 1a is looked at, and it is just an integer multiple of 256, and 16 bytes of 2 bytes.
When the lower digit of the radix becomes “00 16 ”, the files are inspected in the order registered in the directory block 30. Then, an update average value is calculated by adding the update counter 31 of the blocks constituting the file and dividing by the number of blocks constituting the file. Next, the same update average value is issued for the next file and compared, and the lower one is left as a comparison control, and compared with the update average value of the next file. Find the file that Then, the average of the update counts of the unused blocks is calculated, and the difference from the file having the lowest average update count is calculated. Next, a correction processing operation in the information processing apparatus according to the present invention will be described with reference to FIG.
FIG. 7 is a schematic diagram illustrating a correction processing operation in the information processing apparatus according to the present invention. In these figures, a file 41 is composed of blocks BLOCK5 to BLOCK7, and has the lowest average number of updates. An unused block group 42 is indicated by an unused start block number OSB of the pointer block 1a. The unused block group 42 includes blocks BLOCK50, 10, 11, 1
8, 55, 80, and 81 have one chain structure. First, in order to connect the start block of the file 41 to the subsequent stage of the block BLOCK 81 of the unused block group 42, as shown in FIG.
The contents of the chain block area 35 of the LOCK 81 are changed from “FF 16 ” to the contents of the chain block area 35 of “05 16 ”, that is, the block BLOCK 5 of the file 41 as shown in FIG. Blocks BLOCK 5 to 7 (until the contents of the chain block area 35 of the file 41 become “FF 16 ”) are converted to blocks BLOCK 81 of the unused block group 42.
The start pointer of the file 41 of the directory block 30 is changed to the block BLOCK50, and the end pointer is changed to the block BLOCK11, as shown in FIG. Next, the unused start block number OSB of the unused block group 42
To “12 16 ” and the unused end block number OEB to “0B 16 ”. As a result, it becomes possible to use again the blocks constituting the registered file, and the EE
The entire block of the PROM 1 is used and updated on average. [0024] FIG 8 is a flowchart illustrating an example of a data rewriting control procedure to EEPROM1 in the information processing apparatus according to the present invention. Note that (1) to (1)
8) shows each step. First, an empty area of the directory block 30 is searched, and a new file name is written (1). Next, the unused start block number OS
B is stored in the accumulator ACC of the CPU 11 (2). The number of times of rewriting WCNT of the block designated by the accumulator ACC is updated by "+1" (3). here,
It is determined whether the number of rewrites WCNT has exceeded "10000" (4). If YES, the continuation block area CB of the block indicated by the accumulator ACC is stored in the accumulator ACC (5), and the process returns to step (3).
If NO, the contents of the accumulator ACC are written into the start block number area (SB) 33 of the directory block 30 (6). Next, data is written to the data area of the block designated by the accumulator ACC (7). Here, it is determined whether the write data exceeds 2 35 bytes (8), YES if the accumulator ACC is to store the continuation block area CB of the block that instructs the accumulator BCC (9). Next, the number of times W of rewriting the block designated by the accumulator BCC is W
The CNT is updated by "+1" (10). Next, it is determined whether or not the number of rewrites WCNT has exceeded "10000" (11). If YES, the continuation block area CB of the block designated by the accumulator BCC is stored in the accumulator BCC (12), and the process returns to step (10). ,
If NO, the contents of the accumulator BCC are written into the continuation block area CB of the block designated by the accumulator ACC (13), and the process returns to step (7). On the other hand, if the determination in step (8) is NO, the continuation block area CB specified by the accumulator ACC is written to the unused start block number OSB (14). Next, the number of times W of rewriting of the pointer block 1a is W
The CNT is updated by "+1" (15). Next, the continuation block area CB of the block designated by the accumulator ACC
"FF 16 " is written to (16). Then, the contents of the accumulator ACC are written to the end block number area 34 at the new file position of the directory block 30 (17).
Next, the number of rewrites WCN of the directory block 30
T is updated (18). FIG. 9 is a flowchart showing an example of a correction control processing procedure in the information processing apparatus according to the present invention.
Note that (1) to (7) indicate each step. First, it is determined whether or not the number of rewrites WCNT of the pointer block 1a is an integral multiple of "256" (1).
If S, the average value of the update counter 31 of the blocks constituting each file registered in the directory block 30 is calculated, and the file with the least number of updates is found.
(2). Next, the average value of the update count of the unused block is calculated (3). Next, the minimum value of the average value of the update counters of the blocks constituting the file is subtracted from the average value of the update counters of the unused blocks, and “25” is obtained from the subtraction value.
It is determined whether the value obtained by subtracting "6" is positive (4). If NO, the process returns. If YES, the head of the file corresponding to the end of the unused block is connected (5). Next, the contents of the connected file are transferred to an unused block (6), and the start pointer and end pointer of the connected file in the directory block 30 are changed (7).
And return. As described above, according to the present invention,
Correction means based on the number of rewrites of each area determined by the judgment means for judging the number of rewrites for each area stored in the storage means for storing the number of rewrites for each area of the memory divided into a plurality of areas But the number of rewrites is small
Rewrite the memory so that the
, The frequency of writing to each area can be dispersed, and the writing life of the memory can be greatly extended. Therefore, there is an effect that data can be prevented from being altered or lost due to data rewriting on a memory means such as a programmable read only memory.

【図面の簡単な説明】 【図1】本発明の一実施例を示すメモリの書き込み制御
装置を適用可能な情報処理装置の構成を説明するブロッ
ク図である。 【図2】図1に示したEEPROMのメモリマップを説
明する模式図である。 【図3】図1に示したにEEPROMの記憶領域を示す
模式図である。 【図4】図3に示した各ディレクトリブロックの構造を
説明する模式図である。 【図5】未使用のEEPROMの状態を説明する模式図
である。 【図6】図1に示したEEPROMへの書き込み動作を
説明する模式図である。 【図7】発明に係る情報処理装置における補正処理動作
を説明する模式図である。 【図8】本発明に係る情報処理装置におけるEEPRO
Mへのデータ書き換え制御処理手順の一例を示すフロー
チャートである。 【図9】本発明に係る情報処理装置における補正制御処
理手順の一例を示すフローチャートである。 【符号の説明】 1 EEPROM 1a ポインタブロック 21 ブロック番号 30 ディレクトリブロック 31 更新カウンタ 32 ファイル領域 33 スタートブロック番号エリア 34 エンドブロック番号エリア 35 チェーンブロックエリア 41 ファイル 42 未使用ブロック群
BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a write control of a memory showing one embodiment of the present invention.
1 is a block diagram illustrating a configuration of an information processing device to which the device can be applied . FIG. 2 is a schematic diagram illustrating a memory map of the EEPROM shown in FIG. FIG. 3 is a schematic diagram showing a storage area of the EEPROM shown in FIG. FIG. 4 is a schematic diagram illustrating the structure of each directory block shown in FIG. FIG. 5 is a schematic diagram illustrating a state of an unused EEPROM. FIG. 6 is a schematic diagram illustrating a write operation to the EEPROM shown in FIG. 1; FIG. 7 is a schematic diagram illustrating a correction processing operation in the information processing apparatus according to the invention. FIG. 8 shows an EEPRO in the information processing apparatus according to the present invention.
It is a flowchart which shows an example of the data rewriting control processing procedure to M. FIG. 9 is a flowchart illustrating an example of a correction control processing procedure in the information processing apparatus according to the present invention. [Description of Signs] 1 EEPROM 1a Pointer block 21 Block number 30 Directory block 31 Update counter 32 File area 33 Start block number area 34 End block number area 35 Chain block area 41 File 42 Unused block group

Claims (1)

(57)【特許請求の範囲】 1.メモリに書き込まれた情報を電気的に書き換えので
きるメモリの書き込み制御装置であって、 複数の領域に分割されたメモリの各領域毎の書き換え回
数を記憶する記憶手段と、 該記憶手段に記憶された各領域毎の書き換え回数を判断
する判断手段と、 前記判断手段により判断された各領域の書き換え回数に
基づいて、各領域の書き換え回数の差が少なくなるよう
、書き換え回数の少ない領域を優先的に使用するよう
に前記メモリの書き換えを制御する補正手段と、を有す
ることを特徴とするメモリの書き込み制御装置。
(57) [Claims] A memory write control device capable of electrically rewriting information written in a memory, comprising: storage means for storing the number of rewrites for each area of a memory divided into a plurality of areas; Determining means for determining the number of times of rewriting for each area; and, based on the number of times of rewriting for each area determined by the determining means , giving priority to an area having a small number of times of rewriting so as to reduce the difference in the number of times of rewriting for each area. To use
And a correction means for controlling rewriting of the memory.
JP2341893A 1993-01-20 1993-01-20 Memory write control device Expired - Fee Related JP2749752B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2341893A JP2749752B2 (en) 1993-01-20 1993-01-20 Memory write control device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2341893A JP2749752B2 (en) 1993-01-20 1993-01-20 Memory write control device

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP12473186A Division JP2685173B2 (en) 1986-05-31 1986-05-31 Memory write control method

Publications (2)

Publication Number Publication Date
JPH06302194A JPH06302194A (en) 1994-10-28
JP2749752B2 true JP2749752B2 (en) 1998-05-13

Family

ID=12109957

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2341893A Expired - Fee Related JP2749752B2 (en) 1993-01-20 1993-01-20 Memory write control device

Country Status (1)

Country Link
JP (1) JP2749752B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003132693A (en) * 2001-10-29 2003-05-09 Mitsubishi Electric Corp Nonvolatile semiconductor memory
JP5180957B2 (en) * 2007-05-10 2013-04-10 パナソニック株式会社 Memory controller, semiconductor recording device, and rewrite count notification method
JP5491201B2 (en) 2008-01-16 2014-05-14 パナソニック株式会社 Semiconductor recording apparatus and semiconductor recording system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS58215794A (en) * 1982-06-08 1983-12-15 Toshiba Corp Non-volatile memory device
JPS60212900A (en) * 1984-04-09 1985-10-25 Nec Corp Semiconductor fixed memory

Also Published As

Publication number Publication date
JPH06302194A (en) 1994-10-28

Similar Documents

Publication Publication Date Title
JP2685173B2 (en) Memory write control method
JPH07109717B2 (en) Memory write control method
US6839823B1 (en) Increased reliability of data stored on flash memory in applications sensitive to power-loss
US7191306B2 (en) Flash memory, and flash memory access method and apparatus
US6401160B1 (en) Method and apparatus to permit adjustable code/data boundary in a nonvolatile memory
US5448728A (en) Storage medium control system for controlling a write-once read-many storage medium
US6871259B2 (en) File system including non-volatile semiconductor memory device having a plurality of banks
US5682497A (en) Managing file structures for a flash memory file system in a computer
US10353607B2 (en) Bloom filters in a flash memory
US5530827A (en) Data management system for programming-limited type semiconductor memory and IC memory card employing data save/erase process with flag assignment
JP4268396B2 (en) Non-volatile memory device file management that can be programmed once
US20020041517A1 (en) Method of driving remapping in flash memory and flash memory architecture suitable therefor
US10261704B1 (en) Linked lists in flash memory
JP2008508596A (en) System, method, computer readable medium, and apparatus for memory management using NVRAM
JPH07105691A (en) Method of writing/erasing and controlling storage
JPH08328762A (en) Semiconductor disk device and memory management method therefor
US7895164B1 (en) Efficient checkpoint process
KR20020016513A (en) Reclaim space reserve for a compressed memory system
JP2001154909A (en) Flash memory management device and recording medium
JP2749752B2 (en) Memory write control device
JPH113287A (en) Storage device and storage area management method used for the device
JPH06349286A (en) Writing controller and control method for flash memory
US20030200232A1 (en) Information processor and program
US20200364151A1 (en) Hash tables in flash memory
JPH10289144A (en) Memory control method

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees