JP4572930B2 - Information processing device - Google Patents

Information processing device Download PDF

Info

Publication number
JP4572930B2
JP4572930B2 JP2007304492A JP2007304492A JP4572930B2 JP 4572930 B2 JP4572930 B2 JP 4572930B2 JP 2007304492 A JP2007304492 A JP 2007304492A JP 2007304492 A JP2007304492 A JP 2007304492A JP 4572930 B2 JP4572930 B2 JP 4572930B2
Authority
JP
Japan
Prior art keywords
area
data
write
erase
buffer
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2007304492A
Other languages
Japanese (ja)
Other versions
JP2008097635A (en
Inventor
尚人 菅井
敦 攝津
三郎 古林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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 JP2007304492A priority Critical patent/JP4572930B2/en
Publication of JP2008097635A publication Critical patent/JP2008097635A/en
Application granted granted Critical
Publication of JP4572930B2 publication Critical patent/JP4572930B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

本発明は、あらかじめ定められた消去単位での消去および書き込みがなされる複数の消去単位領域を有するメモリ、例えばフラッシュメモリを使用する情報処理装置に関するものである。   The present invention relates to an information processing apparatus using a memory having a plurality of erase unit areas that are erased and written in predetermined erase units, for example, a flash memory.

フラッシュメモリは、電気的に消去・書き込みが可能な半導体メモリであり、電源を供給しなくても記憶内容を保持できるという特徴がある。フラッシュメモリは、特に産業用コンピュータにおいて、ハードディスクに代わる記録媒体として使用されることが多い。
しかし、フラッシュメモリにおいては、新たなデータを直接上書きすることができない。つまり、フラッシュメモリ上のデータの書き換えを行なうには、書き込みの前にまず、64Kなどといった消去単位を、一旦、一括して消去しなければならない。消去単位を消去した後、消去した消去単位全体を新たに書き込むことによりデータの書き換えを行なう。
A flash memory is an electrically erasable and writable semiconductor memory, and has a feature that stored contents can be held without supplying power. Flash memory is often used as a recording medium in place of a hard disk, particularly in industrial computers.
However, new data cannot be directly overwritten in the flash memory. That is, in order to rewrite data on the flash memory, first, erase units such as 64K must be erased once in a lump before writing. After erasing the erase unit, data is rewritten by newly writing the entire erased erase unit.

特に、大容量・高密度のフラッシュメモリは、その構造上、一般に消去単位が書き換え単位に比べ大きい。従って、書き換えデータが消去単位よりも容量の小さいことが多くなるが、このようなデータを書き換える場合でも、書き換えないデータ部分も含めた消去単位全体を一旦消去し、書き換えないデータ部分も、もう一度フラッシュメモリに書き込まなくてはならない。
このための書き換え方式の技術として、特許文献1がある。図18は、この従来技術の回路の概略を示す構成図である。図18を用いて動作を説明する。
In particular, a large-capacity and high-density flash memory generally has a larger erase unit than a rewrite unit due to its structure. Therefore, the rewritten data often has a smaller capacity than the erase unit, but even when rewriting such data, the entire erase unit including the data portion that is not rewritten is once erased, and the data portion that is not rewritten is flashed again. Must be written to memory.
As a technique of the rewriting method for this purpose, there is Patent Document 1. FIG. 18 is a block diagram showing an outline of this prior art circuit. The operation will be described with reference to FIG.

FRAM(登録商標)4のデータの書き換え動作について説明する。SRAM3上に、FRAM(登録商標)4の書き換え情報をダウンロードする。FRAM(登録商標)4上における書き換えないエリアの情報を、レジスタ5にコピーし、EPROM2内のFRAM(登録商標)クリアプログラムによって、FRAM(登録商標)4の内容を全消去する。そして、SRAM3上にダウンロードした書き換え情報をFRAM(登録商標)4にコピーし、さらに、レジスタ5に待避しておいた情報をFRAM(登録商標)4上の元の書き換えないエリアにコピーする。 The data rewriting operation of FRAM (registered trademark) 4 will be described. Rewrite information of FRAM (registered trademark) 4 is downloaded onto the SRAM 3. The information of the area that is not rewritten on the FRAM (registered trademark) 4 is copied to the register 5 and the contents of the FRAM (registered trademark) 4 are completely erased by the FRAM (registered trademark) clear program in the EPROM 2. Then, the rewrite information downloaded on the SRAM 3 is copied to the FRAM (registered trademark) 4, and the information saved in the register 5 is copied to the original non-rewritten area on the FRAM (registered trademark) 4.

しかし、上記従来技術においては、フラッシュメモリの書き換え時に情報を待避する領域であるレジスタ5として揮発性のメモリを使用すると、消去後に装置への電源供給が断たれた等の場合には、書き換えを行なう領域のみならず、書き換えを行なわない領域のデータまでもが失われてしまい、信頼性を低下させるという問題があった。
又、このようにレジスタに記録されたデータが消失することを防ぐためには、レジスタに一旦記録されたデータは、すぐにフラッシュメモリに書き込まなくてはならなかった。そのため、動作上、フラッシュメモリの書き換え毎にフラッシュメモリの消去を行う必要があり、結果として、書き換えの回数と同じ回数だけの消去回数が必要であった。一方、フラッシュメモリには、消去可能な回数に制限(一般に10万回程度)があり、できるだけ消去回数を減らすことも必要であるが、上記従来技術においては、徒にフラッシュメモリの消去回数を増やすことになり、その寿命を短縮させる原因となっていた。
However, in the above prior art, if a volatile memory is used as the register 5 which is an area for saving information at the time of rewriting the flash memory, the rewriting is performed when the power supply to the apparatus is cut off after erasing. Not only the area to be performed but also the data in the area not to be rewritten is lost, and there is a problem that the reliability is lowered.
Further, in order to prevent the data recorded in the register from being lost in this way, the data once recorded in the register must be immediately written in the flash memory. Therefore, in operation, it is necessary to erase the flash memory every time the flash memory is rewritten, and as a result, the number of times of erasure equal to the number of times of rewriting is necessary. On the other hand, the flash memory has a limit on the number of times that it can be erased (generally about 100,000 times), and it is necessary to reduce the number of times of erasing as much as possible. As a result, it was a cause of shortening the service life.

この発明は、上記のような問題を解決するためになされたもので、フラッシュメモリのデータを書き換える場合に、メモリのデータが容易に消去することなく、フラッシュメモリへのデータ書き込み時の信頼性を向上させた情報処理装置を提供することを第1の目的とする。
又、本発明は、フラッシュメモリの消去回数への制限の課題に対し、簡易な構造で、かつ信頼性を維持しつつ、フラッシュメモリの消去回数を削減することにより、フラッシュメモリの劣化を低減することのできる情報処理装置を提供することを第2の目的とする。
The present invention has been made to solve the above-described problems. When data in the flash memory is rewritten, the memory data is not easily erased, and the reliability at the time of data writing to the flash memory is improved. A first object is to provide an improved information processing apparatus.
Further, the present invention reduces the deterioration of the flash memory by reducing the number of erases of the flash memory while maintaining the reliability with a simple structure in response to the problem of limiting the number of erases of the flash memory. A second object of the present invention is to provide an information processing apparatus that can handle the above.

この発明における情報処理装置は、あらかじめ定められた消去単位でデータの消去および書き込みがなされる複数の消去単位領域を有する第1のメモリと、前記消去単位領域に記憶されたデータを前記消去単位で消去する消去手段とを有し、前記消去単位領域に記憶されたデータを第1の書き込みデータに書き換える情報処理装置において、消去ブロックバッファおよび書き込み禁止フラグ領域を備えた任意のデータ単位でデータの書き込みが可能な不揮発性の第2のメモリと、前記第1のメモリの第1の消去単位領域に前記第1の書き込みデータを書き込むことを要求する第1の書き込み要求に対し、前記書き込み禁止フラグ領域の値が書き込み許可状態になっている場合に、前記第1の書き込みデータを前記消去ブロックバッファに書き込む書き込み制御手段と、前記第1の書き込み要求に対し、前記書き込み禁止フラグ領域の値が書き込み許可状態になっている場合に、前記第1の消去単位領域内の不変データを前記消去ブロックバッファに書き込む待避手段と、前記書き込み禁止フラグ領域の値が書き込み許可状態になっている場合に、前記消去ブロックバッファの内容を第1のメモリに書き込むメモリ書き込み手段とを備え、前記メモリ書き込み手段は、前記書き込み禁止フラグ領域の値が書き込み許可状態から書き込み禁止状態になった場合に、前記消去ブロックバッファの内容を第1のメモリに書き込むことを特徴とするものである。 The information processing apparatus according to the present invention includes a first memory having a plurality of erase unit areas in which data is erased and written in a predetermined erase unit, and data stored in the erase unit area in the erase unit. An information processing apparatus having an erasing unit for erasing and rewriting data stored in the erasing unit area to first write data, and writing data in an arbitrary data unit including an erasing block buffer and a write prohibition flag area And a write prohibition flag area for a first write request that requests writing of the first write data to the first erase unit area of the first memory. Is written to the erase block buffer, the first write data is written to the erase block buffer. When the value of the write prohibition flag area is in a write enable state in response to the first write request and the write control means, the invariant data in the first erase unit area is stored in the erase block buffer. A write saving unit; and a memory writing unit that writes the contents of the erase block buffer to a first memory when the value of the write prohibition flag area is in a write-permitted state, and the memory writing unit includes: The contents of the erase block buffer are written to the first memory when the value of the write inhibit flag area changes from the write enable state to the write inhibit state .

この発明によれば、メモリ書き込み手段は書き込み禁止フラグ領域の値が書き込み許可状態のときのみ消去ブロックバッファへの書き込みを実施するようにしたので、データの書き込みを抑制する情報処理装置を得ることができる。   According to the present invention, since the memory writing means performs writing to the erase block buffer only when the value of the write prohibition flag area is in the write enabled state, an information processing apparatus that suppresses data writing can be obtained. it can.

実施の形態1.
図1はこの発明の一実施の形態である情報処理装置の構成を示す図である。図1において、101は複数の消去単位領域からなるフラッシュメモリである。このフラッシュメモリは、予め定められた消去単位ごとにデータの消去および書き込みがなされるメモリである。
102は、フラッシュメモリとは異なり、データの書き換えのために一定の消去単位を消去する必要がなく任意のデータ単位でメモリへのデータの直接書き込みが可能であり、かつ不揮発性のメモリである。具体的には、バッテリーバックアップSRAMである。
Embodiment 1 FIG.
FIG. 1 is a diagram showing a configuration of an information processing apparatus according to an embodiment of the present invention. In FIG. 1, reference numeral 101 denotes a flash memory composed of a plurality of erase unit areas. This flash memory is a memory in which data is erased and written for each predetermined erase unit.
Unlike a flash memory, 102 is a non-volatile memory in which it is not necessary to erase a certain erase unit for rewriting data, and data can be directly written to the memory in an arbitrary data unit. Specifically, it is a battery backup SRAM.

103は、不揮発性メモリ102であるバッテリーバックアップSRAM上に設けられ、フラッシュメモリの1つの消去単位領域内のデータを退避して記録するのに十分な大きさの容量を持つ消去ブロックバッファである。本実施の形態においては、消去単位領域と同容量の領域を有するエリアで構成している。この消去ブロックバッファ103は不揮発性メモリであるバッテリーバックアップSRAM上に構成されているので、任意のデータ単位でデータの書き込みが可能である。111はフラッシュメモリ101へのデータの書き込みを制御する書き込み制御手段、112は消去単位領域内のデータを消去ブロックバッファ103に待避させる待避手段、301はフラッシュメモリ101に対し消去単位領域の消去のための命令を出す消去命令手段である。302はフラッシュメモリ101に書き込みデータの書き込みを行う書き込み手段である。以下、書き込みデータとは、フラッシュメモリ101や不揮発性メモリ102等のメモリに対して新たに書き込むべきデータを意味し、又、書き込み要求に含まれる書き込みデータを特に書き込み要求データと呼ぶ。
202は、不揮発性メモリ102内のエリアであって、消去単位番号を記録する消去単位番号保持領域である。
Reference numeral 103 denotes an erase block buffer which is provided on the battery backup SRAM which is the nonvolatile memory 102 and has a capacity large enough to save and record data in one erase unit area of the flash memory. In the present embodiment, it is constituted by an area having an area having the same capacity as the erase unit area. Since the erase block buffer 103 is configured on a battery backup SRAM which is a nonvolatile memory, data can be written in an arbitrary data unit. 111 is a write control means for controlling data writing to the flash memory 101, 112 is a save means for saving data in the erase unit area in the erase block buffer 103, and 301 is for erasing the erase unit area from the flash memory 101. This is an erasure command means for issuing the command. Reference numeral 302 denotes writing means for writing write data into the flash memory 101. Hereinafter, the write data means data to be newly written to a memory such as the flash memory 101 and the nonvolatile memory 102, and the write data included in the write request is particularly referred to as write request data.
Reference numeral 202 denotes an area in the non-volatile memory 102, which is an erase unit number holding area for recording an erase unit number.

図2は、この実施形態を実現する、具体的なシステムの概略を示す構成図である。181はプロセッサ、102はバッテリーバックアップSRAM、101はフラッシュメモリ、184は入出力インターフェース、185は主記憶としてのDRAMである。書き込み制御手段111、待避手段112、消去命令手段301、書き込み手段302のそれぞれは、プロセッサ上181でソフトウェアが動作することにより実現される。フラッシュメモリ101の消去単位領域内のデータの消去は、消去命令手段301から消去命令を受けたフラッシュメモリ101が、ハードウェア的に行う。この消去単位の具体的な消去は、フラッシュメモリ101が備えた消去手段(不図示)が行う。新たなデータ書き込みは、例えば、入出力インターフェース184から書き込み要求をプロセッサ181が受けることにより行われる。   FIG. 2 is a configuration diagram showing an outline of a specific system for realizing this embodiment. Reference numeral 181 denotes a processor, 102 denotes a battery backup SRAM, 101 denotes a flash memory, 184 denotes an input / output interface, and 185 denotes a DRAM as a main memory. Each of the write control unit 111, the save unit 112, the erase command unit 301, and the write unit 302 is realized by software operating on the processor 181. Data in the erase unit area of the flash memory 101 is erased in hardware by the flash memory 101 that has received the erase command from the erase command means 301. The specific erasing of the erasing unit is performed by an erasing unit (not shown) provided in the flash memory 101. New data is written, for example, when the processor 181 receives a write request from the input / output interface 184.

以下、本実施の形態における、フラッシュメモリ101上のデータの書き換え動作について説明する。図3は、本実施の形態における情報処理装置が、フラッシュメモリ101上のデータの書き換えを行うフローチャートである。以下の各処理は、断りがない限り書き込み制御手段111が行う。
まず、S101において、フラッシュメモリ101へのデータの書き込み要求を受ける。この書き込み要求には、書き込むデータとしての書き込み要求データ、データを書き込むフラッシュメモリ上のアドレスを特定する書き込み要求領域、そしてデータの大きさの情報が含まれている。
次に、S102において、消去単位の容量と書き込み要求領域から、書き込み要求領域を含む消去単位の番号と、書き込み要求領域が対応する消去単位内の位置を算出する。尚、書き込み要求領域はフラッシュメモリ101全体の相対的位置を特定するアドレスであり、消去単位内の位置は特定の消去単位内での相対的位置を特定するものである。
Hereinafter, the data rewriting operation on the flash memory 101 in this embodiment will be described. FIG. 3 is a flowchart in which the information processing apparatus according to the present embodiment rewrites data on the flash memory 101. The following processes are performed by the write control unit 111 unless otherwise specified.
First, in S101, a data write request to the flash memory 101 is received. This write request includes write request data as data to be written, a write request area for specifying an address on the flash memory to which data is written, and data size information.
Next, in S102, the erase unit number including the write request area and the position in the erase unit corresponding to the write request area are calculated from the capacity of the erase unit and the write request area. The write request area is an address for specifying the relative position of the entire flash memory 101, and the position in the erase unit is for specifying the relative position in the specific erase unit.

さらにS103において、書き込み要求データを、消去ブロックバッファ103内の領域であって、書き込み要求領域に対応した位置に書き込む。即ち、S102において算出した消去単位内の位置に対応する消去ブロックバッファ103内の位置に書き込まれる。
そして、S104において、待避手段112に待避指示を出す。この待避指示には、消去単位の番号と、書き込み要求領域が対応する消去単位内の位置についての情報が含まれている。この指示を受けた待避手段112は、S102において算出した消去単位番号の消去単位領域内のデータであって、S103において書き込まれた領域に対応する部分以外のデータである不変データを、消去ブロックバッファ103に書き込む。この明細書において、不変データとは、消去単位領域内のデータの内、書き込み要求データによって書き換えられないデータをいう。
Further, in S103, the write request data is written into an area in the erase block buffer 103 at a position corresponding to the write request area. That is, the data is written in the position in the erase block buffer 103 corresponding to the position in the erase unit calculated in S102.
In S104, a save instruction is issued to the save unit 112. This save instruction includes information on the number of erase units and the position in the erase unit corresponding to the write request area. Upon receiving this instruction, the saving unit 112 stores the invariant data, which is data in the erase unit area of the erase unit number calculated in S102 and is data other than the part corresponding to the area written in S103, in the erase block buffer. 103 is written. In this specification, invariant data refers to data that cannot be rewritten by write request data among data in an erase unit area.

続いてS105において、消去命令手段301に対して消去指示を出す。この消去指示には、フラッシュメモリ101の消去単位の番号が含まれている。この指示を受けた消去命令手段301は、フラッシュメモリ101の消去手段に対し、消去単位の番号が対応するフラッシュメモリ内の1つの消去単位を消去するように命令を出す。フラッシュメモリ101の消去手段による消去が完了すると、書き込み手段302が消去ブロックバッファ103に記憶されたデータを、消去されたフラッシュメモリ101内の消去単位領域に書き込む。
書き込み要求発生の度にS101〜S105の処理が実行される。
Subsequently, in S105, an erase instruction is issued to the erase command means 301. This erase instruction includes the number of the erase unit of the flash memory 101. Upon receipt of this instruction, the erase command means 301 issues an instruction to the erase means of the flash memory 101 so as to erase one erase unit in the flash memory corresponding to the erase unit number. When erasing by the erasing unit of the flash memory 101 is completed, the writing unit 302 writes the data stored in the erasing block buffer 103 to the erase unit area in the erased flash memory 101.
Every time a write request occurs, the processing of S101 to S105 is executed.

ここで、フラッシュメモリ101内のデータの消去からフラッシュメモリ101への書き込みまでの間に装置に対する電源断が発生した場合の復旧処理について説明する。不揮発性メモリ102上の消去ブロックバッファ103にフラッシュメモリ101への書き込みが完了していないデータがあるときに、電源入力後に、この消去ブロックバッファ103上のデータをフラッシュメモリ101に再度書き込む処理について説明する。   Here, a description will be given of a recovery process in the case where the power supply to the apparatus is interrupted between erasing data in the flash memory 101 and writing to the flash memory 101. FIG. A description will be given of a process of rewriting data in the erase block buffer 103 to the flash memory 101 after power is input when there is data in the erase block buffer 103 on the nonvolatile memory 102 that has not been written to the flash memory 101. To do.

まず、通常の処理について説明する。
書き込み制御手段111は、S105において、フラッシュメモリ101の消去指示を出した後、この消去指示に含まれるフラッシュメモリ101の消去単位の番号を、不揮発性メモリ102内に設けられた消去単位番号保持領域202に記録する。
フラッシュメモリ101へのデータの書き込みが終了すると、書き込み制御手段111は消去単位番号保持領域202に記録された消去単位番号を無効にする。
First, normal processing will be described.
In step S105, the write control unit 111 issues an erase instruction for the flash memory 101, and then, the erase unit number holding area provided in the nonvolatile memory 102 indicates the erase unit number of the flash memory 101 included in the erase instruction. 202.
When the writing of data to the flash memory 101 is completed, the write control unit 111 invalidates the erase unit number recorded in the erase unit number holding area 202.

次に、フラッシュメモリ101の消去からフラッシュメモリ101への書き込みまでの間に装置に対する電源断が発生した場合の、復旧処理について説明する。
電源断の発生及び電源入力後に、書き込み制御手段111は、不揮発性メモリ102内の消去単位番号保持領域202を確認する。消去単位番号保持領域202に有効な消去単位番号が存在している場合には、書き込みが終了していないと判断され、消去ブロックバッファ103に記録されているデータを、フラッシュメモリ101へ書き込む処理を行う。消去ブロックバッファ103に記録されているデータが書き込まれるフラッシュメモリ101内の消去単位の番号は、消去単位番号保持領域202に記録されている。その後、消去単位番号保持領域202に記憶された消去単位番号を無効にする。消去単位番号保持領域202に有効な消去単位番号が存在しない場合には、フラッシュメモリ101へ書き込む処理を行なわずに、そのまま復旧処理を終了する。
以上の処理により、装置に対する電源断が発生した場合の、復旧処理が可能となる。
Next, a description will be given of a recovery process in the case where the power supply to the apparatus is interrupted between erasing the flash memory 101 and writing to the flash memory 101. FIG.
After the occurrence of power interruption and power input, the write control unit 111 checks the erase unit number holding area 202 in the nonvolatile memory 102. When a valid erase unit number exists in the erase unit number holding area 202, it is determined that the writing has not been completed, and the process of writing the data recorded in the erase block buffer 103 to the flash memory 101 is performed. Do. The number of the erase unit in the flash memory 101 to which the data recorded in the erase block buffer 103 is written is recorded in the erase unit number holding area 202. Thereafter, the erase unit number stored in the erase unit number holding area 202 is invalidated. If there is no valid erase unit number in the erase unit number holding area 202, the restoration process is terminated without performing the process of writing to the flash memory 101.
With the above processing, it is possible to perform recovery processing when the power supply to the apparatus is interrupted.

以上のように、この実施の形態によれば、フラッシュメモリ101上の書き換えが行なわれる消去単位内のデータは不揮発性メモリ上の消去ブロックバッファ103領域に待避されているため、フラッシュメモリ上のデータの消去後、フラッシュメモリへの新たなデータの書き込みが完了する前に電源断等が発生しても、データが失われることがなく、フラッシュメモリ上の書き換えに関し、信頼性の高い情報処理装置を得ることができる。   As described above, according to this embodiment, the data in the erase unit to be rewritten on the flash memory 101 is saved in the erase block buffer 103 area on the nonvolatile memory. After erasing data, even if a power interruption occurs before writing new data to the flash memory, the data is not lost, and a highly reliable information processing device is available for rewriting on the flash memory. Obtainable.

尚、本実施の形態においては、S103で書き込みデータを消去ブロックバッファ103に書き込んだ後に、S104において不変データを待避させているが、この順番が逆であってもよい。又、待避手段112による待避を行った後に、書き込みデータを消去ブロックバッファ103に書き込む場合には、待避させるデータは不変データだけはなく、不変データを含んだ消去単位内の全データを待避させ、その後、待避させたデータに書き込みデータを上書きすればよい。   In this embodiment, after the write data is written to the erase block buffer 103 in S103, the invariant data is saved in S104. However, this order may be reversed. Further, when writing data to the erasure block buffer 103 after saving by the saving means 112, the data to be saved is not limited to the invariant data, and all the data in the erase unit including the invariant data is saved. Thereafter, the write data may be overwritten on the saved data.

また、本実施の形態においては、S103で書き込みデータを消去ブロックバッファ103に書き込むこととしているが、書き込みデータの消去ブロックバッファ103への書き込みは、遅くとも、書き込み手段302が消去ブロックバッファ103に記憶されたデータをフラッシュメモリ101内の消去単位領域に書き込む前までに完了していれば良い。
さらに、本実施の形態ではS102において、消去単位の容量と書き込み要求領域から、書き込み要求領域を含む消去単位の番号と、書き込み要求領域が対応する消去単位内の位置を算出しているが、書き込み要求データにこれらデータを含めるようにすることも可能である。その場合には、S102の算出処理は省略される。
In this embodiment, write data is written to the erase block buffer 103 in S103. However, the write means 302 is stored in the erase block buffer 103 at the latest when the write data is written to the erase block buffer 103. It is sufficient that the data is completed before the data is written to the erase unit area in the flash memory 101.
Further, in this embodiment, in S102, the erase unit number including the write request area and the position in the erase unit corresponding to the write request area are calculated from the erase unit capacity and the write request area. It is possible to include these data in the request data. In that case, the calculation process of S102 is omitted.

この実施の形態において、フラッシュメモリ101は、あらかじめ定められた消去単位でデータの消去および書き込みがなされる複数の消去単位領域を有するメモリの一例であり、フラッシュメモリ101の消去手段(不図示)は、前記消去単位領域に記憶されたデータを前記消去単位で消去する消去手段の一例であり、バッテリーバックアップSRAM102は、任意のデータ単位でデータの書き込みが可能な不揮発性の消去ブロックバッファの一例である。また、書き込み制御手段111は、消去ブロックバッファに書き込みデータを書き込む書き込みデータ書き込み手段の一例であり、待避手段112は、不変データを消去ブロックバッファに書き込む待避手段の一例であり、書き込み手段302は、書き込みデータおよび不変データを消去単位領域に書き込むメモリ書き込み手段の一例である。   In this embodiment, the flash memory 101 is an example of a memory having a plurality of erase unit areas in which data is erased and written in a predetermined erase unit, and an erase unit (not shown) of the flash memory 101 is used. The erasing unit erases data stored in the erasing unit area in the erasing unit. The battery backup SRAM 102 is an example of a non-volatile erasing block buffer capable of writing data in an arbitrary data unit. . The write control unit 111 is an example of a write data writing unit that writes write data to the erase block buffer, the save unit 112 is an example of a save unit that writes invariant data to the erase block buffer, and the write unit 302 It is an example of a memory writing means for writing write data and invariant data into an erase unit area.

実施の形態2.
図4は、本発明の他の実施形態である、情報処理装置の概略を示す構成図である。図において、201はフラッシュメモリ101又は不揮発性メモリ102からデータを読み出す読み出し手段、202は不揮発性メモリ102内のエリアであって、消去単位番号を記録する消去単位番号保持領域である。他の構成は、図1において説明した構成の同一又は相当部であり、説明を省略する。読み出し手段201は、ソフトウエアがプロセッサ181上で動作することにより実現される。
尚、本実施の形態においては、特に、同一の消去単位領域へ、連続して書き込みデータを書き込む場合の動作について説明する。
Embodiment 2. FIG.
FIG. 4 is a configuration diagram showing an outline of an information processing apparatus according to another embodiment of the present invention. In the figure, 201 is a reading means for reading data from the flash memory 101 or the nonvolatile memory 102, and 202 is an area in the nonvolatile memory 102, which is an erase unit number holding area for recording the erase unit number. The other configuration is the same as or equivalent to the configuration described with reference to FIG. The reading unit 201 is realized by software operating on the processor 181.
In the present embodiment, an operation in the case where write data is continuously written to the same erase unit area will be described.

本実施の形態において、メモリへのデータ書き込み時の動作を図5を用いて説明する。ここでメモリとは、フラッシュメモリ101と不揮発性メモリ102の双方を含む概念である。尚、以下の各処理は、断りがない限り書き込み制御手段111の動作である。
まず、S201において、フラッシュメモリ101へのデータの書き込み要求を受ける。この要求の内容は、実施の形態1と同様である。
次に、S202において、書き込み要求領域を含むフラッシュメモリの消去単位の番号を求める。この消去単位の番号を求める方法は、実施の形態1と同様である。
In this embodiment mode, operation at the time of data writing to the memory will be described with reference to FIG. Here, the memory is a concept including both the flash memory 101 and the nonvolatile memory 102. The following processes are operations of the write control unit 111 unless otherwise specified.
First, in S201, a data write request to the flash memory 101 is received. The contents of this request are the same as in the first embodiment.
Next, in S202, the erase unit number of the flash memory including the write request area is obtained. The method for obtaining the erase unit number is the same as in the first embodiment.

続いて、S203において、消去単位番号保持領域202を参照し、消去単位番号保持領域202に消去単位番号の記録が存在するかを判定する。
消去番号の記録が存在しなければ、S204において、書き込みデータを消去ブロックバッファ103に書き込む。消去ブロックバッファ103への書き込み動作は、実施の形態1と同様である。
次に、S205において、待避手段112に対して待避指示を行なう。待避指示の内容は、実施の形態1と同様である。待避手段112は、S202で求めた番号のフラッシュメモリの消去単位から、不変データを消去ブロックバッファ103に書き込む。
続いて、S206において、S202において求めた消去単位番号を消去番号保持領域202に記録する。この後、フラッシュメモリ101にデータを書き込むことなく、メモリへのデータの書き込み処理を終了する。
Subsequently, in S203, the erase unit number holding area 202 is referred to and it is determined whether or not the erase unit number is recorded in the erase unit number holding area 202.
If there is no record of the erase number, write data is written to the erase block buffer 103 in S204. The write operation to the erase block buffer 103 is the same as in the first embodiment.
Next, in S205, the saving unit 112 is instructed to save. The contents of the save instruction are the same as those in the first embodiment. The saving unit 112 writes invariant data to the erase block buffer 103 from the erase unit of the flash memory having the number obtained in S202.
Subsequently, in S206, the erase unit number obtained in S202 is recorded in the erase number holding area 202. Thereafter, the data writing process to the memory is terminated without writing the data to the flash memory 101.

S203において消去単位番号保持領域202に消去単位番号の記録が存在する場合には、S207において、S202で求めた消去単位番号が消去単位番号保持領域202に存在する記録と一致するかを判定する。
判定により消去単位番号が異なる場合には、S208において、消去命令手段301に対し消去指示を行なう。消去指示の内容は実施の形態1と同様である。この指示を受けた消去命令手段301は、フラッシュメモリ101の消去手段に対し、消去単位の番号が対応するフラッシュメモリ内の1つの消去単位を消去するように命令を出す。フラッシュメモリ101の消去手段による消去が完了すると、書き込み手段302が消去ブロックバッファ103の内容を、フラッシュメモリ101内のこの消去単位の領域に書き込む。
If there is an erase unit number record in the erase unit number holding area 202 in S203, it is determined in S207 whether the erase unit number obtained in S202 matches the record in the erase unit number holding area 202.
If the erase unit number differs depending on the determination, an erase instruction is issued to the erase command means 301 in S208. The contents of the erase instruction are the same as in the first embodiment. Upon receipt of this instruction, the erase command means 301 issues an instruction to the erase means of the flash memory 101 so as to erase one erase unit in the flash memory corresponding to the erase unit number. When erasing by the erasing means of the flash memory 101 is completed, the writing means 302 writes the contents of the erasure block buffer 103 into this erasure unit area in the flash memory 101.

続いて、消去単位番号の記録が存在しない場合と同様に、S204からS206の処理を行ない、書き込みデータの消去ブロックバッファへの書き込み、フラッシュメモリからのデータの退避、消去単位番号の記録を行なう。
S207でS202で求めた消去単位番号が消去単位番号保持領域202に存在する記録と一致する場合には、S209において、書き込み要求データを消去ブロックバッファ103へ書き込む。
以上説明したように、消去単位番号の記録が存在していない場合にはS201〜S206の手順で処理が実行され、消去単位番号の記録が存在している場合にはS201〜S203、S207、S208、S204〜S206の手順で処理が実行されるか若しくは、S201〜S203、S207、S209の手順で処理が実行される。即ち、書き込み要求が第1回目の要求であった場合には、S201〜S206の手順で処理が実行され、第2回目の書き込み要求以降は、S201〜S203、S207、S208、S204〜S206の手順で処理が実行されるか若しくは、S201〜S203、S207、S209の手順で処理が実行される。以上の処理が書き込み要求が発生する度に実行される。
Subsequently, similarly to the case where no erasure unit number is recorded, the processing from S204 to S206 is performed to write the write data to the erasure block buffer, save the data from the flash memory, and record the erasure unit number.
If the erase unit number obtained in S202 in S207 matches the record existing in the erase unit number holding area 202, the write request data is written into the erase block buffer 103 in S209.
As described above, when the erase unit number record does not exist, the process is executed in the steps S201 to S206, and when the erase unit number record exists, the steps S201 to S203, S207, and S208 are performed. The processing is executed in the sequence of S204 to S206, or the processing is executed in the sequence of S201 to S203, S207, and S209. That is, when the write request is the first request, the process is executed in the steps S201 to S206, and after the second write request, the steps S201 to S203, S207, S208, and S204 to S206 are performed. The process is executed in step S201 or S203, S207, and S209. The above processing is executed every time a write request occurs.

次に、メモリからのデータ読み出し時の動作について図6を用いて説明する。以下の各処理は、断りがない限り読み出し手段201の動作である。
まず、S211において読み出し要求を受ける。読み出し要求には、読み出し要求領域としてのフラッシュメモリ101のアドレスと読み出すデータの大きさに関する情報が含まれている。
次に、S212において、読み出し要求領域を含むフラッシュメモリの消去単位の番号を書き込み時と同様に求める。尚、読み出し要求領域とは、読み出すべきデータが記憶されているフラッシュメモリ101上のエリアであり、フラッシュメモリ101上の相対的位置を特定する。
Next, the operation at the time of reading data from the memory will be described with reference to FIG. The following processes are operations of the reading unit 201 unless otherwise specified.
First, a read request is received in S211. The read request includes information on the address of the flash memory 101 serving as a read request area and the size of data to be read.
Next, in S212, the erase unit number of the flash memory including the read request area is obtained in the same manner as at the time of writing. The read request area is an area on the flash memory 101 in which data to be read is stored, and specifies a relative position on the flash memory 101.

続いて、S213において、消去単位番号保持領域202を参照し、消去単位番号の記録が存在し、かつその消去単位番号がS212において求めたものと一致するかを判定する。
一致した場合には、読み出し領域のデータは消去ブロックバッファに保持されているので、S214において、消去ブロックバッファからデータを読み出す。
消去単位番号の記録が消去単位番号保持領域202に存在しないか、あるいは記録された消去番号がS212おいて求めたものと一致しない場合には、読み出し領域のデータは消去ブロックバッファに保持されていないので、S215において、フラッシュメモリからデータの読み出しを行なう。
Subsequently, in S213, the erase unit number holding area 202 is referred to and it is determined whether or not there is a record of the erase unit number and the erase unit number matches the one obtained in S212.
If they match, the data in the read area is held in the erase block buffer, so in S214, the data is read from the erase block buffer.
If the record of the erase unit number does not exist in the erase unit number holding area 202 or the recorded erase number does not match that obtained in S212, the data in the read area is not held in the erase block buffer. Therefore, in S215, data is read from the flash memory.

以上のように本実施の形態によれば、フラッシュメモリの同一の消去単位領域へ続けて書き込みを行う場合、1回目のデータ書き込みデータを不揮発性メモリ上の消去ブロックバッファに書き込んだ後、フラッシュメモリに消去ブロックバッファ上のデータを書き込まず、さらに2回目の書き込みデータを消去ブロックバッファに記録されているデータに書き込みを行う。同一の消去単位領域への書き込みが更に続く場合は、この処理を続けて行う。この動作により、実施の形態1の奏する効果に加え、フラッシュメモリ上の同一の消去単位領域への連続した書き込みを一括して行なうことにより、フラッシュメモリ上のデータの消去回数を減らすことができ、フラッシュメモリの劣化を低減することが可能となる。
尚、本実施の形態においても、実施の形態1と同様に電源断時の復旧処理を行うことが可能である。この場合、書き込み未終了フラグとして、消去単位番号の記録を利用してもよい。これは、フラッシュメモリへの書き込みの後に、消去単位番号を無効にすることにより実現できる。
この実施の形態ではS205において、フラッシュメモリの消去単位から不変データを消去ブロックバッファ103に書き込む待避処理を行なっているが、この処理は遅くとも不変データをフラッシュメモリ101に書き込むまでに実行され完了していればよい。また、S204における書き込み要求データの消去ブロックバッファへの書き込みは、次回の書き込み要求の書き込み要求データを消去ブロックバッファに書き込むまでに実行すればよい。
As described above, according to the present embodiment, when data is continuously written to the same erase unit area of the flash memory, after the first data write data is written to the erase block buffer on the nonvolatile memory, the flash memory The data on the erase block buffer is not written, and the second write data is written to the data recorded in the erase block buffer. If writing to the same erase unit area continues, this process is continued. With this operation, in addition to the effect of the first embodiment, the number of times of erasing data on the flash memory can be reduced by collectively performing continuous writing to the same erasing unit area on the flash memory. It becomes possible to reduce the deterioration of the flash memory.
In the present embodiment as well, it is possible to perform recovery processing when the power is turned off as in the first embodiment. In this case, the record of the erase unit number may be used as the write incomplete flag. This can be realized by invalidating the erase unit number after writing to the flash memory.
In this embodiment, a save process for writing invariant data from the erase unit of the flash memory to the erase block buffer 103 is performed in S205, but this process has been executed and completed by the time the invariant data is written to the flash memory 101 at the latest. Just do it. The write request data to be written to the erase block buffer in S204 may be executed until the write request data of the next write request is written to the erase block buffer.

実施の形態3.
本発明の他の実施形態における情報処理装置について説明する。情報処理装置の構成は実施の形態2と同様であり、図4に示される。本実施形態の基本的動作は実施の形態2と同様である。本実施形態においては、フラッシュメモリからデータを待避させた後のステップとして、その消去単位のデータ消去を行う。
本実施の形態におけるメモリへのデータ書き込み時の動作を、図7を用いて説明する。以下の各処理は、断りがない限り書き込み制御手段111の動作である。
まず、S301において、データの書き込み要求を受ける。書き込み要求の内容は実施の形態1と同様である。
次に、S302において、書き込み要求領域を含むフラッシュメモリの消去単位の番号を求める。消去単位の番号を求める動作については、実施の形態1と同様である。
Embodiment 3 FIG.
An information processing apparatus according to another embodiment of the present invention will be described. The configuration of the information processing apparatus is the same as that of the second embodiment and is shown in FIG. The basic operation of this embodiment is the same as that of the second embodiment. In this embodiment, as a step after saving data from the flash memory, data erasure is performed for the erasure unit.
The operation at the time of data writing to the memory in this embodiment will be described with reference to FIG. The following processes are operations of the write control unit 111 unless otherwise specified.
First, in S301, a data write request is received. The contents of the write request are the same as in the first embodiment.
Next, in S302, the erase unit number of the flash memory including the write request area is obtained. The operation for obtaining the erase unit number is the same as in the first embodiment.

続いて、S303において、消去単位番号保持領域202を参照し、消去単位番号の記録が存在するかを判定する。
S303において消去単位番号保持領域202に消去番号の記録が存在しなければ、S304において、書き込み要求データを消去ブロックバッファ103に書き込む。
続いてS305において、待避手段112に対して待避指示を行なう。待避指示の内容は実施の形態1と同様である。待避指示を受けた待避手段112は、消去単位内の不変データを消去ブロックバッファ103に書き込むことにより待避させる。
さらにS306において、S302で求めた消去単位番号を、消去単位番号保持領域202に記録する。
次にS307において、消去命令手段301に対して消去指示を出す。消去指示には、S302で求めた消去単位番号の情報が含まれている。消去指示を受けた消去命令手段301は、S305における消去ブロックバッファへの待避が完了した消去単位領域内のデータを消去するように、命令を出す
Subsequently, in S303, the erase unit number holding area 202 is referred to and it is determined whether or not there is a record of the erase unit number.
If there is no erase number record in the erase unit number holding area 202 in S303, the write request data is written in the erase block buffer 103 in S304.
Subsequently, in S305, a save instruction is issued to the save unit 112. The contents of the save instruction are the same as in the first embodiment. Upon receiving the save instruction, the save unit 112 saves by writing the invariant data in the erase unit into the erase block buffer 103.
In step S306, the erase unit number obtained in step S302 is recorded in the erase unit number holding area 202.
In step S307, an erase instruction is issued to the erase command unit 301. The erase instruction includes information on the erase unit number obtained in S302. Upon receiving the erase instruction, the erase command means 301 issues a command to erase the data in the erase unit area that has been saved in the erase block buffer in S305.

S303において消去単位番号保持領域202に消去単位番号の記録が存在する場合には、S308において、S302で求めた消去単位番号が消去単位番号保持手段302に存在する記録と一致するかを判定する。
消去単位番号が異なる場合には、S309において、書き込み手段302に対し書き込み指示を行なう。この書き込み指示には、消去単位番号に関する情報が含まれる。書き込み指示を受けた書き込み手段302は、現在の消去ブロックバッファ103のデータをフラッシュメモリ101に書き込む。フラッシュメモリ101の当該消去単位領域のデータは、以前の書き込み処理時(S307)にすでに消去されているため、すでに消去された消去単位領域に消去ブロックバッファ103のデータを書き込む書き込み処理のみを行なう。これ以降は消去番号の記録が存在しなかった場合と同様に、S304〜S307の処理を行う。
If there is an erase unit number record in the erase unit number holding area 202 in S303, it is determined in S308 whether the erase unit number obtained in S302 matches the record in the erase unit number holding means 302.
If the erase unit numbers are different, a write instruction is given to the writing means 302 in S309. This write instruction includes information related to the erase unit number. Receiving the write instruction, the writing means 302 writes the current data in the erase block buffer 103 into the flash memory 101. Since the data in the erase unit area of the flash memory 101 has already been erased in the previous write process (S307), only the write process for writing the data in the erase block buffer 103 into the erased erase unit area is performed. Thereafter, the processing of S304 to S307 is performed in the same manner as in the case where there is no erasure number record.

S308で消去単位番号が一致する場合には、書き込み要求データを書き込むべき消去単位領域内のデータは消去ブロックバッファに記録されているので、S310において、書き込み要求データを消去ブロックバッファ103へ書き込む。
尚、本実施の形態における読み出し時の動作は、実施の形態2の場合と同様である。
以上の処理が書き込み要求が発生する度に実行される。
この発明の実施の形態によれば、フラッシュメモリからデータを待避させた後にフラッシュメモリのデータを消去するので、消去ブロックバッファのデータをフラッシュメモリに書き込む際には、フラッシュメモリのデータを消去する処理を行う必要がない。フラッシュメモリの消去は、フラッシュメモリがハードウェア的に行うため、プロセッサが他の処理を平行して行うことができる。例えば、入出力インターフェースから主記憶装置へのデータの書き込みや、プロセッサ内の計算処理等を並列的に行うことができる。
If the erase unit numbers match in S308, the data in the erase unit area into which the write request data is to be written is recorded in the erase block buffer, so the write request data is written into the erase block buffer 103 in S310.
The operation at the time of reading in the present embodiment is the same as that in the second embodiment.
The above processing is executed every time a write request occurs.
According to the embodiment of the present invention, the data in the flash memory is erased after the data is saved from the flash memory. Therefore, when the data in the erase block buffer is written in the flash memory, the data in the flash memory is erased. There is no need to do. Since the flash memory is erased by hardware, the processor can perform other processes in parallel. For example, data writing from the input / output interface to the main storage device, calculation processing in the processor, and the like can be performed in parallel.

一方、フラッシュメモリにデータを書き込む際にフラッシュメモリのデータを消去する場合には、プロセッサは書き込み要求をうけているので、プロセッサは消去の処理を待たなければならず、他の処理を平行して行うことができない。
以上のように、本実施の形態においては、フラッシュメモリからデータを待避させた後にフラッシュメモリのデータを消去するので、フラッシュメモリにデータを書き込む際にフラッシュメモリのデータを消去する必要がない。そのため、実施の形態2の奏する効果に加え、書き込み処理の時間を短縮することができる。又、フラッシュメモリの消去処理と平行してプロセッサの処理が可能となり、情報処理装置全体の処理速度の向上を図ることが可能となる。
On the other hand, when erasing the data in the flash memory when writing data to the flash memory, the processor has received a write request, so the processor must wait for the erasure process, and perform other processes in parallel. I can't do it.
As described above, in the present embodiment, the data in the flash memory is erased after the data is saved from the flash memory. Therefore, it is not necessary to erase the data in the flash memory when writing the data in the flash memory. Therefore, in addition to the effect of the second embodiment, the time for the writing process can be shortened. In addition, the processing of the processor can be performed in parallel with the erase processing of the flash memory, and the processing speed of the entire information processing apparatus can be improved.

実施の形態4.
図8は本発明の他の実施形態における情報処理装置の構成を示す図である。図において、402は任意のデータ単位で書き込み可能な不揮発性メモリ102上に構成され、書き込みデータを記録する書き込みバッファである。書き込みバッファ402は、書き込みデータを記録するためのものであり、不変データを記録することはない。403は書き込みバッファ管理領域である。書き込みバッファ管理領域403には、消去単位番号、消去単位内オフセットおよびデータサイズとが記憶される。他の構成は、図3における構成の同一もしくは相当部であり説明を省略する。 図9は、書き込みバッファ管理領域403に記録されているデータの内容を示す図である。書き込みバッファ管理領域403には、書き込みバッファ402に保持されたデータが書き込まれるべきフラッシュメモリ101上の消去単位番号と、この消去単位領域内の書き込み領域の位置を特定するオフセットと、書き込み領域の大きさに関するデータを保持する。消去単位番号の「−1」は、これ以上書き込みデータが存在しないことを意味する。ここでは、書き込み領域の大きさは一定になっているが、この大きさは個々のデータ毎に異なっていてもよい。
Embodiment 4 FIG.
FIG. 8 is a diagram showing a configuration of an information processing apparatus according to another embodiment of the present invention. In the figure, reference numeral 402 denotes a write buffer configured to be written on the non-volatile memory 102 which can be written in an arbitrary data unit and to record write data. The write buffer 402 is for recording write data and does not record invariant data. Reference numeral 403 denotes a write buffer management area. The write buffer management area 403 stores an erase unit number, an erase unit offset, and a data size. The other configuration is the same as or equivalent to the configuration in FIG. FIG. 9 is a diagram showing the contents of data recorded in the write buffer management area 403. In the write buffer management area 403, an erase unit number on the flash memory 101 to which data held in the write buffer 402 should be written, an offset for specifying the position of the write area in the erase unit area, and the size of the write area Holds data about length. The erase unit number “−1” means that there is no more write data. Here, the size of the writing area is constant, but this size may be different for each piece of data.

本実施の形態におけるメモリへの書き込み時の動作を、図10を用いて説明する。以下の各処理は、断りがない限り書き込み制御手段111の動作である。
まず、S401において、データの書き込み要求を受ける。書き込み要求の内容は、実施の形態1と同様である。
次に、S402において、書き込み要求領域を含むフラッシュメモリの消去単位の番号を求める。この動作は、実施の形態1と同様である。
続いてS403において、消去単位番号保持領域202を参照し、消去単位番号の記録が存在するかを判定する。
ここで、消去番号の記録が存在しなければ、S404において、書き込み制御手段111は、書き込み要求データを消去ブロックバッファ103に書き込む。
The operation at the time of writing to the memory in this embodiment will be described with reference to FIG. The following processes are operations of the write control unit 111 unless otherwise specified.
First, in S401, a data write request is received. The content of the write request is the same as in the first embodiment.
Next, in S402, the erase unit number of the flash memory including the write request area is obtained. This operation is the same as in the first embodiment.
Subsequently, in S403, it is determined whether or not there is a record of the erase unit number by referring to the erase unit number holding area 202.
If there is no erase number record, the write control unit 111 writes the write request data to the erase block buffer 103 in S404.

さらに、S405において、待避手段112に対して待避指示を行う。待避指示の内容は実施の形態1と同様である。待避指示を受けた待避手段112は、S402で算出された消去単位番号で特定される消去単位領域内の不変データを消去ブロックバッファ103に書き込む。
続いて、S406において、S402で求めた消去単位番号を消去単位番号保持領域202に記録する。
さらに、S407において、消去命令手段301に対して消去指示を出す。消去指示の内容は実施の形態2と同様である。消去指示を受けた消去命令手段301は、消去ブロックバッファ103へ待避された消去単位の消去を行なうように、フラッシュメモリ101に命令を出す。
Further, in S405, a save instruction is issued to the save unit 112. The contents of the save instruction are the same as in the first embodiment. Upon receiving the save instruction, the save unit 112 writes the invariant data in the erase unit area specified by the erase unit number calculated in S <b> 402 to the erase block buffer 103.
Subsequently, in S406, the erase unit number obtained in S402 is recorded in the erase unit number holding area 202.
Further, in S407, an erase instruction is issued to the erase command means 301. The contents of the erase instruction are the same as in the second embodiment. Upon receiving the erase instruction, the erase command means 301 issues a command to the flash memory 101 so as to erase the erase unit saved in the erase block buffer 103.

S403において消去単位番号保持領域202に消去単位番号の記録が存在する場合には、S408において、S402で求めた消去単位番号が消去単位番号保持領域202に存在する記録と一致するかを判定する。
S408において消去単位番号が異なる場合には、S409において、書き込みバッファ管理領域403を参照し、書き込みバッファ管理領域403に記録されている情報から、書き込み要求領域と同一の領域に書き込みを行なうデータが既に書き込みバッファ402に存在するかを判定する。この判定は、書き込みバッファ管理領域403に記憶されている消去単位番号及び消去単位内オフセットおよびサイズから把握することができる。換言すれば、S409においては、書き込み要求領域で特定される領域が既に書き込みバッファ402に存在するデータの書き込み要求領域に含まれるか否かを判定する。書き込み要求領域で特定される領域が既に書き込みバッファ402に存在するデータの書き込み要求領域に含まれる場合としては、例えば、書き込み要求領域で特定される領域と既に書き込みバッファ402に存在するデータの書き込み要求領域とが完全に同一の場合、及び書き込み要求領域で特定される領域が既に書き込みバッファ402に存在するデータの書き込み要求領域内に収まる場合の2つの場合が該当する。
If there is a record of the erase unit number in the erase unit number holding area 202 in S403, it is determined in S408 whether or not the erase unit number obtained in S402 matches the record in the erase unit number holding area 202.
If the erasure unit number is different in S408, the write buffer management area 403 is referred to in S409, and data to be written to the same area as the write request area from the information recorded in the write buffer management area 403 has already been obtained. It is determined whether it exists in the write buffer 402. This determination can be grasped from the erase unit number, the erase unit offset and the size stored in the write buffer management area 403. In other words, in S409, it is determined whether or not the area specified in the write request area is included in the write request area of data already existing in the write buffer 402. Examples of the case where the area specified by the write request area is included in the data write request area already existing in the write buffer 402 include, for example, the area specified by the write request area and the data write request already existing in the write buffer 402 The two cases correspond to the case where the area is completely the same, and the case where the area specified by the write request area is within the write request area of data already existing in the write buffer 402.

S409において、書き込み要求領域と同一の領域に書き込みを行なうデータが書き込みバッファ402に存在しない場合には、さらにS410において書き込み制御手段111は、書き込み要求のデータを書き込むことができる領域が書き込みバッファ402に存在するかを、書き込みバッファ402の空き領域を調べることで判定する。空き領域の存在は、書き込みバッファ管理領域403に記録されている情報から知ることができる。本実施の形態では、最後の消去単位番号を−1としておくことで、空き領域の存在を記録する。最後が−1以外であれば、空き領域は存在しない。もちろん、書き込みバッファ402の容量と管理情報に含まれるサイズの情報から、空き領域の存在を求めてもよい。   In S409, when there is no data to be written in the same area as the write request area in the write buffer 402, in S410, the write control unit 111 further stores an area in which the write request data can be written in the write buffer 402. Whether it exists is determined by examining the free area of the write buffer 402. The existence of a free area can be known from the information recorded in the write buffer management area 403. In the present embodiment, the presence of an empty area is recorded by setting the last erase unit number to -1. If the last is other than -1, there is no free area. Of course, the existence of a free area may be obtained from the capacity of the write buffer 402 and the size information included in the management information.

書き込みバッファ402に空き領域がない場合には、S411において書き込み制御手段111は、書き込み手段302に対し書き込み指示を行なう。書き込み指示の内容は実施の形態1と同様である。書き込み指示を受けた書き込み手段302は、消去ブロックバッファ103に現在記録されているデータをフラッシュメモリ101に書き込む。
続いて、S404からS407の処理を、消去単位番号の記録が存在しない場合と同様に行なう。
If there is no free space in the write buffer 402, the write control unit 111 instructs the write unit 302 to write in S411. The contents of the write instruction are the same as in the first embodiment. Upon receiving the write instruction, the writing unit 302 writes the data currently recorded in the erase block buffer 103 into the flash memory 101.
Subsequently, the processing from S404 to S407 is performed in the same manner as when no erasure unit number is recorded.

S410で書き込みバッファに空き領域が存在した場合には、S412において、書き込みデータを書き込みバッファ402へ書き込む。
次にS413において、書き込みバッファ管理領域403に、S412で書き込んだ書き込みデータに関する管理情報を記録する。管理情報は、消去単位番号とその中での位置を特定するオフセット、及び書き込みデータの大きさを記録する。書き込みバッファ管理領域403における管理情報と、書き込みバッファ402における書き込みデータの対応づけは、各エリアにおけるアドレス上の順序が同一になるように記録されることで行われる。尚、書き込みバッファ管理領域403に、書き込みデータが記録されている書き込みバッファ内のアドレスを記録することにより、各管理情報と書き込みデータの対応づけを行ってもよい。
If there is an empty area in the write buffer in S410, the write data is written to the write buffer 402 in S412.
In step S413, management information related to the write data written in step S412 is recorded in the write buffer management area 403. The management information records an erase unit number, an offset for specifying the position in the erase unit number, and the size of write data. The management information in the write buffer management area 403 and the write data in the write buffer 402 are associated with each other by recording the addresses in the same order in each area. The management information may be associated with the write data by recording the address in the write buffer in which the write data is recorded in the write buffer management area 403.

S409で書き込み要求領域と同一の領域に書き込みを行なうデータが既に存在すると判定された場合には、S414において、書き込みデータを書き込みバッファの同一領域のデータが記録されているエリアに書き込む。
S408で、S402で算出した消去単位番号が消去単位番号保持領域202に存在する記録と一致すると判定された場合には、S415において、書き込み要求データを消去ブロックバッファに書き込む。書き込み要求データの消去ブロックバッファへの書き込み動作については実施の形態1と同様である。
If it is determined in S409 that the data to be written already exists in the same area as the write request area, the write data is written in the area where the data in the same area of the write buffer is recorded in S414.
If it is determined in S408 that the erase unit number calculated in S402 matches the record existing in the erase unit number holding area 202, the write request data is written in the erase block buffer in S415. The write operation of the write request data to the erase block buffer is the same as in the first embodiment.

次に、メモリからのデータ読み出し時の動作を図11を用いて説明する。以下の各処理は、断りがない限り読み出し手段201の動作である。
まずS451において、読み出し要求を受ける。この読み出し要求の内容は実施の形態2と同様である。
次にS452において、読み出し要求領域を含むフラッシュメモリの消去単位番号を求める。消去単位の番号を求める動作は実施の形態2と同様である。
続いてS453において、消去単位番号保持領域202を参照し、消去単位番号の記録が存在するかを判定する。
消去単位番号の記録が存在しない場合には、S454において、書き込みバッファ管理領域403の管理情報を参照し、読み出し要求領域として特定された領域に書き込まれるべきデータが書き込みバッファ402に存在するかを判定する。
Next, the operation when reading data from the memory will be described with reference to FIG. The following processes are operations of the reading unit 201 unless otherwise specified.
First, in S451, a read request is received. The contents of this read request are the same as in the second embodiment.
In step S452, the erase unit number of the flash memory including the read request area is obtained. The operation for obtaining the erase unit number is the same as in the second embodiment.
Subsequently, in S453, the erase unit number holding area 202 is referred to and it is determined whether or not there is a record of the erase unit number.
If there is no record of the erase unit number, in S454, the management information in the write buffer management area 403 is referred to, and it is determined whether data to be written in the area specified as the read request area exists in the write buffer 402. To do.

読み出し要求領域として特定された領域に書き込まれるべきデータが書き込みバッファ402に存在する場合には、S455において、その領域のデータを書き込みバッファ402から読み出す。
読み出し要求領域として特定された領域に書き込まれるべきデータが書き込みバッファ402に存在しない場合には、S456において、読み出しデータをフラッシュメモリ101から読み出す。
S453で消去単位番号保持領域202に消去単位番号の記録が存在し、かつS452で求めた消去単位番号と一致する場合には、読み出し領域のデータは消去ブロックバッファ103に保持されているので、S457において、消去ブロックバッファ103から読み出しデータを読み出す。
以上の処理が読み出し要求が発生する度に実行される。
If data to be written to the area specified as the read request area exists in the write buffer 402, the data in that area is read from the write buffer 402 in S455.
If the data to be written to the area specified as the read request area does not exist in the write buffer 402, the read data is read from the flash memory 101 in S456.
If there is a record of the erase unit number in the erase unit number holding area 202 in S453 and it matches the erase unit number obtained in S452, the data in the read area is held in the erase block buffer 103, so S457 Then, read data is read from the erase block buffer 103.
The above processing is executed every time a read request occurs.

本実施の形態の情報処理装置によれば、不揮発メモリ102上に、消去ブロックバッファ103に加えて、書き込みデータを記録する書き込みバッファ402を設けているので、異なる消去単位領域に対する複数の書き込みデータを記録することができ、実施の形態3の奏する効果に加え、フラッシュメモリ101への書き込み回数をさらに低減でき、フラッシュメモリ101の劣化を低減することが可能となる。又、特にバッテリバックアップSRAMは、記録容量あたりの値段が高いこともあり、その効率的利用が強く求められているが、本実施の形態のように、消去ブロックバッファ103に加えて、不変データを記録せずに書き込みデータを記録するエリアとして書き込みバッファ402を設けることにより、複数の消去ブロックバッファを設ける場合に比較し、効率的に不揮発メモリ102を利用つつ、フラッシュメモリの劣化を大きく低減することが可能となる。   According to the information processing apparatus of this embodiment, in addition to the erase block buffer 103, the write buffer 402 for recording write data is provided on the nonvolatile memory 102, so that a plurality of write data for different erase unit areas can be stored. In addition to the effects of the third embodiment, the number of times of writing to the flash memory 101 can be further reduced, and deterioration of the flash memory 101 can be reduced. In particular, since the battery backup SRAM has a high price per recording capacity and its efficient use is strongly demanded, in this embodiment, in addition to the erase block buffer 103, invariant data is stored. By providing the write buffer 402 as an area for recording write data without recording, the deterioration of the flash memory can be greatly reduced while using the nonvolatile memory 102 more efficiently than in the case of providing a plurality of erase block buffers. Is possible.

この実施の形態において、書き込みバッファ402は、不変データを記憶することなく書き込みデータを記憶する書き込みバッファの一例であり、書き込み制御手段111は、第1の消去単位領域に第1の書き込みデータを書き込むことを要求する第1の書き込み要求に対し、前記第1の書き込みデータを前記消去ブロックバッファに書き込む書き込みデータ書き込み手段、および第2の消去単位領域に第2の書き込みデータを書き込むことを要求する第2の書き込み要求に対して、前記第2の書き込みデータを前記書き込みバッファに書き込む書き込みバッファ書き込み手段の一例である。この実施の形態では、データ書き込み手段とバッファ書き込み手段の機能を書き込み制御手段111にて果たしている。待避手段112は、第1の消去単位領域に第1の書き込みデータを書き込むことを要求する第1の書き込み要求に対し、第1の消去単位領域内の不変データを前記消去ブロックバッファに書き込む待避手段の一例である。   In this embodiment, the write buffer 402 is an example of a write buffer that stores write data without storing invariant data, and the write control unit 111 writes the first write data to the first erase unit area. In response to the first write request for requesting, the write data writing means for writing the first write data to the erase block buffer, and the second request for writing the second write data to the second erase unit area 2 is an example of a write buffer writing means for writing the second write data into the write buffer in response to a write request of 2; In this embodiment, the write control means 111 fulfills the functions of data writing means and buffer writing means. The saving means 112 is a saving means for writing invariant data in the first erase unit area to the erase block buffer in response to a first write request for writing the first write data in the first erase unit area. It is an example.

実施の形態5.
図12は本実施の形態における情報処理装置の構成を示す図である。図において、501は書き込みバッファ402のデータを移動するバッファ移動手段である。他の構成は、既に説明した構成の同一もしくは相当部であり、説明を省略する。本実施形態の基本的動作は実施の形態4と同様であるが、バッファ移動手段501によって、書き込みバッファ402内の同一の消去単位領域に含まれるデータを、消去ブロックバッファ103に移動する処理を有する点で実施の形態4と相違する。
実施の形態5における書き込み時の動作を、図13および図14を用いて説明する。以下の各処理は、断りがない限り書き込み制御手段111の動作である。
まずS501において、データの書き込み要求を受ける。書き込み要求の内容は実施の形態1と同様である。
次にS502において、書き込み要求領域が含まれるフラッシュメモリの消去単位の番号を求める。消去単位番号を求める動作は実施の形態1と同様である。
Embodiment 5 FIG.
FIG. 12 is a diagram illustrating a configuration of the information processing apparatus according to the present embodiment. In the figure, reference numeral 501 denotes buffer moving means for moving data in the write buffer 402. The other configuration is the same as or equivalent to the configuration already described, and the description is omitted. The basic operation of the present embodiment is the same as that of the fourth embodiment, but has a process of moving data included in the same erase unit area in the write buffer 402 to the erase block buffer 103 by the buffer moving unit 501. This is different from the fourth embodiment.
The operation at the time of writing in the fifth embodiment will be described with reference to FIG. 13 and FIG. The following processes are operations of the write control unit 111 unless otherwise specified.
First, in S501, a data write request is received. The contents of the write request are the same as in the first embodiment.
In step S502, the erase unit number of the flash memory including the write request area is obtained. The operation for obtaining the erase unit number is the same as in the first embodiment.

続いてS503において、消去単位番号保持領域202を参照し、消去単位番号の記録が存在するかを判定する。
消去単位番号保持領域202に消去番号の記録が存在しなければ、S504において、書き込みデータを消去ブロックバッファ103に書き込む。
さらにS505において、待避手段112に対して待避指示を行なう。待避指示の内容は実施の形態1と同様である。待避指示を受けた待避手段112は、待避処理として不変データを消去ブロックバッファ103へ書き込む。
続いて、S506において、S502において求めた消去単位番号を消去単位番号保持領域202に記録する。
次にS507において、消去命令手段301に対して消去指示を出す。消去指示の内容は実施の形態1と同様である。消去指示を受けた消去命令手段301は、すでに消去ブロックバッファ103への待避が完了した消去単位領域内のデータを消去するようにフラッシュメモリ101に命令を出す。
Subsequently, in S503, the erase unit number holding area 202 is referred to and it is determined whether or not there is a record of the erase unit number.
If there is no record of the erase number in the erase unit number holding area 202, the write data is written into the erase block buffer 103 in S504.
Further, in S505, a save instruction is issued to the save unit 112. The contents of the save instruction are the same as in the first embodiment. The saving unit 112 that has received the save instruction writes invariant data to the erase block buffer 103 as a save process.
Subsequently, in S506, the erase unit number obtained in S502 is recorded in the erase unit number holding area 202.
In step S507, an erase instruction is issued to the erase command unit 301. The contents of the erase instruction are the same as in the first embodiment. Upon receiving the erase instruction, the erase command means 301 issues a command to the flash memory 101 to erase the data in the erase unit area that has already been saved in the erase block buffer 103.

S503で消去単位番号保持領域202に消去単位番号の記録が存在した場合には、S508において、S502において求めた消去単位番号が消去単位番号保持領域202に存在する記録と一致するかを判定する。
S508において消去単位番号が異なる場合には、S509において、書き込みバッファ管理領域403を参照し、書き込み要求領域と同一の領域に書き込まれるデータが既に書き込みバッファに存在するかを判定する。
S509で書き込み要求領域と同一の領域に書き込まれるデータが書き込みバッファに存在しないと判定された場合には、S510の処理として、S502において求めた消去単位番号と同じ消去単位番号のデータが書き込みバッファ402に存在するかを書き込みバッファ管理領域403を参照して判定する。
If there is a record of the erase unit number in the erase unit number holding area 202 in S503, it is determined in S508 whether the erase unit number obtained in S502 matches the record in the erase unit number holding area 202.
If the erase unit numbers are different in S508, the write buffer management area 403 is referred to in S509 to determine whether data to be written in the same area as the write request area already exists in the write buffer.
If it is determined in S509 that the data to be written in the same area as the write request area does not exist in the write buffer, as the processing in S510, the data having the same erase unit number as the erase unit number obtained in S502 is written. Is determined with reference to the write buffer management area 403.

S510で同じ消去単位番号のデータが書き込みバッファ402に存在する場合には、バッファデータ移動処理を行なうが、これについては後述する。
S510で同じ消去単位番号のデータが書き込みバッファ402に存在しない場合には、さらにS511において、書き込み要求データを書き込むことができる領域が書き込みバッファ402に存在するかを判定する。
S511において空き領域がないと判断した場合には、S512において書き込み制御手段111は、書き込み手段302に対し書き込み指示を行なう。書き込み指示を受けた書き込み手段302は、現在の消去ブロックバッファ103のデータをフラッシュメモリ101に書き込む。
これ以降、S504〜S507の処理を行ない、消去単位番号の記録が存在しない場合と同一の処理を行なう。
If data of the same erase unit number exists in the write buffer 402 in S510, a buffer data movement process is performed, which will be described later.
If data of the same erase unit number does not exist in the write buffer 402 in S510, it is further determined in S511 whether an area where the write request data can be written exists in the write buffer 402.
If it is determined in S511 that there is no free space, the write control unit 111 instructs the writing unit 302 to write in S512. Receiving the write instruction, the writing means 302 writes the current data in the erase block buffer 103 into the flash memory 101.
Thereafter, the processing of S504 to S507 is performed, and the same processing as when no erasure unit number is recorded is performed.

S511で書き込みバッファ402に空き領域が存在すると判断した場合には、S513において書き込み制御手段111は、書き込みデータを書き込みバッファ402の空き領域へ書き込む。
S514において、書き込みバッファ管理領域に、管理情報として、消去単位番号とその中でのオフセット、及び書き込みデータの大きさを記録する。
S509で書き込み要求領域と同一の領域に書き込まれるデータが書き込みバッファに存在すると判定された場合には、S516において書き込み制御手段111は、書き込み要求領域と同一の領域に書き込まれるデータが存在するエリアに書き込み要求データを上書きする。
S508においてS502で算出した消去単位番号が消去単位番号保持領域202に存在する記録と一致すると判定された場合には、S517において、書き込み要求データの消去単位番号と同一の消去単位番号のデータが記憶されている消去ブロックバッファ103内のエリアに書き込み要求データを上書きする。
If it is determined in S511 that there is a free area in the write buffer 402, the write control unit 111 writes the write data to the free area in the write buffer 402 in S513.
In S514, the erase unit number, the offset in it, and the size of the write data are recorded as management information in the write buffer management area.
If it is determined in S509 that the data to be written in the same area as the write request area is present in the write buffer, the write control unit 111 determines in S516 that the data to be written in the same area as the write request area exists. Overwrites the write request data.
If it is determined in S508 that the erase unit number calculated in S502 matches the record existing in the erase unit number holding area 202, data of the same erase unit number as the erase unit number of the write request data is stored in S517. The write request data is overwritten in the erased block buffer 103 area.

S510において、同じ消去単位番号のデータが書き込みバッファ402に存在する場合に行われる、バッファデータ移動処理の動作を図14を用いて説明する。以下の各処理は、断りがない限り書き込み制御手段111の動作である。
まずS521において、消去ブロックバッファ103に現在登録されているデータをフラッシュメモリ101に書き込む。
次にS522において、書き込み要求データを消去ブロックバッファ103へ書き込む。
続いてS523において、バッファ移動手段501は書き込みバッファ402に記録されているデータの内、書き込み要求データの消去単位と同一の消去単位に含まれる全ての書き込みデータを、消去ブロックバッファ103へ移動する。書き込み要求データの書き込み要求領域と、既に書き込みバッファ402に記憶されている書き込みデータの書き込み要求領域とが異なる場合には、書き込み要求データ及び書き込みバッファ402に記憶されている書き込みデータがすべて消去ブロックバッファ103に記憶される。書き込み要求データの書き込み要求領域と、既に書き込みバッファ402に記憶されている書き込みデータの書き込み要求領域とが一部重複する場合には、重複する領域については書き込み要求データが優先的に消去ブロックバッファ103に書き込まれ、重複しない部分については書き込み要求データ及び書き込みバッファ402に記憶されている書き込みデータがそれぞれ消去ブロックバッファ103に書き込まれる。
The operation of the buffer data movement process performed when data of the same erase unit number exists in the write buffer 402 in S510 will be described with reference to FIG. The following processes are operations of the write control unit 111 unless otherwise specified.
First, in S521, the data currently registered in the erase block buffer 103 is written into the flash memory 101.
In step S522, the write request data is written to the erase block buffer 103.
In step S <b> 523, the buffer moving unit 501 moves all the write data included in the same erase unit as the erase unit of the write request data among the data recorded in the write buffer 402 to the erase block buffer 103. When the write request area of the write request data is different from the write request area of the write data already stored in the write buffer 402, all the write request data and the write data stored in the write buffer 402 are erase block buffers. 103. When the write request area for the write request data and the write request area for the write data already stored in the write buffer 402 partially overlap, the write request data is preferentially erased for the overlap area. The write request data and the write data stored in the write buffer 402 are written to the erase block buffer 103 for the non-overlapping parts.

さらにS524において、待避手段112に対して待避指示を行ない、待避指示を受けた待避手段112は、S523において消去ブロックバッファ103へ書き込まれた領域以外のデータである不変データを、フラッシュメモリの当該消去単位から待避する。
続いて、S525において消去単位番号を消去単位番号保持領域202に記録し、S526において、書き込みバッファ402から消去ブロックバッファ103へ移動に伴う書き込みバッファ管理領域403の更新を行う。
最後にS527において、消去命令手段301に対して消去指示を出し、消去指示を受けた消去命令手段301は消去ブロックバッファ103へ待避された消去単位の消去を行なうようにフラッシュメモリ101に命令を出す。
以上の処理が書き込み要求が発生する度に実行される。
Further, in S524, the save unit 112 issues a save instruction to the save unit 112. Upon receiving the save instruction, the save unit 112 receives the invariant data other than the area written in the erase block buffer 103 in S523, and erases the invariant data in the flash memory. Save from the unit.
Subsequently, the erase unit number is recorded in the erase unit number holding area 202 in S525, and the write buffer management area 403 is updated in accordance with the movement from the write buffer 402 to the erase block buffer 103 in S526.
Finally, in S527, an erase instruction is issued to the erase command means 301, and the erase command means 301 having received the erase instruction issues an instruction to the flash memory 101 to erase the erase unit saved in the erase block buffer 103. .
The above processing is executed every time a write request occurs.

尚、実施の形態5における読み出し時の動作は、実施の形態4の場合と同一である。
この実施の形態の情報処理装置によれば、フラッシュメモリ101の同一消去単位領域に含まれる書き込みバッファ403上の書き込みデータ及び書き込み要求データを消去ブロックバッファ103にまとめることにより、書き込みバッファ402を効率よく使用することができるので、実施の形態4の効果に加え、フラッシュメモリ101への書き込み回数をより低減でき、フラッシュメモリ101の劣化を低減することができるという効果がある。
Note that the read operation in the fifth embodiment is the same as that in the fourth embodiment.
According to the information processing apparatus of this embodiment, write data on the write buffer 403 and write request data included in the same erase unit area of the flash memory 101 are collected in the erase block buffer 103, so that the write buffer 402 is efficiently stored. Since it can be used, in addition to the effect of the fourth embodiment, the number of times of writing to the flash memory 101 can be further reduced, and the deterioration of the flash memory 101 can be reduced.

尚、本実施の形態において、書き込みデータの移動を、書き込み要求データの消去単位と同一の消去単位に含まれる書き込みデータ及び書き込み要求データではなく、書き込みバッファ402に記憶されている複数の書き込みデータを移動するようにしてもよい。即ち、書き込みバッファ402に記録されている書き込みデータであって、同一の消去単位に含まれる複数の書き込みデータを移動するようにしてもよい。
この場合、S510において、書き込み制御手段111は、書き込みバッファ管理領域403を参照し、書き込みバッファ402に記憶されている書き込みデータの一番多い消去単位を判定する。これは、書き込みバッファ管理領域403内の消去単位番号を参照することにより判定可能である。
S510において同一の消去単位に含まれる書き込みデータが書き込みバッファ402内に存在しない場合には、S511の処理に進む。
S510において同一の消去単位に含まれる書き込みデータが書き込みバッファ402内に存在する場合には、S510で書き込みデータの一番多い消去単位を判定し、S515において、書き込みバッファ402内に記憶されている複数の書き込みデータのバッファデータ移動処理を行う。
In this embodiment, the write data is moved not by write data and write request data included in the same erase unit as the write request data but by a plurality of write data stored in the write buffer 402. You may make it move. That is, a plurality of pieces of write data included in the same erase unit may be moved that are write data recorded in the write buffer 402.
In this case, in step S <b> 510, the write control unit 111 refers to the write buffer management area 403 and determines the erase unit with the largest amount of write data stored in the write buffer 402. This can be determined by referring to the erase unit number in the write buffer management area 403.
If the write data included in the same erase unit does not exist in the write buffer 402 in S510, the process proceeds to S511.
If write data included in the same erase unit exists in the write buffer 402 in S510, the erase unit with the largest write data is determined in S510, and a plurality of data stored in the write buffer 402 is determined in S515. The buffer data movement processing of the write data of is performed.

バッファデータ移動処理においては、S521、S522の処理を行わず、S510で一番多い消去単位として判定された消去単位を書き込み先として持つ書き込みデータをすべて書き込みバッファ402から消去ブロックバッファ103に移動する。書き込みデータの書き込み要求領域が互いに異なる場合には、書き込みバッファ402に記憶されている書き込みデータがすべて消去ブロックバッファ103に記憶される。書き込み要求データの書き込み要求領域が互いに一部重複する場合には、重複する領域について新しい書き込みデータが優先的に消去ブロックバッファ103に書き込まれる。消去ブロックバッファ103に書き込みが完了した後、移動したデータが記憶されていた書き込みバッファ402のエリアのデータが消去される。
その後、S525とS526の間において、書き込み要求データを書き込みバッファ402に書き込む。
S526において新たな書き込みデータに基づき管理情報の更新を行い、最後にS527の処理を行う。
以上のように、書き込みデータの一番多い消去単位の書き込みデータを消去ブロックバッファ103に移動することで、さらに効率的に不揮発性メモリ102を利用することが可能となる。
In the buffer data movement processing, the processing of S521 and S522 is not performed, and all the write data having the erase unit determined as the largest erase unit in S510 as the write destination is moved from the write buffer 402 to the erase block buffer 103. When write request areas for write data are different from each other, all the write data stored in the write buffer 402 is stored in the erase block buffer 103. When the write request areas of the write request data partially overlap each other, new write data is preferentially written into the erase block buffer 103 for the overlapping areas. After writing to the erase block buffer 103 is completed, the data in the area of the write buffer 402 where the moved data is stored is erased.
Thereafter, the write request data is written to the write buffer 402 between S525 and S526.
In S526, the management information is updated based on the new write data, and finally the process in S527 is performed.
As described above, the nonvolatile memory 102 can be used more efficiently by moving the write data of the erase unit with the largest amount of write data to the erase block buffer 103.

実施の形態6.
実施の形態6における情報処理装置の構成は、実施の形態5の場合と同一である。但し、書き込みバッファ管理領域403には、図9で示したものに加えて、書き込みバッファ402の領域の使用頻度に関する情報が記録される。ここでは、図15に示すように、バッファの領域を使用する使用頻度の情報の一例として、書き込みバッファ402へのデータ書き込みが行われる度に1ずつ加算され、書き込まれた順番を特定する書き込みの一連番号と、バッファ領域への書き込み回数とを記録するものとする。
本実施形態は、実施の形態5と基本的動作において同様であるが、特に、書き込みバッファ402へのの領域を使用する使用頻度に基づき、書き込みデータの移動を行うものである。
Embodiment 6 FIG.
The configuration of the information processing apparatus in the sixth embodiment is the same as that in the fifth embodiment. However, in addition to the information shown in FIG. 9, the write buffer management area 403 records information on the frequency of use of the write buffer 402 area. Here, as shown in FIG. 15, as an example of the usage frequency information using the buffer area, 1 is added every time data is written to the write buffer 402, and a write operation that specifies the order of writing is specified. The serial number and the number of writes to the buffer area are recorded.
This embodiment is similar in basic operation to the fifth embodiment, but moves write data based on the frequency of use of the area to the write buffer 402 in particular.

実施の形態6における書き込み時の動作を、図16および図17を用いて説明する。以下の各処理は、断りがない限り書き込み制御手段111の動作である。
まずS601において、データの書き込み要求を受け、さらにS602において、書き込み要求領域を含むフラッシュメモリの消去単位の番号を求める。書き込み要求の内容と消去単位の番号を求める動作は実施の形態1と同様である。
続いてS603において、消去単位番号保持領域202を参照し、消去単位番号の記録が存在するかを判定する。
消去番号の記録が存在しなければ、S604において、書き込み要求データを消去ブロックバッファ103に書き込む。
The operation at the time of writing in the sixth embodiment will be described with reference to FIG. 16 and FIG. The following processes are operations of the write control unit 111 unless otherwise specified.
First, in S601, a data write request is received, and in S602, the erase unit number of the flash memory including the write request area is obtained. The operation for obtaining the contents of the write request and the erase unit number is the same as in the first embodiment.
Subsequently, in S603, the erase unit number holding area 202 is referred to and it is determined whether or not there is a record of the erase unit number.
If there is no record of the erase number, the write request data is written into the erase block buffer 103 in S604.

次にS605において、待避手段112に対して待避指示を行ない、待避指示を受けた待避手段112が消去単位内の不変データを消去ブロックバッファ103に書き込むことにより待避させる。
続いてS606において、S602において求めた消去単位番号を消去単位番号保持領域202に記録する。
さらにS607において、消去命令手段301に対して消去指示を出し、消去指示を受けた消去命令手段301がすでに消去ブロックバッファ103へ待避された消去単位の消去を行なうようにフラッシュメモリ101に命令を出す。消去指示の内容は実施の形態1と同様である。
In step S <b> 605, a save instruction is issued to the save unit 112, and the save unit 112 having received the save instruction writes the invariant data in the erase unit to the erase block buffer 103 to save it.
Subsequently, in S606, the erase unit number obtained in S602 is recorded in the erase unit number holding area 202.
Further, in step S607, an erase instruction is issued to the erase command unit 301, and the erase command unit 301 that has received the erase command issues a command to the flash memory 101 to erase the erase unit that has already been saved in the erase block buffer 103. . The contents of the erase instruction are the same as in the first embodiment.

S603で消去単位番号の記録が存在する場合、S608において、S602で求めた消去単位番号が消去単位番号保持領域302に存在する記録と一致するかを判定する。
S608で消去単位番号が異なる場合には、S609において、書き込みバッファ管理領域403を参照し、書き込みバッファに書き込み要求領域と同一領域のデータが存在するかを判定する。
S609で同一領域のデータが存在しない場合には、S610の処理として、S602において求めた消去単位番号と同じ消去単位のデータが書き込みバッファに存在するかを、書き込みバッファ管理領域403を参照して判定する。
If there is an erase unit number record in S603, it is determined in S608 whether the erase unit number obtained in S602 matches the record in the erase unit number holding area 302.
If the erase unit numbers are different in S608, the write buffer management area 403 is referred to in S609 to determine whether data in the same area as the write request area exists in the write buffer.
If there is no data in the same area in S609, it is determined in S610 by referring to the write buffer management area 403 whether data in the same erase unit as the erase unit number obtained in S602 exists in the write buffer. To do.

S610で同じ消去単位のデータが書き込みバッファに存在する場合には、S620においてバッファデータ移動処理(1)を行なうが、これは図14に示された実施の形態5のバッファデータ移動処理と同一であり、説明を省略する。
S610で同じ消去単位のデータが書き込みバッファに存在しない場合には、さらにS611において、書き込み制御手段111は書き込み要求のデータを書き込むことができる領域が書き込みバッファ402に存在するかを判定する。
S611で空き領域がない場合には、S612でバッファデータ移動処理(2)を行なうが、これについては後述する。
If data of the same erase unit exists in the write buffer in S610, buffer data movement processing (1) is performed in S620, which is the same as the buffer data movement processing of the fifth embodiment shown in FIG. Yes, the description is omitted.
If the same erasure unit data does not exist in the write buffer in S610, the write control unit 111 further determines in S611 whether an area in which the write request data can be written exists in the write buffer 402.
If there is no free space in S611, buffer data movement processing (2) is performed in S612, which will be described later.

S611で書き込みバッファに空き領域が存在した場合には、S613において書き込み制御手段111は、書き込み要求データを書き込みバッファへ書き込む。
次に、S614において、書き込みバッファ管理領域403内のデータの書き込まれたバッファに対応する部分に、フラッシュメモリ上での位置を示す情報として、消去単位番号とその中でのオフセット、書き込まれた大きさを記録するとともに、バッファの領域の使用頻度の情報として、書き込みの一連番号と、バッファ書き込み回数の初期値として1を記録する。
If there is an empty area in the write buffer in S611, the write control unit 111 writes the write request data to the write buffer in S613.
Next, in S614, as the information indicating the position on the flash memory in the portion corresponding to the buffer in which the data is written in the write buffer management area 403, the erase unit number, the offset therein, and the written size In addition, the serial number of writing and the initial value of the number of times of buffer writing are recorded as information on the frequency of use of the buffer area.

S609で書き込み要求と同一領域のデータが存在すると判定された場合には、S630において、書き込み制御手段111は、書き込み要求データを書き込みバッファに書き込む。
続いてS631において、書き込みバッファ管理領域403内の、対応する領域についてのバッファの領域の使用頻度の情報として、書き込みの一連番号を記録し、バッファ書き込み回数を1加算したものに更新する。
S608においてS602で算出した消去単位番号が消去単位番号保持手段302に存在する記録と一致すると判定された場合には、S630において、書き込み要求データを消去ブロックバッファ103に書き込む。
If it is determined in S609 that data in the same area as the write request exists, in S630, the write control unit 111 writes the write request data to the write buffer.
Subsequently, in S631, the serial number of writing is recorded as information on the frequency of use of the buffer area for the corresponding area in the write buffer management area 403, and the number of times of buffer writing is updated by one.
If it is determined in S608 that the erase unit number calculated in S602 matches the record existing in the erase unit number holding unit 302, the write request data is written in the erase block buffer 103 in S630.

S611で書き込みバッファに空き領域がない場合に行われる、バッファデータ移動処理(2)(S611)の動作を図17を用いて説明する。以下の動作は、断りがない限り書き込み制御手段111の動作である。
まず、S681で現在の消去ブロックバッファ103のデータをフラッシュメモリ101に書き込む。
S682において、書き込みバッファ管理領域403を検索し、使用頻度の低い書き込みバッファの領域を選択する。使用頻度の判定は、書き込みバッファ管理領域403内の書き込みの一連番号および書き込み回数を用いて行ない、一連番号が最も小さく、かつ書き込み回数が最も少ない領域があれば、その領域を選択する。一連番号が最小の領域と、書き込み回数が最少の領域が一致しない場合には、一連番号が小さい順に書き込み回数を調べていき、書き込み回数が最少のものを選択する。尚、書き込み回数が最少のものではなく、一連番号が最小のものを選択してもよい。
The operation of the buffer data movement process (2) (S611) performed when there is no free space in the write buffer in S611 will be described with reference to FIG. The following operations are operations of the write control unit 111 unless otherwise noted.
First, in S681, the current data in the erase block buffer 103 is written into the flash memory 101.
In step S682, the write buffer management area 403 is searched to select a write buffer area that is not frequently used. The use frequency is determined using the write serial number and the write count in the write buffer management area 403. If there is an area with the smallest serial number and the lowest write count, that area is selected. If the area with the smallest serial number and the area with the smallest number of writings do not match, the number of writings is examined in ascending order of the serial number, and the one with the smallest number of writings is selected. Note that the number with the smallest serial number may be selected instead of the smallest number of times of writing.

S683においては、S682で選択された書き込みバッファのデータを消去ブロックバッファへ103移動する。
続いてS684において、書き込み要求データを、消去ブロックバッファ103へ移動されたデータが記録されていた書き込みバッファ内の領域へ書き込む。
次にS685において、消去ブロックバッファ103へ移動されたデータを含むフラッシュメモリ101の消去単位について、待避手段301に対し待避指示を行なう。待避指示をうけた待避手段301は、待避指示に従い、消去単位の不変データを消去ブロックバッファ103へ書き込むことにより待避させる。
In S683, the data in the write buffer selected in S682 is moved to the erase block buffer 103.
Subsequently, in S684, the write request data is written into the area in the write buffer where the data moved to the erase block buffer 103 was recorded.
In step S685, a save instruction is issued to the save unit 301 for the erase unit of the flash memory 101 including the data moved to the erase block buffer 103. In response to the save instruction, the save unit 301 saves the data by writing invariant data in the erase unit to the erase block buffer 103 in accordance with the save instruction.

さらにS686において、S685で待避された消去単位番号を消去単位番号保持領域202に記録する。
続いてS687において、書き込みバッファ管理領域403の、書き込みバッファ402から消去ブロックバッファ103へ移動されたエリアに対応する部分を、新たに書き込まれたデータに対応するように更新する。
最後にS688において消去命令手段301に対して消去指示を出し、消去指示を受けた消去命令手段301は、消去ブロックバッファ103へ待避された消去単位の消去を行なうようにフラッシュメモリ101に命令を出す。
以上の処理が書き込み要求が発生する度に実行される。
In S686, the erase unit number saved in S685 is recorded in the erase unit number holding area 202.
Subsequently, in S687, the part of the write buffer management area 403 corresponding to the area moved from the write buffer 402 to the erase block buffer 103 is updated so as to correspond to the newly written data.
Finally, in step S688, an erase instruction is issued to the erase command unit 301, and the erase command unit 301 having received the erase command issues a command to the flash memory 101 so as to erase the erase unit saved in the erase block buffer 103. .
The above processing is executed every time a write request occurs.

尚、実施の形態6における読み出し時の動作は、実施の形態4の場合と同一である。
以上のように、本実施の形態の情報処理装置によれば、書き込みバッファ上で使用頻度の低い領域を先にフラッシュメモリに書き込むことにより、書き込みバッファを効率よく使用することができるので、実施の形態5の効果に加え、フラッシュメモリへの書き込み回数をさらに低減でき、フラッシュメモリの劣化を低減することができるという効果がある。
Note that the read operation in the sixth embodiment is the same as that in the fourth embodiment.
As described above, according to the information processing apparatus of the present embodiment, the write buffer can be efficiently used by first writing the low-use area on the write buffer to the flash memory. In addition to the effect of the fifth aspect, the number of times of writing to the flash memory can be further reduced, and the deterioration of the flash memory can be reduced.

実施の形態7.
図19は発明の実施の形態7における情報処理装置の概略を示す構成図である。図において、601は不揮発性メモリ102内のエリアであって、消去単位番号領域202内の値と同じ値が記録される消去単位番号確認領域、611は情報処理装置の起動時に実行され、消去単位番号領域202,および消去単位番号確認領域601内のデータを元に、消去ブロックバッファ103の内容をフラッシュメモリ101に書き戻す復旧手段である。他の構成は、図1において説明した構成の同一又は相当部であり、説明を省略する。
Embodiment 7 FIG.
FIG. 19 is a block diagram showing an outline of an information processing apparatus according to Embodiment 7 of the present invention. In the figure, reference numeral 601 denotes an area in the non-volatile memory 102, which is an erase unit number confirmation area in which the same value as the value in the erase unit number area 202 is recorded, and 611 is executed when the information processing apparatus is started. This is recovery means for writing back the contents of the erase block buffer 103 to the flash memory 101 based on the data in the number area 202 and the erase unit number confirmation area 601. The other configuration is the same as or equivalent to the configuration described with reference to FIG.

本実施の形態において、メモリへのデータ書き込み時の動作を図20を用いて説明する。以下の各処理は断りがない限り書き込み制御手段111の動作である。図20において、S701、S702、S704、S705、S707は実施の形態1の処理(図3のS101、S102、S103、S104、S105)と同一であるので説明を省略する。
この実施の形態ではS703、S706、S708の処理を有する点で相違するため、この点を中心に説明する。
In this embodiment mode, operation at the time of data writing to the memory will be described with reference to FIG. The following processes are operations of the write control unit 111 unless otherwise noted. 20, S701, S702, S704, S705, and S707 are the same as the processing in the first embodiment (S101, S102, S103, S104, and S105 in FIG. 3), and thus description thereof is omitted.
Since this embodiment is different in that it includes the processes of S703, S706, and S708, this point will be mainly described.

S701にて書き込み要求を受けた後、S702においてフラッシュメモリ101上の消去単位番号を求める。
続いて、S703にてS702において求められた消去単位番号を消去単位番号保持領域202に書き込む。
その後、S704で消去ブロックバッファ103へ書き込み要求データを書き込み、S705で待避手段112に待避指示を出す。
After receiving the write request in S701, the erase unit number on the flash memory 101 is obtained in S702.
Subsequently, in S703, the erase unit number obtained in S702 is written into the erase unit number holding area 202.
Thereafter, write request data is written to the erase block buffer 103 in S704, and a save instruction is issued to the save means 112 in S705.

続いて、S706にてS702において求められた消去単位番号を消去単位番号確認領域601に書き込む。これにより、消去単位番号保持領域202および消去単位番号確認領域601の値が同一の場合、消去ブロックバッファ103への書き込みは全て完了したことを示すことになる。
次に、S707にて消去命令手段301に対して消去指示を出した後、書き込み手段302に書き込み指示を出す。
Subsequently, in S706, the erase unit number obtained in S702 is written in the erase unit number confirmation area 601. As a result, when the values of the erase unit number holding area 202 and the erase unit number confirmation area 601 are the same, it indicates that all writing to the erase block buffer 103 has been completed.
Next, in step S707, an erase instruction is issued to the erase command unit 301, and then a write instruction is issued to the write unit 302.

続いて、S708にて消去単位番号保持領域202と消去単位番号確認領域601の内容をクリアする。これにより、消去ブロックバッファ601にはデータが残っていないことを示す。
以上がメモリへのデータ書き込み時の動作である。
In step S708, the contents of the erase unit number holding area 202 and the erase unit number confirmation area 601 are cleared. This indicates that no data remains in the erase block buffer 601.
The above is the operation when writing data into the memory.

次に、情報処理装置の起動時に実行される復旧手段611の動作を図21を用いて説明する。
復旧手段611はまず、S781において、消去単位番号保持領域202内の値と消去単位番号確認領域601の値を読み出す。続いてS782にて、消去単位番号保持領域202内と消去単位番号確認領域601にフラッシュメモリ内の消去単位番号が存在するかチェックする。
Next, the operation of the recovery unit 611 executed when the information processing apparatus is activated will be described with reference to FIG.
First, the recovery unit 611 reads the value in the erase unit number holding area 202 and the value in the erase unit number confirmation area 601 in S781. Subsequently, in S782, it is checked whether an erase unit number in the flash memory exists in the erase unit number holding area 202 and the erase unit number confirmation area 601.

番号が存在しない場合、消去ブロックバッファにはデータがないので、復旧手段611の処理を終了する。
S782にて、番号が存在する場合、S783にて、消去単位番号保持領域202内の値と消去単位番号確認領域601の値が同一かをチェックする。
If the number does not exist, there is no data in the erase block buffer, and the processing of the recovery means 611 is terminated.
If the number exists in S782, it is checked in S783 whether the value in the erase unit number holding area 202 is the same as the value in the erase unit number confirmation area 601.

値が同一な場合、メモリへのデータ書き込み時において、消去ブロックバッファ103の内容をフラッシュメモリ101に書き込む最中、即ち図20において、S706からS708の間に電源断が発生し、情報処理装置が再起動されたことになるので、復旧手段611はS784にて、消去命令手段301に対し消去指示を出した後、書き込み手段302に書き込み指示を出し、消去ブロックバッファ103の内容をフラッシュメモリ101に書き込む。この消去指示および書き込み指示の内容は、メモリへのデータ書き込み時の動作(図20)のS707と同様である。   When the values are the same, when data is written to the memory, the contents of the erase block buffer 103 are being written to the flash memory 101, that is, in FIG. 20, a power interruption occurs between S706 and S708, and the information processing apparatus In step S784, the recovery unit 611 issues an erase instruction to the erase command unit 301, and then issues a write instruction to the write unit 302. The contents of the erase block buffer 103 are stored in the flash memory 101. Write. The contents of the erase instruction and the write instruction are the same as S707 in the operation for writing data into the memory (FIG. 20).

値が同一でない場合、消去ブロックバッファにデータを書き込んでいる最中、即ち図20においてS703からS705の間に電源断が発生し、情報処理装置が再起動されたことになり、消去ブロックバッファ103内のデータは途中までの書き込みデータしか存在しないので、復旧手段611はS785にて、情報処理装置にエラー通知を行う。これにより情報処理装置は書き込み途中の電源断を検出することができる。   If the values are not the same, the power is cut off while data is being written to the erase block buffer, that is, between S703 and S705 in FIG. 20, and the information processing apparatus is restarted. Since there is only halfway write data, the recovery unit 611 notifies the information processing apparatus of an error in S785. As a result, the information processing apparatus can detect a power interruption during writing.

S784またはS785の処理が終了すると、復旧手段611はS786にて、消去単位番号保持領域202および消去単位番号確認領域601をクリアする。これは、S784経由の場合、消去ブロックバッファへの書き込みが完了したことを意味し、S785経由の場合はエラー通知にて、消去ブロックバッファのエラーを通知したので、再度消去ブロックバッファを利用可能状態にするために実施する。
以上が復旧手段611の動作である。
When the process of S784 or S785 ends, the recovery unit 611 clears the erase unit number holding area 202 and the erase unit number confirmation area 601 in S786. This means that the write to the erase block buffer has been completed via S784, and since the error of the erase block buffer was notified by an error notification when via S785, the erase block buffer can be used again. To implement.
The above is the operation of the recovery means 611.

以上のように、この実施の形態によれば、メモリへのデータ書き込み時において、消去ブロックバッファへのデータ書き込み前に消去番号保持領域に消去単位番号を書き込み、待避手段に待避指示を出した後に消去単位番号確認領域に消去番号を格納するようにしたので、電源断の復旧時に書き込み要求処理中に電源断が発生したかを検知することができる情報処理装置を得ることができる。
さらに、不揮発性メモリが電池などでデータの内容を保持するようなメモリの場合において、電源断後の電池の電圧降下により、不揮発性メモリの内容が不定になった場合でも、復旧手段に消去番号保持領域および消去番号確認領域内の値をチェックするようにしたので、不揮発性メモリの内容が不安定になっているかを検知することができる情報処理装置を得ることができる。
As described above, according to this embodiment, when data is written to the memory, the erasure unit number is written in the erasure number holding area before the data is written to the erasure block buffer, and the evacuation instruction is issued to the evacuation means. Since the erasure number is stored in the erasure unit number confirmation area, it is possible to obtain an information processing apparatus that can detect whether a power interruption has occurred during the write request processing when the power interruption is restored.
Furthermore, in the case where the nonvolatile memory is a memory that retains the data contents such as a battery, even if the contents of the nonvolatile memory become unstable due to the voltage drop of the battery after the power is turned off, the erasure number is given to the recovery means. Since the values in the holding area and the erase number confirmation area are checked, an information processing apparatus capable of detecting whether the contents of the nonvolatile memory are unstable can be obtained.

尚、本実施の形態においては、S785にてエラー通知の後、S786を処理するようにしているが、S785の処理終了後、復旧手段611を終了させ、情報処理装置の再起動時に再度エラー通知させても構わない。また、消去単位番号確認領域に書き込む値を消去単位番号保持領域の値と同一のものとしているが、消去単位番号保持領域の値と伴って変化する値、例えば、消去単位番号保持領域の値のNOT値を設定し、復旧手段611のS783にて消去単位番号保持領域の値と消去番号確認領域の値のNOT値が等しいかでチェックしてもよい。   In this embodiment, S786 is processed after the error notification in S785. However, after the processing in S785 is completed, the recovery unit 611 is terminated, and the error notification is performed again when the information processing apparatus is restarted. It does n’t matter. In addition, the value to be written to the erase unit number confirmation area is the same as the value of the erase unit number holding area, but the value that changes with the value of the erase unit number holding area, for example, the value of the erase unit number holding area It is also possible to set a NOT value and check whether the value of the erasure unit number holding area is equal to the value of the erasure number confirmation area in S783 of the recovery means 611.

また、復旧手段611は情報処理押す値の再起動時に実行されると記載しているが、復旧手段611を書き込み要求時に実行してもよい。   Further, although the recovery means 611 is described as being executed when the information processing push value is restarted, the recovery means 611 may be executed when a write request is made.

実施の形態8.
図22は発明の実施の形態8における情報処理装置の概略を示す構成図である。図において、602は不揮発性メモリ102内のエリアであって、消去ブロックバッファ103の内容が正しいことを示すチェック値を格納する消去ブロックバッファ確認領域である。他の構成は、図19において説明した構成の同一又は相当部であり、説明を省略する。
Embodiment 8 FIG.
FIG. 22 is a block diagram showing an outline of an information processing apparatus according to the eighth embodiment of the invention. In the figure, reference numeral 602 denotes an area in the nonvolatile memory 102, which is an erase block buffer confirmation area for storing a check value indicating that the contents of the erase block buffer 103 are correct. The other configuration is the same as or equivalent to the configuration described in FIG.

本実施の形態において、メモリへのデータ書き込み時の動作を図23を用いて説明する。以下の各処理は断りがない限り書き込み制御手段111の動作である。図23において、S801〜S806、S808、S809は実施の形態7の処理(図20のS701〜S706、S707、S708)と同一であるので説明を省略する。
この実施の形態ではS807の処理を有する点で相違するため、この点を中心に説明する。
In this embodiment mode, an operation at the time of data writing to the memory will be described with reference to FIG. The following processes are operations of the write control unit 111 unless otherwise noted. In FIG. 23, S801 to S806, S808, and S809 are the same as the processing of the seventh embodiment (S701 to S706, S707, and S708 in FIG. 20), and thus the description thereof is omitted.
Since this embodiment is different in that it has the processing of S807, this point will be mainly described.

S801〜S806の後、S807にて消去ブロックバッファ内のデータが有効であるか否かのチェックに用いる値を消去ブロックバッファ確認領域602に書き込む。この値は消去ブロックバッファ内に書き込まれているデータが正しいか否かをチェック際に用いられるものであり、消去ブロックバッファ内のデータ値をすべて加算したチェックサム値などが入る。
S807の後、S808、S809の処理を実行する。
以上がメモリへのデータ書き込み時の動作である。
After S801 to S806, a value used for checking whether or not the data in the erase block buffer is valid is written in the erase block buffer confirmation area 602 in S807. This value is used for checking whether or not the data written in the erase block buffer is correct, and contains a checksum value obtained by adding all the data values in the erase block buffer.
After S807, the processing of S808 and S809 is executed.
The above is the operation when writing data into the memory.

次に、情報処理装置の起動時に実行される復旧手段611の動作を図24を用いて説明する。図24において、S881〜S883、S886〜S888は実施の形態7の処理(図21のS781〜S783、S784〜S786)と同一であるので説明を省略する。
この実施の形態ではS884、S885の処理を有する点で相違するため、この点を中心に説明する。
Next, the operation of the recovery unit 611 executed when the information processing apparatus is activated will be described with reference to FIG. In FIG. 24, S881 to S883 and S886 to S888 are the same as the processing of the seventh embodiment (S781 to S783, S784 to S786 in FIG. 21), and thus description thereof is omitted.
Since this embodiment is different in that it has the processing of S884 and S885, this point will be mainly described.

S881〜S883を実施し、S883にて、消去単位番号保持領域202の内の値と消去単位番号確認領域601の値が同一である場合、S884に進む。
S884では、消去ブロックバッファ103内のデータをチェックし、消去ブロックバッファ確認領域602の値と比較する。即ち図23でのS807での処理と同様の規則で消去ブロックバッファ103内のデータを計算することで得られる値と、消去ブロックバッファ確認領域602の値とを比較する。通常、両者の値は同一値になるが、消去ブロックバッファに本発明の手段以外の操作によりデータが書きまれたり、消去ブロックバッファ103が使用している不揮発性メモリが故障した場合には両者の値は一致しない。
両者の値が一致しなければ、S885にて値が妥当でないと判断する。
Steps S881 to S883 are performed. If the value in the erase unit number holding area 202 is the same as the value in the erase unit number confirmation area 601 in S883, the process proceeds to S884.
In S884, the data in the erase block buffer 103 is checked and compared with the value in the erase block buffer confirmation area 602. That is, the value obtained by calculating the data in the erase block buffer 103 according to the same rule as the processing in S807 in FIG. 23 is compared with the value in the erase block buffer confirmation area 602. Normally, both values are the same, but when data is written to the erase block buffer by an operation other than the means of the present invention, or when the nonvolatile memory used by the erase block buffer 103 fails, both The values do not match.
If the two values do not match, it is determined in S885 that the value is not valid.

S885にて値が妥当でないと判断された場合、S886に進み情報処理装置にエラー通知を行う。そして、S889にて消去単位番号保持領域202と消去単位番号確認領域601の内容をクリアする。これにより、消去ブロックバッファを利用可能状態にする。
S885にて値が妥当であると判断した場合、S887、S888の処理を実行する。
以上が復旧手段611の動作である。
If it is determined in S885 that the value is not valid, the process proceeds to S886 to notify the information processing apparatus of an error. In step S889, the contents of the erase unit number holding area 202 and the erase unit number confirmation area 601 are cleared. This makes the erase block buffer available.
If it is determined in S885 that the value is appropriate, the processing of S887 and S888 is executed.
The above is the operation of the recovery means 611.

以上のように、この実施の形態によれば、消去ブロックバッファ内のデータが正しいことを示す値を保持する消去ブロックバッファ確認領域を備えるようにしたので、消去ブロックバッファを保持している不揮発性メモリが故障し、消去ブロックバッファ内のデータが不正になっても、情報処理装置がそれを検出することができる。
さらに、消去ブロックバッファに他手段から不正なデータ書き込みがあっても、それを検出することができる。
As described above, according to this embodiment, since the erase block buffer confirmation area that holds the value indicating that the data in the erase block buffer is correct is provided, the nonvolatile memory that holds the erase block buffer is provided. Even if the memory fails and the data in the erase block buffer becomes illegal, the information processing apparatus can detect it.
Furthermore, even if illegal data is written to the erase block buffer from other means, it can be detected.

実施の形態9.
図25は発明の実施の形態9における情報処理装置の概略を示す構成図である。図において、603は不揮発性メモリ102内のエリアであって、消去ブロックバッファ103およびフラッシュメモリ101に対する書き込みを禁止または許可することを意味する値を格納する書き込み禁止フラグ領域である。また図において、612は書き込み禁止フラグ領域603に書き込み許可を意味する値を書き込む書き込み許可指示手段、613は書き込み禁止フラグ領域603に書き込み禁止を意味する値を書き込む書き込み禁止指示手段である。他の構成は図4において説明した構成の同一または相当部であり、説明を省略する。
Embodiment 9 FIG.
FIG. 25 is a block diagram showing an outline of an information processing apparatus according to the ninth embodiment of the invention. In the figure, reference numeral 603 denotes an area in the non-volatile memory 102, which is a write prohibition flag area for storing a value indicating that writing to the erase block buffer 103 and the flash memory 101 is prohibited or permitted. In the figure, reference numeral 612 denotes a write permission instruction means for writing a value indicating write permission in the write prohibition flag area 603, and 613 denotes a write prohibition instruction means for writing a value meaning write prohibition in the write prohibition flag area 603. The other configuration is the same as or equivalent to the configuration described in FIG.

本実施の形態において、メモリへのデータ書き込み時の動作を図26を用いて説明する。以下の各処理は断りがない限り書き込み制御手段111の動作である。図26において、S901、S904〜911は実施の形態2の処理(図5のS201、S202〜209)と同一であるので説明を省略する。
この実施の形態ではS902、S903の処理を有する点で相違するため、この点を中心に説明する。
In this embodiment mode, operation at the time of data writing to the memory will be described with reference to FIG. The following processes are operations of the write control unit 111 unless otherwise noted. In FIG. 26, S901 and S904 to 911 are the same as the processing of the second embodiment (S201 and S202 to 209 in FIG. 5), and thus the description thereof is omitted.
Since this embodiment is different in that it has the processing of S902 and S903, this point will be mainly described.

まず、S901にてデータの書き込み要求を受けた後、S902にて書き込み禁止フラグ領域をチェックし、その領域の値が書き込み禁止を意味する値になっているかをチェックする。もし、値が書き込み禁止を意味する値になっていた場合、S903に進み、情報処理装置にエラー通知を行い処理を終了する。これにより、書き込み禁止が指定されている限り、消去ブロックバッファ103およびフラッシュメモリ101にデータ書き込みは発生しない。
S902にて書き込み禁止フラグ領域の値が書き込み禁止を意味する値でない場合、S904に進む。S904以降の処理は実施の形態2と同様である。
以上がメモリへのデータ書き込み時の動作である。
First, after receiving a data write request in S901, the write prohibition flag area is checked in S902, and it is checked whether or not the value of the area is a value indicating write prohibition. If the value is a value indicating write prohibition, the process advances to step S903 to notify the information processing apparatus of an error, and the process ends. As a result, as long as write prohibition is designated, data writing does not occur in the erase block buffer 103 and the flash memory 101.
If the value of the write prohibition flag area is not a value indicating write prohibition in S902, the process proceeds to S904. The processing after S904 is the same as that in the second embodiment.
The above is the operation when writing data into the memory.

次に、書き込み許可指示手段612の動作について図27を用いて説明する。
書き込み許可指示手段612は、書き込み許可指示を受けるとS952にて書き込み禁止フラグ領域603に書き込み許可を意味する値を書き込み、処理を終了する。これにより、以降のメモリへのデータ書き込み時に、データを書き込むことが可能になる。
以上が書き込み許可指示手段612の動作である。
Next, the operation of the write permission instruction means 612 will be described with reference to FIG.
When receiving the write permission instruction, the write permission instructing means 612 writes a value indicating write permission in the write prohibition flag area 603 in S952 and ends the process. As a result, data can be written when data is subsequently written to the memory.
The operation of the write permission instruction unit 612 has been described above.

次に、書き込み禁止指示手段613の動作を図28を用いて説明する。
まず、S982において、消去単位番号保持領域603の内容を参照し、消去単位番号の記録が存在するか判定する。存在しない場合、S985へ進む。
Next, the operation of the write prohibition instruction unit 613 will be described with reference to FIG.
First, in S982, the contents of the erase unit number holding area 603 are referred to and it is determined whether or not there is an erase unit number record. If not, the process proceeds to S985.

S982において、消去単位番号保持領域603に消去単位番号の記録が存在する場合、消去ブロックバッファにデータが残っているので、これをフラッシュメモリ101に書き戻す処理を行う。まず、S983において、消去命令手段301に対し消去指示を出した後、書き込み手段302に書き込み指示を出し、消去ブロックバッファ103の内容をフラッシュメモリ101に書き込む。この消去指示および書き込み指示の内容は、実施の形態7におけるデータ書き込み時の動作(図23)のS808の処理と同様である。続いて、S984にて消去単位番号保持領域202をクリアし、消去ブロックバッファにデータが存在しないことを示す。   In S982, if there is a record of the erase unit number in the erase unit number holding area 603, data remains in the erase block buffer, and processing for writing this back to the flash memory 101 is performed. First, in step S983, an erase instruction is issued to the erase command unit 301, and then a write instruction is issued to the write unit 302 to write the contents of the erase block buffer 103 into the flash memory 101. The contents of the erase instruction and the write instruction are the same as the processing in S808 of the data write operation (FIG. 23) in the seventh embodiment. In step S984, the erasure unit number holding area 202 is cleared to indicate that no data exists in the erasure block buffer.

次に、S985にて、書き込み禁止フラグ領域603に書き込み禁止を意味する値を書き込む。これにより、以降のメモリへのデータ書き込み時に、データを書き込むことを抑制することが可能となる。
以上が書き込み禁止指示手段613の動作である。
Next, in S985, a value indicating write prohibition is written in the write prohibition flag area 603. As a result, it is possible to prevent data from being written when data is subsequently written to the memory.
The operation of the write prohibition instruction unit 613 has been described above.

以上のように、この実施の形態によれば、書き込み禁止フラグ領域を設け、書き込み許可指示手段において、書き込みを許可する値を設定し、書き込み禁止手段において書き込みを禁止する値を設定し、書き込み制御手段は書き込み禁止フラグ領域の値が書き込み許可を示すときのみ書き込みを実施するようにしたので、データの書き込みを抑制する情報処理装置を得ることができる。
また、書き込み禁止指示時に、消去ブロックバッファの内容をフラッシュメモリに書き込むようにし、書き込み禁止状態では不揮発性メモリにデータが残らないようにしたので、不揮発性メモリが電池などでデータの内容を保持するようなメモリの場合において、電源断後の電池の電圧降下による不揮発性メモリ内のデータ破壊においても、データが消去されないようにすることができる。
As described above, according to this embodiment, the write prohibition flag area is provided, the write permission instructing means sets the value to permit writing, the write prohibiting means sets the value to prohibit writing, and the write control Since the means performs the writing only when the value of the write prohibition flag area indicates the write permission, an information processing apparatus that suppresses the data writing can be obtained.
In addition, the contents of the erasure block buffer are written to the flash memory at the time of write prohibition instruction so that no data remains in the nonvolatile memory in the write prohibition state. In the case of such a memory, it is possible to prevent the data from being erased even when the data in the nonvolatile memory is destroyed due to the voltage drop of the battery after the power is turned off.

実施の形態10.
図29は実施の形態10における情報処理装置の概略を示す構成図である。図において、601は不揮発性メモリ102内のエリアであって、消去単位番号保持領域202内の値と同じ値が記録される消去単位番号確認領域、611は情報処理装置の起動時に実行され、消去単位番号保持領域202, および消去単位番号確認領域601内のデータを元に、消去ブロックバッファ103の内容をフラッシュメモリ101に書き戻す復旧手段である。他の構成は図4において説明した構成の同一または相当部であり、説明を省略する。
Embodiment 10 FIG.
FIG. 29 is a block diagram showing an outline of the information processing apparatus in the tenth embodiment. In the figure, reference numeral 601 denotes an area in the non-volatile memory 102, which is an erase unit number confirmation area in which the same value as the value in the erase unit number holding area 202 is recorded. This is recovery means for writing back the contents of the erase block buffer 103 to the flash memory 101 based on the data in the unit number holding area 202 and the erase unit number confirmation area 601. The other configuration is the same as or equivalent to the configuration described in FIG.

本実施の形態において、メモリへのデータ書き込み時の動作を図30を用いて説明する。以下の各処理は、断りのない限り書き込み制御手段111の動作である。図30において、S1001〜S1003、S1005、S1006、S1008、S1009、S1011は実施の形態2の処理(図5のS201〜S203、S204、S205、S207、S208、S209)と同一であるので説明を省略する。
この実施の形態ではS1004、S1007、S1010の処理を有する点で相違するため、この点を中心に説明する。
In this embodiment mode, an operation at the time of data writing to the memory will be described with reference to FIG. The following processes are operations of the write control unit 111 unless otherwise specified. In FIG. 30, S1001 to S1003, S1005, S1006, S1008, S1009, and S1011 are the same as the processing of the second embodiment (S201 to S203, S204, S205, S207, S208, and S209 in FIG. 5), and thus description thereof is omitted. To do.
Since this embodiment is different in that it includes the processes of S1004, S1007, and S1010, this point will be mainly described.

S1001で書き込み要求を受け、S1002で書き込み要求領域を含むフラッシュメモリ101上の消去単位番号を求め、S1003で消去単位番号保持領域202を参照し、消去単位番号保持領域202に消去単位番号の記録が存在するかを判定する。   In step S1001, a write request is received. In step S1002, an erase unit number on the flash memory 101 including the write request area is obtained. In step S1003, the erase unit number holding area 202 is referred to, and the erase unit number is recorded in the erase unit number holding area 202. Determine if it exists.

消去単位番号の記録が存在しなければ、S1004にてS1002にて求められた消去単位番号を消去単位番号保持領域202に書き込む。続いて、S1005で書き込みデータを消去ブロックバッファ103に書き込み、S1006で待避手段112に対して待避指示を行う。待避手段112は、S1002で求めた番号のフラッシュメモリの消去単位領域から、不変データを消去ブロックバッファ103に書き込む。   If there is no record of the erase unit number, the erase unit number obtained in S1002 is written in the erase unit number holding area 202 in S1004. Subsequently, write data is written to the erase block buffer 103 in S1005, and a save instruction is issued to the save means 112 in S1006. The saving unit 112 writes invariant data into the erase block buffer 103 from the erase unit area of the flash memory having the number obtained in S1002.

続いて、S1007にて、S1002において求められた消去単位番号を消去単位番号確認領域601に書き込む。これにより、消去単位番号保持領域202および消去単位番号確認領域601の値が同一の場合、消去ブロックバッファ103への書き込みは全て完了したことを示すことになる。S1007の処理が終了すると、フラッシュメモリ101にデータを書き込むことなく、メモリへのデータ書き込み処理を終了する。   Subsequently, in S1007, the erase unit number obtained in S1002 is written in the erase unit number confirmation area 601. As a result, when the values of the erase unit number holding area 202 and the erase unit number confirmation area 601 are the same, it indicates that all writing to the erase block buffer 103 has been completed. When the processing of S1007 is completed, the data writing processing to the memory is terminated without writing data to the flash memory 101.

S1003において、消去単位番号保持領域202に消去単位番号の記録が存在する場合には、S1008、S1009により消去ブロックバッファ103の内容をフラッシュメモリ101内に書き込んだ後、S1010にて消去単位番号保持領域202および消去単位番号確認領域601の内容をクリアする。即ち、消去単位番号保持領域202および消去単位番号確認領域601がクリアされているということは消去ブロックバッファ103にデータがないことを示す。   If there is an erase unit number record in the erase unit number holding area 202 in S1003, the contents of the erase block buffer 103 are written into the flash memory 101 in S1008 and S1009, and then the erase unit number holding area in S1010. The contents of 202 and the erase unit number confirmation area 601 are cleared. That is, that the erase unit number holding area 202 and the erase unit number confirmation area 601 are cleared indicates that there is no data in the erase block buffer 103.

続いて、消去単位番号の記録が存在しない場合と同様に、S1004からS1007の処理を行い、消去単位番号保持領域への消去単位番号の設定、書き込みデータの消去ブロックバッファへの書き込み、フラッシュメモリからのデータの待避、消去単位番号確認領域への消去単位番号の設定を行う。   Subsequently, similarly to the case where there is no record of the erase unit number, the processing from S1004 to S1007 is performed to set the erase unit number in the erase unit number holding area, write the write data to the erase block buffer, Save data and set the erase unit number in the erase unit number confirmation area.

S1008で、S1002で求めた消去単位番号が消去単位番号保持領域202に存在する記録と一致する場合には、S1011において、書き込み要求データを消去ブロックバッファ103へ書き込む。
以上がメモリへのデータ書き込み時の動作である。
If the erase unit number obtained in S1002 matches the record existing in the erase unit number holding area 202 in S1008, the write request data is written to the erase block buffer 103 in S1011.
The above is the operation when writing data into the memory.

次に、情報処理装置の起動時に実行される復旧手段611の動作を図31を用いて説明する。
復旧手段はまず、S1051において、消去単位番号保持領域202内の値と消去単位番号確認領域601の値を読み出す。続いてS1052にて、消去単位番号保持領域202内の値と消去単位番号確認領域601にフラッシュメモリ内の消去単位番号が存在するかチェックする。
Next, the operation of the recovery unit 611 executed when the information processing apparatus is activated will be described with reference to FIG.
First, the recovery means reads the value in the erasure unit number holding area 202 and the value in the erasure unit number confirmation area 601 in S1051. Subsequently, in S1052, it is checked whether the value in the erase unit number holding area 202 and the erase unit number in the flash memory exist in the erase unit number confirmation area 601.

番号が存在しない場合、消去ブロックバッファにはデータがないので、復旧手段の処理を終了する。
S1052にて、番号が存在する場合、S1053にて、消去単位番号保持領域202内の値と消去単位番号確認領域601の値が同一かを判定する。
値が同一な場合、消去ブロックバッファにはデータが残っていることを示すので、復旧手段611はS1054にて、消去命令手段301に対し消去指示を出した後、書き込み手段302に書き込み指示を出し、消去ブロックバッファ103の内容をフラッシュメモリ101に書き込む。この消去指示および書き込み指示の内容は、実施の形態7におけるデータ書き込み時の動作(図23)のS808の処理と同様である。
If the number does not exist, there is no data in the erase block buffer, so the processing of the recovery means is terminated.
If the number exists in S1052, it is determined in S1053 whether the value in the erase unit number holding area 202 is the same as the value in the erase unit number confirmation area 601.
If the values are the same, it indicates that data remains in the erase block buffer. Therefore, the recovery unit 611 issues an erase instruction to the erase command unit 301 and then issues a write instruction to the write unit 302 in S1054. Then, the contents of the erase block buffer 103 are written into the flash memory 101. The contents of the erase instruction and the write instruction are the same as the processing in S808 of the data write operation (FIG. 23) in the seventh embodiment.

値が同一でない場合、まだ消去ブロックバッファの内容が完成していない、即ち図30において、S1005からS1007の間に電源断が発生し、情報処理装置が再起動されたことになり、消去ブロックバッファ103内のデータは途中までの書き込みデータしか存在しないので、復旧手段611はS1055にて、情報処理装置にエラー通知を行う。これにより、情報処理装置は書き込み途中の電源断を検出することができる。   If the values are not the same, the contents of the erase block buffer have not yet been completed, that is, in FIG. 30, a power failure has occurred between S1005 and S1007, and the information processing apparatus has been restarted. Since the data in 103 has only halfway written data, the recovery unit 611 notifies the information processing apparatus of an error in S1055. Thereby, the information processing apparatus can detect a power interruption during writing.

S1054またはS1055の処理が終了すると、復旧手段611はS1056にて、消去単位番号保持領域202および消去単位番号確認領域601をクリアする。これは、S1054経由の場合、消去ブロックバッファへの書き込みが完了したことを意味し、S1055経由の場合はエラー通知にて、消去ブロックバッファのエラーを通知したので、再度消去ブロックバッファを利用可能状態にするために実施される。
以上が復旧手段611の動作である。
When the process of S1054 or S1055 is completed, the recovery unit 611 clears the erase unit number holding area 202 and the erase unit number confirmation area 601 in S1056. This means that the write to the erase block buffer has been completed via S1054, and since the error of the erase block buffer was notified by an error notification via S1055, the erase block buffer can be used again. To be implemented.
The above is the operation of the recovery means 611.

以上のように、この実施の形態によれば、メモリへのデータ書き込み時において、消去ブロックバッファへのデータ書き込み前に消去番号保持領域消去単位番号を書き込み、待避手段に待避指示を出した後に消去単位番号確認領域に消去単位番号を格納するようにしたので、電源断の復旧時に書き込み要求処理中に電源断が発生したかを検知することができる情報処理装置を得ることができる。   As described above, according to this embodiment, when data is written to the memory, the erase number holding area erase unit number is written before the data is written to the erase block buffer, and the data is erased after the save instruction is issued to the save means. Since the erasing unit number is stored in the unit number confirmation area, it is possible to obtain an information processing apparatus capable of detecting whether a power interruption has occurred during the write request process when the power interruption is restored.

さらに、復旧時に消去ブロックバッファの内容をフラッシュメモリに書き戻すようにしたので、復旧後に、データの書き込みを行わない限り、データは全てフラッシュメモリ上に存在し、電池等でバックアップする不揮発性メモリを消去ブロックバッファに使うような場合、電源断後の電圧降下による不揮発性メモリ内の内容が不正になることによる、データ破壊を防ぐことができる。   In addition, since the contents of the erase block buffer are written back to the flash memory at the time of restoration, all data exists on the flash memory after restoration, and a non-volatile memory that is backed up by a battery etc. When used for an erasure block buffer, it is possible to prevent data destruction due to illegal contents in the nonvolatile memory due to a voltage drop after power-off.

実施の形態11.
本発明の他の実施形態における情報処理装置について説明する。情報処理装置の構成は、実施の形態10と同様であり、図29に示される。本実施の形態の基本動作は復旧手段611の処理動作以外は実施の形態10と同じである。
本実施の形態における復旧手段611の動作を図32を用いて説明する。
Embodiment 11 FIG.
An information processing apparatus according to another embodiment of the present invention will be described. The configuration of the information processing apparatus is the same as that of the tenth embodiment and is shown in FIG. The basic operation of this embodiment is the same as that of Embodiment 10 except for the processing operation of the recovery means 611.
The operation of the recovery means 611 in this embodiment will be described with reference to FIG.

復旧手段はまず、S1101において、消去単位番号保持領域202内の値と消去単位番号確認領域601の値を読み出す。続いて、S1102において、消去単位番号保持領域202内の値と消去単位番号確認領域601にフラッシュメモリ内の消去単位番号が存在するか判定する。   In step S1101, the recovery unit first reads the value in the erase unit number holding area 202 and the value in the erase unit number confirmation area 601. Subsequently, in S1102, it is determined whether the value in the erase unit number holding area 202 and the erase unit number in the flash memory exist in the erase unit number confirmation area 601.

番号が存在しない場合、消去ブロックバッファにはデータがないので、復旧手段の処理を終了する。
S1102にて番号が存在する場合、S1103にて、消去単位番号保持領域202内の値と消去単位番号確認領域601の値が同一かを判定する。値が同一な場合、消去ブロックバッファにはデータが残っていることを意味し、処理を終了する。
If the number does not exist, there is no data in the erase block buffer, so the processing of the recovery means is terminated.
If the number exists in S1102, it is determined in S1103 whether the value in the erase unit number holding area 202 is the same as the value in the erase unit number confirmation area 601. If the values are the same, it means that data remains in the erase block buffer, and the process ends.

値が同一でない場合、消去ブロックバッファ103内のデータは途中までの書き込みデータしか存在しないので、復旧手段611はS1104にて、情報処理装置にエラー通知を行う。これにより、情報処理装置は書き込み途中の電源断を検出することができる。続いて、S1105にて、再度消去ブロックバッファを利用可能状態にするため、消去単位番号保持領域202および消去単位番号確認領域601の内容をクリアする。
以上が復旧手段611の動作である。
If the values are not the same, only halfway write data exists in the erase block buffer 103, so the recovery unit 611 notifies the information processing apparatus of an error in S1104. Thereby, the information processing apparatus can detect a power interruption during writing. Subsequently, in S1105, the contents of the erase unit number holding area 202 and the erase unit number confirmation area 601 are cleared in order to make the erase block buffer available again.
The above is the operation of the recovery means 611.

以上のように、この実施の形態によれば、復旧時に消去単位番号保持領域の内容と消去単位番号確認領域の内容が一致していた場合はなにもせず、一致していない場合のみエラー通知および消去単位番号保持領域・消去単位番号確認領域のクリアを行うようにしたので、消去ブロックバッファに内容が残っている場合の復旧処理を速くすることができる。   As described above, according to this embodiment, if the contents of the erasure unit number holding area and the contents of the erasure unit number confirmation area match at the time of recovery, nothing is done, and an error is notified only when the contents do not match. Since the erasure unit number holding area and the erasure unit number confirmation area are cleared, the recovery process when the contents remain in the erasure block buffer can be accelerated.

実施の形態12.
図33は、実施の形態11における情報処理装置の概略を示す構成図である。図において、601は不揮発性メモリ102内のエリアであって、消去単位番号保持領域202内の値と同じ値が記録される消去単位番号確認領域、604は消去ブロックバッファを一定サイズ毎に区切り、各区域内のデータが正しいことを示すチェック値が格納された消去ブロックバッファ管理領域である。
Embodiment 12 FIG.
FIG. 33 is a configuration diagram illustrating an outline of the information processing apparatus according to the eleventh embodiment. In the figure, reference numeral 601 denotes an area in the non-volatile memory 102, which is an erase unit number confirmation area in which the same value as the value in the erase unit number holding area 202 is recorded. This is an erase block buffer management area in which a check value indicating that the data in each area is correct is stored.

また図において、611は情報処理装置の起動時に実行され、消去単位番号領域202、および消去単位番号確認領域611、および消去ブロックバッファ管理領域604内のデータを元に、消去ブロックバッファ103の内容をフラッシュメモリ101に書き戻す復旧手段であり、614は書き込み制御手段111および待避手段112からの書き込み指示により、書き込みデータを消去ブロックバッファに書き込むとともに、書き込んだ領域に対応するチェック値を消去ブロックバッファ管理領域604に書き込む消去ブロックバッファ書き込み手段である。これ以外の構成については、図4と同様である。   In the figure, reference numeral 611 is executed when the information processing apparatus is started, and the contents of the erase block buffer 103 are changed based on the data in the erase unit number area 202, erase unit number confirmation area 611, and erase block buffer management area 604. Recover means for writing back to the flash memory 101, and 614 writes write data to the erase block buffer and writes a check value corresponding to the written area to the erase block buffer in response to a write instruction from the write control means 111 and the save means 112. This is erase block buffer writing means for writing in the area 604. Other configurations are the same as those in FIG.

次に、消去ブロックバッファ管理領域604の構造を図34を用いて説明する。消去ブロックバッファ管理領域604は消去ブロックバッファ103を一定サイズ、例えば4Kバイト毎に区切り、各区域に対して、その区域内のデータチェックに用いる値、例えば区域内のデータをすべて加算したチェックサム値などが入る。   Next, the structure of the erase block buffer management area 604 will be described with reference to FIG. The erasure block buffer management area 604 divides the erasure block buffer 103 into a certain size, for example, every 4K bytes, and for each area, a value used for data check in the area, for example, a checksum value obtained by adding all the data in the area Etc.

図34の例では、書き込み領域1のデータチェック値(チェックサム値)が「0x12345678」、書き込み領域2のデータチェック値(チェックサム値)が「0x789a123」、書き込み領域3のデータチェック値(チェックサム値)が「0xa1b8901」となっている(0xは16進数を示す)。書き込み領域1、書き込み領域2、書き込み領域3は消去ブロックバッファ103内の一定サイズの区域を示す。   In the example of FIG. 34, the data check value (checksum value) in the write area 1 is “0x12345678”, the data check value (checksum value) in the write area 2 is “0x789a123”, and the data check value (checksum) in the write area 3 Value) is “0xa1b8901” (0x indicates a hexadecimal number). A write area 1, a write area 2, and a write area 3 indicate areas of a certain size in the erase block buffer 103.

