JP2002304320A - Data storage method - Google Patents

Data storage method

Info

Publication number
JP2002304320A
JP2002304320A JP2001105057A JP2001105057A JP2002304320A JP 2002304320 A JP2002304320 A JP 2002304320A JP 2001105057 A JP2001105057 A JP 2001105057A JP 2001105057 A JP2001105057 A JP 2001105057A JP 2002304320 A JP2002304320 A JP 2002304320A
Authority
JP
Japan
Prior art keywords
data
record
stored
address
data storage
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
JP2001105057A
Other languages
Japanese (ja)
Inventor
Shinji Imamura
伸二 今村
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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric Corp
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 Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP2001105057A priority Critical patent/JP2002304320A/en
Publication of JP2002304320A publication Critical patent/JP2002304320A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

PROBLEM TO BE SOLVED: To provide a data storage method into a nonvolatile memory capable of immediately executing data writing processing without executing erasure processing just before the writing processing. SOLUTION: This method includes a process for retrieving a data non-storage record in the nonvolatile memory having plural record blocks capable of storing data that are erasure units, such as a flash memory 4, by use of a retrieval means facilitating retrieval of the presence of storage of data such as a flag, FFh or a pointer; a process for writing the data into the retrieved data non- storage record; and a process for calculating size of the data non-storage record after the writing process, and erasing stored data of a data storage block different from the data storage block of the record wherein the data are written in the writing process when the calculated size is small.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、半導体メモリへの
データ格納方法に関し、特にデータ書き込みの前に格納
データの消去を必要とし、その消去回数に制限があるよ
うな不揮発性メモリ、例えばフラッシュメモリへのデー
タ格納方法に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a method for storing data in a semiconductor memory, and more particularly to a nonvolatile memory such as a flash memory which requires erasure of stored data before data writing and has a limited number of erasures. This is related to a method of storing data in a.

【0002】[0002]

【従来の技術】データの書き込みおよび読み出し、さら
に電気的消去も可能な不揮発性メモリとしてフラッシュ
メモリなどが知られている。フラッシュメモリへの書き
込みを行う場合、フラッシュメモリは初期状態である必
要があり、既に書き込まれているデータ、即ち格納デー
タを別のデータに書き変える場合には、一旦、格納デー
タを消去しておく必要がある。しかしフラッシュメモリ
における格納データの消去は、チップ単位あるいは数1
0キロバイト程度のブロック単位で行われ、このデータ
消去の単位が大きいためにそれに要する時間がデータの
書き込みおよび読み出し時間に比して、格段に大きい問
題がある。
2. Description of the Related Art A flash memory or the like is known as a non-volatile memory capable of writing and reading data and further electrically erasing data. When writing to the flash memory, the flash memory needs to be in the initial state, and when rewriting the already written data, that is, the stored data to another data, the stored data is temporarily erased. There is a need. However, erasure of stored data in a flash memory is performed in chip units or
This is performed in units of blocks of about 0 kilobytes, and the time required for the data erasure is large, which is much larger than the data write and read times.

【0003】また書き込み要求が発生する度に格納デー
タの消去処理を行なうと、この消去に要する時間だけ書
き込み処理の効率が悪くなるだけでなく、フラッシュメ
モリでは消去回数に制限があるため、該メモリの短寿命
化を招く問題もある。
If erasure of stored data is performed every time a write request is issued, not only does the efficiency of the write process deteriorate by the time required for the erasure, but also the number of erasures in the flash memory is limited. There is also a problem that leads to shortening of service life.

【0004】上記の諸問題を解決するために、フラッシ
ュメモリにデータを書き込む際に、書き込み要求が発生
する度に消去処理を行うのではなく、書き込み対象とさ
れる単位領域(以下、レコード)の大きさの複数倍の領
域を一括して消去した後、かく消去されたレコード群の
先頭レコードから順に所望データを書き込むようにする
方法が提案されている。
In order to solve the above problems, when writing data to a flash memory, an erasing process is not performed every time a write request is generated, but a unit area (hereinafter referred to as a record) to be written is used. There has been proposed a method in which after erasing a plurality of areas of multiple sizes at once, desired data is written in order from the first record of the erased record group.

【0005】例えば特開平9- 259046号公報に開
示された方法においては、各レコードに格納の有無を確
認するためのフラグが付加されており、書き込み開始に
当たり先頭レコードから順に前記フラグによりデータ格
納未格納の検索を行い、データ未格納のレコードが検索
された場合には、データ未格納の先頭レコードから順に
データの書き込みを開始し、データ未格納のレコードが
存在しなかった場合には、新規に書き込みを行わんとす
るデータの大きさの複数倍の既書き込みデータを先ず一
括して消去して新規に書き込み可能なレコード群を確保
した後に書き込み処理が実行される。よってこの方法
は、書き込み処理が発生する度に消去処理を実行する問
題を回避している。
For example, in the method disclosed in Japanese Patent Application Laid-Open No. 9-259046, a flag for confirming the presence or absence of storage is added to each record. A search for storage is performed, and if a record that does not store data is found, writing of data starts in order from the first record that does not store data.If there is no record that does not store data, a new record is created. The write processing is executed after first erasing the already-written data having a size several times larger than the size of the data to be written and securing a newly writable record group. Therefore, this method avoids the problem of executing the erasing process every time the writing process occurs.

【0006】しかし前述したような従来の方法では、書
き込み要求が発生した際、データ未格納のレコードが存
在しなかった場合における書き込み可能なレコード群の
確保のために、書き込み処理の直前に消去処理を実行す
ることが必要となり、その場合に書き込み処理の効率が
悪くなると言う問題があった。
However, in the above-described conventional method, when a write request is issued, an erasure process is performed immediately before a write process in order to secure a writable record group in a case where no data-unstored record exists. Has to be performed, and in that case, there is a problem that the efficiency of the writing process is deteriorated.

