[go: up one dir, main page]

JP2001051910A - Non-volatile memory device - Google Patents

Non-volatile memory device

Info

Publication number
JP2001051910A
JP2001051910A JP11229444A JP22944499A JP2001051910A JP 2001051910 A JP2001051910 A JP 2001051910A JP 11229444 A JP11229444 A JP 11229444A JP 22944499 A JP22944499 A JP 22944499A JP 2001051910 A JP2001051910 A JP 2001051910A
Authority
JP
Japan
Prior art keywords
sector
data
nonvolatile memory
management information
logical
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP11229444A
Other languages
Japanese (ja)
Other versions
JP2001051910A5 (en
Inventor
Toyoaki Sugaya
豊明 菅谷
Kenichiro Hiramoto
健一郎 平本
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.)
Konica Minolta Inc
Original Assignee
Konica Minolta 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 Konica Minolta Inc filed Critical Konica Minolta Inc
Priority to JP11229444A priority Critical patent/JP2001051910A/en
Publication of JP2001051910A publication Critical patent/JP2001051910A/en
Publication of JP2001051910A5 publication Critical patent/JP2001051910A5/ja
Pending legal-status Critical Current

Links

Landscapes

  • Techniques For Improving Reliability Of Storages (AREA)
  • Memory System (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

PROBLEM TO BE SOLVED: To protect data just before reloading and to shorten time required for data reloading of a sector even when an accident occurs in the middle of reloading. SOLUTION: This device has a non-volatile memory 1 having plural sectors and capable of electric erasure and write for performing the erasure for the unit of a sector, a non-volatile memory control means 2 for instructing and controlling the erasure, write and read of data to the non-volatile memory 1, a temporary sector data holding means 3 for temporarily holding sector data and a sector managing information holding means 10 for holding sector managing information showing which sector stores effective data.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は不揮発メモリ装置に
関する。
The present invention relates to a nonvolatile memory device.

【0002】[0002]

【従来の技術】従来の不揮発メモリ装置には、以下のよ
うなタイプがあった。 電気的消去書き込みが可能で、所定のブロック(以下
セクタという。詳しくはフラッシュメモリへの書き込み
と消去の単位である)単位で消去を行ない、電源切断時
も記憶データが消滅しない不揮発メモリと、該不揮発メ
モリにデータの消去、データの書き込み、データの読み
出しを指示し、制御を行なう不揮発メモリ制御手段を具
備している。
2. Description of the Related Art There are the following types of conventional nonvolatile memory devices. A non-volatile memory capable of electrically erasing and writing, performing erasing in units of predetermined blocks (hereinafter referred to as a sector, which is a unit of writing and erasing to a flash memory in detail) so that stored data is not lost even when power is turned off; A nonvolatile memory control means is provided for instructing and controlling data erasing, data writing, and data reading to and from the nonvolatile memory.

【0003】そして、データを読み出す時は、データの
内容に応じた特定のセクタからデータを読み出す。ま
た、データを書き換える際は、前記不揮発メモリ制御手
段が書き換え対象データの内容に応じた特定のセクタ
(書き換え対象セクタ)からデータを読み出して、セク
タデータ一時保持手段に格納し、セクタデータ一時保持
手段に格納されたデータの書き換え対象データを更新
し、該書き換え対象セクタを消去した後、該セクタデー
タ一時保持手段内の更新されたセクタデータを前記消去
した書き換え対象セクタに書き込むようになっている。
When reading data, data is read from a specific sector according to the content of the data. When rewriting data, the nonvolatile memory control means reads data from a specific sector (rewriting target sector) corresponding to the content of the data to be rewritten and stores the data in the sector data temporary holding means. After the data to be rewritten is updated and the sector to be rewritten is erased, the updated sector data in the sector data temporary holding means is written to the erased sector to be rewritten.

【0004】電気的消去書き込みが可能で、所定のブ
ロック(以下セクタという)単位で消去を行ない、電源
切断時も記憶データが消滅しない不揮発メモリと、該不
揮発メモリにデータの消去、データの書き込み、データ
の読み出しを指示し、制御を行なう不揮発メモリ制御手
段と、どのセクタに有効なデータが記憶されているかを
示すセクタ管理情報を保持するセクタ管理情報保持手段
を具備している。
[0004] A non-volatile memory capable of electrically erasing and writing, performing erasing in units of a predetermined block (hereinafter referred to as a sector) and storing data even when power is turned off, and erasing data, writing data, A nonvolatile memory control means for instructing and controlling data reading and a sector management information holding means for holding sector management information indicating in which sector valid data is stored.

【0005】そして、前記不揮発メモリは、1つ以上の
書き換え対象セクタ(0個以上の書き換え非対象セク
タ)と、書き換え対象セクタと同数で、かつ、各対象セ
クタと対応付けられた予備セクタを持っている。
The non-volatile memory has one or more rewrite target sectors (zero or more non-rewrite target sectors) and a spare sector in the same number as the rewrite target sectors and associated with each target sector. ing.

【0006】書き換え対象セクタと、各予備セクタは、
実データ部と、データ検証部からなり、書き換え対象セ
クタの内容を書き換える時は、該書き換え対象セクタに
対応する予備セクタの内容も同様に書き換えて、書き換
え対象セクタとこれに対応する予備セクタの内容を同一
に保ち、書き換え対象セクタのデータ検証部を参照し
て、該書き換え対象セクタが異常と判定された時には、
該書き換え対象セクタに対応する予備セクタの内容を該
書き換え対象セクタにコピーし、予備セクタのデータ検
証部を参照して、該予備セクタが異常と判定された時
は、該予備セクタに対応する書き換え対象セクタの内容
を該予備セクタにコピーするようになっている。
The sector to be rewritten and each spare sector are:
When the contents of the rewrite target sector are rewritten, the contents of the spare sector corresponding to the rewrite target sector are similarly rewritten, and the contents of the rewrite target sector and the corresponding spare sector are written. When the sector to be rewritten is determined to be abnormal with reference to the data verification unit of the sector to be rewritten,
The contents of the spare sector corresponding to the rewrite target sector are copied to the rewrite target sector, and when the spare sector is determined to be abnormal by referring to the data verification unit of the spare sector, the rewrite corresponding to the spare sector is performed. The contents of the target sector are copied to the spare sector.

【0007】図17は従来技術1の動作説明図である。
1はフラッシュメモリ等よりなる不揮発メモリで、該不
揮発メモリはセクタ0〜セクタ3より構成されている。
2は不揮発メモリ1と接続され、不揮発メモリ1にデー
タの消去、データの書き込み、データの読み出しを指示
し制御を行なう不揮発メモリ制御手段、3はセクタデー
タを一時保持するセクタデータ一時保持手段であり、例
えばRAMで構成されている。
FIG. 17 is a diagram for explaining the operation of the prior art 1.
Reference numeral 1 denotes a nonvolatile memory such as a flash memory, and the nonvolatile memory includes sectors 0 to 3.
Reference numeral 2 denotes a nonvolatile memory control unit which is connected to the nonvolatile memory 1 and instructs and controls data erasing, data writing, and data reading in the nonvolatile memory 1, and 3 denotes a sector data temporary holding unit for temporarily holding sector data. , For example, a RAM.

【0008】ここで、セクタ1の内容の一部を書き換え
る場合、不揮発メモリ制御手段2がセクタ1の内容をR
AM3にコピーする()。次に、不揮発メモリ制御手
段がセクタ1を消去すると共に、RAM3中の書き換え
対象データを書き換える()。次に、不揮発メモリ制
御手段2はRAM3の内容をセクタ1に書き込む
()。この方法の問題点は、との途中で事故があ
ると、セクタ1の内容が消失してしまうという問題があ
る。
Here, when rewriting a part of the contents of the sector 1, the nonvolatile memory control means 2 stores the contents of the sector 1 in R.
Copy to AM3 (). Next, the nonvolatile memory control means erases the sector 1 and rewrites the data to be rewritten in the RAM 3 (). Next, the nonvolatile memory control means 2 writes the contents of the RAM 3 into the sector 1 (). The problem with this method is that if there is an accident on the way, the contents of sector 1 will be lost.

【0009】図18は従来技術2の検証と復帰の説明図
である。図17と同一のものは、同一の符号を付して示
す。この実施例では、セクタ0からセクタ3までが全て
予備のセクタを持っていることである。不揮発メモリ制
御手段2は、(a)に示すようにセクタ1とセクタ1用
予備セクタのデータ検証部1bを調べる()。なお、
1aは実データ部である。
FIG. 18 is an explanatory diagram of verification and return of the prior art 2. The same components as those in FIG. 17 are denoted by the same reference numerals. In this embodiment, all sectors 0 to 3 have spare sectors. The non-volatile memory control means 2 checks the data verification section 1b of the sector 1 and the spare sector for the sector 1 as shown in FIG. In addition,
1a is an actual data section.

【0010】ここで、データ検証部1bの動作を説明す
る。 1.方法1 消去後の値(例えばFFh:hは16進数を示す)と異
なる所定のビットパターン(例えば55h)をセクタ所
定の位置(例えば末尾)に、実データ部を書き込んだ直
後に書き込む。セクタ所定の位置(例えば末尾)が所定
のビットパターン(例えば55h)であれば、実データ
の書き込みが正常に行われていると判定できる。
Here, the operation of the data verification unit 1b will be described. 1. Method 1 A predetermined bit pattern (for example, 55h) different from the value after erasing (for example, FFh: h indicates a hexadecimal number) is written at a predetermined position (for example, end) of the sector immediately after writing the real data portion. If the predetermined position (for example, the end) of the sector is a predetermined bit pattern (for example, 55h), it can be determined that the writing of the actual data is performed normally.

【0011】2.方法2 また、実データ部1aのチェックサムをセクタ所定の位
置に書き込む。実データ部とチェックサムを読み出し、
矛盾がなければ、実データは正常と判定できる。
2. Method 2 In addition, the checksum of the actual data portion 1a is written at a predetermined position in the sector. Read the actual data and checksum,
If there is no inconsistency, the actual data can be determined to be normal.

【0012】セクタ1のデータ検証部1bが異常で、セ
クタ1用予備セクタのデータ検証部1bが正常の時につ
いて考える。不揮発メモリ制御手段2はセクタ1用予備
セクタの内容を(b)に示すようにRAM3にコピーし
た後、(c)に示すようにセクタ1を消去し、RAM3
の内容をセクタ1に書き込む()。
Consider a case where the data verification unit 1b of the sector 1 is abnormal and the data verification unit 1b of the spare sector for the sector 1 is normal. The non-volatile memory control means 2 copies the contents of the spare sector for sector 1 to the RAM 3 as shown in (b), erases the sector 1 as shown in (c), and
Is written to sector 1 ().

【0013】なお、セクタ1のデータ検証部1bが正常
で、セクタ1用予備セクタのデータ検証部1bが異常の
時、不揮発メモリ制御手段2はセクタ1の内容をRAM
3にコピーした後、セクタ1用予備セクタを消去し、R
AM3の内容をセクタ1用予備セクタに書き込む。
When the data verification section 1b of the sector 1 is normal and the data verification section 1b of the spare sector for the sector 1 is abnormal, the nonvolatile memory control means 2 stores the contents of the sector 1 in the RAM.
3, the spare sector for sector 1 is erased, and R
Write the contents of AM3 to the spare sector for sector 1.

【0014】セクタ1のデータ検証部1bと、セクタ1
用予備セクタのデータ検証部1bが共に正常の時には何
もしない。セクタ1のデータ検証部1bとセクタ1用予
備セクタのデータ検証部1bが共に異常の時には、修正
不能であるが、このような事故は殆ど発生しない。
The data verification unit 1b of the sector 1 and the sector 1
When both the data verification units 1b of the spare sectors are normal, nothing is done. When both the data verification unit 1b of the sector 1 and the data verification unit 1b of the spare sector for the sector 1 are abnormal, the data cannot be corrected, but such an accident hardly occurs.

【0015】図19は従来技術2のセクタ書き換えの説
明図である。(a)に示すようにセクタ1の内容をRA
M3にコピーする()。次に、(b)に示すようにセ
クタ1を消去すると共に、RAM3中の書き換え対象デ
ータを書き換える()。図の1kが書き換え部分であ
る。次に、(c)に示すようにRAM3の内容をセクタ
に書き込む()。次に、セクタ1用予備セクタを消去
した後、RAM3の内容を(d)に示すようにセクタ1
用予備セクタに書き込む()。
FIG. 19 is an explanatory diagram of sector rewriting of the prior art 2. As shown in FIG.
Copy to M3 (). Next, the sector 1 is erased and the data to be rewritten in the RAM 3 is rewritten as shown in FIG. 1k in the figure is a rewriting portion. Next, the contents of the RAM 3 are written to the sector as shown in FIG. Next, after erasing the spare sector for sector 1, the contents of RAM 3 are changed to sector 1 as shown in FIG.
Write to the reserved spare sector ().

【0016】この方法の場合には、〜の間に事故が
あっても、書き換え直前のデータがセクタ1又は予備セ
クタの何れかに残り、セクタの検証と復帰処理を行え
ば、書き換え直前の状態に戻すことができる。
In the case of this method, even if there is an accident between the data, the data immediately before rewriting remains in either the sector 1 or the spare sector. Can be returned to.

【0017】問題点は、以下の通りである。 1.書き換え対象セクタと同数の予備セクタが必要 2.同じデータを書き換え対象セクタと予備セクタの両
方に書き込むので、データの書き換えに時間がかかる。
The problems are as follows. 1. 1. The same number of spare sectors as rewrite target sectors are required. Since the same data is written to both the rewrite target sector and the spare sector, it takes time to rewrite the data.

【0018】[0018]

【発明が解決しようとする課題】従来の技術の場合、書
き換え対象セクタの消去開始から更新した内容の書き込
み完了までの間に、操作ミスや停電により電源が切れた
り、ノイズやソフトウェアのバグ等で不揮発メモリ制御
手段2が誤動作した場合、該書き換え対象セクタの内容
が消失してしまい、元に戻すことができない。また、こ
のような問題を解決するために、書き換え対象セクタと
同数の予備セクタを持たせる方法の場合には、多くのセ
クタ(即ちメモリ容量)を必要とし、しかも、同じデー
タを書き換え対象セクタと予備セクタの両方に書き込む
ため、データの書き換えに時間がかかるという問題があ
った。
In the case of the conventional technique, the power is turned off due to an operation error or a power failure, or noise or software bugs occur between the start of erasure of the sector to be rewritten and the completion of writing the updated contents. If the nonvolatile memory control means 2 malfunctions, the contents of the sector to be rewritten are lost and cannot be restored. In order to solve such a problem, in the case of a method of providing the same number of spare sectors as the rewrite target sector, many sectors (that is, memory capacity) are required, and the same data is used as the rewrite target sector. There is a problem that it takes time to rewrite data because data is written to both of the spare sectors.

【0019】本発明はこのような課題に鑑みてなされた
ものであって、書き換えの途中で事故が発生しても書き
換え直前のデータを保護することができ、またセクタの
データ書き換えに要する時間を短縮することができる不
揮発メモリ装置を提供することを目的としている。
The present invention has been made in view of such a problem, and can protect data immediately before rewriting even if an accident occurs during rewriting, and can reduce the time required for rewriting data in a sector. It is an object to provide a nonvolatile memory device which can be shortened.

【0020】[0020]

【課題を解決するための手段】(1)前記した課題を解
決する請求項1記載の発明は、複数のセクタを有する電
気的消去、書き込みが可能でセクタ単位で消去を行なう
不揮発メモリと、該不揮発メモリにデータの消去、デー
タの書き込み、データの読み出しを指示し制御を行なう
不揮発メモリ制御手段と、セクタデータを一時保持する
セクタデータ一時保持手段と、どのセクタに有効なデー
タが記憶されているかを示すセクタ管理情報を保持する
セクタ管理情報保持手段とを有することを特徴とする。
According to a first aspect of the present invention, there is provided a nonvolatile memory capable of electrically erasing and writing data having a plurality of sectors and performing erasing in sector units. Non-volatile memory control means for instructing and controlling data erasing, data writing, and data reading in the non-volatile memory, sector data temporary holding means for temporarily storing sector data, and in which sector valid data is stored And a sector management information holding means for holding sector management information indicating the following.

【0021】このように構成すれば、セクタ管理情報保
持手段を参照して予備セクタを決めながらセクタ書き換
えを行なうので、書き換えの途中で事故が発生しても書
き換え直前のデータを保護することができる。また、予
備セクタは少なくとも1つ設けるだけでよいので、書き
換えに要する時間を短縮することができる。
With this configuration, sector rewriting is performed while determining a spare sector with reference to the sector management information holding means, so that even if an accident occurs during rewriting, data immediately before rewriting can be protected. . Also, since only at least one spare sector needs to be provided, the time required for rewriting can be reduced.

【0022】(2)請求項2では、前記不揮発メモリ
は、有効なデータを記憶する1つ以上の有効セクタと、
有効なデータを記憶していない少なくとも1つの予備の
セクタから構成され、各有効セクタと各予備セクタは、
セクタ管理部と、実データ部と、データ検証部からな
り、データを読み出す時は不揮発メモリ制御手段が、セ
クタ管理情報保持手段内に保持されているセクタ管理情
報を参照して所望のデータがどのセクタにあるかを判別
して読み出し、データを書き換える際は、不揮発メモリ
制御手段が予備セクタを消去し、それと同時若しくは前
後に、セクタ管理情報保持手段内に保持されているセク
タ管理情報を参照して書き換え対象のデータがどのセク
タにあるかを判別して、該セクタのセクタ管理部と、実
データ部を読み出してセクタデータ一時保持手段に格納
し、セクタデータ一時保持手段に格納した実データ部の
書き換え対象部分を更新すると共に、所定のアルゴリズ
ムに基づいてセクタ管理部の内容を更新し、また所定の
アルゴリズムに基づいてデータ検証部を生成し、該更新
されたセクタデータ一時保持手段内の実データ部とセク
タ管理部とデータ検証部を、前記消去した予備セクタに
書き込むと共に、セクタ管理情報保持手段内のセクタ管
理情報を更新することを特徴とする。
(2) In claim 2, the non-volatile memory includes at least one valid sector for storing valid data,
Consisting of at least one spare sector that does not store valid data, each valid sector and each spare sector are:
When reading data, the nonvolatile memory control means refers to the sector management information held in the sector management information holding means to determine which data is desired. When reading and rewriting data by judging whether or not the data is in a sector, the nonvolatile memory control means erases the spare sector and refers to the sector management information held in the sector management information holding means at the same time or before or after that. The sector management unit and the real data part of the sector are read out and stored in the sector data temporary holding means, and the real data part stored in the sector data temporary holding means is determined. Update the portion to be rewritten, update the contents of the sector management unit based on a predetermined algorithm, and update the contents of the sector management unit based on a predetermined algorithm. A data verification unit, and writes the actual data part, the sector management unit, and the data verification unit in the updated sector data temporary holding unit to the erased spare sector, and writes the sector management information in the sector management information holding unit. It is characterized by updating information.

【0023】このように構成すれば、セクタ管理情報保
持手段を参照して予備セクタを決めながらセクタ書き換
えを行なうので、書き換えの途中で事故が発生しても書
き換え直前のデータを保護することができる。また、予
備セクタは少なくとも1つ設けるだけでよいので、書き
換えに要する時間を短縮することができる。
With this configuration, sector rewriting is performed while determining a spare sector with reference to the sector management information holding means, so that even if an accident occurs during rewriting, data immediately before rewriting can be protected. . Also, since only at least one spare sector needs to be provided, the time required for rewriting can be reduced.

【0024】(3)請求項3では、電源投入時には、前
記不揮発メモリ制御手段が全てのセクタのセクタ管理部
とデータ検証部を読み出し、この情報を基にセクタの管
理情報を作成し、セクタ管理情報保持手段に保持するこ
とを特徴とする。
(3) In claim 3, when the power is turned on, the non-volatile memory control means reads out the sector management units and the data verification units of all the sectors, creates sector management information based on the information, and creates sector management information. It is characterized in that it is stored in an information storage unit.

【0025】このように構成すれば、以後の不揮発メモ
リへのデータの書き換えを誤りなく、行なうことが可能
となる。 (4)請求項4では、各セクタのセクタ管理部は、セク
タが保持するデータの内容を示すセクタ内情報(論理セ
クタ番号)と、該セクタが保持するデータ(論理セク
タ)を書き換えた回数を示す情報とを含むことを特徴と
する。
With this configuration, it is possible to rewrite data in the nonvolatile memory thereafter without error. (4) In claim 4, the sector management unit of each sector determines the information in the sector (logical sector number) indicating the content of the data held by the sector and the number of times the data (logical sector) held by the sector has been rewritten. And information to be shown.

【0026】このように構成すれば、再起動時に各セク
タが保持するデータの書き換え回数を用いて、どのセク
タが予備セクタであるかを判別し、セクタ管理情報を生
成することにより、不揮発メモリからのデータの読み出
しと書き込みを誤りなく行なうことが可能となる。
With this configuration, it is possible to determine which sector is a spare sector by using the number of times of rewriting of data held in each sector at the time of restart, and to generate sector management information. Can be read and written without error.

【0027】(5)請求項5では、各セクタのセクタ管
理部は、セクタが保持するデータの内容を示すセクタ内
情報(論理セクタ番号)と、該セクタが保持するデータ
(論理セクタ)を書き換えた時刻の順序関係を示す書き
換え順序情報とを含むことを特徴とする。
(5) In claim 5, the sector management unit of each sector rewrites information (logical sector number) in the sector indicating the contents of data held by the sector and data (logical sector) held by the sector. And rewriting order information indicating the order relationship of the time of the event.

【0028】このように構成すれば、再起動時に各セク
タが保持するデータの書き換え時刻の順序関係を用い
て、不揮発メモリからのデータの読み出しと書き込みを
誤りなく行なうことが可能となる。
With this configuration, it is possible to read and write data from the nonvolatile memory without error by using the order of the data rewriting time held in each sector at the time of restart.

【0029】(6)請求項6では、各セクタのセクタ管
理部は、セクタが保持するデータの内容を示すセクタ内
容情報(論理セクタ番号)と、全セクタの書き換え時刻
の順序関係を示す、全セクタ書き換え順序情報とを含む
ことを特徴とする。
(6) In claim 6, the sector management unit of each sector includes a sector content information (logical sector number) indicating the content of data held by the sector and an order relationship between rewriting times of all sectors. And sector rewriting order information.

【0030】このように構成すれば、再起動時に前記全
セクタ書き換え順序情報に基づき、不揮発メモリからの
データの読み出しと書き込みを誤りなく行なうことが可
能となる。
With this configuration, it is possible to read and write data from the nonvolatile memory without error based on the all-sector rewrite order information at the time of restart.

【0031】(7)請求項7では、各セクタのセクタ管
理部は、各セクタが保持するデータの内容を示す、全セ
クタ内容情報(論理セクタ番号テーブル)と、全セクタ
の書き換え時刻の順序関係を示す、全セクタ書き換え順
序情報とを含むことを特徴とする。
(7) According to the seventh aspect, the sector management unit of each sector includes all-sector content information (logical sector number table) indicating the content of data held by each sector and the order relationship between the rewriting times of all sectors. , And all sector rewrite order information.

【0032】このように構成すれば、再起動時に全セク
タ内容情報と全セクタの時刻の順序関係に基づいて、不
揮発メモリからのデータの読み出しと書き込みを誤りな
く行なうことが可能となる。
With this configuration, it is possible to read and write data from the non-volatile memory without error based on the order relationship between the contents information of all sectors and the time of all sectors at the time of restart.

【0033】(8)請求項8では、前記データ検証部
は、所定の特定データを含むことを特徴とする。このよ
うに構成すれば、データ検証部がセクタデータの誤りを
検出することが可能となる。
(8) In claim 8, the data verifying section includes predetermined specific data. With this configuration, the data verification unit can detect an error in the sector data.

【0034】(9)請求項9では、前記データ検証部
は、セクタ管理部とデータ部のチェックサムであること
を特徴とする。このように構成すれば、簡単な計算によ
り、セクタデータの異常を検出することが可能となる。
(9) In the ninth aspect, the data verification unit is a checksum of a sector management unit and a data unit. With this configuration, it is possible to detect an abnormality in the sector data by a simple calculation.

【0035】[0035]

【発明の実施の形態】以下、図面を参照して本発明の実
施の形態例を詳細に説明する。図1は本発明によるデー
タの検証とセクタ管理情報の生成を示す図である。図1
9と同一のものは、同一の符号を付して示す。図におい
て、1は不揮発メモリで、物理セクタ番号と、論理セク
タ番号が付されている。1aは実データ部、1bはデー
タ検証部(チェックサム)である。1cは各論理セクタ
の書き換え回数記憶部、1dは論理セクタ番号記憶部
で、1cと1dとでセクタ管理部を構成している。ここ
では、物理セクタと論理セクタが使用されているが、物
理セクタは、実際にどこにアクセスするかを区別するた
めに用いるものであり、論理セクタは、どこにどのよう
な情報が入っているかを区別するための管理情報として
機能するものである。
Embodiments of the present invention will be described below in detail with reference to the drawings. FIG. 1 is a diagram showing data verification and generation of sector management information according to the present invention. FIG.
The same components as 9 are denoted by the same reference numerals. In the figure, reference numeral 1 denotes a non-volatile memory, which is assigned a physical sector number and a logical sector number. 1a is an actual data part, 1b is a data verification part (checksum). 1c is a storage unit for the number of rewrites of each logical sector, 1d is a logical sector number storage unit, and 1c and 1d constitute a sector management unit. Here, a physical sector and a logical sector are used, but the physical sector is used to distinguish where to actually access, and the logical sector distinguishes where and what information is contained. It functions as management information for performing the operation.

【0036】10は物理セクタと論理セクタの対応関係
を示すセクタ管理情報保持手段であり、どのセクタに有
効なデータが記憶されているかを示すセクタ管理情報を
記憶するものである。該セクタ管理情報保持手段10と
しては、例えばRAMが用いられる。2は不揮発メモリ
制御手段で、例えばCPUが用いられ、3はセクタデー
タ一時保持手段で、例えばRAMが用いられる。論理セ
クタ番号記憶部1dと論理セクタ書き換え回数記憶部1
cとでセクタ管理部を構成している。
Numeral 10 denotes sector management information holding means for indicating the correspondence between physical sectors and logical sectors, and stores sector management information indicating in which sector valid data is stored. As the sector management information holding means 10, for example, a RAM is used. Reference numeral 2 denotes a nonvolatile memory control unit, for example, a CPU, and 3 denotes a sector data temporary holding unit, for example, a RAM. Logical sector number storage 1d and logical sector rewrite frequency storage 1
c constitutes a sector management unit.

【0037】先ず、電源投入による立ち上げ動作につい
て説明する。電源投入時には、不揮発メモリ制御手段2
が、全てのセクタのセクタ管理部とデータ検証部を読み
出し、これら情報を基にセクタ管理情報保持手段10の
内部構成を作成する。不揮発メモリ1に蓄積されている
セクタ情報(セクタ管理部情報、データ検証部1b)は
電源断時にも記憶されている。従って、電源投入する
と、その内容を読み出すことができる。
First, a start-up operation by turning on the power will be described. When power is turned on, the nonvolatile memory control means 2
Reads the sector management units and the data verification units of all the sectors, and creates an internal configuration of the sector management information holding unit 10 based on the information. The sector information (sector management unit information, data verification unit 1b) stored in the nonvolatile memory 1 is stored even when the power is turned off. Therefore, when the power is turned on, the contents can be read.

【0038】この実施の形態例によれば、以後の不揮発
メモリ1へのデータの書き換えを誤りなく行なうことが
可能となる。図1に示すように構成されたシステムにお
いて、不揮発メモリ制御手段2は、論理セクタ番号1
d、論理セクタ書き換え回数1c、実データ部1aのチ
ェックサムを照合し、矛盾がなければ記憶されている論
理セクタ番号を、その物理セクタの論理セクタ番号とす
る。但し、他の物理セクタと同じ論理セクタ番号が付い
ている場合には、論理セクタ書き換え回数記憶部1cを
参照して論理セクタ書き換え回数が大きい方を有効とす
る。残った物理セクタ(チェックサムに矛盾があったも
の、又は論理セクタ書き換え回数が小さい方)を予備セ
クタとする。
According to this embodiment, it is possible to rewrite data in the nonvolatile memory 1 thereafter without error. In the system configured as shown in FIG. 1, the nonvolatile memory control means 2
d, the number of logical sector rewrites 1c, and the checksum of the actual data portion 1a are compared, and if there is no inconsistency, the stored logical sector number is set as the logical sector number of the physical sector. However, if the same logical sector number is assigned to another physical sector, the logical sector rewrite frequency storage unit 1c is referred to as the logical sector rewrite frequency and the one with the larger logical sector rewrite frequency is made valid. The remaining physical sectors (the ones with inconsistent checksums or the smaller number of logical sector rewrites) are taken as spare sectors.

【0039】図に示す場合には、物理セクタ3と4が共
に同じ論理セクタ番号3を持っている。この場合には、
書き換え回数が多い方(書き換え回数20を有するセク
タ)を本来のセクタとして用い、書き換え回数が小さい
方(書き換え回数19を有するセクタ)を予備セクタと
する。
In the case shown in the figure, both physical sectors 3 and 4 have the same logical sector number 3. In this case,
The sector with the larger number of rewrites (sector having the number of rewrites 20) is used as the original sector, and the one with the smaller number of rewrites (sector having the number of rewrites 19) is used as the spare sector.

【0040】この実施の形態例によれば、各セクタが保
持するデータの書き換え回数を用いて、どのセクタが予
備セクタであるか判別し、セクタ管理情報を生成するこ
とにより、不揮発メモリからのデータの読み出しと、デ
ータの書き込みを誤りなく行なうことが可能となる。
According to this embodiment, which sector is a spare sector is determined by using the number of times of rewriting of data held in each sector, and sector management information is generated, so that data from the nonvolatile memory can be read. And writing of data can be performed without error.

【0041】図2〜図4は本発明によるデータの書き換
えの説明図である。図1と同一のものは、同一の符号を
付して示す。ここでは、論理セクタ1の内容を書き換え
る場合を例にとって説明する。不揮発メモリ制御手段2
は、セクタ管理情報保持手段10を参照して、(a)に
示すように論理セクタ1を保持する物理セクタ2の全デ
ータをRAM3へコピーする()。この時の予備セク
タは、物理セクタ4である。
FIGS. 2 to 4 are explanatory diagrams of data rewriting according to the present invention. 1 are denoted by the same reference numerals. Here, a case where the contents of the logical sector 1 are rewritten will be described as an example. Non-volatile memory control means 2
Refers to the sector management information holding means 10 and copies all data of the physical sector 2 holding the logical sector 1 to the RAM 3 as shown in FIG. The spare sector at this time is the physical sector 4.

【0042】次に、不揮発メモリ制御手段2は、セクタ
管理情報保持手段10を参照して、予備セクタである物
理セクタ4を(b)に示すように消去すると共に、RA
M3中の書き換え対象データを書き換え、論理セクタ書
き換え回数を1つ加算し、チェックサムを生成する
()。この結果、RAM3中の書き換え回数が12か
ら13に変化する。
Next, the nonvolatile memory control means 2 refers to the sector management information holding means 10 to erase the physical sector 4 which is a spare sector as shown in FIG.
The data to be rewritten in M3 is rewritten and the number of logical sector rewrites is incremented by one to generate a checksum (). As a result, the number of times of rewriting in the RAM 3 changes from 12 to 13.

【0043】次に、RAM3中のデータを物理セクタ4
に書き込むと共に、セクタ管理情報の論理セクタ1に対
応する物理セクタ番号と予備セクタに対応する物理セク
タ番号を(c)に示すように入れ換える()。この結
果、論理セクタ1が予備セクタになる。この時の、予備
セクタの内容は、論理セクタ1の1回前の内容となる。
Next, the data in the RAM 3 is stored in the physical sector 4
And the physical sector number corresponding to the logical sector 1 in the sector management information and the physical sector number corresponding to the spare sector are replaced as shown in FIG. As a result, the logical sector 1 becomes a spare sector. At this time, the contents of the spare sector are the contents immediately before the logical sector 1.

【0044】この実施の形態例によれば、〜の処理
中に事故があっても、データの検証とセクタ管理情報の
生成によって、書き換え直前の状態に復帰することがで
きる。また、複数の書き換え対象セクタに対して、1つ
の予備セクタを用意するだけでよい。更に、データ書き
換え時、同じデータを複数のセクタに2度書く必要がな
い。
According to this embodiment, even if an accident occurs during the processing of, it is possible to return to the state immediately before rewriting by verifying the data and generating the sector management information. Also, it is only necessary to prepare one spare sector for a plurality of sectors to be rewritten. Further, when rewriting data, it is not necessary to write the same data twice in a plurality of sectors.

【0045】なお、セクタ書き換え回数がオーバフロー
しないように、セクタ書き換え回数の領域を想定する最
大書き換え回数の最大値より十分大きくとる。例えば、
最大書き換え回数を100万回に設定すれば、220>1
00万なので、セクタ書き換え回数の領域を20ビット
用意すればよい。
In order to prevent the number of times of sector rewriting from overflowing, the area of the number of times of sector rewriting is set to be sufficiently larger than the maximum value of the assumed maximum number of times of rewriting. For example,
If the maximum number of rewrites is set to 1 million, 2 20 > 1
Since it is one million, a 20-bit area for the number of times of sector rewriting may be prepared.

【0046】また、回数の大小関係を循環的に考えるこ
とにする。例えば、セクタ書き換え回数の領域が8ビッ
トの時、0<1<2<3…<255<0、即ち、255
よりも0が大きいと解釈することとし、書き換え回数2
55の次は0に戻すようにすればよい。
Further, the magnitude relation of the number of times is cyclically considered. For example, when the area of the sector rewrite frequency is 8 bits, 0 <1 <2 <3... <255 <0, that is, 255
0 is greater than
What is necessary is just to return to 0 after 55.

【0047】また、データ検証部1bは、チェックサム
の代わりに、前述した所定のビットパターンを入れるよ
うにしてもよい。この場合、データ検証部の所定の位置
に所定のビットパターンがあれば実データに異常がない
と判定できる。
The data verifying section 1b may insert the above-mentioned predetermined bit pattern instead of the checksum. In this case, if there is a predetermined bit pattern at a predetermined position of the data verification unit, it can be determined that there is no abnormality in the actual data.

【0048】図5は本発明によるデータの検証とセクタ
管理情報の生成の説明図である。図4と同一のものは、
同一の符号を付して示す。図において、5は全セクタの
書き換え通算回数を記憶するセクタ書き換え通算回数記
憶部である。該セクタ書き換え通算回数記憶部5は不揮
発メモリ制御手段2と接続され、不揮発メモリ制御手段
2から出力されたデータを記憶する。その他の構成は、
図4と同じである。このように構成されたシステムの動
作を以下に説明する。
FIG. 5 is an explanatory diagram of data verification and generation of sector management information according to the present invention. The same thing as FIG.
The same reference numerals are given. In the figure, reference numeral 5 denotes a total sector rewrite count storage unit for storing the total number of rewrites for all sectors. The sector rewrite count storage unit 5 is connected to the nonvolatile memory control unit 2 and stores data output from the nonvolatile memory control unit 2. Other configurations are
It is the same as FIG. The operation of the system configured as described above will be described below.

【0049】不揮発メモリ制御手段2は、セクタの内容
を検証しながら、セクタ管理情報を作成する。即ち、各
セクタについて論理セクタ番号1d、セクタ書き換え通
算回数1e、実データ部1aのチェックサムを照合し、
矛盾がなければ、記録されている論理セクタ番号をその
物理セクタの論理セクタ番号とする。
The non-volatile memory control means 2 creates sector management information while verifying the contents of the sector. That is, for each sector, the logical sector number 1d, the total number of sector rewrites 1e, and the checksum of the actual data portion 1a are compared.
If there is no inconsistency, the recorded logical sector number is used as the logical sector number of the physical sector.

【0050】但し、他の物理セクタと同じ論理セクタ番
号が付いている場合には、セクタ書き換え通算回数が大
きい方を有効とする。残った物理セクタ(前記チェック
サムで矛盾があったもの、又はセクタ書き換え通算回数
が小さい方)を予備セクタとする。
However, if the same logical sector number as another physical sector is assigned, the one with the larger total number of sector rewrites is valid. The remaining physical sectors (the ones with inconsistencies in the checksum or the smaller total number of sector rewrites) are used as spare sectors.

【0051】チェックサムに矛盾のないセクタ(正常セ
クタ)に記録されているセクタ書き換え通算回数のうち
最大の値(図では物理セクタ3の20)をセクタ書き換
え回数記憶部5に、現在のセクタ書き換え通算回数とし
て保持する。
The maximum value (20 in the physical sector 3 in the figure) of the total number of sector rewrites recorded in the sector (normal sector) having no inconsistency in the checksum is stored in the sector rewrite frequency storage unit 5 and the current sector rewrite is stored. Stored as the total number of times.

【0052】図6〜図8は本発明のデータの書き換えの
説明図である。図5と同一のものは、同一の符号を付し
て示す。ここでは、論理セクタ1の内容を書き換える場
合を例にとって説明する。
FIGS. 6 to 8 are explanatory diagrams of data rewriting according to the present invention. The same components as those in FIG. 5 are denoted by the same reference numerals. Here, a case where the contents of the logical sector 1 are rewritten will be described as an example.

【0053】このシステムにおいて、セクタ管理情報を
参照して、(a)に示すように論理セクタ1を保持する
物理セクタ2の全データをRAM3にコピーする
()。RAM3には、物理セクタ2の内容がコピーさ
れる。この時のセクタ書き換え回数記憶部5の値は正常
セクタに記録されているセクタ書き換え回数の最大値で
ある20である。予備セクタは、物理セクタ4である。
In this system, referring to the sector management information, all data of the physical sector 2 holding the logical sector 1 is copied to the RAM 3 as shown in FIG. The contents of the physical sector 2 are copied to the RAM 3. At this time, the value of the sector rewrite frequency storage unit 5 is 20, which is the maximum value of the sector rewrite frequency recorded in the normal sector. The spare sector is the physical sector 4.

【0054】不揮発メモリ制御手段2は、セクタ管理情
報保持手段10を参照して、予備セクタである物理セク
タ4を(b)に示すように消去すると共に、RAM3中
の書き換え対象データを書き換え、セクタ書き換え通算
回数記憶部5の値を1つ加算して21にすると共に、そ
の書き換え通算回数をRAM3中のセクタ書き換え通算
回数格納部にも書き込み、更にチェックサム1bを生成
する()。
The nonvolatile memory control means 2 refers to the sector management information holding means 10 to erase the physical sector 4 which is a spare sector as shown in FIG. The value of the total number of rewrites storage unit 5 is incremented by 1 to 21 and the total number of rewrites is also written to the total number of sector rewrites storage unit in the RAM 3 to generate a checksum 1b ().

【0055】次に、RAM3中のデータを予備セクタで
ある物理セクタ4に書き込むと共に、セクタ管理情報の
論理セクタ1に対応する物理セクタ番号と予備セクタに
対応する物理セクタ番号を(c)に示すように入れ換え
る()。なお、予備セクタの内容は、論理セクタ1の
1回前の内容である。
Next, the data in the RAM 3 is written into the physical sector 4 which is a spare sector, and the physical sector number corresponding to the logical sector 1 and the physical sector number corresponding to the spare sector in the sector management information are shown in FIG. (). Note that the content of the spare sector is the content one time before the logical sector 1.

【0056】この発明の実施の形態例の効果は、図2〜
図4に示す実施の形態例と同様である。なお、セクタ書
き換え通算回数がオーバフローしないように、セクタ書
き換え回数の領域を想定する最大書き換え回数の最大値
より十分大きくとる。例えば、最大書き換え回数を10
0万回に設定すれば、220>100万なので、セクタ書
き換え回数の領域を20ビット用意すればよい。
The effects of the embodiment of the present invention are shown in FIGS.
This is the same as the embodiment shown in FIG. In order to prevent the total number of times of sector rewriting from overflowing, the area of the number of times of sector rewriting is set to be sufficiently larger than the maximum value of the assumed maximum number of times of rewriting. For example, if the maximum number of rewrites is 10
If it is set to 100,000 times, since 2 20 > 1,000,000, it is sufficient to prepare a 20-bit area for the sector rewrite frequency.

【0057】また、回数の大小関係を循環的に考えるこ
とにする。例えば、セクタ書き換え回数の領域が8ビッ
トの時、0<1<2<3…<255<0、即ち、255
よりも0が大きいと解釈することとし、書き換え回数2
55の次は0に戻すようにすればよい。
Further, the magnitude relation of the number of times is cyclically considered. For example, when the area of the sector rewrite frequency is 8 bits, 0 <1 <2 <3... <255 <0, that is, 255
0 is greater than
What is necessary is just to return to 0 after 55.

【0058】また、データ検証部1bは、チェックサム
の代わりに、前述した所定のビットパターンを入れるよ
うにしてもよい。図9は本発明によるデータの検証とセ
クタ管理情報の説明図である。この実施の形態例では、
セクタ書き換え回数の代わりに、セクタ管理部が時刻情
報1fを記憶するようにしたものである。時刻情報1f
は、書き換え日時と、書き換え時刻と、書き換え秒デー
タより構成されている。6は時計である。
The data verifying section 1b may insert the above-mentioned predetermined bit pattern instead of the checksum. FIG. 9 is an explanatory diagram of data verification and sector management information according to the present invention. In this embodiment,
Instead of the number of times of sector rewriting, the sector management section stores the time information 1f. Time information 1f
Is composed of rewriting date and time, rewriting time, and rewriting second data. 6 is a clock.

【0059】このように構成されたシステムにおいて、
不揮発メモリ制御手段2は、セクタの内容を検証しなが
ら、セクタ管理情報を作成する。即ち、各物理セクタに
ついて、論理セクタ番号1d、論理セクタ書き換え時刻
情報1f、実データ部1aのチェックサムを照合し、矛
盾がなければ記録されている論理セクタ番号を、その物
理セクタの論理セクタ番号とする。但し、他の物理セク
タと同じ論理セクタ番号が付いている場合には、セクタ
書き換え日時が遅い方を有効とする。そして、残った物
理セクタで、チェックサムに矛盾があったもの、又はセ
クタ書き換え日時が早い方を予備セクタとする。
In the system configured as described above,
The nonvolatile memory control means 2 creates sector management information while verifying the contents of the sector. That is, for each physical sector, the logical sector number 1d, the logical sector rewrite time information 1f, and the checksum of the actual data portion 1a are collated, and if there is no inconsistency, the recorded logical sector number is replaced by the logical sector number of the physical sector. And However, if the same logical sector number is assigned to another physical sector, the later sector rewrite date and time is valid. Then, the remaining physical sectors having a check sum inconsistency or the sector rewriting date and time that is earlier are set as spare sectors.

【0060】図10〜図12は本発明によるデータの書
き換えの説明図である。図9と同一のものは、同一の符
号を付して示す。ここでは、論理セクタ1の内容を書き
換える場合について説明する。不揮発メモリ制御手段2
は、セクタ管理情報保持手段10を参照し、(a)に示
すように論理セクタ1を保持する物理セクタ2の全デー
タをRAM3へコピーする()。次に、不揮発メモリ
制御手段2は、セクタ管理情報保持手段10を参照し、
予備セクタである物理セクタ4を(b)に示すように消
去すると共に、RAM3中の書き換え対象データを書き
換え、6の時計を参照して、現在の日時をRAM3中に
書き込み、更にチェックサムを生成する()。
FIGS. 10 to 12 are explanatory diagrams of data rewriting according to the present invention. The same components as those in FIG. 9 are denoted by the same reference numerals. Here, a case where the contents of the logical sector 1 are rewritten will be described. Non-volatile memory control means 2
Refers to the sector management information holding means 10 and copies all the data of the physical sector 2 holding the logical sector 1 to the RAM 3 as shown in FIG. Next, the nonvolatile memory control means 2 refers to the sector management information holding means 10 and
The physical sector 4 as a spare sector is erased as shown in (b), the data to be rewritten in the RAM 3 is rewritten, the current date and time are written in the RAM 3 with reference to the clock of 6, and a checksum is further generated. Yes ().

【0061】次に、不揮発メモリ制御手段2は、RAM
3中のデータを物理セクタ4に書き込むと共に、セクタ
管理情報の論理セクタ1に対応する物理セクタ番号と予
備セクタに対する物理セクタ番号を(c)に示すように
入れ換える()。なお、予備セクタの内容は、論理セ
クタ1の1回前の内容である。この実施の形態例の効果
は、前述した実施の形態例と同じである。
Next, the nonvolatile memory control means 2
3 is written in the physical sector 4, and the physical sector number corresponding to the logical sector 1 in the sector management information and the physical sector number for the spare sector are replaced as shown in FIG. Note that the content of the spare sector is the content one time before the logical sector 1. The effect of this embodiment is the same as that of the above-described embodiment.

【0062】なお、書き換え順序が分かるように、セク
タ書き換え日時の単位を十分細かくする必要がある。例
えば、セクタ1回の書き換えに最低1msかかるとすれ
ば、記録する日時を1ms以下の単位で記録すればよ
い。当然、それ以上の精度の時計が必要となる。
It is necessary to make the unit of the sector rewrite date and time sufficiently small so that the rewrite order can be understood. For example, if it takes at least 1 ms for one sector rewrite, the recording date and time may be recorded in units of 1 ms or less. Naturally, a clock with higher precision is required.

【0063】また、データ検証部1bとしては、チェッ
クサムの代わりに所定のビットパターンを使用してもよ
い。以上、説明したように、この実施の形態例によれ
ば、各セクタが保持するデータの書き換え時刻の順序関
係を用いて不揮発メモリへのデータの書き換えを誤りな
く行なうことが可能となる。
The data verifying section 1b may use a predetermined bit pattern instead of the checksum. As described above, according to this embodiment, data can be rewritten to the nonvolatile memory without error using the order of the data rewriting time held by each sector.

【0064】図13は、本発明によるデータの検証とセ
クタ管理情報の生成の説明図である。図5と同一のもの
は、同一の符号を付して示す。この実施の形態例では、
セクタ管理情報として、全セクタの書き換え通算回数1
eと、全ての論理セクタと物理セクタの対応関係を示す
論理セクタ番号テーブル1gが設けられている。その他
の構成は、図5と同じである。
FIG. 13 is an explanatory diagram of data verification and generation of sector management information according to the present invention. The same components as those in FIG. 5 are denoted by the same reference numerals. In this embodiment,
As the sector management information, the total number of rewrites of all sectors is 1
e and a logical sector number table 1g showing the correspondence between all logical sectors and physical sectors. Other configurations are the same as those in FIG.

【0065】このように構成されたシステムにおいて、
不揮発メモリ制御手段2は、各セクタのセクタ書き換え
通算回数1e、論理セクタテーブル1g、実データ部1
aのチェックサムを照合する。そして、チェックサムに
矛盾のない(即ち正常な)セクタの中で、セクタ書き換
え通算回数の最も大きな値(図では物理セクタ3の2
0)を、セクタ書き換え通算回数記憶部5中に、現在の
セクタ書き換え通算回数として保持する。そして、セク
タ書き換え通算回数の最も大きなセクタ(図の例では物
理セクタ3)に記憶されている論理セクタ番号テーブル
1gを読み出し、セクタ管理情報保持手段10に論理セ
クタ0,1,2,3,予備セクタにそれぞれ対応する物
理セクタ番号として保持する。
In the system configured as described above,
The nonvolatile memory control means 2 includes a total number 1e of sector rewrites for each sector, a logical sector table 1g,
Verify the checksum of a. Then, among the sectors whose checksums are not inconsistent (that is, normal), the largest value of the total number of sector rewrites (2 in the physical sector 3 in the figure).
0) is stored in the total sector rewrite count storage unit 5 as the current total number of sector rewrites. Then, the logical sector number table 1g stored in the sector having the largest total number of sector rewrites (the physical sector 3 in the example in the figure) is read out, and the logical sectors 0, 1, 2, 3, spare It is held as a physical sector number corresponding to each sector.