消去ブロックバッファ書き込み手段614は、書き込み領域1への書き込みがあった場合、消去ブロックバッファ103にデータを書き込むとともに、消去ブロックバッファ管理領域の書き込み領域1に対応する領域、即ち図34において、「0x12345678」が格納されている領域に書き込み領域1のデータチェック値を書き込む。   The erasure block buffer writing means 614 writes data to the erasure block buffer 103 when writing to the write area 1 and at the same time corresponds to the write area 1 of the erasure block buffer management area, that is, “0x12345678 in FIG. The data check value of the write area 1 is written in the area where “is stored.

次に本実施の形態におけるメモリへのデータ書き込み時の動作を図35を用いて説明する。以下の各処理は断りがない限り書き込み制御手段111の動作である。図35において、S1201〜S1203、S1204、S1207〜S1210は実施の形態10の処理(図29のS1001〜S1003、S1004、S1007〜S1010)と同一であるので説明を省略する。
この実施の形態ではS1205、S1206、S1211の処理を有する点で相違するため、この点を中心に説明する。
Next, the operation at the time of data writing to the memory in this embodiment will be described with reference to FIG. The following processes are operations of the write control unit 111 unless otherwise noted. 35, steps S1201 to S1203, S1204, and S1207 to S1210 are the same as the processing of the tenth embodiment (S1001 to S1003, S1004, and S1007 to S1010 in FIG. 29), and thus description thereof is omitted.
Since this embodiment is different in that it includes the processing of S1205, S1206, and S1211, this point will be mainly described.