【0007】さらに、エラーログなど書き込み要求が発
生したときには瞬時に書き込みを完了させ、電源断時に
おいても格納したデータを保持する必要があるような場
合、書き込み要求が発生してから、消去と書き込みの処
理を実行していたのでは、消去に要する時間が大きいた
め、重要なデータが欠落するという問題もあった。
Further, when a write request such as an error log occurs, the writing is completed instantaneously, and when it is necessary to retain the stored data even when the power is turned off, erasing and writing are performed after the write request is generated. However, there is a problem that important data is lost because the time required for erasure is long if the above process is performed.

【0008】[0008]

【発明が解決しようとする課題】本発明の課題は、前述
した従来技術における問題を解決してデータ書き込み処
理の直前に消去処理を行なうことなく、直ちに書き込み
処理が可能な不揮発性メモリへのデータ格納方法を提供
することにある。
SUMMARY OF THE INVENTION An object of the present invention is to solve the above-mentioned problem in the prior art and to write data to a nonvolatile memory which can be written immediately without performing an erasing process immediately before a data writing process. It is to provide a storage method.

【0009】[0009]

【課題を解決するための手段】本発明のデータ格納方法
は、(1)消去単位となる複数のデータ格納可能なレコ
ードブロックを有する不揮発性メモリにおけるデータ未
格納レコードのアドレスを検索する手順イ、検索された
上記アドレスのレコードにデータを書き込む手順ロ、上
記手順ロの後に残存するデータ未格納レコードのサイズ
を算出し、算出された上記サイズが小さい場合には上記
手順ロにおいてデータが書き込まれたレコードが属する
レコードブロックとは別のレコードブロックの格納デー
タを消去する手順ハを含むものである。 (2)上記(1)において、上記手順イにおいて、デー
タ未格納レコードのアドレスの検索を容易にする検索手
段を利用するものである。 (3)上記(2)において、上記検索手段は、格納デー
タに付加されてデータ格納の有無を意味するフラグであ
る。 (4)上記(2)において、上記検索手段は、格納デー
タに付加されて次のデータを格納するレコードのアドレ
スを示すポインタである。
The data storage method according to the present invention comprises: (1) a procedure for retrieving the address of a data non-stored record in a nonvolatile memory having a plurality of record blocks capable of storing data as an erasing unit; Procedure B for writing data to the record of the retrieved address, calculating the size of the data-unstored record remaining after the procedure B. If the calculated size is small, the data was written in the procedure B This includes a procedure C for erasing stored data in a record block different from the record block to which the record belongs. (2) In the above (1), in the above procedure a, a search means for facilitating a search for an address of a record not storing data is used. (3) In the above (2), the search means is a flag added to the stored data to indicate whether data is stored. (4) In the above (2), the search means is a pointer indicating the address of a record added to the stored data and storing the next data.

【0010】本発明のデータ格納方法は、また(5)R
AMが内蔵されたデータ格納装置を用い、上記RAM上
に次にデータを格納するレコードのアドレスを示す書き
込みポインタが有効である場合には上記書込ポインタに
従って、消去単位となる複数のデータ格納可能なレコー
ドブロックを有する不揮発性メモリにおけるデータ未格
納レコードにデータを書き込む手順ニ、上記手順ニの後
に残存するデータ未格納レコードのサイズを算出し、算
出された上記サイズが小さい場合には上記手順ニにおい
てデータが書き込まれたレコードが属するレコードブロ
ックとは別のレコードブロックの格納データを消去する
手順ハを含むものである。 (6)上記(5)において、上記不揮発性メモリは、フ
ラッシュメモリであることを特徴とする請求項1または
請求項5記載のデータ格納方法。 (7)上記(6)において、上記(2)における上記検
索手段として、初期状態および格納データの消去状態が
FFhであることを利用するものである。
[0010] The data storage method of the present invention further comprises (5) R
When a write pointer indicating the address of a record for storing data next is valid on the RAM using a data storage device having a built-in AM, a plurality of data serving as an erase unit can be stored according to the write pointer. And d) calculating the size of the data non-stored record remaining after the above procedure d. If the calculated size is small, the procedure d. And a procedure for erasing stored data in a record block different from the record block to which the record to which the data is written belongs. (6) The data storage method according to (1) or (5), wherein in (5), the nonvolatile memory is a flash memory. (7) In the above (6), the search means in the above (2) utilizes that the initial state and the erase state of the stored data are FFh.

【0011】[0011]

【発明の実施の形態】実施の形態1.図1〜図3は、本
発明のデータ格納方法における実施の形態1を説明する
ものであって、図1は上記不揮発性メモリの一例として
のフラッシュメモリへのデータ格納方法が適用されるデ
ータ格納装置の主要部分の概略構成図であり、図2はフ
ラッシュメモリの概略構造図であり、図3はフラッシュ
メモリへのデータ格納方法の動作フローを示すフローチ
ャートである。
DESCRIPTION OF THE PREFERRED EMBODIMENTS Embodiment 1 1 to 3 illustrate a first embodiment of a data storage method according to the present invention. FIG. 1 illustrates a data storage method to which a data storage method is applied to a flash memory as an example of the nonvolatile memory. FIG. 2 is a schematic structural diagram of a flash memory, and FIG. 3 is a flowchart showing an operation flow of a method of storing data in the flash memory.