【0066】図14〜図16は本発明によるデータ書き
換えの説明図である。論理セクタ1の内容を書き換える
場合、(a)に示すようにセクタ管理情報保持手段10
からセクタ管理情報を参照し、論理セクタ1を保持する
物理セクタ2の全データをRAM3にコピーする
()。
FIGS. 14 to 16 are explanatory diagrams of data rewriting according to the present invention. When rewriting the contents of the logical sector 1, as shown in FIG.
Then, referring to the sector management information, all the data of the physical sector 2 holding the logical sector 1 is copied to the RAM 3 ().

【0067】次に、不揮発メモリ制御手段2は、セクタ
管理情報を参照し、予備セクタである物理セクタ4を
(b)に示すように消去すると共に、RAM3中の書き
換え対象データを書き換え、セクタ書き換え通算回数記
憶部5の書き換え回数を1つ加算して21にすると共
に、その書き換え回数をRAM3中のセクタ書き換え通
算回数格納部にも書き込む。また、セクタ管理情報の論
理セクタ1に対応する物理セクタ番号と予備セクタに対
応する物理セクタ番号を入れ換え、更新されたセクタ管
理情報の論理セクタ0,1,2,3,予備セクタに対応
する物理セクタ番号をRAM3の論理セクタ番号テーブ
ル格納部にコピーし、更にチェックサムを生成する
()。
Next, the non-volatile memory control means 2 refers to the sector management information, erases the physical sector 4 which is a spare sector as shown in (b), rewrites the data to be rewritten in the RAM 3, and rewrites the sector. The number of rewrites in the total number storage unit 5 is incremented by 1 to 21 and the number of rewrites is also written in the sector rewrite total number storage unit in the RAM 3. In addition, the physical sector number corresponding to the logical sector 1 of the sector management information and the physical sector number corresponding to the spare sector are exchanged, and the physical sectors corresponding to the logical sectors 0, 1, 2, 3, and spare sector of the updated sector management information are replaced. The sector number is copied to the logical sector number table storage of the RAM 3, and a checksum is generated ().