S1201〜S1204までを実施の形態10と同様に実行する。
そして、S1204を実行した後、S1205において書き込みデータを消去ブロックバッファに書き込むため消去ブロックバッファ書き込み手段614に指示を行う。この指示には、書き込みデータの消去ブロックバッファ103上の位置およびサイズおよび書き込みデータが含まれる。消去ブロックバッファ書き込み手段614の具体的な処理内容については後述する。
Steps S1201 to S1204 are executed in the same manner as in the tenth embodiment.
Then, after executing S1204, an instruction is given to the erase block buffer writing means 614 to write the write data to the erase block buffer in S1205. This instruction includes the position and size of the write data on the erase block buffer 103 and the write data. Specific processing contents of the erase block buffer writing means 614 will be described later.

次に、S1206において、待避手段112に対して待避指示を行う。待避手段112の処理内容については後述する。
続いて、S1207でS1202において求められた消去単位番号を消去単位番号確認領域601に書き込む。S1207の処理が終了すると、フラッシュメモリ101にデータを書き込むことなく、メモリへのデータ書き込み処理を終了する。
Next, in S1206, the save instruction is given to the save means 112. The processing contents of the saving unit 112 will be described later.
Subsequently, in S1207, the erase unit number obtained in S1202 is written in the erase unit number confirmation area 601. When the process of S1207 ends, the data writing process to the memory ends without writing data to the flash memory 101.