【0012】図1において、1は上記データ格納装置の
各部分を制御するCPU、2はROM、3はRAM、4
はフラッシュメモリである。ROM2にはCPU1が制
御するための各種プログラム、特にCPU1がフラッシ
ュメモリ4へデータを格納するための方法が記述された
プログラムが格納されており、RAM3は汎用データの
一時格納場所として使用され、フラッシュメモリ4は本
発明の主対象となる各種のデータ格納用として機能す
る。
In FIG. 1, 1 is a CPU for controlling each part of the data storage device, 2 is a ROM, 3 is a RAM,
Is a flash memory. The ROM 2 stores various programs for the CPU 1 to control, in particular, a program describing a method for the CPU 1 to store data in the flash memory 4. The RAM 3 is used as a temporary storage for general-purpose data. The memory 4 functions to store various types of data that is a main object of the present invention.

【0013】本発明において使用可能なフラッシュメモ
リとしては、一般的に二以上の複数の消去単位となるレ
コードブロックを有するものが用いられるが、実施の形
態1ではその一例として消去単位となる二つのレコード
ブロックA、Bを有するフラッシュメモリ4が用いられ
ている。図2は、このフラッシュメモリ4をCPU1か
ら見たアドレス空間を割り付けた図であり、フラッシュ
メモリ4の一部領域を二つのレコードブロック、即ち、
レコードブロックAとレコードブロックBとして割り付
けていることを示す。またレコードブロックAは、該ブ
ロックの使用状態を管理するブロック管理領域A0およ
びレコードA1、A2、・・、Anを有し、同様にレコ
ードブロックBは、該ブロックの使用状態を管理するブ
ロック管理領域B0およびレコードB1、B2、・・、
Bnを有する。
As a flash memory usable in the present invention, a flash memory generally having two or more record blocks serving as erase units is used. In the first embodiment, for example, two flash units serving as erase units are used. A flash memory 4 having record blocks A and B is used. FIG. 2 is a diagram in which the address space of the flash memory 4 as viewed from the CPU 1 is allocated, and a partial area of the flash memory 4 is divided into two record blocks, ie, two record blocks.
This indicates that record blocks A and B are allocated. The record block A has a block management area A0 for managing the use state of the block and records A1, A2,..., An. Similarly, the record block B has a block management area for managing the use state of the block. B0 and records B1, B2,.
Bn.

【0014】つぎに、フラッシュメモリ4へのデータ格
納の方法を図2、図3を参照して説明する。レコードブ
ロックA、Bは、初期状態ではA1〜Bnのすべてのレ
コードがデータ未格納状態であり、両レコードブロック
A、Bにおけるデータ格納の可否については各ブロック
管理領域A0、B0にて管理され、書き込みを要するデ
ータはレコードA1、A2、・・、An、B1、B2、
・・、Bnの順に格納されるものとする。また説明のた
めに、いまレコードA1〜AmおよびレコードB1〜B
nがデータ格納済であって、レコードブロックA中のレ
コードAm+1〜Anのみがデータ未格納の状態、換言
すると新規にデータ格納が可能であるとする。
Next, a method of storing data in the flash memory 4 will be described with reference to FIGS. In the record blocks A and B, in the initial state, all records of A1 to Bn are in a data non-stored state, and whether or not data can be stored in both record blocks A and B is managed in each block management area A0, B0. Data to be written include records A1, A2,..., An, B1, B2,
.. And Bn are stored in this order. For the sake of explanation, records A1 to Am and records B1 to B
It is assumed that n has already been stored and only records Am + 1 to An in record block A have no data stored, in other words, new data can be stored.

【0015】CPU1から書き込み要求が発生した場
合、上記の手順イにおいてレコードブロックA、Bの中
からデータ未格納のレコードのアドレスを検索してレコ
ードAm+1〜Anのみがデータ未格納であること知る
(ステップ100)。ついで上記の手順ロにおいて、か
く検索された上記データ未格納のレコードに対してレコ
ードAm+1から順にデータの書き込みを開始する(ス
テップ101)。その後に手順ハにおいて、残存するデ
ータ未格納レコードのサイズを算出し、かく算出された
上記サイズが或る規定値以上であるか否かを判定する
(ステップ102)。この判定によって、データ未格納
のサイズが規定値以上ある場合には、つぎにデータ書き
込み要求が発生した場合においても十分量の未格納レコ
ードは存在するので、書き込み処理が可能であるとして
手順ハを終了する。一方、上記の算出の結果、データ未
格納レコードのサイズが規定値より小さいことが判明し
た場合には、次のレコードブロック(この場合はレコー
ドブロックB)のデータを消去し、データを書き込むた
めのレコードを確保して(ステップ103)手順ハを終
了する。
When a write request is issued from the CPU 1, the address of a record having no data stored therein is searched from the record blocks A and B in the above procedure A, and it is known that only the records Am + 1 to An have no data stored therein ( Step 100). Then, in the above procedure B, data writing is started in order from the record Am + 1 to the data-unstored record thus found (step 101). Thereafter, in procedure C, the size of the remaining data-unstored record is calculated, and it is determined whether the calculated size is equal to or larger than a certain specified value (step 102). As a result of this determination, if the size of unstored data is equal to or larger than the specified value, there is a sufficient amount of unstored records even when a data write request is issued next. finish. On the other hand, as a result of the above calculation, when it is found that the size of the data non-stored record is smaller than the specified value, the data of the next record block (in this case, record block B) is erased and the data for writing the data is written. After securing the record (step 103), the procedure c is completed.

【0016】このように実施の形態1では、フラッシュ
メモリ4へのデータ書き込み要求が発生した場合、従来
のようにデータの新規書き込み要求が発生してから既書
き込みデータの消去作業を行なうことなく、CPU1か
らの書き込み要求に応じて即座に新規データの書き込み
処理を実行することが可能となる。なお上記規定値の大
きさは、上記データ格納装置の種類、稼働環境、あるい
はその他のデータ格納要求を考慮して適宜決定される。
As described above, according to the first embodiment, when a data write request to the flash memory 4 is issued, the operation of erasing the already written data is not performed after a new data write request is issued as in the related art. New data write processing can be immediately executed in response to a write request from the CPU 1. The size of the specified value is appropriately determined in consideration of the type of the data storage device, the operating environment, or other data storage requests.