【0068】次に、(c)に示すようにRAM3中のデ
ータを物理セクタ4に書き込む()。そして、物理セ
クタ2が予備セクタとなる。この予備セクタの内容は、
論理セクタ1の1回前の内容となる。
Next, the data in the RAM 3 is written to the physical sector 4 as shown in FIG. Then, the physical sector 2 becomes a spare sector. The contents of this spare sector are
The content is one time before the logical sector 1.

【0069】このように構成された実施の形態例の効果
は、前述した他の実施の形態例の場合と同様である。な
お、セクタ書き換え通算回数がオーバフローしないよう
に、セクタ書き換え回数の領域を想定する最大書き換え
回数の最大値より十分大きくとる。例えば、最大書き換
え回数を100万回に設定すれば、220>100万なの
で、セクタ書き換え回数の領域を20ビット用意すれば
よい。
The effect of the embodiment configured as described above is the same as that of the other embodiments described above. In order to prevent the total number of times of sector rewriting from overflowing, the area of the number of times of sector rewriting is set to be sufficiently larger than the maximum value of the assumed maximum number of times of rewriting. For example, if the maximum number of rewrites is set to 1,000,000, since 2 20 > 1,000,000, a 20-bit sector rewrite area may be prepared.

【0070】また、回数の大小関係を循環的に考えるこ
とにする。例えば、セクタ書き換え回数の領域が8ビッ
トの時、0<1<2<3…<255<0、即ち、255
よりも0が大きいと解釈することとし、書き換え回数2
55の次は0に戻すようにすればよい。
Further, the magnitude relation of the number of times will be considered cyclically. For example, when the area of the sector rewrite frequency is 8 bits, 0 <1 <2 <3... <255 <0, that is, 255
0 is greater than
What is necessary is just to return to 0 after 55.