S1208で、S1202で求めた消去単位番号が消去単位番号保持領域202に存在する記録と一致する場合には、S1211において消去ブロックバッファ書き込み手段に指示し、書き込み要求データを消去ブロックバッファ103へ書き込む。この指示には、書き込みデータの消去ブロックバッファ103上の位置およびサイズおよび書き込みデータが含まれる。消去ブロックバッファ書き込み手段614の具体的な処理内容については後述する。
以上がメモリへのデータ書き込み時の動作である。
If the erase unit number obtained in S1202 matches the record existing in the erase unit number holding area 202 in S1208, the erase block buffer writing unit is instructed in S1211, and the write request data is written into the erase block buffer 103. This instruction includes the position and size of the write data on the erase block buffer 103 and the write data. Specific processing contents of the erase block buffer writing means 614 will be described later.
The above is the operation when writing data into the memory.

次に、フラッシュメモリ101内の不変データを消去ブロックバッファ103に書き込む待避手段112の動作を、図36を用いて説明する。
待避手段112は、まずS1231において書き込み要求データが含まれるフラッシュメモリ101内の消去単位領域の先頭から、書き込み要求データが含まれる領域の先頭までのデータをフラッシュメモリ101から読み出し、消去ブロックバッファ書き込み手段614に指示し、読み出したデータを消去ブロックバッファ103に書き込む。この時、消去ブロックバッファ書き込み手段614への指示には、消去単位領域の先頭アドレス、消去単位領域の先頭アドレスから書き込み要求領域の先頭までのサイズ、およびフラッシュメモリ101から読み出したデータが含まれる。
Next, the operation of the save unit 112 for writing the invariant data in the flash memory 101 to the erase block buffer 103 will be described with reference to FIG.
In step S1231, the saving unit 112 first reads data from the flash memory 101 from the beginning of the erase unit area in the flash memory 101 including the write request data to the beginning of the area including the write request data, and erase block buffer writing unit. Instructed to 614, the read data is written into the erase block buffer 103. At this time, the instruction to the erase block buffer writing unit 614 includes the start address of the erase unit area, the size from the start address of the erase unit area to the start of the write request area, and data read from the flash memory 101.