【0017】実施の形態2.図4〜図5は、本発明のデ
ータ格納方法における実施の形態2を説明するものであ
って、図4はフラッシュメモリの部分概略構造図であ
り、前記図2におけるレコードA1〜Bnの各構造を概
略的に表したものであって、データが格納されたレコー
ドにおける格納データには、データ格納済を意味するフ
ラグが付加されていることを示す。図5はフラッシュメ
モリへのデータ格納方法の動作フローを示すフローチャ
ートである。
Embodiment 2 FIG. 4 and 5 illustrate a data storage method according to a second embodiment of the present invention. FIG. 4 is a partial schematic structural diagram of a flash memory, and each structure of records A1 to Bn in FIG. And that a flag indicating that data has been stored is added to the stored data in the record in which the data is stored. FIG. 5 is a flowchart showing an operation flow of a method of storing data in a flash memory.

【0018】つぎに、実施の形態2における上記フラグ
を付加した場合の動作について前記図2および図3をも
参照して説明する。実施の形態2においては、データ未
格納レコードを検索する手順イにおいて、この検索を容
易にする検索手段としてフラグを以下に詳述方法に従っ
て利用する。
Next, the operation of the second embodiment when the flag is added will be described with reference to FIGS. In the second embodiment, in the procedure (a) for searching for a data-unstored record, a flag is used as a search means for facilitating the search in accordance with a detailed method described below.

【0019】即ち、前記実施の形態1における上記手順
イのステップ100(図3参照)において、書き込みア
ドレスを先頭レコードのアドレスに設定し(ステップ1
10)、そのアドレスのレコードについて上記フラグに
よりそのレコードがデータ未格納であるか否かの判定を
行い(ステップ111)、データが未格納であればその
検索されたアドレスのレコードにデータを書き込む(ス
テップ101)。一方、或るアドレスのレコードがデー
タ格納済みであった場合には、書き込みアドレスを次の
アドレスにインクリメントし(ステップ112)、再び
前記フラグによりデータが未格納であるかどうかの判定
を行い、データ未格納のアドレスが検索されるまでステ
ップ111及び112の処理を繰り返す。以上の方法に
より、データ未格納のレコードのアドレスを検索してデ
ータ書き込み(ステップ101)を実行する。その後の
処理は実施の形態1と同様である。
That is, in step 100 (see FIG. 3) of the procedure A in the first embodiment, the write address is set to the address of the first record (step 1).
10) For the record at that address, it is determined whether or not the record has no data stored by the flag (step 111). If the data has not been stored, the data is written to the record at the searched address (step 111). Step 101). On the other hand, if the record at a certain address has already stored the data, the write address is incremented to the next address (step 112), and it is determined again by the flag whether or not the data is not stored. The processes of steps 111 and 112 are repeated until an unstored address is searched. With the above method, the address of the record in which no data is stored is searched to execute data writing (step 101). Subsequent processing is the same as in the first embodiment.

【0020】例えば、データ格納状態が実施の形態1で
示した状態、即ちレコードブロックA中のレコードAm
+1〜Anのみがデータ未格納の状態にあり、データ格
納有りの状態を表すフラグを「0」、データ格納無しの
状態を「1」とすると、レコードA1〜Bnのうち、デ
ータが格納されたレコードでは各格納データにはフラグ
「0」が付加されており、レコードAm+1〜Anでは
「1」のままとされている。よってレコードA1からフ
ラグを検索開始し、レコードAm+1に至ってフラグ
「0」を有しないデータ未格納のレコードAm+1が検
出され、そのレコードから順に新たにデータを書き込
む。
For example, the data storage state is the state shown in the first embodiment, that is, the record Am in the record block A
Assuming that only +1 to An are in a state where no data is stored, a flag indicating a state with data storage is “0”, and a state without data storage is “1”, data is stored in records A1 to Bn. A flag “0” is added to each stored data in the record, and remains “1” in the records Am + 1 to An. Therefore, a search for a flag is started from the record A1, and a record Am + 1 that does not have the flag “0” and is not stored until the record Am + 1 is detected, and data is newly written in order from the record.

【0021】このように実施の形態2では、フラッシュ
メモリ4へのデータ書き込み要求が発生した場合、レコ
ード毎に付加されたフラグを検索することにより、かか
るフラグの付加のない実施の形態1の場合よりも、高能
率でデータ未格納のレコードのアドレスを決定すること
ができる効果がある。
As described above, in the second embodiment, when a data write request to the flash memory 4 is issued, the flag added to each record is searched, and the flag in the first embodiment without the flag is added. This has the effect that the address of a record in which data is not stored can be determined more efficiently.

【0022】実施の形態3.図6は、本発明のデータ格
納方法における実施の形態3を説明するものであって、
フラッシュメモリへのデータ格納方法の動作フローを示
すフローチャートである。以下に、実施の形態3におけ
る動作について前記図2および図3をも参照して図6に
より説明する。実施の形態3では、データ未格納レコー
ドを検索する手順イにおいて、この検索を容易にする検
索手段としてFFhを利用する。
Embodiment 3 FIG. FIG. 6 illustrates Embodiment 3 in the data storage method of the present invention.
5 is a flowchart illustrating an operation flow of a method of storing data in a flash memory. The operation in the third embodiment will be described below with reference to FIGS. In the third embodiment, FFh is used as search means for facilitating the search in the procedure A for searching for a record that does not store data.