【0071】また、データ検証部1bは、チェックサム
の代わりに、前述した所定のビットパターンを入れるよ
うにしてもよい。また、セクタ書き換え通算回数の代わ
りに、セクタ書き換え日時を使用してもよい。
The data verifying section 1b may insert the above-mentioned predetermined bit pattern instead of the checksum. Instead of the total number of times of sector rewriting, the date and time of sector rewriting may be used.

【0072】[0072]

【発明の効果】以上、詳細に説明したように、本発明に
よれば以下の効果が得られる。 (1)請求項1記載の発明によれば、複数のセクタを有
する電気的消去、書き込みが可能でセクタ単位で消去を
行なう不揮発メモリと、該不揮発メモリにデータの消
去、データの書き込み、データの読み出しを指示し制御
を行なう不揮発メモリ制御手段と、セクタデータを一時
保持するセクタデータ一時保持手段と、どのセクタに有
効なデータが記憶されているかを示すセクタ管理情報を
保持するセクタ管理情報保持手段とを有することによ
り、セクタ管理情報保持手段を参照して予備セクタを決
めながらセクタ書き換えを行なうので、書き換えの途中
で事故が発生しても書き換え直前のデータを保護するこ
とができる。また、予備セクタは少なくとも1つ設ける
だけでよいので、書き換えに要する時間を短縮すること
ができる。
As described above, according to the present invention, the following effects can be obtained. (1) According to the first aspect of the present invention, a nonvolatile memory having a plurality of sectors and capable of performing electrical erasing and writing and erasing in sector units, erasing data, writing data, and writing data to the nonvolatile memory Non-volatile memory control means for instructing and controlling reading, sector data temporary holding means for temporarily holding sector data, and sector management information holding means for holding sector management information indicating in which sector valid data is stored Since sector rewriting is performed while determining a spare sector with reference to the sector management information holding means, even if an accident occurs during rewriting, data immediately before rewriting can be protected. Also, since only at least one spare sector needs to be provided, the time required for rewriting can be reduced.