次に待避手段112はS1232において、書き込み要求データが含まれるフラッシュメモリ101内の消去単位領域の書き込み要求領域の最後から消去単位領域の最後までのデータをフラッシュメモリ101から読み出し、消去ブロックバッファ書き込み手段614に指示し、読み出したデータを消去ブロックバッファ103に書き込む。この時、消去ブロックバッファ書き込み手段614への指示には、消去単位領域内の書き込み要求領域の最後方アドレス、消去単位領域内の書き込み要求領域の最後方アドレスから消去単位領域の最後方アドレスまでのサイズ、およびフラッシュメモリ101から読み出したデータが含まれる。
以上が、待避手段112の動作である。これにより、消去単位領域内の不変データが消去ブロックバッファ103に書き込まれる。
Next, in step S1232, the saving unit 112 reads data from the end of the write request area of the erase unit area to the end of the erase unit area in the flash memory 101 including the write request data from the flash memory 101, and erase block buffer writing unit. In step 614, the read data is written into the erase block buffer 103. At this time, the instruction to the erase block buffer writing means 614 includes the last address of the write request area in the erase unit area, the last address of the write request area in the erase unit area to the last address of the erase unit area. The size and data read from the flash memory 101 are included.
The above is the operation of the save unit 112. As a result, invariant data in the erase unit area is written into the erase block buffer 103.

次に、消去ブロックバッファ103にデータを書き込む消去ブロックバッファ書き込み手段614の動作を図37を用いて説明する。
まず、S1251において、消去ブロックバッファ103への書き込み要求を受ける。この書き込み要求には、書き込むデータとしての書き込み要求データ、データを書き込む消去ブロックバッファ103上のアドレスを特定する書き込み要求領域、そしてデータの大きさの情報が含まれている。
Next, the operation of the erase block buffer writing means 614 for writing data to the erase block buffer 103 will be described with reference to FIG.
First, in S1251, a write request to the erase block buffer 103 is received. This write request includes write request data as data to be written, a write request area for specifying an address on the erase block buffer 103 to which the data is written, and data size information.

次にS1252において、書き込み要求データを消去ブロックバッファ管理領域で管理するサイズに分割する。例えば、管理するサイズの単位が1000バイトで、書き込み要求データが消去ブロックバッファの先頭からのオフセットで100〜2099のところまでを占める場合、書き込み要求データは、消去ブロックバッファの先頭からのオフセットで、100〜999、1000〜1999, 2000〜2099の3つに分割される。これは、書き込み要求領域から見たオフセットでは、0〜899, 900〜1899, 1900〜1999の領域となる。以降、この分割された領域を先頭から順に処理していく。即ち、まず100〜999の領域、次に1000〜1999の領域、2000〜2099の領域が処理されていく。   In step S1252, the write request data is divided into sizes managed in the erase block buffer management area. For example, when the unit of the size to be managed is 1000 bytes and the write request data occupies up to 100 to 2099 as an offset from the head of the erase block buffer, the write request data is an offset from the head of the erase block buffer, It is divided into three parts, 100-999, 1000-1999, 2000-2099. This is an area from 0 to 899, 900 to 1899, and 1900 to 1999 in terms of an offset viewed from the write request area. Thereafter, the divided areas are processed in order from the top. That is, first, the region of 100 to 999, the region of 1000 to 1999, and the region of 2000 to 2099 are processed.

次にS1253において、消去ブロックバッファに分割された書き込み要求データを書き込む。この時、書き込み要求データ以外の領域、例えば、100〜999に対する書き込みの場合の、0〜99の部分に対する書き込みは実施しない。
続いてS1254において、書き込んだ領域に対するチェック値を求め、それを消去ブロックバッファ管理領域の対応するチェック値領域に書き込む。例えば、100〜999までの書き込みをS1253にて行った場合、S1254は図34の書き込み領域1のデータチェック値に消去ブロックバッファ103内のオフセット0〜999までのデータチェック値を書き込む。このデータチェック値は対応する領域内のデータが正しいか否かをチェックする基準値として用いられるものであり、領域内のデータ値を全て加算したチェックサム値などが入る。
Next, in S1253, the write request data divided into the erase block buffer is written. At this time, in the case of writing to an area other than the write request data, for example, 100 to 999, writing to the 0 to 99 portion is not performed.
Subsequently, in S1254, a check value for the written area is obtained and written in the corresponding check value area in the erase block buffer management area. For example, when writing from 100 to 999 is performed in S1253, S1254 writes the data check value from offset 0 to 999 in the erase block buffer 103 to the data check value in the write area 1 in FIG. This data check value is used as a reference value for checking whether or not the data in the corresponding area is correct, and includes a checksum value obtained by adding all the data values in the area.

次にS1255において、書き込み要求データが全て消去ブロックバッファに書き込まれたかをチェックする。S1255において、まだ書き込み要求データがすべて書き込まれていない場合は、次の分割された書き込み要求領域、即ち100〜999に対する書き込みを行っていた場合は、1000〜1999までの領域に対し、S1253およびS1254の処理を行う。
以上が消去ブロックバッファ書き込み手段の動作である。
In step S1255, it is checked whether all write request data has been written to the erase block buffer. In S1255, when all the write request data has not been written yet, when writing to the next divided write request area, that is, from 100 to 999, S1253 and S1254 are performed for the area from 1000 to 1999. Perform the process.
The above is the operation of the erase block buffer writing means.

次に、情報処理装置の起動時に実行される復旧手段611の動作を図38を用いて説明する。
復旧手段はまず、S1281において、消去番号保持領域202内の値と消去単位番号確認領域601の値を読み出す。続いて、S1282にて、消去単位番号保持領域202内の値と消去単位番号確認領域601にフラッシュメモリ内の消去単位番号が存在するかチェックする。
Next, the operation of the recovery unit 611 executed when the information processing apparatus is activated will be described with reference to FIG.
First, in S1281, the recovery means reads the value in the erase number holding area 202 and the value in the erase unit number confirmation area 601. Subsequently, in S1282, it is checked whether the value in the erase unit number holding area 202 and the erase unit number in the flash memory exist in the erase unit number confirmation area 601.

S1281で番号が存在しない場合、消去ブロックバッファにはデータがないので、復旧手段の処理を終了する。
S1282で番号が存在する場合、S1283にて、消去単位番号保持領域202内の値と消去単位番号確認領域601の値が同一かをチェックする。
If the number does not exist in S1281, there is no data in the erase block buffer, and the processing of the recovery means is terminated.
If a number exists in S1282, it is checked in S1283 whether the value in the erase unit number holding area 202 is the same as the value in the erase unit number confirmation area 601.

S1283で値が同一でない場合、S1287に進み、情報処理装置にエラー通知を行う。これにより情報処理装置は書き込み途中の電源断を検出することができる。その後、S1288にて、消去単位番号保持領域202および消去単位番号確認領域601をクリアする。これにより、消去ブロックバッファを利用可能状態にする。
S1283で消去単位番号保持領域202内の値と消去単位番号確認領域601の値が同一である場合、S1284に進む。
If the values are not the same in S1283, the process proceeds to S1287, and an error notification is sent to the information processing apparatus. Thereby, the information processing apparatus can detect a power interruption during writing. Thereafter, in S1288, the erase unit number holding area 202 and the erase unit number confirmation area 601 are cleared. This makes the erase block buffer available.
If the value in the erasure unit number holding area 202 is the same as the value in the erasure unit number confirmation area 601 in S1283, the process proceeds to S1284.

S1284では、消去ブロックバッファ管理領域604内の各書き込み領域のデータチェック値を読み出す。また、対応する消去ブロックバッファ103内の領域の値を算出する(この算出規則は書き込み領域のデータチェック値の算出規則と同様の規則にて行う、例えばデータチェック値がチェックサム値であれば、データの合計値を算出する)。そして、消去ブロックバッファ管理領域604内の各書き込み領域のデータチェック値と消去ブロックバッファ103内の領域の計算値とを比較する。   In S1284, the data check value of each write area in the erase block buffer management area 604 is read. Further, the value of the area in the corresponding erase block buffer 103 is calculated (this calculation rule is performed according to the same rule as the calculation rule of the data check value of the write area. For example, if the data check value is a checksum value, Calculate the total value of the data). Then, the data check value of each write area in the erase block buffer management area 604 is compared with the calculated value of the area in the erase block buffer 103.

両者の値が一致すれば、消去ブロックバッファ103のデータが妥当であると判定する。消去ブロックバッファ内の領域のデータが妥当でない場合、S1287に進み情報処理装置にエラー通知を行う。これにより、本発明の手段以外の操作により消去ブロックバッファ103にデータが書き込まれたり、消去ブロックバッファ103が使用している不揮発性メモリが故障した場合のエラーを検出することができる。そして、S1288にて消去単位番号保持領域202と消去単位番号確認領域601の内容をクリアする。これにより、消去ブロックバッファを利用可能状態にする。   If the two values match, it is determined that the data in the erase block buffer 103 is valid. If the data in the area in the erase block buffer is not valid, the process proceeds to S1287 to notify the information processing apparatus of an error. As a result, it is possible to detect an error when data is written to the erase block buffer 103 by an operation other than the means of the present invention or when the nonvolatile memory used by the erase block buffer 103 fails. In step S1288, the contents of the erase unit number holding area 202 and the erase unit number confirmation area 601 are cleared. This makes the erase block buffer available.

S1285にて、消去ブロックバッファ管理領域604内の値が妥当であると判断した場合、S1286に進む。S1286では、消去ブロックバッファ内のデータチェックが最終領域まで達したかを判定する。最終領域まで達していない場合、次の領域へ進み、S1284〜S1286の処理を続行する。
S1286にて、消去ブロックバッファ内の最終領域まで到達した場合、処理を終了する。これにより、復旧後、消去ブロックバッファ内のデータは正しいことがわかる。
If it is determined in S1285 that the value in the erase block buffer management area 604 is valid, the process proceeds to S1286. In S1286, it is determined whether the data check in the erase block buffer has reached the final area. If the final area has not been reached, the process proceeds to the next area, and the processing of S1284 to S1286 is continued.
If the final area in the erase block buffer has been reached in S1286, the process ends. Thereby, it can be seen that the data in the erase block buffer is correct after the recovery.

以上のように、この実施の形態によれば、消去ブロックバッファ内を一定のサイズに分割し、個々の領域に対するデータチェック値を格納する消去ブロックバッファ管理領域を設けたので、消去ブロックバッファを保持している不揮発性メモリが故障し、消去ブロックバッファ内のデータが不正になっても、情報処理装置がそれを検出することができる。   As described above, according to this embodiment, the erase block buffer is divided into a certain size, and the erase block buffer management area for storing the data check value for each area is provided. Even if the non-volatile memory being used fails and the data in the erase block buffer becomes illegal, the information processing apparatus can detect it.

さらに、消去ブロックバッファ内を一定サイズに分割したので、消去ブロックバッファに格納されている消去単位領域と同一の領域に対する書き込み要求があった場合、その書き込み要求領域に付随する領域のみデータチェック値を更新すればよく、消去ブロックバッファ全体のデータチェック値を再計算する必要がないので、メモリへのデータ書き込み処理が速くなる。   In addition, since the erase block buffer is divided into a certain size, if there is a write request to the same area as the erase unit area stored in the erase block buffer, only the data check value associated with the write request area is set. It is only necessary to update the data, and it is not necessary to recalculate the data check value of the entire erase block buffer.

実施の形態13.
本発明の他の実施形態における情報処理装置について説明する。情報処理装置の構成は、実施の形態12と同様であり、図33に示される。本実施の形態では、消去ブロックバッファ管理領域604の構造と消去ブロックバッファ書き込み手段614および復旧手段611の動作以外は実施の形態12と同様である。
Embodiment 13 FIG.
An information processing apparatus according to another embodiment of the present invention will be described. The configuration of the information processing apparatus is the same as that of the twelfth embodiment and is shown in FIG. The present embodiment is the same as the twelfth embodiment except for the structure of the erase block buffer management area 604 and the operations of the erase block buffer writing means 614 and the recovery means 611.

図39は本実施の形態における消去ブロックバッファ管理領域604の構造である。本実施の形態では、消去ブロックバッファを任意のサイズで管理するため、消去ブロックバッファ管理領域には領域を示す情報として、消去ブロックバッファ内のオフセット値、領域のサイズ、データチェック値の3つのデータが保持される。図において、「−1」となっているのは、領域情報が格納されていないことを示す。   FIG. 39 shows the structure of the erase block buffer management area 604 in this embodiment. In this embodiment, since the erase block buffer is managed with an arbitrary size, the erase block buffer management area has three pieces of data, ie, an offset value in the erase block buffer, an area size, and a data check value, as information indicating the area. Is retained. In the figure, "-1" indicates that no area information is stored.

本実施の形態における消去ブロックバッファ書き込み手段614の動作を図40を用いて説明する。
まず、S1301にて、消去ブロックバッファ103への書き込み要求を受ける。この書き込み要求には、書き込みデータとしての書き込み要求データ、データを書き込み消去ブロックバッファ103上のアドレスを特定する書き込み要求領域、そしてデータの大きさの情報が含まれている。
The operation of the erase block buffer writing unit 614 in the present embodiment will be described with reference to FIG.
First, in S1301, a write request to the erase block buffer 103 is received. This write request includes write request data as write data, a write request area for specifying an address on the write / erase block buffer 103, and data size information.

続いて、S1302において、書き込み要求データを消去ブロックバッファに103に書き込む。
次に、S1303において、消去ブロックバッファ管理領域604を検索する。
S1304において、S1301で受けた書き込み要求の書き込み要求領域が消去ブロックバッファ管理領域604に登録されている領域と同一領域か判定する。もし、同一領域が存在する場合、S1305に進み、既に消去ブロックバッファ管理領域604に保持されているデータチェック値を書き込み要求データのデータチェック値に更新し、処理を終了する。
Subsequently, in S1302, the write request data is written into the erase block buffer 103.
Next, in S1303, the erase block buffer management area 604 is searched.
In S1304, it is determined whether the write request area of the write request received in S1301 is the same area as the area registered in the erase block buffer management area 604. If the same area exists, the process advances to step S1305 to update the data check value already held in the erase block buffer management area 604 to the data check value of the write request data, and the process ends.

S1304で同一の領域でないと判定した場合、S1306において、書き込み要求領域が消去ブロックバッファ管理領域604に登録されている領域に含まれる(例えば、オフセット0〜1000までの領域が登録されていた時にオフセット200〜400まで領域に対し書き込みがあった場合)か判定する。もし、含まれる場合場合にはS1307にて、消去ブロックバッファ管理領域604に登録されている領域のデータ(消去ブロックバッファ内オフセット、サイズ、データチェック値)を削除する。   If it is determined in S1304 that they are not the same area, the write request area is included in the area registered in the erasure block buffer management area 604 in S1306 (for example, an offset when an area from offset 0 to 1000 is registered). 200 to 400 when there is a write to the area). If it is included, in step S1307, the data (the erase block buffer offset, size, data check value) of the area registered in the erase block buffer management area 604 is deleted.

そして、登録されていた領域の先頭から書き込み要求データの先頭までの領域を新規に登録(S1308)し、さらに書き込み要求領域を新規登録し(S1309)、最後に書き込み要求データの最後から登録されていた領域の最後までの領域を新規登録(S1310)し、処理を終了する。それぞれ新規登録の際に、消去ブロックバッファ内オフセット、サイズ、データチェック値を書き込む。   Then, a new area from the beginning of the registered area to the beginning of the write request data is newly registered (S1308), and a new write request area is newly registered (S1309). Finally, the area is registered from the end of the write request data. The region up to the end of the region is newly registered (S1310), and the process is terminated. In each new registration, the erase block buffer offset, size, and data check value are written.

S1306にて、消去ブロックバッファ管理領域604に登録されている領域が書き込み要求領域を含まなかった場合、S1311にて、消去ブロックバッファ管理領域604に登録されている領域で、書き込み要求領域が跨ぐ領域があるか判定する。   If the area registered in the erase block buffer management area 604 does not include the write request area in S1306, the area that is registered in the erase block buffer management area 604 and spans the write request area in S1311 Determine if there is any.

もし、跨ぐ領域が存在する場合、S1312にて、消去ブロックバッファ管理領域604に登録されている、書き込み要求領域が跨ぐ領域を全て削除する。続いて、跨れた領域の最初の領域の先頭から、書き込み要求領域の先頭までを消去ブロックバッファ管理領域604に新規登録(S1313)し、さらに書き込み要求領域を消去ブロックバッファ管理領域604に新規登録した(S1314)後、書き込み要求領域の最後から跨れた領域の最後の領域の最後までを新規登録(S1315)し、処理を終了する。それぞれ新規登録の際に、消去ブロックバッファ内オフセット、サイズ、データチェック値を書き込む。   If there is an area that straddles, in S1312, all areas that are registered in the erase block buffer management area 604 and that straddle the write request area are deleted. Subsequently, the first part of the straddled area to the beginning of the write request area is newly registered in the erase block buffer management area 604 (S1313), and the write request area is newly registered in the erase block buffer management area 604. After this (S1314), new registration is performed up to the end of the last area of the area straddling from the end of the write request area (S1315), and the process ends. In each new registration, the erase block buffer offset, size, and data check value are written.

S1311にて、消去ブロックバッファ管理領域604に登録されている領域で、書き込み要求領域が跨ぐ領域が存在しない場合、消去ブロックバッファ管理領域604には書き込み要求領域に対する情報が格納されていないので、S1316において、書き込み要求領域を消去ブロックバッファ管理領域604に新規登録する。この時、消去ブロックバッファ管理領域604には、書き込み要求領域の消去ブロックバッファ103上の位置(オフセット)、書き込み要求領域のサイズ、および書き込み要求データが正しいことを示すチェック値が格納される。
以上が消去ブロックバッファ書き込み手段614の動作である。
In S1311, if there is no area that is registered in the erase block buffer management area 604 and that spans the write request area, the erase block buffer management area 604 stores no information for the write request area. Then, the write request area is newly registered in the erase block buffer management area 604. At this time, the erase block buffer management area 604 stores the position (offset) of the write request area on the erase block buffer 103, the size of the write request area, and a check value indicating that the write request data is correct.
The operation of the erase block buffer writing unit 614 has been described above.

次に、消去ブロックバッファ管理領域604内のデータ操作を図41の例を用いて説明する。図41では、オフセット値0x2000(0xは16進数を示す)、サイズ0x2000、データチェック値0xfedca123のデータを書き込んだ場合の、消去ブロックバッファ内のデータ操作を示している。   Next, data operation in the erase block buffer management area 604 will be described with reference to the example of FIG. FIG. 41 shows data operation in the erase block buffer when data of offset value 0x2000 (0x indicates a hexadecimal number), size 0x2000, and data check value 0xfedca123 is written.

まず、最初の例(例1)は書き込み要求領域が消去ブロックバッファ管理領域604に登録されている領域と同一のものがあった場合の例である。この例では、消去ブロックバッファ管理領域604には、オフセット0x2000、サイズ0x2000の領域が既に登録されており、これは書き込み要求データと同じ領域である。   First, the first example (example 1) is an example in which the write request area is the same as the area registered in the erase block buffer management area 604. In this example, the erase block buffer management area 604 has already registered an area of offset 0x2000 and size 0x2000, which is the same area as the write request data.

この場合、消去ブロックバッファ書き込み手段614は、図40のS1305の処理、即ち、既に登録されていた領域のチェック値を書き込み要求データに対するチェック値に更新する。これにより、データ書き込み後は図41中の網掛けの部分が更新される。   In this case, the erasure block buffer writing means 614 updates the check value for the write request data in the processing of S1305 in FIG. Thereby, the shaded portion in FIG. 41 is updated after the data is written.