【0023】即ち、フラッシュメモリの初期状態、すな
わちデータ消去状態ではFFh(16進数表記における
1のみの状態)であることを利用し、前記実施の形態1
でのステップ100(図3参照)において、書き込みア
ドレスをレコードの最終アドレスに設定し(ステップ1
20)、そのアドレスのレコードではFFhであるか否
かによってデータが未格納であるか否かの判定を行い
(ステップ121)、FFhでなくてデータが格納済み
であれば、そのアドレスをインクリメントしたアドレス
のレコードにデータを書き込む(ステップ123、10
1)。一方、FFhであってデータが未格納であれば、
アドレスを先頭アドレス方向にデクリメントして(ステ
ップ122)、再びFFhであるかどうかによりデータ
が未格納であるか否かの判定を行い、データ格納済みの
アドレスが検索されるまでステップ121及び122の
処理を繰り返す。以上の方法により、書き込みアドレス
を検索し、データ書き込み(ステップ101)を実行す
る。その後の処理は、実施の形態1と同様である。
That is, the first embodiment of the present invention utilizes the fact that the initial state of the flash memory, ie, the data erase state, is FFh (state of only 1 in hexadecimal notation).
In step 100 (see FIG. 3), the write address is set to the last address of the record (step 1).
20) In the record of the address, it is determined whether or not the data is not stored according to whether or not it is FFh (step 121). If the data is not FFh and the data is stored, the address is incremented. Write data to the address record (steps 123, 10
1). On the other hand, if it is FFh and the data is not stored,
The address is decremented in the direction of the head address (step 122), and it is again determined whether or not the data is not stored according to whether or not the data is FFh. Repeat the process. With the above method, a write address is searched, and data writing (step 101) is executed. Subsequent processing is the same as in the first embodiment.

【0024】例えば、データ格納状態が実施の形態1で
示した状態にあるとすると、レコードAnからAn−
1、An−2、・・の順に検索を実行することによりレ
コードAm+1まではFFhであってデータ未格納状態
であること、およびレコードAmに至ってデータ格納済
み状態となることが判明し、したがってレコードAmの
次のレコードAm+1からデータを書き込む。
For example, assuming that the data storage state is the state shown in the first embodiment, records An to An-
By performing the search in the order of 1, An-2,..., It is found that up to the record Am + 1 is FFh and the data is not stored, and that the record Am is reached to the data stored state. Data is written from the record Am + 1 following Am.

【0025】このように実施の形態3では、各レコード
にフラグなどの検索手段を付加する手順の必要がなく、
フラッシュメモリ4へのデータ書き込み要求が発生した
場合、各レコードがFFhであるか否かを検索すること
により、未格納レコードのアドレスを決定することがで
きる効果がある。
As described above, in the third embodiment, there is no need to add a search means such as a flag to each record.
When a data write request to the flash memory 4 is issued, it is possible to determine whether or not each record is FFh, thereby determining the address of an unstored record.

【0026】実施の形態4.図7〜図8は、本発明のデ
ータ格納方法における実施の形態4を説明するものであ
って、図7は、フラッシュメモリの部分概略構造図であ
り、データが格納されたレコードに次のデータを格納す
るレコードのアドレスを示すポインタが付加されている
ことを示す。図8は、フラッシュメモリへのデータ格納
方法の動作フローを示すフローチャートである。
Embodiment 4 7 and 8 illustrate a data storage method according to a fourth embodiment of the present invention. FIG. 7 is a partial schematic structural diagram of a flash memory. Indicates that a pointer indicating the address of the record storing the is added. FIG. 8 is a flowchart showing an operation flow of a method of storing data in a flash memory.

【0027】つぎに実施の形態4における動作につい
て、前記図2、図3をも参照して説明する。実施の形態
4においては、データ未格納レコードを検索する手順イ
において、この検索を容易にする検索手段として上記の
ポインタが利用される。即ち、前記実施の形態1でのス
テップ100(図3参照)において、書き込みアドレス
をレコードの先頭アドレスに設定し(ステップ10
0)、そのアドレスでの上記ポインタがFFhであるか
否かによりデータが未格納であるか否かの判定を行い
(ステップ130)、FFhであってデータが未格納で
あれば、その検索されたアドレスのレコードにデータを
書き込む(ステップ101)。一方、上記ポインタがF
Fhでない、すなわちデータが格納済みであった場合に
は、書き込みアドレスを次のアドレスに設定し(ステッ
プ131)、再び上記ポインタによりFFhであるか否
かにより未格納であるか否かの判定を行い、データ未格
納のアドレスが検索されるまでステップ130及び13
1の処理を繰り返す。以上の方法により、書き込みアド
レスを検索し、データ書き込み(ステップ101)を実
行する。その後の処理は、実施の形態1と同様である。
Next, the operation of the fourth embodiment will be described with reference to FIGS. In the fourth embodiment, in the procedure A for searching for a record that does not store data, the above-mentioned pointer is used as search means for facilitating the search. That is, in step 100 (see FIG. 3) in the first embodiment, the write address is set to the head address of the record (step 10).
0), it is determined whether or not the data is not stored based on whether or not the pointer at the address is FFh (step 130). The data is written to the record at the address (step 101). On the other hand, if the pointer is F
If it is not Fh, that is, if the data has been stored, the write address is set to the next address (step 131), and it is determined again whether or not it is unstored based on whether or not it is FFh by the pointer again. Steps 130 and 13 until the address where no data is stored is searched.
Step 1 is repeated. With the above method, a write address is searched, and data writing (step 101) is executed. Subsequent processing is the same as in the first embodiment.

【0028】このように実施の形態4では、フラッシュ
メモリ4へのデータ書き込み要求が発生した場合、上記
ポインタを順に検索することにより未格納レコードのア
ドレスを決定することができる。
As described above, in the fourth embodiment, when a data write request to the flash memory 4 occurs, the address of an unstored record can be determined by sequentially searching the pointer.