【0073】(2)請求項2記載の発明によれば、セク
タ管理情報保持手段を参照して予備セクタを決めながら
セクタ書き換えを行なうので、書き換えの途中で事故が
発生しても書き換え直前のデータを保護することができ
る。また、予備セクタは少なくとも1つ設けるだけでよ
いので、書き換えに要する時間を短縮することができ
る。
(2) According to the second aspect of the present invention, sector rewriting is performed while determining a spare sector with reference to the sector management information holding means. Can be protected. Also, since only at least one spare sector needs to be provided, the time required for rewriting can be reduced.

【0074】(3)請求項3記載の発明によれば、電源
投入時には、前記不揮発メモリ制御手段が全てのセクタ
のセクタ管理部とデータ検証部を読み出し、この情報を
基にセクタの管理情報を作成し、セクタ管理情報保持手
段に保持することにより、以後の不揮発メモリからのデ
ータの読み出しと書き換えを誤りなく、行なうことが可
能となる。
(3) According to the third aspect of the present invention, when the power is turned on, the nonvolatile memory control means reads the sector management units and the data verification units of all the sectors, and based on the information, reads the sector management information. By making the data and storing it in the sector management information holding means, it becomes possible to read and rewrite data from the nonvolatile memory without error thereafter.

【0075】(4)請求項4記載の発明によれば、各セ
クタのセクタ管理部は、セクタが保持するデータの内容
を示すセクタ内情報(論理セクタ番号)と、該セクタが
保持するデータ(論理セクタ)を書き換えた回数を示す
情報とを含むことにより、各セクタが保持するデータの
書き換え回数を用いて、どのセクタが予備セクタである
かを判別し、セクタ管理情報を生成することにより、不
揮発メモリからのデータの読み出しと書き込みを誤りな
く行なうことが可能となる。
(4) According to the fourth aspect of the invention, the sector management unit of each sector includes information (logical sector number) in the sector indicating the content of the data held by the sector and the data (logical sector number) held by the sector. Information indicating the number of times a logical sector has been rewritten, and by using the number of times data has been rewritten in each sector, it is determined which sector is a spare sector, and sector management information is generated. Reading and writing of data from the nonvolatile memory can be performed without errors.