次の例(例2)は、書き込み要求領域が消去ブロックバッファ管理領域604に登録されている領域の中に含まれる場合の例である。この例では、消去ブロックバッファ管理領域604には、オフセット0x1000、サイズ0x4000の領域があり、書き込み要求領域はこの領域に含まれる。この場合、消去ブロックバッファ書き込み手段614は、図40のS1307〜S1310の処理を行う。   The next example (example 2) is an example in which the write request area is included in the area registered in the erase block buffer management area 604. In this example, the erase block buffer management area 604 includes an area having an offset of 0x1000 and a size of 0x4000, and the write request area is included in this area. In this case, the erase block buffer writing unit 614 performs the processing of S1307 to S1310 in FIG.

初めに、登録されている領域、即ちオフセット0x1000、サイズ0x4000のデータを削除する(図40、S1307)。次に登録されていた領域の先頭から書き込み要求領域の先頭までの領域(オフセット0x1000, サイズ0x1000)を新規登録する(図40, S1308)。そして、書き込み要求領域(オフセット0x2000, サイズ0x2000)を新規登録する(図40, S1309)。最後に、書き込み要求データの最後から登録されていた領域の最後までの領域(オフセット0x4000,サイズ0x1000)を新規登録する(図40, S1310)。これにより、データ書き込み後は図41中の網掛けの部分が更新される。   First, the registered area, that is, data of offset 0x1000 and size 0x4000 is deleted (FIG. 40, S1307). Next, a new area (offset 0x1000, size 0x1000) from the beginning of the registered area to the beginning of the write request area is newly registered (FIG. 40, S1308). A write request area (offset 0x2000, size 0x2000) is newly registered (FIG. 40, S1309). Finally, an area (offset 0x4000, size 0x1000) from the end of the write request data to the end of the registered area is newly registered (FIG. 40, S1310). Thereby, the shaded portion in FIG. 41 is updated after the data is written.

次の例(例3)は、書き込み要求領域が消去ブロックバッファ管理領域604に登録されている領域を跨ぐ場合の例である。この例では、書き込み要求領域は、消去ブロックバッファ管理領域604に登録されている2つの領域(オフセット0x0000,サイズ0x3000の領域およびオフセット0x3000、サイズ0x2000の領域)を跨ぐ。この場合、消去ブロックバッファ書き込み手段614は、図40のS1312〜S1315の処理を行う。   The next example (example 3) is an example in which the write request area straddles the area registered in the erase block buffer management area 604. In this example, the write request area spans two areas registered in the erase block buffer management area 604 (an area of offset 0x0000, size 0x3000, an offset of 0x3000, and size 0x2000). In this case, the erase block buffer writing unit 614 performs the processing of S1312 to S1315 of FIG.

初めに、登録されている領域、即ちオフセット0x0000,サイズ0x3000の領域およびオフセット0x3000,サイズ0x2000の領域を削除する(図40, S1312)。次に登録されていた領域の内最初の領域(オフセット0x0000、サイズ0x3000)の先頭から、書き込み要求領域の先頭までの領域(オフセット0x0000,サイズ0x2000)を新規登録する(図40, S1313)。そして書き込み要求領域(オフセット0x2000, サイズ0x2000)を新規登録する(図40, S1314)。最後に、書き込み要求領域の最後から跨れた領域の最後の領域の最後までの領域(オフセット0x4000, サイズ0x1000)を新規登録する(図40, S1315)。これにより、データ書き込み後は図41中の網掛けの部分が更新される。   First, the registered areas, that is, the area of offset 0x0000, size 0x3000 and the area of offset 0x3000, size 0x2000 are deleted (FIG. 40, S1312). Next, an area (offset 0x0000, size 0x2000) from the beginning of the first area (offset 0x0000, size 0x3000) to the beginning of the write request area is newly registered (FIG. 40, S1313). A write request area (offset 0x2000, size 0x2000) is newly registered (FIG. 40, S1314). Finally, a new area (offset 0x4000, size 0x1000) from the end of the write request area to the end of the last area is registered (FIG. 40, S1315). Thereby, the shaded portion in FIG. 41 is updated after the data is written.

最後の例(例4)は、書き込み要求領域が消去ブロックバッファ管理領域604に登録されていない場合の例である。この例では、消去ブロックバッファ管理領域604には、オフセット0x4000,サイズ0xc000の領域のみ登録されており、書き込み要求領域(オフセット0x2000, サイズ0x2000)は登録されていない。   The last example (example 4) is an example in which the write request area is not registered in the erase block buffer management area 604. In this example, only the area of offset 0x4000 and size 0xc000 is registered in the erase block buffer management area 604, and the write request area (offset 0x2000, size 0x2000) is not registered.

この場合、消去ブロックバッファ書き込み手段614は図40のS1316の処理、即ち、書き込み要求領域(オフセット0x2000, サイズ0x1000)を消去ブロックバッファ管理領域604に新規登録する。これにより、データ書き込み後は図41中の網掛けの部分が更新される。   In this case, the erase block buffer writing unit 614 newly registers the process of S1316 in FIG. 40, that is, the write request area (offset 0x2000, size 0x1000) in the erase block buffer management area 604. Thereby, the shaded portion in FIG. 41 is updated after the data is written.

次に本実施の形態における復旧手段611の動作を図42を用いて説明する。
復旧手段611はまず、S1351において、消去単位番号保持領域202内の値と消去単位番号確認領域601の値を読み出す。続いて、S1282にて、消去単位番号保持領域202内の値と消去単位番号確認領域601にフラッシュメモリ内の消去単位番号が存在するかチェックする。
Next, the operation of the recovery means 611 in the present embodiment will be described with reference to FIG.
First, the recovery unit 611 reads the value in the erase unit number holding area 202 and the value in the erase unit number confirmation area 601 in S1351. Subsequently, in S1282, it is checked whether the value in the erase unit number holding area 202 and the erase unit number in the flash memory exist in the erase unit number confirmation area 601.

番号が存在しない場合、消去ブロックバッファにはデータがないので、復旧手段の処理を終了する。
S1352において、番号が存在する場合、S1353にて、消去単位番号保持領域202内の値と消去単位番号確認領域601の値が同一かをチェックする。
値が同一でない場合、S1357に進み、情報処理装置にエラー通知を行う。これにより、情報処理装置は書き込み途中の電源断を検出することができる。その後、S1358にて、消去単位番号保持領域202および消去単位番号確認領域601をクリアする。これにより、消去ブロックバッファを利用可能状態にする。
If the number does not exist, there is no data in the erase block buffer, so the processing of the recovery means is terminated.
If the number exists in S1352, it is checked in S1353 whether the value in the erase unit number holding area 202 is the same as the value in the erase unit number confirmation area 601.
If the values are not the same, the process proceeds to S1357, and an error notification is sent to the information processing apparatus. Thereby, the information processing apparatus can detect a power interruption during writing. Thereafter, in S1358, the erase unit number holding area 202 and the erase unit number confirmation area 601 are cleared. This makes the erase block buffer available.

S1353にて、消去単位番号保持領域202内の値と消去単位番号確認領域601の値が同一である場合、S1354に進む。S1354では、消去ブロックバッファ管理領域604に登録されている領域情報に対応させて、消去ブロックバッファ103内のデータを読み出す。そして、消去ブロックバッファ103内のデータを用いて値を算出する(この算出規則は書き込み領域のデータチェック値の算出規則と同様の規則にて行う、例えばデータチェック値がチェックサム値であれば、データの合計値を算出する)。
続いて、S1355にて算出した値と消去ブロックバッファ管理領域604の領域情報にあるデータチェック値をチェックする。
If it is determined in S1353 that the value in the erase unit number holding area 202 and the value in the erase unit number confirmation area 601 are the same, the process advances to S1354. In S 1354, the data in the erase block buffer 103 is read in correspondence with the area information registered in the erase block buffer management area 604. Then, a value is calculated using the data in the erase block buffer 103 (this calculation rule is based on a rule similar to the calculation rule of the data check value in the write area. For example, if the data check value is a checksum value, Calculate the total value of the data).
Subsequently, the value calculated in S1355 and the data check value in the area information of the erase block buffer management area 604 are checked.

両者の値が一致すれば、消去ブロックバッファ103のデータが妥当であると判定する。   If the two values match, it is determined that the data in the erase block buffer 103 is valid.

S1355にて妥当でない、即ち消去ブロックバッファ103内のデータが正しくない場合、S1357に進み、情報処理装置にエラー通知を行う。これにより、本発明の手段以外の操作により消去ブロックバッファ103にデータが書き込まれたり、消去ブロックバッファ103が使用している不揮発性メモリが故障したことを検出することができる。そして、S1358にて消去単位番号保持領域202と消去単位番号確認領域601の内容をクリアする。これにより、消去ブロックバッファを利用可能状態にする。   If it is not valid in S1355, that is, if the data in the erase block buffer 103 is not correct, the process proceeds to S1357, and an error notification is sent to the information processing apparatus. As a result, it is possible to detect that data has been written to the erase block buffer 103 by an operation other than the means of the present invention or that the nonvolatile memory used by the erase block buffer 103 has failed. In step S1358, the contents of the erase unit number holding area 202 and the erase unit number confirmation area 601 are cleared. This makes the erase block buffer available.

S1355にて妥当であると判断した場合、S1356に進む、。S1356では、消去ブロックバッファ管理領域604に登録されている領域の最後に到達したかチェックする。領域の最後まで到達していない場合、次の領域に対し、S1354〜S1356の処理を続行する。   If it is determined to be valid in S1355, the process proceeds to S1356. In S1356, it is checked whether the end of the area registered in the erase block buffer management area 604 has been reached. If the end of the area has not been reached, the processing of S1354 to S1356 is continued for the next area.

S1356にて、消去ブロックバッファ管理領域604に登録されている領域の最後に登録されている領域まで達した場合、処理を終了する。これにより、復旧後、消去ブロックバッファには正しいデータのみ残る。
以上のように、この実施の形態によれば、消去ブロックバッファ管理領域に登録する領域を可変サイズにするようにしたので、消去ブロックバッファ書き込み手段でバッファへの書き込み時に書き込み要求領域を分割する必要がなく、メモリへのデータ書き込み処理を高速に行うことができる。
In S1356, when the area registered at the end of the area registered in the erase block buffer management area 604 is reached, the process is terminated. Thereby, only the correct data remains in the erase block buffer after recovery.
As described above, according to this embodiment, since the area to be registered in the erase block buffer management area is made variable, it is necessary to divide the write request area when writing to the buffer by the erase block buffer writing means. Therefore, the data writing process to the memory can be performed at high speed.

実施の形態14.
本発明の他の実施の形態における情報処理装置について説明する。情報処理装置の構成は、実施の形態12と同様であり、図33に示される。本実施の形態では、読み出し手段の動作以外は実施の形態12と同様である。
Embodiment 14 FIG.
An information processing apparatus according to another embodiment of the present invention will be described. The configuration of the information processing apparatus is the same as that of the twelfth embodiment and is shown in FIG. This embodiment is the same as the twelfth embodiment except for the operation of the reading means.

本実施の形態における読み出し手段201の動作を図43を用いて説明する。図43において、S1401〜S1403、S1404は実施の形態2の処理(図6のS211〜S213、S215)と同一であるので説明を省略する。
この実施の形態ではS1405、S1406、S1407の処理を有する点で相違するため、この点を中心に説明する。
The operation of the reading unit 201 in this embodiment will be described with reference to FIG. In FIG. 43, S1401 to S1403 and S1404 are the same as the processing of the second embodiment (S211 to S213 and S215 of FIG. 6), and thus description thereof is omitted.
Since this embodiment is different in that it includes the processing of S1405, S1406, and S1407, this point will be mainly described.

S1401において読み出し要求を受けると、S1402において読み出し要求領域を含むフラッシュメモリの消去単位の番号を求め、S1403において消去単位番号保持領域202の記録とS1402において求めた消去単位の番号とが一致するかを判定する。
消去単位番号の記録が消去単位番号保持領域202に存在しないか、あるいは記録された消去番号がS1402において求めたものと一致しない場合には、読み出し領域のデータは消去ブロックバッファに保持されていないので、S1404において、フラッシュメモリからデータの読み出しを行う。
When a read request is received in S1401, the erase unit number of the flash memory including the read request area is obtained in S1402. In S1403, whether the record in the erase unit number holding area 202 matches the erase unit number obtained in S1402 or not. judge.
If the erase unit number record does not exist in the erase unit number holding area 202 or if the recorded erase number does not match that obtained in S1402, the data in the read area is not held in the erase block buffer. In step S1404, data is read from the flash memory.

消去単位番号の記録がS1402において求めたものと一致する場合、S1405に進み、読み込み要求領域のデータを消去ブロックバッファ103から読み出す。
続いてS1406において、読み出した領域に対応する消去ブロックバッファ管理領域604のデータチェック値を用いて、読み出した領域のデータが正しいか否かを判定する。即ち、S1405で消去ブロックバッファ103から読み出したデータを用いて値を算出し(この算出規則は消去ブロックバッファ管理領域604のデータチェック値を算出する算出規則と同様の規則である。)、この算出値と読み出した領域に対応する消去ブロックバッファ管理領域604のデータチェック値とが同一か否かを判定する。
両者が同一の値であれば、消去ブロックバッファ103から読み出したデータが妥当であると判断する。
If the erase unit number record matches that obtained in S1402, the process proceeds to S1405, and the data in the read request area is read from the erase block buffer 103.
In step S1406, it is determined whether the data in the read area is correct using the data check value in the erase block buffer management area 604 corresponding to the read area. That is, a value is calculated using the data read from the erase block buffer 103 in S1405 (this calculation rule is the same rule as the calculation rule for calculating the data check value of the erase block buffer management area 604), and this calculation. It is determined whether or not the value and the data check value of the erase block buffer management area 604 corresponding to the read area are the same.
If both are the same value, it is determined that the data read from the erase block buffer 103 is valid.

S1406で妥当でないと判断した場合、S1407にて情報処理装置にエラー通知を行い、処理を終了する。S1406で妥当であると判断した場合、読み出した領域のデータは正しい値であるので、そのまま処理を終了する。   If it is determined in S1406 that it is not valid, an error notification is sent to the information processing apparatus in S1407, and the process ends. If it is determined in S1406 that the data is valid, the data in the read area is a correct value, and the process is terminated as it is.

以上のように本実施の形態によれば、消去ブロックバッファ管理領域にあるデータチェック値をデータ読み出し時のデータチェック用に利用するようにしたので、本発明以外の手段により消去ブロックバッファにデータ書き込みが発生した場合や不揮発性メモリに故障が発生した場合、読み出し時にそれをエラーとして検出することができる。   As described above, according to the present embodiment, since the data check value in the erase block buffer management area is used for data check at the time of data read, data is written to the erase block buffer by means other than the present invention. When a failure occurs in the nonvolatile memory, it can be detected as an error at the time of reading.

実施の形態15.
本発明の他の実施の形態における情報処理装置について説明する。情報処理装置の構成は、実施の形態12と同様であり、図33に示される。本実施の形態では、読み出し手段の動作以外は実施の形態12と同様である。
本実施の形態における読み出し手段201の動作を図44を用いて説明する。図44において、S1501〜S1506は実施の形態14の処理(図43のS1401〜S1406)と同一であるので説明を省略する。
Embodiment 15 FIG.
An information processing apparatus according to another embodiment of the present invention will be described. The configuration of the information processing apparatus is the same as that of the twelfth embodiment and is shown in FIG. This embodiment is the same as the twelfth embodiment except for the operation of the reading means.
The operation of the reading unit 201 in this embodiment will be described with reference to FIG. In FIG. 44, S1501 to S1506 are the same as the processing of the fourteenth embodiment (S1401 to S1406 in FIG. 43), and thus description thereof is omitted.

この実施の形態ではフラッシュメモリからの読み出しS1504の処理をS1506において消去ブロックバッファ103から読み出したデータが妥当でなかった場合にも行う。S1504では、読み出し要求領域に対応するフラッシュメモリ上の領域からデータを読み込み、その後処理を終了する。
尚、S1504の処理は、消去単位番号の記録が消去単位番号保持領域202に存在しないか、あるいは記録された消去番号がS1502において求めたものと一致しない場合にも行う。
In this embodiment, the process of reading from the flash memory S1504 is also performed when the data read from the erase block buffer 103 in S1506 is not valid. In S1504, data is read from the area on the flash memory corresponding to the read request area, and then the process ends.
Note that the processing of S1504 is also performed when the erase unit number is not recorded in the erase unit number holding area 202 or when the recorded erase number does not match that obtained in S1502.

以上のように本実施の形態によれば、消去ブロックバッファ103の読み出し時に、読み出したデータが正しくない場合、消去ブロックバッファ103に対応するフラッシュメモリ上の領域からデータを読み込むようにしたので、書き込み前のデータを使い情報処理装置の動作を継続することができる。   As described above, according to the present embodiment, when the read data is not correct when reading from the erase block buffer 103, the data is read from the area on the flash memory corresponding to the erase block buffer 103. The operation of the information processing apparatus can be continued using the previous data.

実施の形態16.
図45は本発明の他の実施の形態における情報処理装置の構成を示す図である。図において、605は消去ブロックバッファの消去単位番号情報や書き込みバッファの消去単位番号情報などが入るバッファ管理領域である。また、611は情報処理装置の起動時に実行され、バッファ管理領域605内の情報に従い、消去ブロックバッファ103および書き込みバッファ402のデータを復旧させる復旧手段である。他の構成は、図8における構成の同一もしくは相当部であり説明を省略する。なお、図8における消去単位番号保持領域202は図45ではバッファ管理領域605内に設定される。
Embodiment 16 FIG.
FIG. 45 is a diagram showing a configuration of an information processing apparatus according to another embodiment of the present invention. In the figure, reference numeral 605 denotes a buffer management area for storing erase unit number information of the erase block buffer and erase unit number information of the write buffer. Reference numeral 611 denotes recovery means that is executed when the information processing apparatus is started up and restores data in the erase block buffer 103 and the write buffer 402 according to information in the buffer management area 605. The other configuration is the same as or equivalent to the configuration in FIG. Note that the erase unit number holding area 202 in FIG. 8 is set in the buffer management area 605 in FIG.

図46は、バッファ管理領域605に記録されているデータの内容を示す。バッファ管理領域605は、消去ブロックバッファの情報を格納する消去ブロックバッファ管理領域6051と、書き込みバッファの情報を格納する書き込みバッファ管理領域6052とで構成される。   FIG. 46 shows the contents of data recorded in the buffer management area 605. The buffer management area 605 includes an erase block buffer management area 6051 that stores information on the erase block buffer, and a write buffer management area 6052 that stores information on the write buffer.

バッファ管理領域605の消去ブロックバッファ管理領域6051には、消去ブロックバッファ103が保持しているデータに対応するフラッシュメモリ上の消去単位番号を記録する消去単位番号保持領域と、消去単位番号保持領域と同じ値を持つ消去単位番号確認領域と、消去ブロックバッファ内のデータが正しいか否かのチェックに用いるデータチェック値を持つデータチェック値領域が含まれる。   In the erase block buffer management area 6051 of the buffer management area 605, an erase unit number holding area for recording an erase unit number on the flash memory corresponding to data held in the erase block buffer 103, an erase unit number holding area, An erase unit number confirmation area having the same value and a data check value area having a data check value used for checking whether or not the data in the erase block buffer is correct are included.

バッファ管理管理領域605の書き込みバッファ管理領域6052には、書き込みバッファ402に保存されてたデータが書き込まれるべきフラッシュメモリ101上の消去単位番号と、この消去単位領域内の書き込み領域の位置を特定するオフセットと、書き込み領域の大きさを示すサイズと、対応する書き込みバッファ内の領域のデータが正しいか否かのチェックに用いるデータチェック値と、この情報領域(消去単位番号領域、消去単位内オフセット、サイズ、データチェック値)のデータが正しいか否かのチェックに用いる管理領域チェック値を保持する。消去単位番号の「−1」は、これ以上書き込みデータが存在しないことを意味する。   The write buffer management area 6052 of the buffer management management area 605 specifies the erase unit number on the flash memory 101 to which the data stored in the write buffer 402 is to be written, and the position of the write area in the erase unit area. The offset, the size indicating the size of the write area, the data check value used for checking whether the data in the corresponding write buffer area is correct, and this information area (erase unit number area, erase unit offset, The management area check value used for checking whether or not the data of size and data check value is correct is held. The erase unit number “−1” means that there is no more write data.

本実施の形態におけるメモリへの書き込み時の動作を図47を用いて説明する。以下の各処理は断りがない限り書き込み制御手段111の動作である。
まず、S1601でデータの書き込み要求を受けるとS1602で書き込み要求がされたフラッシュメモリの消去単位の番号を求める。この動作は、実施の形態1および4と同様である。
The operation at the time of writing to the memory in this embodiment will be described with reference to FIG. The following processes are operations of the write control unit 111 unless otherwise noted.
First, when a data write request is received in S1601, the erase unit number of the flash memory for which the write request was made is obtained in S1602. This operation is the same as in the first and fourth embodiments.

続いて、S1603において、消去ブロックバッファ管理領域6051の消去単位番号保持領域を参照し、消去単位番号の記録が存在するかを判定する。
ここで消去番号の記録が存在しなければ、S1604において、書き込み制御手段111は、消去ブロックバッファ管理領域6051内にある消去単位番号保持領域にS1602で求めた消去単位番号を格納する。
続いて、S1605において書き込み要求データを消去ブロックバッファ103に書き込み、S1606において待避手段112に対して待避指示を行う。待避指示の内容および待避手段の処理動作は実施の形態1および4と同様である。
Subsequently, in S1603, the erase unit number holding area of the erase block buffer management area 6051 is referred to and it is determined whether or not there is a record of the erase unit number.
If there is no erasure number record, the write control unit 111 stores the erasure unit number obtained in S1602 in the erasure unit number holding area in the erasure block buffer management area 6051 in S1604.
Subsequently, write request data is written into the erase block buffer 103 in S1605, and a save instruction is issued to the save unit 112 in S1606. The contents of the save instruction and the processing operation of the save means are the same as in the first and fourth embodiments.

続いてS1607において、データチェック値を消去ブロックバッファ管理領域6051内にあるデータチェック値領域に書き込む。この値は、消去ブロックバッファ103内に書き込まれているデータが正しいか否かをチェックするために用いられる値であり、消去ブロックバッファ103内のデータ値をすべて加算したチェックサム値など、データが正しいか否かをチェックできる値が入る。   In step S1607, the data check value is written in the data check value area in the erase block buffer management area 6051. This value is a value used to check whether the data written in the erase block buffer 103 is correct, and the data such as a checksum value obtained by adding all the data values in the erase block buffer 103 is stored. Contains a value that can be checked for correctness.

さらにS1608において、S1602で求められた消去単位番号を消去ブロックバッファ管理領域6051内にある消去単位番号確認領域に格納する。これにより、消去単位番号保持領域および消去単位番号確認領域の値が同一の場合、消去ブロックバッファ103への書き込みは全て完了したことになる。
次に、S1609において消去命令手段301に対して消去指示を出す。消去指示の内容および消去命令手段301の動作は実施の形態4と同様である。
In step S1608, the erase unit number obtained in step S1602 is stored in the erase unit number confirmation area in the erase block buffer management area 6051. As a result, when the values of the erase unit number holding area and the erase unit number confirmation area are the same, all writing to the erase block buffer 103 is completed.
In step S1609, an erase instruction is issued to the erase command unit 301. The contents of the erase instruction and the operation of the erase command means 301 are the same as in the fourth embodiment.

S1603において消去ブロックバッファ管理領域6051内の消去単位番号保持領域に消去単位番号の記録が存在すると判断した場合には、S1610において、S1602で求めた消去単位番号が消去ブロックバッファ管理領域6051内の消去単位番号保持領域に存在する記録と一致するかを判定する。   If it is determined in S1603 that the erase unit number is recorded in the erase unit number holding area in the erase block buffer management area 6051, the erase unit number obtained in S1602 is the erase unit number in the erase block buffer management area 6051 in S1610. It is determined whether or not it matches the record existing in the unit number holding area.

S1610で消去単位番号が異なると判断した場合には、S1611において、書き込みバッファ管理領域6052を参照し、書き込みバッファ管理領域6052に記録されている情報から、書き込み要求領域と同一の領域に書き込みを行うデータが既に書き込みバッファ402に存在するかを判定する。この判定は、実施の形態4と同様である。
S1611で書き込み要求領域と同一の領域に書き込みを行うデータが書き込みバッファ402に存在しないと判断した場合には、さらにS1612において書き込み制御手段111は書き込みバッファ402の空き領域を調べる。この処理は、実施の形態4と同様である。
If it is determined in S1610 that the erase unit numbers are different, the write buffer management area 6052 is referred to in S1611 and writing is performed from the information recorded in the write buffer management area 6052 to the same area as the write request area. It is determined whether data already exists in the write buffer 402. This determination is the same as in the fourth embodiment.
If it is determined in S1611 that data to be written to the same area as the write request area does not exist in the write buffer 402, the write control unit 111 further checks an empty area of the write buffer 402 in S1612. This process is the same as in the fourth embodiment.

書き込みバッファ402に空き領域が存在しない場合には、S1613において書き込み制御手段111は、書き込み手段301に対し書き込み指示を行う。書き込み指示の内容および書き込み手段301の動作は実施の形態1と同様である。
続いて、S1614において消去ブロックバッファ管理領域6051の消去単位番号保持領域と消去単位番号確認領域の内容をクリアする。これにより、消去ブロックバッファ601にはデータが残っていないことを示す。
さらに、この後、S1604からS1609の処理を、消去単位番号の記録が存在しない場合と同様に行う。
If there is no free space in the write buffer 402, the write control unit 111 instructs the write unit 301 to write in S1613. The contents of the write instruction and the operation of the writing means 301 are the same as in the first embodiment.
In step S1614, the contents of the erase unit number holding area and the erase unit number confirmation area in the erase block buffer management area 6051 are cleared. This indicates that no data remains in the erase block buffer 601.
Thereafter, the processing from S1604 to S1609 is performed in the same manner as when no erasure unit number is recorded.

S1612で書き込みバッファに空き領域が存在した場合には、S1615において、書き込みデータを書き込みバッファ402の空き領域へ書き込む。
次にS1616において、書き込みバッファ管理領域6052に書き込みデータに関する管理情報を記録する。管理情報は、消去単位番号、消去単位番号が示す領域内で書き込みデータの位置を特定するオフセット、書き込みデータのサイズ、書き込みデータが正しいか否かのチェックに用いるデータチェック値、および前記3つの4つのデータが正しいか否かのチェックに用いる管理領域チェック値を記録する。書き込みバッファ管理領域6052における管理情報と、書き込みバッファ402における書き込みデータの対応づけは、各エリアにおけるアドレス上の順序が同一になるように記録されていることで行われる。
If there is a free area in the write buffer in S1612, the write data is written into the free area of the write buffer 402 in S1615.
In step S <b> 1616, management information related to write data is recorded in the write buffer management area 6052. The management information includes an erase unit number, an offset for specifying the position of the write data within the area indicated by the erase unit number, a size of the write data, a data check value used for checking whether the write data is correct, and the three four A management area check value used for checking whether two pieces of data are correct is recorded. The association between the management information in the write buffer management area 6052 and the write data in the write buffer 402 is performed by recording the addresses in the same order in the areas.

S1611で書き込み要求領域と同一の領域に書き込みを行うデータが既に存在すると判定された場合には、S1617において、書き込みデータを書き込みバッファの同一領域のデータが記録されているエリアに書き込む。
続いてS1618において、書き込みバッファ管理領域6052の内、S1617で書き込みデータを書き込んだ領域に関する領域情報を更新する。この時更新される情報は、データチェック値および管理領域チェック値である。
If it is determined in S1611 that the data to be written already exists in the same area as the write request area, the write data is written in the area where the data in the same area of the write buffer is recorded in S1617.
Subsequently, in S1618, the area information relating to the area where the write data is written in S1617 in the write buffer management area 6052 is updated. Information updated at this time is a data check value and a management area check value.

S1610で、S1602で算出した消去単位番号が消去ブロックバッファ管理領域6051の消去単位番号保持領域に存在する記録と一致すると判定された場合には、S1619において、書き込み要求データを消去ブロックバッファ103に書き込む。
続いて、S1620において、消去ブロックバッファ管理領域6051のデータチェック値領域に、更新された消去ブロックバッファ103内のデータから求めたデータチェック値を書き込む。
以上がメモリへのデータ書き込み時の動作である。
If it is determined in S1610 that the erase unit number calculated in S1602 matches the record existing in the erase unit number holding area of the erase block buffer management area 6051, the write request data is written to the erase block buffer 103 in S1619. .
Subsequently, in S1620, the data check value obtained from the updated data in the erase block buffer 103 is written into the data check value area of the erase block buffer management area 6051.
The above is the operation when writing data into the memory.

次に、メモリからのデータ読み出し時の動作を図48を用いて説明する。以下の各処理は、断りのない限り読み出し手段201の動作である。
まずS1651において、読み出し要求を受ける。この読み出し要求の内容は実施の形態4と同様である。
S1652において、読み出し要求領域を含むフラッシュメモリの消去単位番号を求める。消去単位番号を求める動作は実施の形態4と同様である。
Next, the operation at the time of reading data from the memory will be described with reference to FIG. The following processes are operations of the reading unit 201 unless otherwise specified.
First, in S1651, a read request is received. The contents of this read request are the same as in the fourth embodiment.
In S1652, the erase unit number of the flash memory including the read request area is obtained. The operation for obtaining the erase unit number is the same as in the fourth embodiment.

続いてS1653において、消去ブロックバッファ管理領域6051の消去単位番号保持領域を参照し、消去単位番号の記録が存在するかを判定する。
消去単位番号の記録が存在しない場合には、S1657において、書き込みバッファ管理領域6052の管理情報を参照し、読み出し要求領域として特定された領域に書き込まれるべきデータが書き込みバッファ402に存在するかを判定する。
Subsequently, in S1653, the erase unit number holding area in the erase block buffer management area 6051 is referred to and it is determined whether or not there is a record of the erase unit number.
If there is no record of the erasure unit number, the management information in the write buffer management area 6052 is referred to in S1657 to determine whether the data to be written in the area specified as the read request area exists in the write buffer 402. To do.

読み出し要求領域として特定された領域に書き込まれるべきデータが書き込みバッファ402に存在する場合には、S1659において、そのデータが正しいものかどうかを書き込みバッファ管理領域6052に登録されているデータチェック値を使用して判定する。即ち、読み出し要求領域として特定された領域に書き込まれるべきデータを書き込みバッファ402から読み出し、このデータを用いて値を算出する(この算出規則は書き込みバッファ管理領域6052に登録されるデータチェック値の算出規則を用いる)。そして、算出値と書き込みバッファ管理領域6052に登録されているデータチェック値とを比較して、両者が同一値となれば、書き込みバッファ402のデータが妥当であると判断する。   If data to be written to the area specified as the read request area exists in the write buffer 402, in S1659, the data check value registered in the write buffer management area 6052 is used to determine whether the data is correct. Judgment. That is, data to be written to the area specified as the read request area is read from the write buffer 402, and a value is calculated using this data (this calculation rule is to calculate the data check value registered in the write buffer management area 6052). Use rules). Then, the calculated value and the data check value registered in the write buffer management area 6052 are compared, and if both become the same value, it is determined that the data in the write buffer 402 is valid.