【0029】実施の形態5.図9〜図10は、本発明の
データ格納方法における実施の形態5を説明するもので
ある。図9は、フラッシュメモリ4の概略構造図であっ
て、前記図2とはRAM3上に次にデータを格納するレ
コードのアドレスを示す書き込みポインタ31が付加さ
れている点において異なる。図10は、フラッシュメモ
リ4へのデータ格納方法の動作フローを示すフローチャ
ートである。
Embodiment 5 9 and 10 illustrate a fifth embodiment of the data storage method of the present invention. FIG. 9 is a schematic structural view of the flash memory 4, which differs from FIG. 2 in that a write pointer 31 indicating the address of a record for storing data next on the RAM 3 is added. FIG. 10 is a flowchart showing an operation flow of a method of storing data in the flash memory 4.

【0030】つぎに実施の形態5における動作につい
て、図9〜図10を参照して説明する。実施の形態5に
おいて、書き込み要求が発生した場合、まずRAM3上
の書き込みポインタが有効であるか否かの判定を行う
(ステップ140)。その理由は、RAM3上の上記ポ
インタ31は電源投入後の初期状態時になんらかの要因
にて有効でない場合があることによる。かかる場合に
は、前記した実施の形態1〜4の方法が採用される。こ
れに対してRAM3上の書き込みポインタ31が有効で
ある場合、前記実施の形態1〜4において実行された手
順イ、即ちデータ未格納レコードの検索は不要となり、
書き込みアドレスを検索すること無くフラッシュメモリ
4のデータ書き込みアドレスを決定することができる。
データ書き込み(手順ニ)後は、実施の形態1と同様
に、データ未格納の残りレコードを算出し、必要に応じ
てつぎのレコードブロックのデータを消去(手順ホ)し
た後、RAM3上のフラッシュメモリ4への書き込みポ
インタ31をインクリメントしておき、データ書き込み
処理を終了する。
Next, the operation of the fifth embodiment will be described with reference to FIGS. In the fifth embodiment, when a write request is issued, it is first determined whether or not the write pointer on the RAM 3 is valid (step 140). The reason is that the pointer 31 on the RAM 3 may not be valid for some reason in the initial state after the power is turned on. In such a case, the methods of the first to fourth embodiments are adopted. On the other hand, when the write pointer 31 on the RAM 3 is valid, the procedure A executed in the first to fourth embodiments, that is, the search for the data non-stored record becomes unnecessary.
The data write address of the flash memory 4 can be determined without searching for the write address.
After writing the data (procedure d), as in the first embodiment, the remaining records not storing the data are calculated, and the data of the next record block is erased (procedure E) as necessary. The write pointer 31 to the memory 4 is incremented, and the data write processing ends.

【0031】このように実施の形態5では、フラッシュ
メモリ4へのデータ書き込み要求が発生した場合、未格
納レコードのアドレスを検索することなく、書き込みア
ドレスを決定することができ、データを書き込むと共に
データ未格納の残りレコードの大きさをチェックするこ
とにより、常に、データ未格納状態のレコードを確保
し、データ書き込み要求が発生してから消去、書き込み
の手順を繰り返すことなく、即時に書き込み処理を実行
することが可能となり、書き込みアドレスを検索する時
間が削減されることにより、データ書き込みの一層の効
率化が図れる。
As described above, in the fifth embodiment, when a data write request to the flash memory 4 is issued, the write address can be determined without searching for the address of an unstored record. By checking the size of the remaining records that have not been stored, always keep the records in the data non-stored state, and immediately execute the write process without repeating the erase and write procedures after a data write request occurs And the time required to search for a write address is reduced, so that the efficiency of data writing can be further increased.

【0032】[0032]

【発明の効果】本発明のデータ格納方法は、以上説明し
た通り、(1)消去単位となる複数のデータ格納可能な
レコードブロックを有する不揮発性メモリ、例えば
(6)フラッシュメモリ、におけるデータ未格納レコー
ドのアドレスを検索する手順イ、検索された上記アドレ
スのレコードにデータを書き込む手順ロ、上記手順ロの
後に残存するデータ未格納レコードのサイズを算出し、
算出された上記サイズが小さい場合には上記手順ロにお
いてデータが書き込まれたレコードが属するレコードブ
ロックとは別のレコードブロックの格納データを消去す
る手順ハを含むものであるので、従来技術におけるよう
な上記不揮発性メモリへのデータ格納の直前に長時間を
要するデータ消去処理の必要がなく、検索された上記デ
ータ未格納レコードへのデータの書き込みを効率よく行
なうことが可能となり、且つ重要なデータの欠落を防止
することができる。
According to the data storage method of the present invention, as described above, (1) non-data storage in a nonvolatile memory having a plurality of record blocks capable of storing data as an erasing unit, for example, (6) a flash memory A procedure for searching for the address of the record, a procedure for writing data to the record at the searched address, b, calculating the size of the data non-stored record remaining after the procedure b,
If the calculated size is small, the method includes a procedure C for erasing stored data in a record block different from the record block to which the record to which the data is written in the procedure B belongs. This eliminates the need for a long-term data erasing process immediately before storing data in the volatile memory, enables efficient writing of data to the retrieved data non-storage records, and eliminates the loss of important data. Can be prevented.