【0076】(5)請求項5記載の発明によれば、各セ
クタのセクタ管理部は、セクタが保持するデータの内容
を示すセクタ内情報(論理セクタ番号)と、該セクタが
保持するデータ(論理セクタ)を書き換えた時刻の順序
関係を示す書き換え順序情報とを含むことにより、各セ
クタが保持するデータの書き換え時刻の順序関係を用い
て、不揮発メモリからのデータの読み出しと、データの
書き込みを誤りなく行なうことが可能となる。
(5) According to the fifth aspect of the present invention, the sector management unit of each sector stores information (logical sector number) in the sector indicating the content of data held by the sector and data (logical sector number) held by the sector. Logical sector), the data read from the non-volatile memory and the data write can be performed by using the sequence of the data rewrite time held by each sector. It can be performed without error.

【0077】(6)請求項6記載の発明によれば、各セ
クタのセクタ管理部は、セクタが保持するデータの内容
を示すセクタ内容情報(論理セクタ番号)と、全セクタ
の書き換え時刻の順序関係を示す、全セクタ書き換え順
序情報とを含むことにより、前記全セクタ書き換え順序
情報に基づき、不揮発メモリからのデータの読み出しと
データの書き込みを誤りなく行なうことが可能となる。
(6) According to the invention described in claim 6, the sector management section of each sector includes sector content information (logical sector number) indicating the content of the data held by the sector and the order of the rewriting time of all the sectors. By including the all-sector rewrite order information indicating the relationship, it becomes possible to read data from the nonvolatile memory and write the data without error based on the all-sector rewrite order information.