データが妥当であると判定した場合、S1661において、当該データを書き込みバッファ402から読み出し、処理を終了する。
データが妥当でないと判定した場合、S1650において、情報処理装置にエラーを通知し、処理を終了する。
If it is determined that the data is valid, in S1661, the data is read from the write buffer 402, and the process ends.
If it is determined that the data is not valid, in S1650, an error is notified to the information processing apparatus, and the process ends.

S1657で読み出し要求領域として特定された領域に書き込まれるべきデータが書き込みバッファ402に存在しない場合には、S1658において、読み出しデータをフラッシュメモリ101から読み出す。   If the data to be written in the area specified as the read request area in S1657 does not exist in the write buffer 402, the read data is read from the flash memory 101 in S1658.

S1653で消去ブロックバッファ管理領域6051の消去単位番号保持領域に消去単位番号の記録が存在し、かつS1652で求めた消去単位番号と一致する場合には、読み出し要求領域のデータは消去ブロックバッファ103に保持されているので、S1654においてまず、消去ブロックバッファ103内のデータが正しいものであるか、消去ブロックバッファ管理領域6051のデータチェック値値を使用して判定する。この判断手順はS1659の手順と同様である。   If there is a record of the erase unit number in the erase unit number holding area of the erase block buffer management area 6051 in S1653 and it matches the erase unit number obtained in S1652, the data in the read request area is stored in the erase block buffer 103. In step S 1654, it is first determined whether the data in the erase block buffer 103 is correct using the data check value in the erase block buffer management area 6051. This determination procedure is the same as the procedure of S1659.

データが妥当であると判定した場合、S1655において、当該データを消去ブロックバッファから読み出し、処理を終了する。
データが妥当でないと判定した場合、S1656において、情報処理装置にエラーを通知し、処理を終了する。
以上がメモリからのデータ読み出し時の動作である。
If it is determined that the data is valid, in S1655, the data is read from the erase block buffer, and the process ends.
If it is determined that the data is not valid, in S1656, an error is notified to the information processing apparatus, and the process ends.
The above is the operation when reading data from the memory.

次に、情報処理装置の起動時に実行される復旧手段611の動作を図49を用いて説明する。
復旧手段611はまずS1681において、消去ブロックバッファ管理領域6051の消去単位番号保持領域の値と消去単位番号確認領域の値を読み出す。続いてS1682において、消去単位番号保持領域と消去単位番号確認領域にフラッシュメモリ内の消去単位番号が存在するかを判定する。
Next, the operation of the recovery unit 611 executed when the information processing apparatus is activated will be described with reference to FIG.
In step S1681, the recovery unit 611 first reads the value of the erase unit number holding area and the value of the erase unit number confirmation area in the erase block buffer management area 6051. Subsequently, in S1682, it is determined whether an erase unit number in the flash memory exists in the erase unit number holding area and the erase unit number confirmation area.

消去単位番号が存在する場合、S1683において、消去単位番号保持領域の値と消去単位番号確認領域の値が同一かをチェックする。
消去単位番号保持領域の値と消去単位番号確認領域の値が同一の場合、S1684において、消去ブロックバッファ管理領域6051にあるデータチェック値を読み出す。
If there is an erase unit number, it is checked in S1683 if the value in the erase unit number holding area is the same as the value in the erase unit number confirmation area.
If the value of the erase unit number holding area is the same as the value of the erase unit number confirmation area, the data check value in the erase block buffer management area 6051 is read in S1684.

続いてS1685にて、消去ブロックバッファ103内のデータが正しいかを読み出したデータチェック値を用いて判定する。この判定は図48のS1654と同様である。
S1685で、消去ブロックバッファ103内のデータが妥当である場合、消去ブロックバッファ103内のデータは破壊されていないことになるので、書き込みバッファの状態を復旧させるために、S1687でバッファ管理領域605の書き込みバッファ管理領域の領域情報を読み出す。
Subsequently, in S1585, whether the data in the erase block buffer 103 is correct is determined using the read data check value. This determination is the same as S1654 in FIG.
If the data in the erase block buffer 103 is valid in S1585, the data in the erase block buffer 103 is not destroyed. Therefore, in order to restore the write buffer state, the buffer management area 605 is restored in S1687. Read area information of the write buffer management area.

次に、S1688において、書き込みバッファ管理領域6052のデータが正しいかを、管理領域チェック値を用いて判定する。この判定は、管理領域チェック値以外の情報(消去単位番号、オフセット、サイズ、データチェック値)を取出してチェックサム値を算出し、算出して得られたチェックサム値と管理領域チェック値とを比較する。そして両者が一致すれば書き込みバッファ管理領域6052のデータが妥当であると判断する。   Next, in S1688, it is determined using the management area check value whether the data in the write buffer management area 6052 is correct. In this determination, information (erase unit number, offset, size, data check value) other than the management area check value is extracted to calculate a checksum value, and the checksum value obtained by the calculation and the management area check value are calculated. Compare. If they match, it is determined that the data in the write buffer management area 6052 is valid.

S1688で、書き込みバッファ管理領域6052のデータが妥当である場合、S1689において、領域情報に対応する書き込みバッファ402内のデータが正しいか、領域情報にあるデータチェック値を用いて判定する。この判定も上記したチェックサムによる判定方法などを利用して判定される。
S1689で、書き込みバッファ402内のデータが正しいと判断した場合、S1691でこの領域情報が書き込みバッファ管理領域に保持されている領域情報の最後かを判定する。領域情報の最後である場合、処理を終了する。
If the data in the write buffer management area 6052 is valid in S 1688, it is determined in S 1689 whether the data in the write buffer 402 corresponding to the area information is correct using the data check value in the area information. This determination is also made using the above-described checksum determination method or the like.
If it is determined in S1689 that the data in the write buffer 402 is correct, it is determined in S1691 whether this area information is the last area information held in the write buffer management area. If it is the end of the area information, the process is terminated.

S1691で、まだ領域情報の最後でない場合、次の領域情報を読み出しその領域情報が正しいかを判定するために、S1687〜S1691の処理を実行する。
S1689で、書き込みバッファのデータが正しくない場合、S1690において、書き込みバッファ管理領域6052の当該領域情報をクリアし、領域情報および当該書き込みバッファを別のデータが使用することを可能にする。そして、S1691に進み、次の領域情報へ処理を進める。
If it is not the last of the region information in S1691, the next region information is read and the processing of S1687 to S1691 is executed to determine whether the region information is correct.
If the data in the write buffer is not correct in S1689, the area information in the write buffer management area 6052 is cleared in S1690, and another data can be used for the area information and the write buffer. Then, the process proceeds to S1691, and the process proceeds to the next area information.

S1688で、領域情報のデータが正しくない場合、S1690において、書き込みバッファ管理領域6052の当該領域情報をクリアし、領域情報および当該書き込みバッファを別のデータが使用することを可能にする。そして、S1691に進み、次の領域情報へ処理を進める。   If the data of the area information is not correct in S1688, the area information in the write buffer management area 6052 is cleared in S1690, and the area information and the write buffer can be used by another data. Then, the process proceeds to S1691, and the process proceeds to the next area information.

S1685で、消去ブロックバッファ103内のデータが正しくないと判断した場合、S1686において、消去ブロックバッファ管理領域6051の消去単位番号保持領域および消去単位番号確認領域をクリアし、消去ブロックバッファを使用可能にする。そして、S1687〜S1691を実施し、書き込みバッファ104の復旧処理を行う。   If it is determined in S1865 that the data in the erase block buffer 103 is incorrect, in S1686, the erase unit number holding area and erase unit number confirmation area in the erase block buffer management area 6051 are cleared, and the erase block buffer can be used. To do. Then, S1687 to S1691 are performed, and the recovery process of the write buffer 104 is performed.

S1683で、消去ブロックバッファ管理領域6051の消去単位番号保持領域と消去単位番号確認領域の値が同一でない場合、S1686において、消去単位番号保持領域および消去単位番号確認領域をクリアし、消去ブロックバッファを使用可能にする。そして、S1687〜S1691を実施し、書き込みバッファ104の復旧処理を行う。
S1682で、消去ブロックバッファ管理領域6051にある消去単位番号保持領域と消去単位番号確認領域に消去単位番号の記録がない場合、S1687〜S1691を実施し、書き込みバッファ104の復旧処理を行う。
If the values of the erase unit number holding area and the erase unit number confirmation area in the erase block buffer management area 6051 are not the same in S1683, the erase unit number holding area and the erase unit number confirmation area are cleared in S1686, and the erase block buffer is deleted. Make it available. Then, S1687 to S1691 are performed, and the recovery process of the write buffer 104 is performed.
If no erase unit number is recorded in the erase unit number holding area and the erase unit number confirmation area in the erase block buffer management area 6051 in S 1682, S 1687 to S 1691 are executed to restore the write buffer 104.

以上のように本実施の形態によれば、バッファ管理領域605に消去ブロックバッファを管理する消去ブロックバッファ管理領域6051と書き込みバッファを管理する書き込みバッファ管理領域6052を設け、消去ブロックバッファ管理領域6051には、消去単位番号保持領域の他に消去単位番号確認領域とデータチェック値領域を、書き込みバッファ管理領域6052には、消去単位番号領域と消去単位内のオフセット値領域と書き込みデータサイズ領域の他にデータチェック値領域と管理領域チェック値を保持している。そのため、メモリからのデータ読み出し時および情報処理装置の復旧時に当該データチェック値を用い消去ブロックバッファおよび書き込みバッファのデータが正しいかをチェックすることができ、消去ブロックバッファおよび書き込みバッファを保持している不揮発性メモリが故障し、消去ブロックバッファ内のデータが不正になっても、情報処理装置がそれを検出することができる。
さらに、消去ブロックバッファおよび書き込みバッファに他手段から不正なデータ書き込みがあっても、それを検出することができる。
As described above, according to the present embodiment, the buffer management area 605 is provided with the erase block buffer management area 6051 for managing the erase block buffer and the write buffer management area 6052 for managing the write buffer. Includes an erase unit number confirmation area and a data check value area in addition to an erase unit number holding area, and a write buffer management area 6052 includes an erase unit number area, an offset value area in the erase unit, and a write data size area. It holds data check value area and management area check value. Therefore, it is possible to check whether the data in the erase block buffer and the write buffer is correct by using the data check value at the time of reading data from the memory and at the time of restoration of the information processing apparatus, and the erase block buffer and the write buffer are held. Even if the nonvolatile memory breaks down and the data in the erase block buffer becomes illegal, the information processing apparatus can detect it.
Furthermore, even if there is illegal data writing from other means to the erase block buffer and the write buffer, it can be detected.

実施の形態17.
本発明の他の実施の形態における情報処理装置について説明する。情報処理装置の構成は、実施の形態16と同様であり、図45に示される。本実施の形態では、復旧手段の動作以外は実施の形態16と同様である。
本実施の形態における復旧手段611の動作を図50を用いて説明する。図50は、実施の形態16における復旧手段の動作が一部相違している。
Embodiment 17. FIG.
An information processing apparatus according to another embodiment of the present invention will be described. The configuration of the information processing apparatus is the same as that of the sixteenth embodiment and is shown in FIG. The present embodiment is the same as the sixteenth embodiment except for the operation of the recovery means.
The operation of the recovery means 611 in this embodiment will be described with reference to FIG. FIG. 50 is partially different in operation of the recovery means in the sixteenth embodiment.

S1701〜S1705については実施の形態16で述べたS1681〜S1685の処理と同様である。
S1705で消去ブロックバッファのデータが正しくないと判断した場合、S1707に進み、S1707において消去単位番号保持領域と消去単位番号確認領域をクリアし、消去ブロックバッファ103を再利用可能にしてから、S1708に進み、書き込みバッファ402の復旧処理を行う。
S1701 to S1705 are the same as the processing of S1681 to S1685 described in the sixteenth embodiment.
If it is determined in S1705 that the data in the erase block buffer is not correct, the process proceeds to S1707. In S1707, the erase unit number holding area and the erase unit number confirmation area are cleared, and the erase block buffer 103 can be reused. Then, the recovery process of the write buffer 402 is performed.

S1705で消去ブロックバッファのデータが正しいと判断した場合、S1706で消去命令手段301に消去指示を行い、消去ブロックバッファに対応するフラッシュメモリの消去単位領域を消去する。この消去指示の内容は、実施の形態1と同様である。そして、書き込み手段302に書き込み指示を出し、消去ブロックバッファの内容を、消去した領域に書き込む。この書き込み指示の内容も実施の形態1と同様である。   If it is determined in S1705 that the data in the erase block buffer is correct, an erase instruction is issued to the erase command means 301 in S1706, and the erase unit area of the flash memory corresponding to the erase block buffer is erased. The contents of this erasure instruction are the same as in the first embodiment. Then, a write instruction is issued to the writing means 302, and the contents of the erase block buffer are written into the erased area. The contents of this write instruction are the same as in the first embodiment.

そして、S1707において、消去ブロックバッファ管理領域6051の消去単位番号保持領域と消去単位番号確認領域をクリアする。
S1702〜S1707の処理により消去ブロックバッファ103の復旧処理が完了すると、復旧手段611はS1708において、書き込みバッファ管理領域6052の領域情報を読み出す。
In step S1707, the erase unit number holding area and the erase unit number confirmation area in the erase block buffer management area 6051 are cleared.
When the recovery processing of the erase block buffer 103 is completed by the processing of S1702 to S1707, the recovery unit 611 reads the area information of the write buffer management area 6052 in S1708.

次に、S1709、S1710の処理を行う。この処理は実施の形態16で述べたS1688、S1689の処理と同様である。
S1709で書き込みバッファ管理領域6052の領域情報が妥当でないと判断した場合およびS1710で書き込みバッファ402内のデータが正しくないと判断した場合、書き込みバッファ402の書き込み途中で電源断が発生したと考えられるので、S1716において、当該領域情報を書き込みバッファ管理領域6052から削除し、書き込みバッファ402を再利用可能にする。
Next, the processing of S1709 and S1710 is performed. This processing is the same as the processing of S1688 and S1689 described in the sixteenth embodiment.
If it is determined in S1709 that the area information in the write buffer management area 6052 is not valid or if it is determined in S1710 that the data in the write buffer 402 is incorrect, it is assumed that a power failure occurred during the writing of the write buffer 402. In step S1716, the area information is deleted from the write buffer management area 6052 so that the write buffer 402 can be reused.

S1710で書き込みバッファ402内のデータが正しいと判断した場合、S1711において、当該領域情報に対応する書き込みバッファ402のデータを消去ブロックバッファ103に書き込む。
次にS1712において、待避手段112に対して待避指示を行う。待避指示の内容は実施の形態1と同様である。待避指示を受けた待避手段112は、消去単位内の不変データを消去ブロックバッファ103に書き込むことにより待避させる。
If it is determined in S1710 that the data in the write buffer 402 is correct, the data in the write buffer 402 corresponding to the area information is written in the erase block buffer 103 in S1711.
In step S <b> 1712, a save instruction is issued to the save unit 112. The contents of the save instruction are the same as in the first embodiment. Upon receiving the save instruction, the save unit 112 saves by writing the invariant data in the erase unit into the erase block buffer 103.

続いてS1713において、消去ブロックバッファ管理領域6051を更新、即ち、消去単位番号保持領域および消去単位番号確認領域に消去単位番号を書き込み、S1711およびS1712により消去ブロックバッファ103に書き込まれたデータのデータチェック値を書き込む。   In S1713, the erase block buffer management area 6051 is updated, that is, the erase unit number is written in the erase unit number holding area and the erase unit number confirmation area, and the data check of the data written in the erase block buffer 103 in S1711 and S1712 is performed. Write the value.

次にS1714において、消去命令手段301に消去指示を行い、消去ブロックバッファ103に対応するフラッシュメモリの消去単位領域を消去する。この消去指示の内容は、実施の形態1と同様である。そして書き込み手段302に書き込み指示を出し、消去ブロックバッファ103の内容を、消去した領域に書き込む。この書き込み指示の内容も実施の形態1と同様である。   In step S <b> 1714, an erase instruction is issued to the erase command unit 301 to erase the erase unit area of the flash memory corresponding to the erase block buffer 103. The contents of this erasure instruction are the same as in the first embodiment. Then, a write instruction is issued to the writing means 302, and the contents of the erase block buffer 103 are written into the erased area. The contents of this write instruction are the same as in the first embodiment.

続いてS1715にて、消去ブロックバッファ管理領域6051の消去単位番号保持領域と消去単位番号確認領域をクリアする。
次にS1716において、S1708で読み出した領域情報を書き込みバッファ管理領域6052から削除し、書き込みバッファ402の当該領域を再利用可能にする。
In step S1715, the erase unit number holding area and the erase unit number confirmation area in the erase block buffer management area 6051 are cleared.
In step S1716, the area information read in step S1708 is deleted from the write buffer management area 6052 so that the area of the write buffer 402 can be reused.

次に、S1717において、S1708で読み出した領域情報が、バッファ管理領域605の書き込みバッファ管理領域に登録されている領域情報の最後かを判定する。
書き込みバッファ管理領域の最後ではない場合、当該領域情報の次に登録されている領域情報に対し、S1708〜S1717の処理を行う。
書き込みバッファ管理領域の最後である場合、書き込みバッファ402には、データが残っていないので、処理を終了する。
Next, in S1717, it is determined whether the area information read in S1708 is the last area information registered in the write buffer management area of the buffer management area 605.
If it is not the last of the write buffer management area, the processing of S1708 to S1717 is performed on the area information registered next to the area information.
If it is at the end of the write buffer management area, no data remains in the write buffer 402, so the processing ends.

以上のように本実施の形態によれば、情報処理装置の復旧時に、消去ブロックバッファの内容と書き込みバッファの内容をフラッシュメモリに書き込むようにしたので、復旧後にメモリへのデータ書き込みを行わない限り、不揮発性メモリの故障によるデータの破壊を防ぐことができる。   As described above, according to this embodiment, when the information processing apparatus is restored, the contents of the erase block buffer and the contents of the write buffer are written to the flash memory. Therefore, unless data is written to the memory after the restoration, The destruction of data due to the failure of the nonvolatile memory can be prevented.

実施の形態18.
図51は本発明の他の実施の形態における情報処理装置の構成を示す図である。図において、185は揮発性メモリであるDRAMであり、DRAM185には、不揮発性メモリ102内の消去単位番号保持領域202と同じ値を持つ消去単位番号保持領域606と不揮発性メモリ102内の書き込みバッファ管理領域403と同じ値を持つ書き込みバッファ管理領域607とを備える。このDRAM185は不揮発性メモリ102よりもデータの読み書きが高速である。
また図において、611は情報処理装置の起動時に実行される復旧手段である。他の構成は図8における構成の同一もしくは相当部であり、説明を省略する。
Embodiment 18 FIG.
FIG. 51 is a diagram showing a configuration of an information processing apparatus according to another embodiment of the present invention. In the figure, reference numeral 185 denotes a DRAM which is a volatile memory. The DRAM 185 includes an erase unit number holding area 606 having the same value as the erase unit number holding area 202 in the nonvolatile memory 102 and a write buffer in the nonvolatile memory 102. A write buffer management area 607 having the same value as the management area 403; The DRAM 185 reads and writes data faster than the nonvolatile memory 102.
In the figure, reference numeral 611 denotes recovery means executed when the information processing apparatus is activated. The other configuration is the same as or equivalent to the configuration in FIG.

次に本実施の形態におけるメモリへの書き込み時の動作を、図52を用いて説明する。以下の各処理は断りのない限り書き込み制御手段111の動作である。
まず、S1801、S1802の処理は実施の形態4と同様である。
続いて、S1803において、DRAM185上の消去単位番号保持領域606を参照し、消去単位番号の記録が存在するかを判定する。
ここで消去単位番号の記録が存在しなければ、S1804において、書き込み制御手段111は書き込み要求データを消去ブロックバッファ103に書き込む。
Next, the operation at the time of writing to the memory in this embodiment will be described with reference to FIG. The following processes are operations of the write control unit 111 unless otherwise noted.
First, the processing in S1801 and S1802 is the same as that in the fourth embodiment.
Subsequently, in S1803, the erase unit number holding area 606 on the DRAM 185 is referred to and it is determined whether or not the erase unit number is recorded.
If there is no record of the erase unit number, the write control unit 111 writes the write request data into the erase block buffer 103 in S1804.

さらにS1805において、待避手段112に対して待避指示を行う。待避指示の内容および待避手段112の動作は、実施の形態4と同様である。
続いてS1806において、S1802で求めた消去単位番号を不揮発性メモリ102上の消去単位番号保持領域202およびDRAM185上の消去単位番号保持領域606に記録する。DRAM185への消去単位番号の書き込み処理は図54のS1851の処理に相当する。
Further, in S1805, a save instruction is issued to the save unit 112. The contents of the save instruction and the operation of the save means 112 are the same as in the fourth embodiment.
Subsequently, in S 1806, the erase unit number obtained in S 1802 is recorded in the erase unit number holding area 202 on the nonvolatile memory 102 and the erase unit number holding area 606 on the DRAM 185. The process of writing the erase unit number to the DRAM 185 corresponds to the process of S1851 in FIG.

さらにS1807において、消去命令手段301に対して消去指示を出す。消去指示の内容および消去命令手段301の動作は、実施の形態4と同様である。
S1803においてDRAM185上の消去単位番号保持領域606に消去単位番号の記録が存在する場合には、S1808において、S1802で求めた消去単位番号がDRAM185上の消去単位番号保持領域606に存在する記録と一致するかを判定する。
In step S1807, an erase instruction is issued to the erase command unit 301. The contents of the erase instruction and the operation of the erase command means 301 are the same as in the fourth embodiment.
If there is a record of the erase unit number in the erase unit number holding area 606 on the DRAM 185 in S1803, the erase unit number obtained in S1802 matches the record in the erase unit number holding area 606 on the DRAM 185 in S1808. Judge whether to do.

S1808において消去単位番号が異なる場合には、S1809において、DRAM185上の書き込みバッファ管理領域607を参照し、書き込みバッファ管理領域607に記録されている情報から、書き込み要求領域と同一の領域に書き込みを行うデータが既に書き込みバッファ402に存在するかを判定する。この判定は、DRAM185上の書き込みバッファ管理領域607に記憶されている消去単位番号及び消去単位内オフセットおよびサイズから把握することができる。   If the erase unit numbers are different in S1808, the write buffer management area 607 on the DRAM 185 is referred to in S1809, and writing is performed in the same area as the write request area from the information recorded in the write buffer management area 607. It is determined whether data already exists in the write buffer 402. This determination can be grasped from the erase unit number, erase unit offset and size stored in the write buffer management area 607 on the DRAM 185.

S1809において書き込み要求領域と同一の領域に書き込みを行うデータが書き込みバッファ402に存在しない場合には、さらにS1810において書き込み制御手段111は、書き込み要求のデータを書き込むことができる領域が書き込みバッファ402に存在するかを、書き込みバッファ402に空き領域を調べることで判定する。空き領域の存在は、DRAM185上の書き込みバッファ管理領域607に記録されている情報から知ることができる。   In S1809, if there is no data to be written to the same area as the write request area in the write buffer 402, the write control unit 111 further has an area in the write buffer 402 where the write request data can be written in S1810. It is determined by checking the free area in the write buffer 402. The existence of the free area can be known from the information recorded in the write buffer management area 607 on the DRAM 185.

書き込みバッファ402に空き領域がない場合には、S1811において書き込み制御手段111は、書き込み手段302に対し書き込み指示を行う。書き込み指示の内容および書き込み手段302の動作は実施の形態4と同様である。
続いて、S1804からS1807の処理を、消去単位番号の記録が存在しない場合と同様に行う。
If there is no free space in the write buffer 402, the write control unit 111 instructs the write unit 302 to write in S1811. The contents of the write instruction and the operation of the writing means 302 are the same as in the fourth embodiment.
Subsequently, the processing from S1804 to S1807 is performed in the same manner as when no erasure unit number record exists.

S1810で書き込みバッファに空き領域が存在した場合には、S1812において、書き込みデータを書き込みバッファ402へ書き込む。
次にS1813において、不揮発性メモリ102上の書き込みバッファ管理領域403およびDRAM185上の書き込みバッファ管理領域607に、S1812で書き込んだ書き込みデータに関する管理情報を記録する。管理情報は、消去単位番号とその中での位置を特定するオフセット、及び書き込みデータの大きさを記録する。このDRAM185へ書き込みデータに関する管理情報を記録する処理は、図54のS1852に相当する。
If there is an empty area in the write buffer in S1810, the write data is written to the write buffer 402 in S1812.
Next, in S1813, management information relating to the write data written in S1812 is recorded in the write buffer management area 403 on the nonvolatile memory 102 and the write buffer management area 607 on the DRAM 185. The management information records an erase unit number, an offset for specifying the position in the erase unit number, and the size of write data. The process of recording management information regarding write data in the DRAM 185 corresponds to S1852 in FIG.

S1809で書き込み要求領域と同一の領域に書き込みを行うデータが既に存在すると判定された場合には、S1814において、書き込みデータを書き込みバッファの同一領域のデータが記録されているエリアに書き込む。
S1808で、S1802で算出した消去単位番号がDRAM185上の消去単位番号保持領域606に存在する記録と一致すること判定された場合には、S1815において、書き込み要求データを消去ブロックバッファ103に書き込む。
If it is determined in S1809 that data to be written already exists in the same area as the write request area, in S1814, the write data is written in the area where the data in the same area of the write buffer is recorded.
If it is determined in S1808 that the erase unit number calculated in S1802 matches the record existing in the erase unit number holding area 606 on the DRAM 185, the write request data is written into the erase block buffer 103 in S1815.

次に、メモリからのデータ読み出し時の動作を図53を用いて説明する。以下の各処理は、断りのない限り読み出し手段201の動作である。
まずS1831およびS1832は、実施の形態4と同様である。
続いてS1833において、DRAM185上の消去単位番号保持領域606を参照し、消去単位番号の記録が存在するかを判定する。
Next, the operation when reading data from the memory will be described with reference to FIG. The following processes are operations of the reading unit 201 unless otherwise specified.
First, S1831 and S1832 are the same as in the fourth embodiment.
Subsequently, in S1833, the erase unit number holding area 606 on the DRAM 185 is referred to and it is determined whether or not there is a record of the erase unit number.

消去単位番号の記録が存在しない場合には、S1834において、DRAM185上の書き込みバッファ管理領域607の管理情報を参照し、読み出し要求領域として特定された領域に書き込まれるべきデータが書き込みバッファ402に存在するかを判定する。   If there is no record of the erase unit number, the management information in the write buffer management area 607 on the DRAM 185 is referred to in S1834, and the data to be written in the area specified as the read request area exists in the write buffer 402. Determine whether.

読み出し要求領域として特定された領域に書き込まれるべきデータが書き込みバッファ402に存在する場合には、S1835において、その領域のデータを書き込みバッファ402から読み出す。
読み出し要求領域として特定された領域に書き込まれるべきデータが書き込みバッファ402に存在しない場合には、S1836において、読み出しデータをフラッシュメモリ101から読み出す。
If data to be written to the area specified as the read request area exists in the write buffer 402, the data in that area is read from the write buffer 402 in S1835.
If the data to be written to the area specified as the read request area does not exist in the write buffer 402, the read data is read from the flash memory 101 in S1836.

S1833でDRAM185上の消去単位番号保持領域606に消去単位番号の記録が存在し、かつS1832で求めた消去単位番号と一致する場合には、読み出し領域のデータは消去ブロックバッファ103に保持されているので、S1837において、消去ブロックバッファ103から読み出しデータを読み出す。
以上の処理がメモリからのデータ読み出し時の動作である。
If the erase unit number is recorded in the erase unit number holding area 606 on the DRAM 185 in S1833 and matches the erase unit number obtained in S1832, the data in the read area is held in the erase block buffer 103. Therefore, the read data is read from the erase block buffer 103 in S1837.
The above processing is the operation when reading data from the memory.

次に、復旧手段611の動作を図54を用いて説明する。
復旧手段611はまず、S1851において、DRAM185上の消去単位番号保持領域606に、不揮発性メモリ102上の消去単位番号保持領域202の内容を書き込む。これは、DRAM185は揮発性メモリであり、情報処理装置の再起動時にデータが消去されてしまうためである。
Next, the operation of the recovery unit 611 will be described with reference to FIG.
First, the recovery unit 611 writes the contents of the erase unit number holding area 202 on the nonvolatile memory 102 into the erase unit number holding area 606 on the DRAM 185 in S1851. This is because the DRAM 185 is a volatile memory, and data is erased when the information processing apparatus is restarted.

次に、S1852において、DRAM185上の書き込みバッファ管理領域607に、不揮発性メモリ102上の書き込みバッファ管理領域403の内容を書き込む。
以上が復旧手段の動作である。この動作により、復旧手段の処理完了後、不揮発性メモリ102上の消去単位番号保持領域202および書き込みバッファ管理領域403の内容と、DRAM185上の消去単位番号保持領域606および書き込みバッファ管理領域607の内容は同じになる。
Next, in S1852, the contents of the write buffer management area 403 on the nonvolatile memory 102 are written into the write buffer management area 607 on the DRAM 185.
The above is the operation of the recovery means. By this operation, after the processing of the recovery means is completed, the contents of the erase unit number holding area 202 and the write buffer management area 403 on the nonvolatile memory 102, and the contents of the erase unit number holding area 606 and the write buffer management area 607 on the DRAM 185 Will be the same.