【0033】また(2)上記(1)において、上記手順
イにおいて、データ未格納レコードのアドレスの検索を
容易にする検索手段を利用するものであり、(3)上記
(2)において、上記検索手段は、格納データに付加さ
れてデータ格納の有無を意味するフラグであり、また
(4)上記(2)において、上記検索手段は、格納デー
タに付加されて次のデータを格納するレコードのアドレ
スを示すポインタであると、データ格納の有無の検索を
高効率で達成することができて、結果的にデータ格納の
処理が一層高効率となる。
(2) In the above (1), in the above procedure a, a search means for facilitating the search for an address of a record not storing data is used. (3) In the above (2), the above search is performed. The means is a flag added to the stored data to indicate the presence or absence of data storage. (4) In the above (2), the search means is an address of a record added to the stored data and storing the next data. With this pointer, the search for the presence or absence of data storage can be achieved with high efficiency, and as a result, the data storage process becomes even more efficient.

【0034】本発明のデータ格納方法は、以上説明した
通り、また(5)RAMが内蔵されたデータ格納装置を
用い、上記RAM上に次にデータを格納するレコードの
アドレスを示す書き込みポインタが有効である場合には
上記書込ポインタに従って、消去単位となる複数のデー
タ格納可能なレコードブロックを有する不揮発性メモ
リ、例えば(6)フラッシュメモリ、におけるデータ未
格納レコードにデータを書き込む手順ニ、上記手順ニの
後に残存するデータ未格納レコードのサイズを算出し、
算出された上記サイズが小さい場合には上記手順ニにお
いてデータが書き込まれたレコードが属するレコードブ
ロックとは別のレコードブロックの格納データを消去す
る手順ハを含むものであると、書き込みアドレスを検索
する手順が不要となるので、データ書き込みの効率化が
図れる効果がある。
As described above, the data storage method of the present invention uses (5) a data storage device having a built-in RAM, and the write pointer indicating the address of the next record for storing data on the RAM is effective. In the case of, the procedure d for writing data to a non-data-stored record in a non-volatile memory having a plurality of record blocks capable of storing data as an erasing unit, for example, (6) a flash memory in accordance with the write pointer. Calculate the size of the data-unrecorded record remaining after d,
If the calculated size is small, the procedure for erasing the stored data of a record block different from the record block to which the record to which the data was written in the procedure d belongs, and the procedure for searching the write address are included. Since it becomes unnecessary, there is an effect that the efficiency of data writing can be improved.

【0035】またさらに(7)上記(6)において、上
記(2)における上記検索手段として、初期状態および
格納データの消去状態がFFhであることを利用するも
のであると、上記(3)および(4)の場合と同様にデ
ータ格納の有無の検索を高効率で達成することができて
データ格納の処理が一層高効率となる。
(7) In the above (6), the search means in the above (2) utilizes the fact that the initial state and the erased state of the stored data are FFh. As in the case of (4), the search for the presence or absence of data storage can be achieved with high efficiency, and the data storage processing becomes more efficient.

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

【図1】 本発明のデータ格納方法における実施の形態
1で用いられるデータ格納装置の主要部分の概略構成
図。
FIG. 1 is a schematic configuration diagram of a main part of a data storage device used in a first embodiment in a data storage method of the present invention.

【図2】 実施の形態1におけるフラッシュメモリの概
略構造図。
FIG. 2 is a schematic structural diagram of a flash memory according to the first embodiment;

【図3】 実施の形態1におけるフラッシュメモリへの
データ格納動作を示すフローチャート。
FIG. 3 is a flowchart showing an operation of storing data in a flash memory according to the first embodiment;

【図4】 本発明のデータ格納方法における実施の形態
2でのフラッシュメモリの部分概略構造図。
FIG. 4 is a partial schematic structural diagram of a flash memory according to a second embodiment in the data storage method of the present invention.

【図5】 実施の形態2におけるフラッシュメモリへの
データ格納動作を示すフローチャート。
FIG. 5 is a flowchart showing an operation of storing data in a flash memory according to the second embodiment;

【図6】 実施の形態3におけるフラッシュメモリへの
データ格納動作を示すフローチャート。
FIG. 6 is a flowchart showing an operation of storing data in a flash memory according to the third embodiment.

【図7】 本発明のデータ格納方法における実施の形態
4でのフラッシュメモリの部分概略構造図。
FIG. 7 is a partial schematic structural diagram of a flash memory according to a fourth embodiment of the data storage method of the present invention.

【図8】 実施の形態4におけるフラッシュメモリへの
データ格納動作を示すフローチャート。
FIG. 8 is a flowchart showing an operation of storing data in a flash memory according to the fourth embodiment.

【図9】 本発明のデータ格納方法における実施の形態
5でのフラッシュメモリの概略構造図。
FIG. 9 is a schematic structural diagram of a flash memory according to a fifth embodiment of the data storage method of the present invention.

【図10】 実施の形態5におけるフラッシュメモリへ
のデータ格納動作を示すフローチャート。
FIG. 10 is a flowchart showing an operation of storing data in a flash memory according to the fifth embodiment.

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

1 CPU、 2 ROM、3 RAM、31 書き込
みポインタ、4 フラッシュメモリ、A レコードブロ
ック、B レコードブロック。
1 CPU, 2 ROM, 3 RAM, 31 write pointer, 4 flash memory, A record block, B record block.

Claims (7)