【0078】(7)請求項7記載の発明によれば、各セ
クタのセクタ管理部は、各セクタが保持するデータの内
容を示す、全セクタ内容情報(論理セクタ番号テーブ
ル)と、全セクタの書き換え時刻の順序関係を示す、全
セクタ書き換え順序情報とを含むことにより、全セクタ
内容情報と全セクタの時刻の順序関係に基づいて、不揮
発メモリからのデータの読み出しとデータの書き込みを
誤りなく行なうことが可能となる。
(7) According to the seventh aspect of the present invention, the sector management unit of each sector includes all sector contents information (logical sector number table) indicating the contents of data held by each sector, By including the all-sector rewrite order information indicating the order of the rewrite times, data reading from the nonvolatile memory and data writing can be performed without error based on the all-sector content information and the order of the times of all the sectors. It becomes possible.

【0079】(8)請求項8記載の発明によれば、前記
データ検証部は、所定の特定データを含むことにより、
データ検証部がセクタデータの誤りを検出することが可
能となる。
(8) According to the eighth aspect of the present invention, the data verification unit includes predetermined specific data,
The data verification unit can detect an error in the sector data.

【0080】(9)請求項9記載の発明によれば、前記
データ検証部は、セクタ管理部とデータ部のチェックサ
ムであることにより、簡単な計算により、セクタデータ
の異常を検出することが可能となる。
(9) According to the ninth aspect of the present invention, since the data verification section is a checksum of the sector management section and the data section, it can detect an abnormality in the sector data by a simple calculation. It becomes possible.

【0081】このように、本発明によれば、書き換えの
途中で事故が発生しても書き換え直前のデータを保護す
ることができ、またセクタのデータ書き換えに要する時
間を短縮することができる不揮発メモリ装置を提供する
ことができる。
As described above, according to the present invention, even if an accident occurs during rewriting, data immediately before rewriting can be protected and the time required for rewriting data in a sector can be reduced. An apparatus can be provided.

【図面の簡単な説明】[Brief description of the drawings]

【図1】本発明によるデータの検証とセクタ管理情報の
生成を示す図である。
FIG. 1 is a diagram showing data verification and generation of sector management information according to the present invention.

【図2】本発明によるデータの書き換えの説明図であ
る。
FIG. 2 is an explanatory diagram of data rewriting according to the present invention.

【図3】本発明によるデータの書き換えの説明図であ
る。
FIG. 3 is an explanatory diagram of data rewriting according to the present invention.

【図4】本発明によるデータの書き換えの説明図であ
る。
FIG. 4 is an explanatory diagram of data rewriting according to the present invention.

【図5】本発明によるデータの検証とセクタ管理情報の
生成の説明図である。
FIG. 5 is an explanatory diagram of data verification and generation of sector management information according to the present invention.

【図6】本発明のデータの書き換えの説明図である。FIG. 6 is an explanatory diagram of data rewriting of the present invention.

【図7】本発明のデータの書き換えの説明図である。FIG. 7 is an explanatory diagram of data rewriting of the present invention.

【図8】本発明のデータの書き換えの説明図である。FIG. 8 is an explanatory diagram of data rewriting of the present invention.

【図9】本発明によるデータの検証とセクタ管理情報の
生成の説明図である。
FIG. 9 is an explanatory diagram of data verification and generation of sector management information according to the present invention.

【図10】本発明によるデータの書き換えの説明図であ
る。
FIG. 10 is an explanatory diagram of data rewriting according to the present invention.

【図11】本発明によるデータの書き換えの説明図であ
る。
FIG. 11 is an explanatory diagram of data rewriting according to the present invention.

【図12】本発明によるデータの書き換えの説明図であ
る。
FIG. 12 is an explanatory diagram of data rewriting according to the present invention.

【図13】本発明によるデータの検証とセクタ管理情報
の生成の説明図である。
FIG. 13 is an explanatory diagram of data verification and generation of sector management information according to the present invention.

【図14】本発明によるデータの書き換えの説明図であ
る。
FIG. 14 is an explanatory diagram of data rewriting according to the present invention.

【図15】本発明によるデータの書き換えの説明図であ
る。
FIG. 15 is an explanatory diagram of data rewriting according to the present invention.

【図16】本発明によるデータの書き換えの説明図であ
る。
FIG. 16 is an explanatory diagram of data rewriting according to the present invention.

【図17】従来技術1の動作説明図である。FIG. 17 is an operation explanatory diagram of the conventional technique 1.

【図18】従来技術2の検証と復帰の説明図である。FIG. 18 is an explanatory diagram of verification and restoration according to the related art 2.

【図19】従来技術2のセクタ書き換えの説明図であ
る。
FIG. 19 is an explanatory diagram of sector rewriting according to Prior Art 2.

【符号の説明】[Explanation of symbols]

1 不揮発メモリ 1a 実データ部 1b データ検証部 1c セクタ書き換え回数記憶部 1d 論理セクタ番号記憶部 2 不揮発メモリ制御手段 3 セクタデータ一時保持手段 10 セクタ管理情報保持手段 DESCRIPTION OF SYMBOLS 1 Non-volatile memory 1a Actual data part 1b Data verification part 1c Sector rewrite frequency storage part 1d Logical sector number storage part 2 Non-volatile memory control means 3 Sector data temporary holding means 10 Sector management information holding means

Claims (9)

