JPH11282765A - External storage device using flash memory - Google Patents
External storage device using flash memoryInfo
- Publication number
- JPH11282765A JPH11282765A JP8080298A JP8080298A JPH11282765A JP H11282765 A JPH11282765 A JP H11282765A JP 8080298 A JP8080298 A JP 8080298A JP 8080298 A JP8080298 A JP 8080298A JP H11282765 A JPH11282765 A JP H11282765A
- Authority
- JP
- Japan
- Prior art keywords
- data
- flash memory
- writing
- write
- address
- 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
Links
Landscapes
- Techniques For Improving Reliability Of Storages (AREA)
- Read Only Memory (AREA)
Abstract
(57)【要約】
【課題】フラッシュメモリは書込み時間が大きいため、
停電時にフラッシュメモリを使用した外部記憶装置に書
込みを行うと、データや管理情報が不定となり、外部記
憶装置に格納されたデータの破壊が起きる可能性があ
る。
【解決手段】本発明は、記憶媒体として使用されるフラ
ッシュメモリ,ホストインタフェース,フラッシュメモ
リを制御する制御回路,ホストインタフェースと制御回
路の間のホストインタフェースバス,ホストインタフェ
ース制御線,フラッシュメモリと制御回路の間のメモリ
アドレスバス,メモリデータバス,メモリ制御線からな
る。
(57) [Summary] [Problem] Because flash memory has a long writing time,
If data is written to an external storage device using a flash memory at the time of a power failure, data and management information become unstable, and data stored in the external storage device may be destroyed. A flash memory used as a storage medium, a host interface, a control circuit for controlling the flash memory, a host interface bus between the host interface and the control circuit, a host interface control line, a flash memory and a control circuit , A memory address bus, a memory data bus, and a memory control line.
Description
【0001】[0001]
【発明の属する技術分野】本発明は、不揮発性メモリで
あるフラッシュメモリを用いたコンピュータの外部記憶
装置のデータ書込み中の停電時のデータ破壊を防ぐ技術
分野に属する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention belongs to the technical field of preventing data destruction at the time of a power failure during data writing to an external storage device of a computer using a flash memory as a nonvolatile memory.
【0002】[0002]
【従来の技術】外部記憶装置としては磁気ディスクドラ
イブ(ハードディスクドライブ、以下H/Dと記す)が
ある。H/Dは大容量であるが機械部品を使用している
ため、衝撃や振動に弱い欠点がある。この欠点を解消す
るためにフラッシュメモリを記憶媒体に使用した外部記
憶装置が開発された。2. Description of the Related Art As an external storage device, there is a magnetic disk drive (hard disk drive, hereinafter referred to as H / D). H / D has a large capacity, but has drawbacks that it is susceptible to shock and vibration because it uses mechanical parts. To solve this drawback, an external storage device using a flash memory as a storage medium has been developed.
【0003】外部記憶装置はセクタ単位で読み出しや書
込みのアクセスを行う。セクタのサイズとしては512
バイトがよく使用されている。An external storage device performs read and write access in sector units. The size of the sector is 512
Bytes are often used.
【0004】フラッシュメモリはその素子の構造から、
書込みを行う前に消去を行う必要がある。また、読み出
しアクセス時間は速いが、消去時間と書込み時間が大き
い。更に、フラッシュメモリは現状では書込み回数に1
05 回という制限がある。フラッシュメモリ内の一定個
所が書込みの集中により書込み回数の制限に達した場
合、フラッシュメモリのその他の領域が使用可能であっ
ても、外部記憶装置としては、使用不可能となる。A flash memory has a structure of its element,
Erasing must be performed before writing. The read access time is fast, but the erase time and the write time are long. Furthermore, the flash memory currently has a
There is a limit of 0 5 times. When a certain portion in the flash memory reaches the limit of the number of times of writing due to concentration of writing, even if other areas of the flash memory can be used, they cannot be used as an external storage device.
【0005】そのため、従来はフラッシュメモリをセク
タサイズのデータを格納する物理セクタに分割し、リン
グバッファ形式でホストからの書込みデータをフラッシ
ュメモリのアドレスの小さい物理セクタからアドレス大
きい物理セクタへ書込んでいく追記型のデータ書込み方
式が取られていた。この追記型のデータ書込み方式によ
り、書込み前の消去待ち時間の削減と、フラッシュメモ
リの内の一定個所への書込みの集中を避けることによ
り、フラッシュメモリの寿命を延ばし、フラッシュメモ
リを用いた外部記憶装置の寿命を延ばすことが可能とな
る。For this reason, conventionally, the flash memory is divided into physical sectors for storing data of a sector size, and write data from the host is written in a ring buffer format from a physical sector having a small address to a physical sector having a large address in the flash memory. Some write-once data writing methods were used. This write-once type data writing method reduces the erasing wait time before writing and avoids the concentration of writing to a certain part of the flash memory, thereby extending the life of the flash memory and reducing external storage using the flash memory. It is possible to extend the life of the device.
【0006】[0006]
【発明が解決しようとする課題】従来の方式では、フラ
ッシュメモリ内の物理セクタは、ホストからの書込みデ
ータを保持するデータ領域と管理領域に分け、管理領域
にはホストのアクセスアドレスである論理セクタアドレ
スとデータ領域に書かれたデータの有効性を表す無効化
フラグを設けていた。In the conventional method, the physical sector in the flash memory is divided into a data area for holding write data from the host and a management area, and the management area has a logical sector which is an access address of the host. An invalidation flag indicating the validity of the data written in the address and the data area is provided.
【0007】ホストからのデータの書込み時は、ホスト
からの書込みデータをフラッシュメモリの物理セクタの
データ領域に書込んだ後に物理セクタの管理領域にホス
トのアクセスアドレスである論理セクタアドレスを書込
む。ホストからの書込みデータを格納する物理セクタは
次の物理セクタのアドレスに更新される。When writing data from the host, the write data from the host is written to the data area of the physical sector of the flash memory, and then the logical sector address, which is the access address of the host, is written to the management area of the physical sector. The physical sector storing the write data from the host is updated to the address of the next physical sector.
【0008】フラッシュメモリを用いた外部記憶装置で
は、制御回路を持ち、制御回路内にホストからのアクセ
スアドレスである論理セクタアドレスをフラッシュメモ
リ内の物理セクタアドレスに変換するマッピングテーブ
ルと、ホストからの次の書込みデータを格納する物理セ
ンタのアドレスを示すポインタを持つ。マッピングテー
ブルとポインタはホストからの書込みのたびに更新され
るため、RAM上に作成される。An external storage device using a flash memory has a control circuit. The control circuit has a mapping table for converting a logical sector address, which is an access address from the host, into a physical sector address in the flash memory. It has a pointer indicating the address of the physical center that stores the next write data. The mapping table and pointer are updated on every write from the host, and are therefore created on the RAM.
【0009】外部記憶装置の電源断時はRAMの内容は
消えるため、外部記憶装置の電源投入時に制御回路がフ
ラッシュメモリの各物理セクタの管理領域にアクセス
し、マッピングテーブルとポインタを作成する。ポイン
タは、フラッシュメモリの書込みを行わない部分は、消
去後の初期値(通常ビットの値で1)をとることを利用
し、管理領域の論理セクタアドレスが初めてフラッシュ
メモリの初期値をとる物理セクタのアドレスとする。When the power of the external storage device is turned off, the contents of the RAM are erased. Therefore, when the power of the external storage device is turned on, the control circuit accesses the management area of each physical sector of the flash memory and creates a mapping table and a pointer. The pointer uses the initial value after erasure (normal bit value is 1) for the portion where writing to the flash memory is not performed, and uses the physical sector in which the logical sector address of the management area takes the initial value of the flash memory for the first time. Address.
【0010】しかし、フラッシュメモリに書込み中に停
電が起きた場合、書込み箇所のデータは不定となる。ま
た、物理セクタのデータ領域に書込み中に停電が起きた
場合、物理セクタのデータ領域のデータは不定になる。
従来の方法では、復電時に作成されるポインタの値は停
電中に書込みを行っていた物理セクタのアドレスとな
り、データ領域には不定のデータが書込まれているにも
関わらず、ホストから書込みデータが書込まれるため、
正常なデータの書込みを行えなくなる。[0010] However, if a power failure occurs during writing to the flash memory, the data at the writing location is undefined. If a power failure occurs during writing to the data area of the physical sector, the data in the data area of the physical sector becomes undefined.
In the conventional method, the value of the pointer created at the time of power recovery is the address of the physical sector that was being written during the power failure, and the data area was written by the host even though indefinite data was written. Because the data is written,
Normal data cannot be written.
【0011】また、管理領域の論理セクタアドレスの書
込み中に停電が起きた場合、書込み中の論理セクタアド
レスが不定となる。この値をxとすると、xが実際に存
在する論理セクタアドレスの場合、復電時に作成される
マッピングテーブルの論理セクタアドレスxに対する物
理セクタアドレスの値が実際とは異なることとなり、ホ
ストの書込んだデータとは、異なったデータが読み出さ
れることとなる。If a power failure occurs during the writing of the logical sector address in the management area, the logical sector address being written becomes undefined. Assuming that this value is x, if x is a logical sector address that actually exists, the value of the physical sector address for the logical sector address x in the mapping table created at the time of power restoration will be different from the actual value, Different data is read from the data.
【0012】以上述べたように、従来の方法では、フラ
ッシュメモリに書込み中に停電が起きた場合に、外部記
憶装置内のデータが破壊されるという問題点がある。As described above, the conventional method has a problem that data in an external storage device is destroyed when a power failure occurs during writing to a flash memory.
【0013】本発明により、書込み前の消去待ち時間の
削減と、フラッシュメモリ内の一定個所への書込みの集
中を避けることにより、フラッシュメモリの寿命を延ば
し、フラッシュメモリを用いた外部記憶装置の寿命を延
ばすことを可能としつつ、フラッシュメモリを使用した
外部記憶装置の書込み中の停電に伴う格納データの破壊
を避け、格納データの有効性を保証することを可能とす
る。According to the present invention, the life of the flash memory is extended by reducing the erasing wait time before writing and avoiding the concentration of writing at a certain location in the flash memory, and the life of the external storage device using the flash memory. While avoiding destruction of stored data due to a power failure during writing to an external storage device using a flash memory, and ensuring the validity of the stored data.
【0014】[0014]
【課題を解決するための手段】本発明の目的は、ホスト
インタフェース,記憶媒体として使用されるフラッシュ
メモリ,ホストインタフェース,フラッシュメモリを制
御する制御回路,ホストインタフェースと制御回路の間
のホストインタフェースバス,ホストインタフェース制
御線,フラッシュメモリと制御回路の間のメモリアドレ
スバス,メモリデータバス,メモリ制御線からなる。An object of the present invention is to provide a host interface, a flash memory used as a storage medium, a host interface, a control circuit for controlling the flash memory, a host interface bus between the host interface and the control circuit, It comprises a host interface control line, a memory address bus between the flash memory and the control circuit, a memory data bus, and a memory control line.
【0015】[0015]
【発明の実施の形態】以下、図面を用いて本発明の実施
形態を説明する。図1は、本発明の構成例を示す図であ
る。100は本発明であるフラッシュメモリを使用した
外部記憶装置でありホスト200と接続される。1はホ
ストインタフェースである。2は本発明の記憶媒体とし
て使われるフラッシュメモリである。3は制御回路でホ
ストインタフェース1,フラッシュメモリ2を制御す
る。制御回路3はホストインタフェースバス4,ホスト
インタフェース制御線5を介してホストインタフェース
1を制御する。フラッシュメモリ2はメモリアドレスバ
ス6,メモリデータバス7,メモリ制御線8を介して制
御回路3により制御される。Embodiments of the present invention will be described below with reference to the drawings. FIG. 1 is a diagram showing a configuration example of the present invention. An external storage device 100 using the flash memory according to the present invention is connected to the host 200. 1 is a host interface. Reference numeral 2 denotes a flash memory used as a storage medium of the present invention. A control circuit 3 controls the host interface 1 and the flash memory 2. The control circuit 3 controls the host interface 1 via the host interface bus 4 and the host interface control line 5. The flash memory 2 is controlled by a control circuit 3 via a memory address bus 6, a memory data bus 7, and a memory control line 8.
【0016】図2はフラッシュメモリ2の構成である。
フラッシュメモリ2内部はデータの読み書きの単位であ
る物理セクタ20に分けられる。セクタのデータのサイ
ズとしては512バイトがよく使用されている。FIG. 2 shows the configuration of the flash memory 2.
The inside of the flash memory 2 is divided into physical sectors 20, which are data read / write units. 512 bytes are often used as the size of the sector data.
【0017】図3は、物理セクタ20の構成を表す。物
理セクタ20はホスト200からの書込みデータと格納
するデータ領域21と物理セクタの管理情報を格納する
管理領域22から構成される。FIG. 3 shows the configuration of the physical sector 20. The physical sector 20 includes a data area 21 for storing write data from the host 200 and a management area 22 for storing management information of the physical sector.
【0018】図4は、従来の方式における管理領域22
の構成である。データ領域21に書込まれたデータに対
するホスト200のアクセスアドレスである論理セクタ
アドレス23とデータ領域21に書込まれたデータの有
効性を示す無効フラグ24から構成される。FIG. 4 shows the management area 22 in the conventional system.
It is a structure of. It is composed of a logical sector address 23, which is an access address of the host 200 for data written in the data area 21, and an invalid flag 24 indicating the validity of the data written in the data area 21.
【0019】図5は、今回提案する方式における管理領
域22の構成である。論理セクタアドレス23と無効フ
ラグ24に加え、データ領域21の書込み開始を表す書
込み開始フラグ25,データ領域21へのデータの書込
みと管理領域22の論理セクタアドレス23の書込みが
終了したことを示す書込み終了フラグ26から構成され
る。FIG. 5 shows the configuration of the management area 22 in the method proposed this time. In addition to the logical sector address 23 and the invalid flag 24, a write start flag 25 indicating the start of writing in the data area 21, a write indicating that writing of data to the data area 21 and writing of the logical sector address 23 of the management area 22 have been completed. It consists of an end flag 26.
【0020】図6は、ホスト200から外部記憶装置1
00にデータの書込みがあった際のフラッシュメモリ2
へのデータの書込み方法を示す。フラッシュメモリはそ
の素子の構造から、書込みを行う前に消去を行う必要が
ある。また、読み出しアクセス時間は速いが、消去時間
と書込み時間が大きい。更に、フラッシュメモリは現状
では書込み回数に105 回という制限がある。フラッシ
ュメモリ内の一定個所が書込みの集中により書込み回数
の制限に達した場合、フラッシュメモリのその他の領域
が使用可能であっても、外部記憶装置としては、使用不
可能となる。FIG. 6 shows a state in which the host 200 sends the external storage device 1.
Flash memory 2 when data was written to 00
The method of writing data to the memory will be described. Due to the structure of the flash memory, erasing must be performed before writing. The read access time is fast, but the erase time and the write time are long. In addition, flash memory is at present there is a limit of 10 5 times the number of writes. When a certain portion in the flash memory reaches the limit of the number of times of writing due to concentration of writing, even if other areas of the flash memory can be used, they cannot be used as an external storage device.
【0021】そのため、図6に示すように、リングバッ
ファ形式でホスト200からの書込みデータをフラッシ
ュメモリ2のアドレスの小さい物理セクタ20からアド
レス大きい物理セクタ20へ書込んでいく追記型のデー
タ書込み方式を取る。図6において、ホスト200から
外部記憶装置100に対し、N−1回の書込みがあった
とする。網掛けの物理セクタ20は書込み済の物理セク
タを表し、ホスト200からの書込みデータは網掛けの物
理セクタ20に格納されている。Therefore, as shown in FIG. 6, a write-once data write method in which write data from the host 200 is written in the ring buffer format from the physical sector 20 having a small address to the physical sector 20 having a large address in the flash memory 2. I take the. In FIG. 6, it is assumed that the host 200 has written N-1 times to the external storage device 100. The shaded physical sector 20 represents a written physical sector, and write data from the host 200 is stored in the shaded physical sector 20.
【0022】追記型のデータ書込み方式では、書込みを
行っていない空物理セクタの先頭が次のホスト200か
らの書込みデータを格納する物理セクタとなる。図6で
は、N回目(次回)書込みと書かれた物理セクタ20が
ホスト200からの次の書込みデータを格納する物理セ
クタである。図6において、N回目(次回)書込みと書
かれた物理セクタに書込みが行われたら、次にホスト2
00からの書込みデータを格納するのは、N回目(次
回)書込みと書かれた物理セクタとなる。In the write-once type data writing method, the head of an empty physical sector to which data has not been written is a physical sector for storing write data from the next host 200. In FIG. 6, the physical sector 20 in which the N-th (next) write is written is a physical sector in which the next write data from the host 200 is stored. In FIG. 6, if writing is performed on the physical sector written as N-th (next) writing, then the host 2
The write data starting from 00 is stored in the physical sector written as the Nth (next) write.
【0023】この追記型のデータ書込み方式により、書
込み前の消去待ち時間の削減と、フラッシュメモリ2内
の一定個所への書込みの集中を避けることにより、フラ
ッシュメモリ2の寿命を延ばし、フラッシュメモリ2を
用いた外部記憶装置100の寿命を延ばすことが可能と
なる。This write-once type data writing method reduces the erasing wait time before writing and avoids the concentration of writing at a certain location in the flash memory 2, thereby extending the life of the flash memory 2. It is possible to prolong the life of the external storage device 100 using the.
【0024】外部記憶装置100では、制御回路3内に
論理セクタアドレスをフラッシュメモリ内の物理セクタ
アドレスに変換するマッピングテーブルと、ホストから
の次の書込みデータを格納する物理セクタのアドレスを
示すポインタを持つ。In the external storage device 100, a mapping table for converting a logical sector address into a physical sector address in the flash memory and a pointer indicating the address of the physical sector for storing the next write data from the host are stored in the control circuit 3. Have.
【0025】図7は、ホスト200から外部記憶装置1
00へ論理セクタアドレスAのデータが書込まれた時の
フラッシュメモリ2の状態の変化を表す。図7の上部は
ホスト200からの書込みデータをフラッシュメモリ2
に書込んでいる様子を示す。論理ホストアドレスAの旧
データは先頭の物理セクタに格納されており、ホスト2
00からのデータの書込みが終了していないため、有効
なデータとして扱われる。網掛けの部分は書込み済の物
理セクタであるため、物理アドレスA新データ書込みと
書かれた。空物理セクタの先頭の物理セクタのアドレス
がポインタとなる。FIG. 7 is a diagram showing the external storage device 1 from the host 200.
This represents a change in the state of the flash memory 2 when data of the logical sector address A is written to 00. The upper part of FIG. 7 stores write data from the host 200 in the flash memory 2.
Shows that writing is in progress. The old data of the logical host address A is stored in the first physical sector.
Since the writing of data from 00 has not been completed, it is treated as valid data. Since the shaded portion is a written physical sector, the physical address A new data write is written. The address of the leading physical sector of the empty physical sector is used as a pointer.
【0026】図7の下部はホスト300からの書込みデ
ータのフラッシュメモリ2への書込みが終了した後の様
子を示す。論理アドレスA新データ書込み終了と書かれ
た物理セクタはホスト200からのデータの書込みが終
了したため、網掛けになっている。そして、論理セクタ
アドレスAの旧データを格納していた先頭の物理セクタ
は無効化が実行されている。The lower part of FIG. 7 shows a state after the writing of the write data from the host 300 to the flash memory 2 is completed. The physical sector in which the writing of the logical address A new data has been written is shaded because the writing of data from the host 200 has been completed. Then, the first physical sector storing the old data of the logical sector address A is invalidated.
【0027】マッピングテーブルの論理セクタアドレス
Aに対応する物理セクタアドレスは図7の先頭の物理セ
クタアドレスから論理アドレスA新データ書込み終了と
書かれた物理セクタのアドレスに変更される。ポインタ
は、論理アドレスA新データ書込み終了と書かれた物理
セクタのアドレスからその次の物理セクタのアドレスに
変更される。The physical sector address corresponding to the logical sector address A in the mapping table is changed from the first physical sector address in FIG. 7 to the address of the physical sector in which the writing of the logical address A new data is completed. The pointer is changed from the address of the physical sector in which the writing of the logical address A new data is completed to the address of the next physical sector.
【0028】図8〜図10は、従来の方法における図7
の動作の詳細を示す。図8〜図10の上側の物理セクタ
は図7の先頭の物理セクタを表し、図8〜図10の下側
の物理セクタは図7の論理アドレスAの新データの書込
みが行われている物理センタを示す。フラッシュメモリ
2の消去実行後のデータの初期値はビット値で1とす
る。FIGS. 8 to 10 show a conventional method of FIG.
The details of the operation will be described. The upper physical sector in FIGS. 8 to 10 represents the first physical sector in FIG. 7, and the lower physical sector in FIG. 8 to FIG. Indicates the center. The initial value of the data after the execution of the erasure of the flash memory 2 is 1 as a bit value.
【0029】図8では、ホスト200からの書込みデー
タを下側の物理セクタ20のデータ領域21へ書込みの
実行を表している。論理セクタアドレスAの旧データを
格納している上側の物理セクタ20ではデータ領域21
と論理セクタアドレス23が書込み終了となっている。FIG. 8 shows execution of writing of write data from the host 200 to the data area 21 of the lower physical sector 20. In the upper physical sector 20 storing the old data of the logical sector address A, the data area 21
And the logical sector address 23 has been written.
【0030】図9は、図8の次の動作で、下側の物理セ
クタ20のデータ領域21の書込みが終了したため、論
理セクタアドレス23にAを書込んでいる。FIG. 9 shows that the A is written to the logical sector address 23 because the writing of the data area 21 of the lower physical sector 20 has been completed in the next operation of FIG.
【0031】図10は、図9の次の動作で、下側の物理
セクタ20にホスト200からの新規書込みデータの書
込みと論理セクタアドレスAの書込みが終了したため、
旧データを格納している上側の物理セクタ20の無効フ
ラグをフラッシュメモリの初期値である1から0に書き
換え、上側の物理セクタ20に格納されたデータを無効
化している。FIG. 10 shows the next operation of FIG. 9 because the writing of new write data from the host 200 and the writing of the logical sector address A to the lower physical sector 20 have been completed.
The invalid flag of the upper physical sector 20 storing the old data is rewritten from 1 which is the initial value of the flash memory to 0, and the data stored in the upper physical sector 20 is invalidated.
【0032】物理セクタ20に格納されたデータの無効
化は、フラッシュメモリ2の消去単位である消去ブロッ
クが物理セクタ20の大きさよりも大きい時の消去に備
えて行う。次の書込みに向けて消去ブロックの消去を行
う場合、消去の対象となる消去ブロック内の各物理セク
タ20の無効フラグ26を調べ、有効なデータを含む物
理セクタがあったら、空物理セクタに移して無効化して
から消去ブロックの消去を行う。The invalidation of data stored in the physical sector 20 is performed in preparation for erasure when an erase block, which is an erase unit of the flash memory 2, is larger than the size of the physical sector 20. When erasing an erase block for the next write, the invalid flag 26 of each physical sector 20 in the erase block to be erased is checked, and if there is a physical sector containing valid data, it is moved to an empty physical sector. And then erase the erase block.
【0033】図11〜図15に今回提案する方法におけ
る図7の動作の詳細を示す。図8〜図10に比べてデー
タ領域21の書込み前に、書込み開始フラグ25に0を
書込み、初期値の1から0に書換えている点と論理セク
タアドレス23の書込み後に書込み終了フラグ26に0
を書込み初期値の1から0に書換えている点が異なる。
書込み開始フラグ25への0の書込みは図11が表して
おり、書込み終了フラグ26への0の書込みは図14が
表している。図12は図8に、図13は図9に、図15
は図10に対応している。FIGS. 11 to 15 show details of the operation of FIG. 7 in the method proposed this time. Compared to FIGS. 8 to 10, 0 is written in the write start flag 25 before writing in the data area 21, and the write end flag 26 is written in the write end flag 26 after writing the logical sector address 23.
Is rewritten from the write initial value 1 to 0.
FIG. 11 shows the writing of 0 to the writing start flag 25, and FIG. 14 shows the writing of 0 to the writing end flag 26. 12 is shown in FIG. 8, FIG. 13 is shown in FIG.
Corresponds to FIG.
【0034】マッピングテーブルとポインタはホスト2
00からの書込みのたびに更新されるため、制御回路3
のRAM上に作成される。外部記憶装置100の電源断
時はRAMの内容は消えるため、外部記憶装置100の
電源投入時に制御回路3がフラッシュメモリ2の各物理
セクタ20の管理領域22にアクセスし、マッピングテ
ーブルとポインタを作成する。The mapping table and the pointer are stored in the host 2
Since it is updated every time data is written from 00, the control circuit 3
Is created on the RAM. When the power of the external storage device 100 is turned off, the contents of the RAM are erased. Therefore, when the power of the external storage device 100 is turned on, the control circuit 3 accesses the management area 22 of each physical sector 20 of the flash memory 2 and creates a mapping table and a pointer. I do.
【0035】従来の方法では、管理領域22には論理セ
クタアドレス23と無効化フラグ24のみしか含まれて
ないため、マッピングテーブルは論理セクタアドレス2
3が初期値ではなく、実際に存在する論理セクタアドレ
スの範囲をとり、無効化フラグ24が0でない物理セク
タの論理セクタアドレス23と論理セクタアドレスとの
対応表を作ることにより作成する。In the conventional method, since the management area 22 contains only the logical sector address 23 and the invalidation flag 24, the mapping table stores the logical sector address 2
3 is not an initial value, but takes a range of a logical sector address that actually exists, and is created by creating a correspondence table between the logical sector address 23 and the logical sector address of the physical sector in which the invalidation flag 24 is not 0.
【0036】同じ論理セクタアドレス23の値を持つ物
理セクタ20が複数個存在した場合は、フラッシュメモ
リ2に追記型で書込みを行っていることから最後に書込
みが行われた物理セクタ20を割り出し、その物理セク
タのアドレスをマッピングテーブルに登録する。ポイン
タは、物理セクタ20の書込みを行わない部分は、論理
セクタアドレス23がビットの値で1となる初期値をと
ることを利用し、管理領域22の論理セクタアドレス2
3が初めて初期値をとる物理セクタ20のアドレスとす
る。When there are a plurality of physical sectors 20 having the same value of the logical sector address 23, since the write-once type is being written to the flash memory 2, the last written physical sector 20 is determined. The address of the physical sector is registered in the mapping table. The pointer uses the fact that the logical sector address 23 has an initial value of 1 as a bit value for the portion where the physical sector 20 is not written, and uses the logical sector address 2 of the management area 22 as the pointer.
3 is the address of the physical sector 20 that takes the initial value for the first time.
【0037】上記の方法で外部記憶装置100のフラッ
シュメモリ2のデータ管理を行った場合、フラッシュメ
モリ2への書込みを行っていない時に停電が起きたり電
源断になった場合は、外部記憶装置100内に格納され
たデータの破壊は起こらない。しかし、物理セクタ20
への書込み中に停電が起きた場合、外部記憶装置100内
に格納されたデータの破壊が起こる。When data is managed in the flash memory 2 of the external storage device 100 by the above-described method, if a power failure occurs or power is cut off while writing to the flash memory 2 is not performed, the external storage device 100 There is no corruption of the data stored within. However, physical sector 20
If a power failure occurs during writing to the external storage device 100, data stored in the external storage device 100 will be destroyed.
【0038】図16,図17を使用して物理セクタ20
に書込みを行っている際の停電による外部記憶装置10
0内に格納されたデータの破壊を説明する。データの破
壊は、フラッシュメモリ2に書込み中に停電が起きた場
合、書込み箇所のデータは不定となることに起因する。Referring to FIG. 16 and FIG.
External storage device 10 due to a power failure while writing to
The destruction of data stored in 0 will be described. The destruction of data is caused by the fact that if a power failure occurs during writing to the flash memory 2, the data at the write location is undefined.
【0039】図16はデータ領域21の書込み中に停電
が起きた物理セクタ20を表す。データ領域21の書込
み中に停電が起きたのでデータ領域21のデータの値は
不定になる。従来の方法で、復電後、ポインタを作成し
た場合、図16で示す物理セクタ20の論理セクタアド
レス23は初期値のままなので、図16で示される物理
セクタ20が次のホスト200からの書込みデータを格
納する物理セクタとなる。しかし、図16で示される物
理セクタ20はデータ領域21に既に不定のデータが書
込まれているため、新たにホスト200からの次の書込
みデータを正常に書込むことはできなくなる。FIG. 16 shows a physical sector 20 in which a power failure occurred during writing in the data area 21. Since a power failure occurred during writing in the data area 21, the value of the data in the data area 21 is undefined. When a pointer is created after power recovery by the conventional method, the logical sector address 23 of the physical sector 20 shown in FIG. 16 remains at the initial value, so that the physical sector 20 shown in FIG. This is a physical sector for storing data. However, in the physical sector 20 shown in FIG. 16, since undefined data has already been written in the data area 21, the next write data from the host 200 cannot be newly written normally.
【0040】図17の下側の物理セクタ20は、論理セ
クタアドレス23の書込み中に停電が起きた物理セクタ
20を表す。論理セクタアドレス23に書込み中に停電
が起きたので、論理セクタアドレス23は不定になる。
図17の下側の物理セクタ20の論理セクタアドレス2
3の値をxとすると、xが実際に存在する論理セクタア
ドレスの場合、図17の上側の物理セクタ20のように
論理セクフアドレスxで有効なデータを格納した物理セ
クタ20が存在する可能性がある。The lower physical sector 20 in FIG. 17 represents the physical sector 20 in which a power failure occurred during the writing of the logical sector address 23. Since a power failure occurred during writing to the logical sector address 23, the logical sector address 23 is undefined.
Logical sector address 2 of lower physical sector 20 in FIG.
Assuming that the value of 3 is x, if x is a logical sector address that actually exists, there can be a physical sector 20 storing valid data at the logical sector address x as in the upper physical sector 20 in FIG. There is.
【0041】従来の方法でマッピングテーブルを作成し
た場合、論理セクタアドレスxのデータを格納している
のは、図17の下側の物理セクタ20として登録され
る。この結果、ホスト200から論理セクタアドレスx
のデータが読み出された場合、真の値は図17の上側の
物理セクタ20のデータ領域21に書込まれているデー
タであるにも関わらず、図17の下側の物理セクタ20
のデータ領域21に書込まれているデータが読み出され
てしまう。When the mapping table is created by the conventional method, the data storing the logical sector address x is registered as the lower physical sector 20 in FIG. As a result, the host 200 sends the logical sector address x
17 is read, the true value is the data written in the data area 21 of the upper physical sector 20 in FIG.
The data written in the data area 21 is read.
【0042】提案する方法では、各物理セクタ20の管
理領域22の書込み終了フラグ26の値が論理セクタア
ドレス23の書込みが終了したことを示す0である物理
セクタの論理セクタアドレス23と物理セクタアドレス
との対応表を作ることにより作成する。論理セクタアド
レス23の書込みが終了した物理セクタのみをマッピン
グテーブル作成の対象とするため、図17で示したよう
なデータの破壊はなくなる。In the proposed method, the value of the write end flag 26 of the management area 22 of each physical sector 20 is 0 indicating that the writing of the logical sector address 23 has been completed. It is created by making a correspondence table with. Since only the physical sector for which the writing of the logical sector address 23 has been completed is subjected to the mapping table creation, the destruction of data as shown in FIG. 17 is eliminated.
【0043】また、提案する方法では、マッピングテー
ブルは各セクタ20の管理領域22の論理セクタアドレ
ス23を参照するのではなく、書込み開始フラグ25の
値が初めて1になる物理セクタのアドレスとする。物理
セクタ20の書込みは書込み開始フラグ25を0にして
から行うため、図16で示したように、不定データが書
込まれているデータ領域21へホスト200からの書込
みデータを書込むようなデータ破壊はなくなる。In the proposed method, the mapping table does not refer to the logical sector address 23 of the management area 22 of each sector 20, but sets the address of the physical sector in which the value of the write start flag 25 becomes 1 for the first time. Since writing to the physical sector 20 is performed after setting the write start flag 25 to 0, as shown in FIG. 16, data such as writing write data from the host 200 to the data area 21 to which indefinite data is written is written. Destruction is gone.
【0044】[0044]
【発明の効果】以上説明したように、本発明により、書
込み前の消去待ち時間の削減と、フラッシュメモリ内の
一定個所への書込みの集中を避けることにより、フラッ
シュメモリの寿命を延ばし、フラッシュメモリを用いた
外部記憶装置の寿命を延ばすことを可能としつつ、フラ
ッシュメモリを使用した外部記憶装置の書込み中の停電
に伴う格納データの破壊を避け、格納データの有効性を
保証することが可能となる。As described above, according to the present invention, the life of a flash memory can be extended by reducing the erasing wait time before writing and avoiding the concentration of writing at a certain location in the flash memory. It is possible to extend the life of the external storage device using the flash memory, avoid destruction of the stored data due to a power failure during writing to the external storage device using the flash memory, and guarantee the validity of the stored data. Become.
【図1】本発明の実施例である外部記憶装置構成例を示
す図である。FIG. 1 is a diagram illustrating an example of a configuration of an external storage device according to an embodiment of the present invention.
【図2】図1のフラッシュメモリの構成を示す図であ
る。FIG. 2 is a diagram showing a configuration of a flash memory of FIG. 1;
【図3】図2の物理セクタの構成を示す図である。FIG. 3 is a diagram showing a configuration of a physical sector in FIG. 2;
【図4】従来の方式における管理領域の構成を示す図で
ある。FIG. 4 is a diagram showing a configuration of a management area in a conventional method.
【図5】本発明で提案する方式における管理領域の構成
を示す図である。FIG. 5 is a diagram showing a configuration of a management area in a scheme proposed in the present invention.
【図6】本発明のホストから外部記憶装置にデータの書
込みがあった際のフラッシュメモリへのデータの書込み
方法を示す図である。FIG. 6 is a diagram illustrating a method of writing data to a flash memory when data is written from a host to an external storage device according to the present invention.
【図7】図6のホストから外部記憶装置へ論理セクタア
ドレスAのデータが書込まれた時のフラッシュメモリの
状態の変化を表す図である。7 is a diagram showing a change in the state of the flash memory when data of a logical sector address A is written from the host of FIG. 6 to the external storage device.
【図8】従来の方法におけるホストから外部記憶装置へ
論理セクタアドレスAのデータが書込まれた時のフラッ
シュメモリの状態の変化の詳細を示す図である。FIG. 8 is a diagram showing details of a change in the state of the flash memory when data of a logical sector address A is written from a host to an external storage device in a conventional method.
【図9】従来の方法におけるホストから外部記憶装置へ
論理セクタアドレスAのデータが書込まれた時のフラッ
シュメモリの状態の変化の詳細を示す図である。FIG. 9 is a diagram showing details of a change in the state of the flash memory when data of a logical sector address A is written from a host to an external storage device in a conventional method.
【図10】従来の方法におけるホストから外部記憶装置
へ論理セクタアドレスAのデータが書込まれた時のフラ
ッシュメモリの状態の変化の詳細を示す図である。FIG. 10 is a diagram showing details of a change in the state of a flash memory when data of a logical sector address A is written from a host to an external storage device in a conventional method.
【図11】本発明で提案する方法におけるホストから外
部記憶装置へ論理セクタアドレスAのデータが書込まれ
た時のフラッシュメモリの状態の変化の詳細を示す図で
ある。FIG. 11 is a diagram showing details of a change in the state of the flash memory when data of the logical sector address A is written from the host to the external storage device in the method proposed in the present invention.
【図12】本発明で提案する方法におけるホストから外
部記憶装置へ論理セクタアドレスAのデータが書込まれ
た時のフラッシュメモリの状態の変化の詳細を示す図で
ある。FIG. 12 is a diagram showing details of changes in the state of the flash memory when data of a logical sector address A is written from the host to the external storage device in the method proposed in the present invention.
【図13】本発明で提案する方法におけるホストから外
部記憶装置へ論理セクタアドレスAのデータが書込まれ
た時のフラッシュメモリの状態の変化の詳細を示す図で
ある。FIG. 13 is a diagram showing details of a change in the state of the flash memory when data of the logical sector address A is written from the host to the external storage device in the method proposed in the present invention.
【図14】本発明で提案する方法におけるホストから外
部記憶装置へ論理セクタアドレスAのデータが書込まれ
た時のフラッシュメモリの状態の変化の詳細を示す図で
ある。FIG. 14 is a diagram showing details of a change in the state of the flash memory when data of the logical sector address A is written from the host to the external storage device in the method proposed in the present invention.
【図15】本発明で提案する方法におけるホストから外
部記憶装置へ論理セクタアドレスAのデータが書込まれ
た時のフラッシュメモリの状態の変化の詳細を示す図で
ある。FIG. 15 is a diagram showing details of a change in the state of the flash memory when data of the logical sector address A is written from the host to the external storage device in the method proposed in the present invention.
【図16】本発明のデータ領域の書込み中に停電が起き
た物理セクタを表す図である。FIG. 16 is a diagram illustrating a physical sector in which a power failure occurs during writing of a data area according to the present invention.
【図17】本発明の論理セクタアドレスの書込み中に停
電が起きた物理セクタを表す図である。FIG. 17 is a diagram illustrating a physical sector in which a power failure occurs during writing of a logical sector address according to the present invention.
1…ホストインタフェース、2…フラッシュメモリ、3
…制御回路、4…ホストインタフェースバス、5…ホス
トインタフェース制御線、6…メモリアドレスバス、7
…メモルデータバス、8…メモリ制御線、20…物理セ
クタ、21…データ領域、22…管理領域、23…論理
セクタアドレス、24…無効フラグ、25…書込み開始
フラグ、26…書込み終了フラグ、100…外部記憶装
置、200…ホスト。1. Host interface, 2. Flash memory, 3.
... Control circuit, 4 ... Host interface bus, 5 ... Host interface control line, 6 ... Memory address bus, 7
... memory data bus, 8 ... memory control line, 20 ... physical sector, 21 ... data area, 22 ... management area, 23 ... logical sector address, 24 ... invalid flag, 25 ... write start flag, 26 ... write end flag, 100 ... external storage device, 200 ... host.
Claims (2)
シュメモリ内部をデータの読み書きの単位である物理セ
クタに分け、リングバッファ形式でホストからの書込み
データをフラッシュメモリのアドレスの小さい物理セク
タからアドレスの大きい物理セクタへ書込んでいく追記
型のデータ書込み方式をとり、物理セクタはホストから
の書込みデータを保持するデータ領域と管理領域に分
け、管理領域にはホストのアクセスアドレスである論理
セクタアドレスとデータ領域に書かれたデータの有効性
を表す無効化フラグに加え、データ領域の書込み開始を
表す書込み開始フラグ,データ領域へのデータの書込み
と管理領域の論理セクタアドレスの書込みが終了したこ
とを示す書込み終了フラグを設け、電源投入時にフラッ
シュメモリ内の各物理セクタの管理領域の書込み開始フ
ラグの値を参照して最後に書込みが行われた物理セクタ
の位置を知ることにより次に書込みを行う物理セクタの
位置を決めるとともに、書込み終了フラグの値を参照し
て最後に書込まれたデータの有効性を判断することによ
り、フラッシュメモリへの書込み中の停電に伴う格納デ
ータの破壊を避け、格納データの有効性を保証すること
を特徴とするフラッシュメモリを使用した外部記憶装
置。A flash memory is used as a storage medium, and the inside of the flash memory is divided into physical sectors as data read / write units, and write data from a host is written in a ring buffer format from a physical sector having a small address to a large address of the flash memory. A write-once type data writing method of writing data to a physical sector is used. The physical sector is divided into a data area for holding write data from the host and a management area, and the management area has a logical sector address and data which are the access address of the host. In addition to the invalidation flag indicating the validity of the data written in the area, a write start flag indicating the start of writing in the data area, indicating that the writing of data to the data area and the writing of the logical sector address of the management area have been completed. A write end flag is provided, and each item in the flash memory is By referring to the value of the write start flag in the management area of the sector and knowing the position of the physical sector where the last write was performed, the position of the next physical sector to be written next is determined, and the value of the write end flag is referred to. Determining the validity of the last written data in order to avoid destruction of the stored data due to a power failure during writing to the flash memory and to guarantee the validity of the stored data. External storage device used.
数使用したことを特徴とするフラッシュメモリを使用し
た外部記憶装置。2. An external storage device using a flash memory according to claim 1, wherein a plurality of flash memories are used.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP8080298A JPH11282765A (en) | 1998-03-27 | 1998-03-27 | External storage device using flash memory |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP8080298A JPH11282765A (en) | 1998-03-27 | 1998-03-27 | External storage device using flash memory |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH11282765A true JPH11282765A (en) | 1999-10-15 |
Family
ID=13728608
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP8080298A Pending JPH11282765A (en) | 1998-03-27 | 1998-03-27 | External storage device using flash memory |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH11282765A (en) |
Cited By (10)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2003065210A1 (en) * | 2002-01-31 | 2003-08-07 | Matsushita Electric Industrial Co., Ltd. | Information processing apparatus, memory management apparatus, memory management method, and information processing method |
| WO2004031966A1 (en) * | 2002-10-02 | 2004-04-15 | Matsushita Electric Industrial Co., Ltd. | Non-volatile storage device control method |
| US6879528B2 (en) | 2001-06-28 | 2005-04-12 | Matsushita Electric Industrial Co., Ltd. | Control method of nonvolatile memory |
| JP2006085895A (en) * | 2004-09-17 | 2006-03-30 | Samsung Electronics Co Ltd | Program method for nonvolatile memory device having high reliability |
| JP2007334935A (en) * | 2006-06-12 | 2007-12-27 | Sony Corp | Non-volatile memory |
| JP2008077669A (en) * | 2007-10-09 | 2008-04-03 | Mitsubishi Electric Corp | Recording method |
| US7421624B2 (en) | 2004-01-19 | 2008-09-02 | Samsung Electronics Co., Ltd. | Data recovery apparatus and method used for flash memory |
| JP2009276883A (en) * | 2008-05-13 | 2009-11-26 | Oki Electric Ind Co Ltd | Semiconductor auxiliary storage device |
| JP2010170599A (en) * | 2009-01-21 | 2010-08-05 | Renesas Electronics Corp | Nonvolatile memory and control method thereof |
| JP2016071745A (en) * | 2014-09-30 | 2016-05-09 | アイコム株式会社 | Wireless communication device having recording function, recording device for writing data to nonvolatile memory, and recording method for writing data to nonvolatile memory |
-
1998
- 1998-03-27 JP JP8080298A patent/JPH11282765A/en active Pending
Cited By (17)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US6879528B2 (en) | 2001-06-28 | 2005-04-12 | Matsushita Electric Industrial Co., Ltd. | Control method of nonvolatile memory |
| US7418436B2 (en) | 2002-01-31 | 2008-08-26 | Matsushita Electric Industrial Co., Ltd. | Information processing apparatus, memory management apparatus, memory management method, and information processing method |
| WO2003065210A1 (en) * | 2002-01-31 | 2003-08-07 | Matsushita Electric Industrial Co., Ltd. | Information processing apparatus, memory management apparatus, memory management method, and information processing method |
| WO2004031966A1 (en) * | 2002-10-02 | 2004-04-15 | Matsushita Electric Industrial Co., Ltd. | Non-volatile storage device control method |
| JPWO2004031966A1 (en) * | 2002-10-02 | 2006-02-02 | 松下電器産業株式会社 | Method for controlling nonvolatile memory device |
| EP1548602A4 (en) * | 2002-10-02 | 2006-10-04 | Matsushita Electric Industrial Co Ltd | METHOD FOR CONTROLLING REMANENT MEMORY |
| JP4560408B2 (en) * | 2002-10-02 | 2010-10-13 | パナソニック株式会社 | Method for controlling nonvolatile memory device |
| US7321959B2 (en) | 2002-10-02 | 2008-01-22 | Matsushita Electric Industrial Co., Ltd. | Control method of a non-volatile memory apparatus |
| CN100377120C (en) * | 2002-10-02 | 2008-03-26 | 松下电器产业株式会社 | Control method of nonvolatile memory device |
| US7421624B2 (en) | 2004-01-19 | 2008-09-02 | Samsung Electronics Co., Ltd. | Data recovery apparatus and method used for flash memory |
| JP2006085895A (en) * | 2004-09-17 | 2006-03-30 | Samsung Electronics Co Ltd | Program method for nonvolatile memory device having high reliability |
| JP2007334935A (en) * | 2006-06-12 | 2007-12-27 | Sony Corp | Non-volatile memory |
| US8732385B2 (en) | 2006-06-12 | 2014-05-20 | Sony Corporation | Non-volatile memory, controller controlling next access |
| JP2008077669A (en) * | 2007-10-09 | 2008-04-03 | Mitsubishi Electric Corp | Recording method |
| JP2009276883A (en) * | 2008-05-13 | 2009-11-26 | Oki Electric Ind Co Ltd | Semiconductor auxiliary storage device |
| JP2010170599A (en) * | 2009-01-21 | 2010-08-05 | Renesas Electronics Corp | Nonvolatile memory and control method thereof |
| JP2016071745A (en) * | 2014-09-30 | 2016-05-09 | アイコム株式会社 | Wireless communication device having recording function, recording device for writing data to nonvolatile memory, and recording method for writing data to nonvolatile memory |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US10776153B2 (en) | Information processing device and system capable of preventing loss of user data | |
| JP3695766B2 (en) | Memory defect management method | |
| JP3485938B2 (en) | Nonvolatile semiconductor memory device | |
| JP3534585B2 (en) | Data storage control method and apparatus for external storage device using a plurality of flash memories | |
| US6865658B2 (en) | Nonvolatile data management system using data segments and link information | |
| TWI385519B (en) | Data writing method, and flash storage system and controller using the same | |
| US6571312B1 (en) | Data storage method and data processing device using an erasure block buffer and write buffer for writing and erasing data in memory | |
| US20070214309A1 (en) | Nonvolatile storage device and data writing method thereof | |
| US8296503B2 (en) | Data updating and recovering methods for a non-volatile memory array | |
| JPH11338782A (en) | Storage device and its defective sector substituting method | |
| WO1995018407A1 (en) | Solid state memory system | |
| JPH11511879A (en) | Memory system | |
| JPH08137634A (en) | Flash disk card | |
| JP3421581B2 (en) | Storage device using nonvolatile semiconductor memory | |
| WO2023116346A1 (en) | Method and system for recovering trim data under abnormal power failure, and solid-state drive | |
| JP2000182381A (en) | Batch erase nonvolatile memory | |
| KR20010037155A (en) | Flash file system | |
| JP4347707B2 (en) | Information recording medium formatting method and information recording medium | |
| JPH11282765A (en) | External storage device using flash memory | |
| JP4829202B2 (en) | Storage device and memory control method | |
| CN115878033B (en) | Solid state disk and mapping table management method thereof | |
| JPH11272569A (en) | Data recovery method for external storage device using flash memory | |
| CN117746951A (en) | Circuit design method for simulating EEPROM | |
| JPH0511933A (en) | Hard disk emulator and its fixed cache area allocation method | |
| JP4308780B2 (en) | Semiconductor memory device, memory controller, and data recording method |