【特許請求の範囲】[Claims] 【請求項1】 消去単位となる複数のデータ格納可能な
レコードブロックを有する不揮発性メモリにおけるデー
タ未格納レコードのアドレスを検索する手順イ、検索さ
れた上記アドレスのレコードにデータを書き込む手順
ロ、上記手順ロの後に残存するデータ未格納レコードの
サイズを算出し、算出された上記サイズが小さい場合に
は上記手順ロにおいてデータが書き込まれたレコードが
属するレコードブロックとは別のレコードブロックの格
納データを消去する手順ハを含むことを特徴とするデー
タ格納方法。
1. A procedure for searching for an address of a non-data-stored record in a nonvolatile memory having a plurality of record blocks capable of storing data as an erasing unit, a procedure for writing data to a record at the searched address, b. Calculate the size of the data non-stored record remaining after step b, and if the calculated size is small, store the data stored in a record block other than the record block to which the record to which the data was written in step b belongs. A data storage method characterized by including an erasing procedure (c).
【請求項2】 上記手順イにおいて、データ未格納レコ
ードのアドレスの検索を容易にする検索手段を利用する
ことを特徴とする請求項1記載のデータ格納方法。
2. The data storage method according to claim 1, wherein in the step (a), a search means for facilitating a search for an address of a record not storing data is used.
【請求項3】 上記検索手段は、格納データに付加され
てデータ格納済を意味するフラグであることを特徴とす
る請求項2記載のデータ格納方法。
3. The data storage method according to claim 2, wherein said search means is a flag added to the stored data to indicate that data has been stored.
【請求項4】 上記検索手段は、格納データに付加され
て次のデータを格納するレコードのアドレスを示すポイ
ンタであることを特徴とする請求項2記載のデータ格納
方法。
4. The data storage method according to claim 2, wherein said search means is a pointer indicating an address of a record added to the stored data and storing the next data.
【請求項5】 RAMが内蔵されたデータ格納装置を用
い、上記RAM上に次にデータを格納するレコードのア
ドレスを示す書き込みポインタが有効である場合には上
記書込ポインタに従って、消去単位となる複数のデータ
格納可能なレコードブロックを有する不揮発性メモリに
おけるデータ未格納レコードにデータを書き込む手順
ニ、上記手順ニの後に残存するデータ未格納レコードの
サイズを算出し、算出された上記サイズが小さい場合に
は上記手順ニにおいてデータが書き込まれたレコードが
属するレコードブロックとは別のレコードブロックの格
納データを消去する手順ハを含むことを特徴とするデー
タ格納方法。
5. When a data storage device having a built-in RAM is used, and a write pointer indicating an address of a record for storing data next in the RAM is valid, an erase unit is set according to the write pointer. Procedure d for writing data to a data non-stored record in a nonvolatile memory having a plurality of record blocks capable of storing data, calculating the size of the data non-stored record remaining after the above procedure d, and when the calculated size is small And c. Erasing data stored in a record block other than the record block to which the record to which the data was written in step d above belongs.
【請求項6】 上記不揮発性メモリは、フラッシュメモ
リであることを特徴とする請求項1または請求項5記載
のデータ格納方法。
6. The data storage method according to claim 1, wherein the nonvolatile memory is a flash memory.
【請求項7】 上記請求項2における上記検索手段とし
て、初期状態および格納データの消去状態がFFhであ
ることを利用することを特徴とする請求項6記載のデー
タ格納方法。
7. The data storage method according to claim 6, wherein the retrieval means in the second aspect utilizes that the initial state and the erase state of the stored data are FFh.
JP2001105057A 2001-04-03 2001-04-03 Data storage method Pending JP2002304320A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2001105057A JP2002304320A (en) 2001-04-03 2001-04-03 Data storage method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2001105057A JP2002304320A (en) 2001-04-03 2001-04-03 Data storage method

Publications (1)

Publication Number Publication Date
JP2002304320A true JP2002304320A (en) 2002-10-18

Family

ID=18957815

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2001105057A Pending JP2002304320A (en) 2001-04-03 2001-04-03 Data storage method

Country Status (1)

Country Link
JP (1) JP2002304320A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100490603B1 (en) * 2002-12-06 2005-05-27 (주) 라모스테크놀러지 Control method and apparatus for operations of flash memory system
KR100947727B1 (en) 2003-01-21 2010-03-16 엘지전자 주식회사 Rom image composing and updating method for flash memory

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100490603B1 (en) * 2002-12-06 2005-05-27 (주) 라모스테크놀러지 Control method and apparatus for operations of flash memory system
KR100947727B1 (en) 2003-01-21 2010-03-16 엘지전자 주식회사 Rom image composing and updating method for flash memory

Similar Documents

Publication Publication Date Title
US6172906B1 (en) Increasing the memory performance of flash memory devices by writing sectors simultaneously to multiple flash memory devices
US6034897A (en) Space management for managing high capacity nonvolatile memory
US6262918B1 (en) Space management for managing high capacity nonvolatile memory
US7549013B2 (en) Increasing the memory performance of flash memory devices by writing sectors simultaneously to multiple flash memory devices
US6757800B1 (en) Increasing the memory performance of flash memory devices by writing sectors simultaneously to multiple flash memory devices
US7421624B2 (en) Data recovery apparatus and method used for flash memory
US6839798B1 (en) Flash memory capable of storing frequently rewritten data
JP2000020252A (en) Storage device using nonvolatile semiconductor memory
US20010014933A1 (en) Memory management table producing method and memory device
JP2003058417A (en) Storage device
JP2002304320A (en) Data storage method
JPH09259046A (en) Method for storing data in flash memory and method for reading data out of flash memory
JP2005531842A (en) Non-volatile memory writing method and system for realizing the method
JPH0764831A (en) Data storage device
JP2001318824A (en) System for managing data of flash memory and recording medium with its program recorded
JP2003140979A (en) Recording method to eeprom
KR100521155B1 (en) Apparatus and method for writing data in flash memory
JP2000057061A (en) Storage device using flash memory and its control method
JP2002244935A (en) Storage managing device and storage managing method
CN114371816A (en) Data storage method and electronic equipment
JP4935101B2 (en) Memory access method and apparatus
CN115373607A (en) Data storage method and device
JPH10312693A (en) Storage device
JP2010039676A (en) Data management method
JPH11134880A (en) Apparatus and method of controlling memory

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070220

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20070619