【特許請求の範囲】[Claims] 【請求項1】 複数のセクタを有する電気的消去、書き
込みが可能でセクタ単位で消去を行なう不揮発メモリ
と、 該不揮発メモリにデータの消去、データの書き込み、デ
ータの読み出しを指示し制御を行なう不揮発メモリ制御
手段と、 セクタデータを一時保持するセクタデータ一時保持手段
と、 どのセクタに有効なデータが記憶されているかを示すセ
クタ管理情報を保持するセクタ管理情報保持手段とを有
することを特徴とする不揮発メモリ装置。
1. A nonvolatile memory having a plurality of sectors and capable of electrically erasing and writing and performing erasing in sector units, and a nonvolatile memory for instructing and controlling data erasing, data writing, and data reading in the nonvolatile memory. Memory control means; sector data temporary holding means for temporarily holding sector data; and sector management information holding means for holding sector management information indicating in which sector valid data is stored. Non-volatile memory device.
【請求項2】 前記不揮発メモリは、有効なデータを記
憶する1つ以上の有効セクタと、有効なデータを記憶し
ていない少なくとも1つの予備のセクタから構成され、 各有効セクタと各予備セクタは、セクタ管理部と、実デ
ータ部と、データ検証部からなり、 データを読み出す時は不揮発メモリ制御手段が、セクタ
管理情報保持手段内に保持されているセクタ管理情報を
参照して所望のデータがどのセクタにあるかを判別して
読み出し、 データを書き換える際は、不揮発メモリ制御手段が予備
セクタを消去し、 それと同時若しくは前後に、セクタ管理情報保持手段内
に保持されているセクタ管理情報を参照して書き換え対
象のデータがどのセクタにあるかを判別して、該セクタ
のセクタ管理部と、実データ部を読み出してセクタデー
タ一時保持手段に格納し、 セクタデータ一時保持手段に格納した実データ部の書き
換え対象部分を更新すると共に、所定のアルゴリズムに
基づいてセクタ管理部の内容を更新し、また所定のアル
ゴリズムに基づいてデータ検証部を生成し、 該更新されたセクタデータ一時保持手段内の実データ部
とセクタ管理部とデータ検証部を、前記消去した予備セ
クタに書き込むと共に、 セクタ管理情報保持手段内のセクタ管理情報を更新する
ことを特徴とする請求項1記載の不揮発メモリ装置。
2. The non-volatile memory comprises at least one valid sector for storing valid data and at least one spare sector not storing valid data. Each valid sector and each spare sector are A non-volatile memory control means for reading out the data by referring to the sector management information held in the sector management information holding means. When determining which sector is located and reading out and rewriting data, the nonvolatile memory control means erases the spare sector and refers to the sector management information held in the sector management information holding means at the same time or before or after that. To determine in which sector the data to be rewritten is located, read the sector management section of the sector and the actual data section to temporarily store the sector data. In addition to updating the rewrite target portion of the actual data portion stored in the sector data temporary holding unit and updating the contents of the sector management unit based on a predetermined algorithm, and performing data verification based on a predetermined algorithm And writing the actual data part, the sector management part and the data verification part in the updated sector data temporary holding means to the erased spare sector and updating the sector management information in the sector management information holding means. The nonvolatile memory device according to claim 1, wherein:
【請求項3】 電源投入時には、前記不揮発メモリ制御
手段が全てのセクタのセクタ管理部とデータ検証部を読
み出し、この情報を基にセクタの管理情報を作成し、セ
クタ管理情報保持手段に保持することを特徴とする請求
項2記載の不揮発メモリ装置。
3. When power is turned on, the non-volatile memory control means reads out the sector management units and data verification units of all sectors, creates sector management information based on the information, and holds the sector management information in the sector management information holding unit. 3. The non-volatile memory device according to claim 2, wherein:
【請求項4】 各セクタのセクタ管理部は、 セクタが保持するデータの内容を示すセクタ内情報(論
理セクタ番号)と、該セクタが保持するデータ(論理セ
クタ)を書き換えた回数を示す情報とを含むことを特徴
とする請求項3記載の不揮発メモリ装置。
4. The sector management section of each sector includes: information within a sector (logical sector number) indicating the content of data held by the sector; and information indicating the number of times data (logical sector) held by the sector has been rewritten. 4. The nonvolatile memory device according to claim 3, comprising:
【請求項5】 各セクタのセクタ管理部は、 セクタが保持するデータの内容を示すセクタ内情報(論
理セクタ番号)と、該セクタが保持するデータ(論理セ
クタ)を書き換えた時刻の順序関係を示す書き換え順序
情報(論理セクタ書き換え順序)とを含むことを特徴と
する請求項3記載の不揮発メモリ装置。
5. The sector management section of each sector stores information on the contents of the data held by the sector (logical sector number) and the order of the time at which the data (logical sector) held by the sector is rewritten. 4. The nonvolatile memory device according to claim 3, further comprising rewriting order information (logical sector rewriting order).
【請求項6】 各セクタのセクタ管理部は、 セクタが保持するデータの内容を示すセクタ内容情報
(論理セクタ番号)と、全セクタの書き換え時刻の順序
関係を示す、全セクタ書き換え順序情報とを含むことを
特徴とする請求項3記載の不揮発メモリ装置。
6. The sector management unit of each sector stores sector content information (logical sector number) indicating the content of data held by the sector and all sector rewrite order information indicating an order relationship of rewrite times of all sectors. The nonvolatile memory device according to claim 3, further comprising:
【請求項7】 各セクタのセクタ管理部は、 各セクタが保持するデータの内容を示す全セクタ内容情
報(論理セクタ番号テーブル)と、全セクタの書き換え
時刻の順序関係を示す、全セクタ書き換え順序情報とを
含むことを特徴とする請求項3記載の不揮発メモリ装
置。
7. A sector management unit for each sector, wherein: all sector content information (logical sector number table) indicating the content of data held by each sector; The nonvolatile memory device according to claim 3, further comprising information.
【請求項8】 前記データ検証部は、所定の特定データ
を含むことを特徴とする請求項1乃至7の何れかに記載
の不揮発メモリ装置。
8. The nonvolatile memory device according to claim 1, wherein said data verification unit includes predetermined specific data.
【請求項9】 前記データ検証部は、セクタ管理部とデ
ータ部のチェックサムであることを特徴とする請求項1
乃至7の何れかに記載の不揮発メモリ装置。
9. The data verification unit according to claim 1, wherein the data verification unit is a checksum of a sector management unit and a data unit.
8. The nonvolatile memory device according to any one of claims 1 to 7.
JP11229444A 1999-08-13 1999-08-13 Non-volatile memory device Pending JP2001051910A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP11229444A JP2001051910A (en) 1999-08-13 1999-08-13 Non-volatile memory device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP11229444A JP2001051910A (en) 1999-08-13 1999-08-13 Non-volatile memory device

Publications (2)

Publication Number Publication Date
JP2001051910A true JP2001051910A (en) 2001-02-23
JP2001051910A5 JP2001051910A5 (en) 2004-09-02

Family

ID=16892317

Family Applications (1)

Application Number Title Priority Date Filing Date
JP11229444A Pending JP2001051910A (en) 1999-08-13 1999-08-13 Non-volatile memory device

Country Status (1)

Country Link
JP (1) JP2001051910A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002366420A (en) * 2001-06-08 2002-12-20 Nec Corp Nonvolatile memory and its rewriting control method
JP2006018594A (en) * 2004-07-01 2006-01-19 Mitsubishi Electric Corp Information processing device
KR100816120B1 (en) 2006-12-27 2008-03-21 주식회사 하이닉스반도체 Method for exchanging data between blocks of a nonvolatile memory device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002366420A (en) * 2001-06-08 2002-12-20 Nec Corp Nonvolatile memory and its rewriting control method
JP2006018594A (en) * 2004-07-01 2006-01-19 Mitsubishi Electric Corp Information processing device
KR100816120B1 (en) 2006-12-27 2008-03-21 주식회사 하이닉스반도체 Method for exchanging data between blocks of a nonvolatile memory device

Similar Documents

Publication Publication Date Title
JP4031190B2 (en) MEMORY CARD, NONVOLATILE MEMORY, NONVOLATILE MEMORY DATA WRITE METHOD AND DATA WRITE DEVICE
JP3232089B2 (en) Method and apparatus for updating information in a memory and use of the method and apparatus on a memory card
JP4268396B2 (en) Non-volatile memory device file management that can be programmed once
JP3178909B2 (en) Semiconductor memory device
US6865658B2 (en) Nonvolatile data management system using data segments and link information
JP2002351685A (en) Data updating method and controller for nonvolatile memory
JP4480815B2 (en) Memory rewriting method and computer system
US6606683B2 (en) Information recording apparatus and control method thereof
US6839798B1 (en) Flash memory capable of storing frequently rewritten data
KR20060012696A (en) A flash memory device having a bad block management function and a bad block management method of the flash memory device.
JP4315488B2 (en) Data storage device, data processing device, data processing system and data processing method
JP2008533574A (en) Method and apparatus for rewriting semiconductor memory means erasable in sector units into first sector
CN107239411B (en) Memory management method and system for vehicle-mounted controller
KR100291807B1 (en) A nonvolatile storage device and control method therefor
JP2008077221A (en) Vehicular control device
JP2001051910A (en) Non-volatile memory device
JP2008504628A (en) Safe flushing
JPH07248978A (en) Nonvolatile memory
JP7219813B2 (en) Arithmetic processing device, vehicle control device and update method
US7313648B2 (en) Corruption tolerant method and system for deploying and modifying data in flash memory
JP4602387B2 (en) MEMORY CARD, NONVOLATILE MEMORY, NONVOLATILE MEMORY DATA WRITE METHOD AND DATA WRITE DEVICE
JP4031693B2 (en) Nonvolatile memory and data storage device having the same
US7849279B2 (en) Method for the secure updating data areas in non volatile memory, device to perform such a method
JP3583639B2 (en) Method of updating data in memory device
JPH10161942A (en) Method, device for storing information, and information processor

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20060328

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20060404

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20060808