以上のように、この実施の形態によれば、消去単位番号保持領域と書き込みバッファ管理領域を不揮発性メモリ102および不揮発性メモリ102よりも高速なDRAM185上に配置し、消去単位番号保持領域および書き込みバッファ管理領域からの読み出しをDRAM185上のもので行い、消去単位番号保持領域および書き込みバッファ管理領域への書き込みはDRAM185および不揮発性メモリ102双方に行い、復旧時は不揮発性メモリ102の内容をDRAM185にコピーするようにしたので、電源断による消去単位番号保持領域および書き込みバッファ管理領域の内容破壊を起こさずに、かつメモリへのデータの書き込みおよびメモリからのデータの読み込みを速く行うことができる。   As described above, according to this embodiment, the erase unit number holding area and the write buffer management area are arranged on the nonvolatile memory 102 and the DRAM 185 that is faster than the nonvolatile memory 102, and the erase unit number holding area and the write Reading from the buffer management area is performed on the DRAM 185, writing to the erase unit number holding area and the write buffer management area is performed to both the DRAM 185 and the nonvolatile memory 102, and the contents of the nonvolatile memory 102 are stored in the DRAM 185 at the time of recovery. Since copying is performed, the contents of the erase unit number holding area and the write buffer management area are not destroyed due to the power interruption, and data can be written to and read from the memory at high speed.

実施の形態19.
本発明の他の実施形態における情報処理装置について説明する。情報処理装置の構成は実施の形態5と同様であり、図12に示される。
実施の形態19における書き込み時の動作を図55を用いて説明する。以下の各処理は断りがない限り書き込み制御手段111の動作である。
図55において、S1901〜S1910、S1914、S1915は実施の形態5の処理(図13のS501〜S510、S516、S517)と同一であるので説明を省略する。
この実施の形態ではS1910の後にS1911、S1912、S1913の処理を有する点で相違するため、この点を中心に説明する。
Embodiment 19. FIG.
An information processing apparatus according to another embodiment of the present invention will be described. The configuration of the information processing apparatus is the same as that of the fifth embodiment, and is shown in FIG.
The operation at the time of writing in the nineteenth embodiment will be described with reference to FIG. The following processes are operations of the write control unit 111 unless otherwise noted.
55, since S1901 to S1910, S1914, and S1915 are the same as the processing of the fifth embodiment (S501 to S510, S516, and S517 in FIG. 13), description thereof is omitted.
Since this embodiment is different in that the processing of S1911, S1912, and S1913 is performed after S1910, this point will be mainly described.

S1901〜S1910については実施の形態5と同様に処理を行う。
S1910で空き領域が存在すると判断した場合には、S1911において書き込み制御手段111は、書き込みデータを書き込みバッファ402の空き領域へ書き込む。続いて、S1912において、書き込みバッファ管理領域403に管理情報として、消去単位番号とその中のオフセット、及び書き込みデータの大きさを記録する。S1912が完了後、処理を終了する。
S1910において書き込みバッファ402に空き領域が存在しない場合には、S1913においてバッファデータ移動処理を行う。
S1901 to S1910 are processed in the same manner as in the fifth embodiment.
If it is determined in S1910 that a free area exists, the write control unit 111 writes the write data in the free area of the write buffer 402 in S1911. Subsequently, in S 1912, the erase unit number, the offset therein, and the size of the write data are recorded as management information in the write buffer management area 403. After S1912 is completed, the process ends.
If there is no free area in the write buffer 402 in S1910, buffer data movement processing is performed in S1913.

バッファデータ移動処理の動作を図56を用いて説明する。以下の各処理は、断りのない限り書き込み制御手段111の動作である。
まず、S1951において、消去ブロックバッファ103に現在登録されているデータをフラッシュメモリ101に書き込む。
The operation of the buffer data movement process will be described with reference to FIG. The following processes are operations of the write control unit 111 unless otherwise specified.
First, in S1951, the data currently registered in the erase block buffer 103 is written into the flash memory 101.

次にS1952において、書き込みバッファ管理領域403と書き込み要求データを検索し、書き込みバッファ管理領域403に登録されている領域および書き込み要求データの内で、同一消去単位内に含まれる領域群にグループ分けした場合にグループ分けした領域群のサイズが一番多い領域群を選択する。   Next, in S1952, the write buffer management area 403 and the write request data are searched and grouped into areas included in the same erase unit in the areas registered in the write buffer management area 403 and the write request data. In this case, the area group having the largest size is selected.

例えば、書き込みバッファに消去単位番号1に含まれる領域が2個あり、それぞれのサイズが100バイトおよび200バイトであったとする。さらに書き込みバッファに消去単位番号2に含まれる領域が3個あり、それぞれのサイズが10バイトおよび20バイトおよび30バイトであったとし、書き込み要求データは消去単位番号3に対する書き込みでサイズが50バイトであったとする。この場合、S1952の処理では、消去単位番号1の領域群のサイズが300バイトと一番多いので、この2つの領域が選択される。   For example, it is assumed that there are two areas included in the erase unit number 1 in the write buffer and the sizes are 100 bytes and 200 bytes, respectively. Furthermore, it is assumed that there are three areas included in the erase unit number 2 in the write buffer and the sizes are 10 bytes, 20 bytes, and 30 bytes, respectively, and the write request data is written to the erase unit number 3 and the size is 50 bytes. Suppose there was. In this case, in the process of S1952, the size of the area group of erase unit number 1 is the largest, 300 bytes, so these two areas are selected.

次に、S1953においてバッファ移動手段501は、書き込みバッファ402に記録されているデータおよび書き込み要求データの内、S1952で選択された領域群のデータを消去ブロックバッファ103へ移動する。
続いて、S1954において、待避手段112に対して待避指示を行い、待避指示を受けた待避手段112は、S1953において消去ブロックバッファ103へ書き込まれた領域以外のデータである不変データを、フラッシュメモリの当該消去単位から待避する。さらに、S1955において、消去単位番号を消去単位番号保持領域202に記録する。
Next, in S1953, the buffer moving unit 501 moves the data in the area group selected in S1952 to the erase block buffer 103 among the data recorded in the write buffer 402 and the write request data.
Subsequently, in S1954, a save instruction is issued to the save unit 112, and the save unit 112 that has received the save instruction stores invariant data that is data other than the area written in the erase block buffer 103 in S1953 in the flash memory. Save from the erase unit. In S1955, the erase unit number is recorded in the erase unit number holding area 202.

次に、S1956において書き込み制御手段111は、S1953で消去ブロックバッファ103へ移動した領域群に関する管理情報を書き込みバッファ管理領域403から削除する。
次に、S1957において、S1952で算出した領域群に書き込み要求データが存在したか判定する。書き込み要求データが存在しなかった場合、S1958において、S1956の動作によって空きができた書き込みバッファ402に書き込み要求データを書き込み、書き込みバッファ管理領域403に書き込み要求データに関する管理情報を登録する。
Next, in S 1956, the write control unit 111 deletes management information regarding the area group moved to the erase block buffer 103 in S 1953 from the write buffer management area 403.
Next, in S1957, it is determined whether write request data exists in the area group calculated in S1952. If the write request data does not exist, in S1958, the write request data is written in the write buffer 402 that has been vacated by the operation in S1956, and management information relating to the write request data is registered in the write buffer management area 403.

次にS1959において、消去命令手段301に対して消去指示を出し、消去指示を受けた消去命令手段301は消去ブロックバッファ103へ待避された消去単位の消去を行うようにフラッシュメモリ101に命令を出す。
以上はメモリ書き込み時の動作である。
尚、実施の形態19における読み出し時の動作は、実施の形態4と同一である。
In step S 1959, an erase instruction is issued to the erase command unit 301, and the erase command unit 301 receiving the erase command issues an instruction to the flash memory 101 so as to erase the erase unit saved in the erase block buffer 103. .
The above is the operation at the time of memory writing.
Note that the read operation in the nineteenth embodiment is the same as that in the fourth embodiment.

以上のように、この実施の形態によれば、書き込みバッファおよび書き込み要求データを、フラッシュメモリの1消去単位内に収まる領域毎にグループ化し、その内で一番サイズが大きい領域グループを消去ブロックバッファに移動することにより、書き込みバッファの空き領域を効率よく増やすことができるので、フラッシュメモリへの書き込み回数を低減でき、フラッシュメモリの劣化を低減することができる。   As described above, according to this embodiment, the write buffer and the write request data are grouped for each area that falls within one erase unit of the flash memory, and the area group having the largest size is erased from the erase block buffer. By moving to, the free area of the write buffer can be efficiently increased, so that the number of writes to the flash memory can be reduced and the deterioration of the flash memory can be reduced.

実施の形態20.
本発明の他の実施形態における情報処理装置について説明する。情報処理装置の構成は実施の形態5と同様であり、図12に示される。また、メモリ書き込み時におけるバッファ移動処理以外は実施の形態19と同一である。
書き込みバッファ402に空き領域が存在しない場合に行われる、バッファデータ移動処理の動作を図57を用いて説明する。以下の各処理は、断りのない限り書き込み制御手段111の動作である。
Embodiment 20. FIG.
An information processing apparatus according to another embodiment of the present invention will be described. The configuration of the information processing apparatus is the same as that of the fifth embodiment, and is shown in FIG. Further, this embodiment is the same as the nineteenth embodiment except for the buffer movement process at the time of memory writing.
The operation of the buffer data movement process performed when there is no free area in the write buffer 402 will be described with reference to FIG. The following processes are operations of the write control unit 111 unless otherwise specified.

図57において、S2001〜S2009は実施の形態19の処理(図56のS1951〜S1959)と同一であるので説明を省略する。
この実施の形態ではS2009以降の処理としてさらにS2010〜S2018の処理を有する。
In FIG. 57, S2001 to S2009 are the same as the processing of the nineteenth embodiment (S1951 to S1959 of FIG. 56), and thus description thereof is omitted.
In this embodiment, the processing of S2010 to S2018 is further included as processing after S2009.

S2001〜S2009については実施の形態19のS1951〜S1959と同様に実行する。
S2010において書き込み制御手段111は、書き込みバッファ管理領域403を検索し、書き込みバッファ管理領域403に登録されている領域で、同一消去単位内に含まれる領域群にグループ分けした場合にグループ分けした領域群のサイズがnバイトよりも小さい領域群の群数を調べる。
S2001 to S2009 are executed in the same manner as S1951 to S1959 of the nineteenth embodiment.
In S2010, the write control unit 111 searches the write buffer management area 403, and if the areas are registered in the write buffer management area 403 and grouped into area groups included in the same erase unit, grouped area groups The number of area groups whose size is smaller than n bytes is examined.

続いて、S2011において、S2010で調べた群数がm個よりも多いか判定する。群数がm個よりも少ない場合、処理を終了する。
S2011において、群数がm個よりも大きい場合、書き込みバッファの内容を空にする処理を行う。
まず、S2012において書き込み制御手段111は、書き込み手段302に書き込み指示を行い、消去ブロックバッファの内容をフラッシュメモリ101に書き込む。
Subsequently, in S2011, it is determined whether the number of groups examined in S2010 is greater than m. If the number of groups is less than m, the process ends.
In S2011, when the number of groups is larger than m, processing for emptying the contents of the write buffer is performed.
First, in S2012, the writing control unit 111 instructs the writing unit 302 to write, and writes the contents of the erase block buffer into the flash memory 101.

次に、S2013において、書き込みバッファ管理領域403を検索し、書き込みバッファ管理領域403に登録されている領域の内で、同一消去単位内に含まれる領域群にグループ分けした場合にグループ分けした領域群のサイズが一番多い領域群を選択する。   Next, in S2013, when the write buffer management area 403 is searched and grouped into areas included in the same erase unit among the areas registered in the write buffer management area 403, the grouped areas are grouped. The area group with the largest size is selected.

次に、S2014においてバッファ移動手段501は、書き込みバッファ402に記録されているデータの内、S2013で選択された領域群のデータを消去ブロックバッファ103へ移動する。
続いて、S2015において、待避手段112に待避指示を行い、待避指示を受けた待避手段112は、S2014において消去ブロックバッファ103へ書き込まれた領域以外のデータである不変データを、フラッシュメモリの当該消去単位から待避する。さらに、S2016において、消去単位番号を消去単位番号保持領域202に記録する。
Next, in S2014, the buffer moving unit 501 moves the data in the area group selected in S2013 among the data recorded in the write buffer 402 to the erase block buffer 103.
Subsequently, in S2015, the save unit 112 issues a save instruction, and the save unit 112 that has received the save instruction erases invariant data that is data other than the area written in the erase block buffer 103 in S2014 in the flash memory. Save from the unit. Further, in S2016, the erase unit number is recorded in the erase unit number holding area 202.

次にS2017において書き込み制御手段111は、S2014で消去ブロックバッファ103へ移動した領域群に関する領域情報を書き込みバッファ管理領域403から削除する。
次に、S2108において、S2017で更新された書き込みバッファ管理領域403を検索し、まだ登録されている管理情報が存在するか判定する。登録されている管理情報が存在する場合、S2012からS2018の処理をさらに続行する。
登録されている管理情報が存在しない場合、処理を終了する。これにより、書き込みバッファ403にはデータが残らなくなる。
Next, in S2017, the write control unit 111 deletes the area information regarding the area group moved to the erase block buffer 103 in S2014 from the write buffer management area 403.
Next, in S2108, the write buffer management area 403 updated in S2017 is searched to determine whether there is still management information registered. If there is registered management information, the processing from S2012 to S2018 is further continued.
If the registered management information does not exist, the process ends. As a result, no data remains in the write buffer 403.

以上のように、この実施の形態によれば、書き込みバッファに空きがない場合に、書き込みバッファの内容を消去ブロックバッファに移動した後、書き込みバッファ管理領域を検索し、書き込みバッファ管理領域に登録されている領域で、同一消去単位内に含まれる領域群にグループ分けした場合に、グループ分けした領域群のサイズがnバイトより小さい領域群の群数がm個よりも多い場合に、書き込みバッファの内容を空にするようにし、書き込みサイズが小さいものを強制的に書き込みバッファから排除するようにしたので、実施の形態19よりもより効率よく書き込みバッファの空き領域を増やすことができ、フラッシュメモリへの書き込み回数を低減することができる。   As described above, according to this embodiment, when there is no free space in the write buffer, after the contents of the write buffer are moved to the erase block buffer, the write buffer management area is searched and registered in the write buffer management area. If the group size of the grouped area group is smaller than n bytes and the number of grouped area groups is larger than m, the group of the write buffer Since the contents are emptied and those having a small write size are forcibly excluded from the write buffer, the free space in the write buffer can be increased more efficiently than in the nineteenth embodiment, and the flash memory can be increased. The number of times of writing can be reduced.

実施の形態1の情報処理装置の構成図である。1 is a configuration diagram of an information processing apparatus according to a first embodiment. 実施の形態1のシステムの概略を示す構成図である。1 is a configuration diagram illustrating an outline of a system according to a first embodiment. 実施の形態1における情報処理装置がフラッシュメモリ上のデータを書き換える動作を示すフローチャートである。3 is a flowchart illustrating an operation of rewriting data on a flash memory by the information processing apparatus according to the first embodiment. 実施の形態2の情報処理装置の構成図である。3 is a configuration diagram of an information processing apparatus according to Embodiment 2. FIG. 実施の形態2における情報処理装置がフラッシュメモリ上のデータを書き換える動作を示すフローチャートである。10 is a flowchart illustrating an operation of rewriting data on the flash memory by the information processing apparatus according to the second embodiment. 実施の形態2における情報処理装置がメモリからデータを読み出す動作を示すフローチャートである。10 is a flowchart illustrating an operation of reading data from a memory by the information processing apparatus according to the second embodiment. 実施の形態3における情報処理装置がフラッシュメモリ上のデータを書き換える動作を示すフローチャートである。14 is a flowchart illustrating an operation of rewriting data on a flash memory by the information processing apparatus according to the third embodiment. 実施の形態4における情報処理装置の構成図である。FIG. 10 is a configuration diagram of an information processing device in a fourth embodiment. 書き込みバッファ管理領域に記録されているデータの内容を示す図である。It is a figure which shows the content of the data currently recorded on the write buffer management area. 実施の形態4における情報処理装置がフラッシュメモリ上のデータを書き換える動作を示すフローチャートである。15 is a flowchart illustrating an operation of rewriting data on a flash memory by the information processing apparatus according to the fourth embodiment. 実施の形態4における情報処理装置がメモリからデータを読み出す動作を示すフローチャートである。10 is a flowchart illustrating an operation of reading data from a memory by an information processing apparatus according to a fourth embodiment. 実施の形態5における情報処理装置の構成図である。FIG. 10 is a configuration diagram of an information processing device in a fifth embodiment. 実施の形態5における情報処理装置がフラッシュメモリ上のデータを書き換える動作を示すフローチャートである。14 is a flowchart illustrating an operation of rewriting data on a flash memory by the information processing apparatus according to the fifth embodiment. バッファデータ移動処理S515、S620の動作を示すフローチャートである。It is a flowchart which shows operation | movement of buffer data movement process S515, S620. 書き込みバッファの領域を使用する使用頻度の情報の一例である。It is an example of the usage frequency information which uses the area | region of a write buffer. 実施の形態6における情報処理装置がフラッシュメモリ上のデータを書き換える動作を示すフローチャートである。18 is a flowchart illustrating an operation of rewriting data on a flash memory by the information processing apparatus according to the sixth embodiment. バッファデータ移動処理S612の動作を示すフローチャートである。It is a flowchart which shows operation | movement of buffer data movement process S612. 従来の回路の概略を示す構成図である。It is a block diagram which shows the outline of the conventional circuit. 実施の形態7における情報処理装置の構成図である。FIG. 10 is a configuration diagram of an information processing device in a seventh embodiment. 実施の形態7における情報処理装置がフラッシュメモリ上のデータを書き換える動作を示すフローチャートである。18 is a flowchart illustrating an operation of rewriting data on the flash memory by the information processing apparatus according to the seventh embodiment. 復旧手段611の動作を示すフローチャートである。7 is a flowchart showing the operation of the recovery means 611. 実施の形態8における情報処理装置の構成図である。FIG. 20 is a configuration diagram of an information processing device in an eighth embodiment. 実施の形態8における情報処理装置がフラッシュメモリ上のデータを書き換える動作を示すフローチャートである。20 is a flowchart illustrating an operation of rewriting data on a flash memory by an information processing apparatus according to an eighth embodiment. 復旧手段611の動作を示すフローチャートである。7 is a flowchart showing the operation of the recovery means 611. 実施の形態9における情報処理装置の構成図である。FIG. 20 is a configuration diagram of an information processing device in a ninth embodiment. 実施の形態9における情報処理装置がフラッシュメモリ上のデータを書き換える動作を示すフローチャートである。27 is a flowchart illustrating an operation of rewriting data on a flash memory by the information processing apparatus according to the ninth embodiment. 書き込み許可指示手段612の動作を示すフローチャートである。5 is a flowchart showing the operation of a write permission instruction means 612. 書き込み禁止指示手段613の動作を示すフローチャートである。5 is a flowchart showing the operation of a write prohibition instruction unit 613. 実施の形態10における情報処理装置の構成図である。FIG. 22 is a configuration diagram of an information processing device in a tenth embodiment. 実施の形態10における情報処理装置がフラッシュメモリ上のデータを書き換える動作を示すフローチャートである。38 is a flowchart illustrating an operation of rewriting data on a flash memory by the information processing apparatus according to the tenth embodiment. 復旧手段611の動作を示すフローチャートである。7 is a flowchart showing the operation of the recovery means 611. 実施の形態11における情報処理装置の復旧手段611の動作を示すフローチャートである。27 is a flowchart showing the operation of the recovery unit 611 of the information processing apparatus in the eleventh embodiment. 実施の形態12における情報処理装置の構成図である。FIG. 20 is a configuration diagram of an information processing device in a twelfth embodiment. 消去ブロックバッファ管理領域604の構造図である。5 is a structural diagram of an erase block buffer management area 604. FIG. 実施の形態12における情報処理装置がフラッシュメモリ上のデータを書き換える動作を示すフローチャートである。27 is a flowchart illustrating an operation of rewriting data on a flash memory by the information processing apparatus according to the twelfth embodiment. 待避手段112の動作を示すフローチャートである。5 is a flowchart showing the operation of the save means 112. 消去ブロックバッファ書き込み手段614の動作を示すフローチャートである。5 is a flowchart showing the operation of an erase block buffer writing unit 614. 復旧手段611の動作を示すフローチャートである。7 is a flowchart showing the operation of the recovery means 611. 実施の形態13における消去ブロックバッファ管理領域604の構造図である。FIG. 45 is a structural diagram of an erase block buffer management area 604 in Embodiment 13. 消去ブロックバッファ書き込み手段614の動作を示すフローチャートである。5 is a flowchart showing the operation of an erase block buffer writing unit 614. 消去ブロックバッファ管理領域604のデータ操作の例を示す図である。FIG. 10 is a diagram showing an example of data operation in an erase block buffer management area 604. 復旧手段611の動作を示すフローチャートである。7 is a flowchart showing the operation of the recovery means 611. 実施の形態14における情報処理装置のデータ読み出し時の動作を示すフローチャートである。27 is a flowchart illustrating an operation at the time of data reading of the information processing apparatus in the fourteenth embodiment. 実施の形態15における情報処理装置のデータ読み出し時の動作を示すフローチャートである。27 is a flowchart showing an operation at the time of data reading of the information processing apparatus in the fifteenth embodiment. 実施の形態16における情報処理装置の構成図である。FIG. 20 is a configuration diagram of an information processing device in a sixteenth embodiment. バッファ管理領域605に記録されるデータの内容を示す図である。FIG. 5 is a diagram showing the contents of data recorded in a buffer management area 605. 実施の形態16における情報処理装置がフラッシュメモリ上のデータを書き換える動作を示すフローチャートである。27 is a flowchart illustrating an operation of rewriting data on a flash memory by the information processing apparatus according to the sixteenth embodiment. 実施の形態16における情報処理装置のデータ読み出し時の動作を示すフローチャートである。27 is a flowchart illustrating an operation at the time of data reading of the information processing apparatus in the sixteenth embodiment. 復旧手段611の動作を示すフローチャートである。7 is a flowchart showing the operation of the recovery means 611. 実施の形態17における復旧手段611の動作を示すフローチャートである。27 is a flowchart showing the operation of recovery means 611 in the seventeenth embodiment. 実施の形態18における情報処理装置の構成図である。FIG. 20 is a configuration diagram of an information processing device in an eighteenth embodiment. 実施の形態18における情報処理装置がフラッシュメモリ上のデータを書き換える動作を示すフローチャートである。29 is a flowchart illustrating an operation of rewriting data on a flash memory by an information processing device according to an eighteenth embodiment. 実施の形態18における情報処理装置のデータ読み出し時の動作を示すフローチャートである。27 is a flowchart illustrating an operation at the time of data reading of the information processing apparatus in the eighteenth embodiment. DRAM152へのデータの書き込み動作を示すフローチャートである。5 is a flowchart showing a data write operation to a DRAM 152. 実施の形態19における情報処理装置がフラッシュメモリ上のデータを書き換える動作を示すフローチャートである。27 is a flowchart illustrating an operation of the information processing apparatus according to the nineteenth embodiment to rewrite data on the flash memory. バッファデータ移動処理の動作を示すフローチャートである。It is a flowchart which shows the operation | movement of a buffer data movement process. 実施の形態20におけるバッファデータ移動処理の動作を示すフローチャートである。FIG. 29 is a flowchart showing an operation of buffer data movement processing in the twentieth embodiment.

符号の説明Explanation of symbols

101 フラッシュメモリ、102 不揮発性メモリ、103 消去ブロックバッファ、111 書き込み制御手段、112 待避手段、185 DRAM、201 読み出し手段、202 消去単位番号保持領域、301 消去命令手段、302 書き込み手段、402 書き込みバッファ、403 書き込みバッファ管理領域、501 バッファ移動手段、601 消去単位番号確認領域、602 消去ブロックバッファ確認領域、603 書き込み禁止フラグ領域、604 消去ブロックバッファ管理領域、605 バッファ管理領域、611 復旧手段、614 消去ブロックバッファ書き込み手段。   101 flash memory, 102 nonvolatile memory, 103 erase block buffer, 111 write control means, 112 save means, 185 DRAM, 201 read means, 202 erase unit number holding area, 301 erase command means, 302 write means, 402 write buffer, 403 Write buffer management area, 501 Buffer movement means, 601 Erase unit number confirmation area, 602 Erase block buffer confirmation area, 603 Write prohibition flag area, 604 Erase block buffer management area, 605 Buffer management area, 611 Recovery means, 614 Erase block Buffer writing means.

Claims (1)

あらかじめ定められた消去単位でデータの消去および書き込みがなされる複数の消去単位領域を有する第1のメモリと、
前記消去単位領域に記憶されたデータを前記消去単位で消去する消去手段とを有し、前記消去単位領域に記憶されたデータを第1の書き込みデータに書き換える情報処理装置において、
消去ブロックバッファおよび書き込み禁止フラグ領域を備えた任意のデータ単位でデータの書き込みが可能な不揮発性の第2のメモリと、
前記第1のメモリの第1の消去単位領域に前記第1の書き込みデータを書き込むことを要求する第1の書き込み要求に対し、前記書き込み禁止フラグ領域の値が書き込み許可状態になっている場合に、前記第1の書き込みデータを前記消去ブロックバッファに書き込む書き込み制御手段と、
前記第1の書き込み要求に対し、前記書き込み禁止フラグ領域の値が書き込み許可状態になっている場合に、前記第1の消去単位領域内の不変データを前記消去ブロックバッファに書き込む待避手段と、
前記書き込み禁止フラグ領域の値が書き込み許可状態になっている場合に、前記消去ブロックバッファの内容を第1のメモリに書き込むメモリ書き込み手段とを備え
前記メモリ書き込み手段は、前記書き込み禁止フラグ領域の値が書き込み許可状態から書き込み禁止状態になった場合に、前記消去ブロックバッファの内容を第1のメモリに書き込むことを特徴とする情報処理装置。
A first memory having a plurality of erase unit areas for erasing and writing data in a predetermined erase unit;
And an erasing unit for erasing data stored in the erasing unit area in the erasing unit, and rewriting the data stored in the erasing unit area to first write data.
A non-volatile second memory capable of writing data in an arbitrary data unit having an erase block buffer and a write inhibit flag area;
In response to a first write request for requesting writing of the first write data to the first erase unit area of the first memory, the value of the write prohibition flag area is in a write permission state. Write control means for writing the first write data into the erase block buffer;
In response to the first write request, when the value of the write prohibition flag area is in a write-permitted state, a save means for writing invariant data in the first erase unit area to the erase block buffer;
Memory write means for writing the contents of the erase block buffer to the first memory when the value of the write prohibition flag area is in a write enable state ;
The information processing apparatus , wherein the memory writing unit writes the contents of the erase block buffer to a first memory when the value of the write prohibition flag area changes from a write enable state to a write prohibition state .
JP2007304492A 1999-02-19 2007-11-26 Information processing device Expired - Fee Related JP4572930B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007304492A JP4572930B2 (en) 1999-02-19 2007-11-26 Information processing device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP4126099 1999-02-19
JP2007304492A JP4572930B2 (en) 1999-02-19 2007-11-26 Information processing device

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2004319381A Division JP4066991B2 (en) 1999-02-19 2004-11-02 Information processing device

Publications (2)

Publication Number Publication Date
JP2008097635A JP2008097635A (en) 2008-04-24
JP4572930B2 true JP4572930B2 (en) 2010-11-04

Family

ID=39380344

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007304492A Expired - Fee Related JP4572930B2 (en) 1999-02-19 2007-11-26 Information processing device

Country Status (1)

Country Link
JP (1) JP4572930B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5374313B2 (en) * 2009-10-16 2013-12-25 ファナック株式会社 Information processing apparatus having nonvolatile memory protection function
WO2012172708A1 (en) * 2011-06-14 2012-12-20 オムロン株式会社 Backup device and operating method for backup device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3215237B2 (en) * 1993-10-01 2001-10-02 富士通株式会社 Storage device and method for writing / erasing storage device
JPH08249237A (en) * 1995-03-14 1996-09-27 Fuji Film Micro Device Kk Erroneous write prevention system for data

Also Published As

Publication number Publication date
JP2008097635A (en) 2008-04-24

Similar Documents

Publication Publication Date Title
US10007468B2 (en) Method and apparatus for erasing data in data section in flash memory
WO2010086900A1 (en) Storage system and storage control method that compress and store data elements
EP1244019A2 (en) Memory device comprising a non-volatile memory
US20080195799A1 (en) Systems, methods and computer program products for operating a data processing system in which a file delete command is sent to an external storage device for invalidating data thereon
JP4722704B2 (en) INFORMATION RECORDING MEDIUM, ACCESS DEVICE AND ACCESS METHOD FOR INFORMATION RECORDING MEDIUM
JP4691209B2 (en) Access device, information recording device, information recording system, file management method, and program
US10346096B1 (en) Shingled magnetic recording trim operation
CN106886370B (en) data safe deletion method and system based on SSD (solid State disk) deduplication technology
CN110187999A (en) Address mapping data backup method and device
JP3632543B2 (en) Data storage method and information processing apparatus
JP4066991B2 (en) Information processing device
JP4572930B2 (en) Information processing device
JP4608434B2 (en) Data processing apparatus and data recording method for information recording medium
US10915478B2 (en) Method and apparatus for scatter gather processing engine in a storage controller for caching applications
US9122416B2 (en) Mainframe storage apparatus that utilizes thin provisioning
JP4731325B2 (en) Recording medium, data processing apparatus, and data processing method
JP4245021B2 (en) Storage device, storage system, and storage device control method
JP6389616B2 (en) Information processing apparatus and control method thereof
JP4535049B2 (en) Virtual library device, control method for virtual library device, control program for virtual library device
JP2007179085A (en) Disk device, method of selecting data written in disk, and program for selecting data written in disk
JP4244836B2 (en) Computer system, backup / restore method thereof, host computer, program
JP4480592B2 (en) File system
JP5622289B2 (en) Hard disk drive data protection system, method and program thereof
JP2008140396A (en) File managing device
JP2009205590A (en) Access module, information recording module, controller, and information recording system

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20100406

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20100520

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20100608

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20100629

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20100720

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20100802

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

Free format text: PAYMENT UNTIL: 20130827

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees