JP2010176201A - Data loss prevention device for flash memory, and data loss prevention method for flash memory - Google Patents
Data loss prevention device for flash memory, and data loss prevention method for flash memory Download PDFInfo
- Publication number
- JP2010176201A JP2010176201A JP2009015686A JP2009015686A JP2010176201A JP 2010176201 A JP2010176201 A JP 2010176201A JP 2009015686 A JP2009015686 A JP 2009015686A JP 2009015686 A JP2009015686 A JP 2009015686A JP 2010176201 A JP2010176201 A JP 2010176201A
- Authority
- JP
- Japan
- Prior art keywords
- data
- block
- flash memory
- mirror
- writing
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Landscapes
- Techniques For Improving Reliability Of Storages (AREA)
Abstract
Description
本発明は、データ書き換え可能な不揮発性メモリの一種であるフラッシュメモリに係り、詳しくはそのデータ消失防止装置及びデータ消失防止方法に関する。 The present invention relates to a flash memory which is a kind of non-volatile rewritable memory, and more particularly to a data loss prevention device and a data loss prevention method.
従来、装置や機器の動作を統括管理するコンピュータには、動作の際に必要となる各種データの格納先として種々のメモリが搭載されている。このメモリの一種としては、例えば各種データの電気的消去及び書き込みが可能なメモリとして不揮発性メモリが使用され、この不揮発性メモリには、例えば図7に示すようなフラッシュメモリ(Flash Read Only Memory:特許文献1参照)81が広く使用されている。フラッシュメモリ81は、データ書き込み先であるメモリ領域が複数(図7ではA〜Dの4つ)のブロック82〜85の集合体により構築され、このブロック単位ごとにデータ消去可能となっている。なお、これらブロック82〜85は、データ消去単位であることから、イレーズブロックとも呼ばれている。フラッシュメモリ81に対するデータ読み書きは、アプリケーション86からの指令に従って作動するドライバ87によって管理される。
2. Description of the Related Art Conventionally, various memories are mounted as storage destinations of various data necessary for operation in a computer that comprehensively manages the operations of apparatuses and devices. As one type of this memory, for example, a nonvolatile memory is used as a memory capable of electrically erasing and writing various data. For example, a flash memory (Flash Read Only Memory: as shown in FIG. 7) is used as this nonvolatile memory. 81) is widely used. The
ところで、フラッシュメモリ81以外の他のメモリ種であるEEPROM(Electrically Erasable PROM)やSRAM(Static Random Access Memory)には、同じアドレス上にデータを逐次書き込むことができる上書き機能があるので、データ書き込み済みのアドレスにデータ書き込み指令が出されても、このアドレスに逐次データ書き込みが可能である。しかし、前述したフラッシュメモリ81は、その特性として、データ書き込み済みのアドレス上に新たなデータを書き込む際には、ブロック全体を一旦消去してからでないと、この作業を実行することができないという制限がある。
By the way, EEPROM (Electrically Erasable PROM) and SRAM (Static Random Access Memory), which are other memory types than the
よって、この種のフラッシュメモリ81では、データ書き込みに際して、図8及び図9に示すようにA〜Dのブロック82〜85をローテーションして使用する。このとき、まずフラッシュメモリ81に新規データを書き込む際には、図8に示すように、ドライバ87は使用ブロック(図8ではAブロック82)の空き領域にデータを順次書き増ししていく。そして、Aブロック82に空き領域がなくなると、図9に示すように、各データ(図9ではID1〜ID3)におけるその最新値を次の使用ブロックであるBブロック83にコピーし、このBブロック83を新たなデータ書き込み先として使用し、使用ブロックに空き領域が無くなる度に、この作業を順次繰り返すことでデータ書き込みが行われる。また、空き領域がなくなった使用済みブロックは、次のローテーションが回ってくるまでにデータが消去される。
Therefore, in this type of
ところで、種々の要因によって、図10に示すようにドライバ87に使用ブロックへの書き込みエラーが発生すると、それ以降においてドライバ87は使用ブロックにデータ書き込みを実行することができなくなる。これにより、仮にドライバ87はアプリケーション86から新規データを受け付けても、この新規データをフラッシュメモリ81に書き込む動作をとることができず、結果としてこれがデータ消失という問題に繋がっていた。また、このデータ消失という問題は、使用ブロックに書き込んでおいたデータが、エラー動作したドライバ87によって消去されてしまうことも広義として含み、要はフラッシュメモリ81に対する正常なデータ保持が可能な新たな対策が要望されていた。
By the way, when a write error to the used block occurs in the
本発明の目的は、フラッシュメモリにおいてデータ消失を発生し難くすることができるフラッシュメモリのデータ消失防止装置及びフラッシュメモリのデータ消失防止方法を提供することにある。 An object of the present invention is to provide a data loss prevention device for a flash memory and a data loss prevention method for a flash memory that can make it difficult to cause data loss in a flash memory.
前記問題点を解決するために、本発明では、データ書き換え可能な不揮発性メモリとしてフラッシュメモリを使用し、アプリケーションからの書き込み指令によりドライバが前記フラッシュメモリにデータ書き込みを行う際、当該フラッシュメモリのメモリ領域を構築しつつデータ消去単位となっている複数のブロックを、順番にローテーションして使用しながらデータの読み書きを実行するフラッシュメモリのデータ消失防止装置において、組として設定した2つの前記ブロックのうちの一方を、前記ローテーションにおいて用いるローテーションブロックとして使用し、もう一方を当該ローテーションブロックのミラーブロックとして使用するミラーリング処理手段と、前記フラッシュメモリに対する前記ドライバのアクセスに対して異常があるか否かを監視する監視手段と、前記監視手段で前記異常を確認した際に、前記ミラーブロックを使用して前記データの読み書きを継続させる保護実行手段とを備えたことを要旨とする。 In order to solve the above problems, in the present invention, when a flash memory is used as a rewritable nonvolatile memory and a driver writes data to the flash memory by a write command from an application, the memory of the flash memory Among the two blocks set as a set in the data loss prevention device of the flash memory that reads and writes data while sequentially rotating and using a plurality of blocks that are data erasing units while constructing an area One of these is used as a rotation block used in the rotation, and the other is used as a mirror block of the rotation block. And a protection execution means for continuing reading and writing of the data using the mirror block when the abnormality is confirmed by the monitoring means. .
この構成によれば、フラッシュメモリがメモリ領域として持つ複数のブロックを2つずつに区分けし、各々の組において一方のブロックをデータ読み書きに用いるローテーションブロックとして使用し、他方のブロックをローテーションブロックのミラーブロックとして使用する。そして、フラッシュメモリに対するドライバのアクセス、即ち使用中のローテーションブロックに対してアクセス異常が発生した際には、異常が発生してしまったローテーションブロックのミラーブロックを使用することにより、データ読み書きを継続する。このため、もし仮に使用ローテーションブロックに異常が発生しても、ミラーブロックを用いてデータ読み書きを継続することが可能となるので、データ読み書きが継続できずにデータが消失してしまう状況を生じ難くすることが可能となる。 According to this configuration, a plurality of blocks that the flash memory has as a memory area is divided into two, and one block in each set is used as a rotation block used for data reading and writing, and the other block is a mirror of the rotation block. Use as a block. When a driver access to the flash memory, that is, when an access abnormality occurs in the rotation block in use, data reading and writing is continued by using the mirror block of the rotation block in which the abnormality has occurred. . For this reason, even if an abnormality occurs in the used rotation block, it becomes possible to continue data reading and writing using the mirror block, so that it is difficult to cause a situation where data cannot be continuously read and data is lost. It becomes possible to do.
本発明では、前記保護実行手段は、前記監視手段で前記異常を確認した際、前記ミラーブロックで前記データの読み書きを継続するデータ処理継続手段と、前記異常によって破壊されたミラーリングを再構築するミラー再構築手段とを備えたことを要旨とする。 In the present invention, when the abnormality is confirmed by the monitoring unit, the protection execution unit includes a data processing continuation unit that continues to read and write the data in the mirror block, and a mirror that reconstructs the mirroring destroyed by the abnormality. The gist of the present invention is that it comprises a reconstruction means.
この構成によれば、ローテーションブロックでのデータ読み書き異常時に同ブロックのミラーブロックでデータ読み書きを継続した際には、データ処理の継続は可能となるものの、ローテーションブロックとミラーブロックとの間のミラーリングが破壊された状況に陥る。しかし、本構成では、ミラーリングが破壊された際には、ミラー再構築手段によって2ブロック間のミラーリングが再構築されるので、この後、ローテーションブロックでデータの読み書きを実行する動作に戻っても、正常なデータ読み書きを問題なく実行可能となる。 According to this configuration, when data read / write is continued in the mirror block of the same block in the case of abnormal data read / write in the rotation block, data processing can be continued, but mirroring between the rotation block and the mirror block can be performed. The situation is destroyed. However, in this configuration, when mirroring is destroyed, mirroring between the two blocks is reconstructed by the mirror reconstructing means, so after that, even when returning to the operation of reading and writing data in the rotation block, Normal data reading and writing can be executed without problems.
本発明では、前記ミラー再構築手段は、前記ミラーリングの再構築中にアプリケーションから新たなデータの書き込み指令を受け付けた際には、前記再構築を一時中断して、空いた前記メモリ領域に当該データを書き込むことにより、ミラーリング再構築中のデータ書き込みが可能となっていることを要旨とする。 In the present invention, when the mirror rebuilding unit receives a new data write command from the application during the rebuilding of the mirroring, the mirror rebuilding unit suspends the rebuilding and stores the data in the free memory area. The main point is that data can be written during mirroring reconstruction.
この構成によれば、破壊されたミラーリングを再構築している際に、仮に新たなデータ書き込みを受け付けても、再構築を一旦中断してデータ書き込みを優先して実行することにより、これに対応することが可能となる。 According to this configuration, even if new data writing is accepted when rebuilding the mirroring that has been destroyed, the rebuilding is temporarily suspended and data writing is executed with priority. It becomes possible to do.
本発明では、データ書き換え可能な不揮発性メモリとしてフラッシュメモリを使用し、アプリケーションからの書き込み指令によりドライバが前記フラッシュメモリにデータ書き込みを行う際、当該フラッシュメモリのメモリ領域を構築しつつデータ消去単位となっている複数のブロックを、順番にローテーションして使用しながらデータの読み書きを実行するフラッシュメモリのデータ消失防止方法において、組として設定した2つの前記ブロックのうちの一方を、前記ローテーションにおいて用いるローテーションブロックとして使用し、もう一方を当該ローテーションブロックのミラーブロックとして使用し、前記フラッシュメモリに対する前記ドライバのアクセスに対して異常があるか否かを監視手段で監視し、前記監視手段で前記異常を確認した際に、前記ミラーブロックを使用して前記データの読み書きを継続させることを要旨とする。 In the present invention, a flash memory is used as a data rewritable nonvolatile memory, and when a driver writes data to the flash memory in accordance with a write command from an application, a data erasing unit is constructed while building a memory area of the flash memory. In a method for preventing data loss in a flash memory that reads and writes data while using a plurality of blocks that are rotated in order, rotation using one of the two blocks set as a set in the rotation Use as a block, use the other as a mirror block of the rotation block, and monitor whether or not there is an abnormality with respect to the driver access to the flash memory, and the monitoring means When confirming the normal, and summarized in that to continue to read and write the data using the mirror block.
本発明によれば、フラッシュメモリにおいてデータ消失を発生し難くすることができる。 According to the present invention, it is possible to make it difficult for data loss to occur in a flash memory.
以下、本発明を具体化したフラッシュメモリのデータ消失防止装置及びフラッシュメモリのデータ消失防止方法の一実施形態を図1〜図6に従って説明する。
図1に示すように、車両1には、ステアリングホイール2の操舵角を検出する操舵角検出装置3が設けられている。この操舵角検出装置3には、同装置3のセンサ部品(例えば、磁気式センサ)としてステアリングアングルセンサ4と、操舵角検出装置3のコントロールユニットとしてコンピュータ5とが設けられている。コンピュータ5は、ステアリングアングルセンサ4から取得するセンサ出力値を基に、ステアリングホイール2の操舵角を演算し、この演算した操舵角(演算舵角値)を、必要とする他の車載機器に車内LAN(Local Area Network)を介して出力する。
DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment of a flash memory data loss prevention apparatus and flash memory data loss prevention method embodying the present invention will be described below with reference to FIGS.
As shown in FIG. 1, the vehicle 1 is provided with a steering
図2に示すように、コンピュータ5には、各種データを書き込むためのメモリとしてフラッシュメモリ(Flash ROM)6が設けられている。フラッシュメモリ6は、自身のメモリ領域に対するデータの書き換えが可能な不揮発性メモリの一種であって、背景技術でも述べたように、データ消去単位として区分けされた複数(本例はA〜Fの6つ)のブロック7〜12からなる。即ち、この種のフラッシュメモリ6は、自身のメモリ領域に書き込んだデータが書き換え可能であるものの、データ消去はブロック単位でしか実行することができない特性を持ったメモリである。なお、これらブロック7〜12は、フラッシュメモリ6のメモリ領域を均等に区分することにより、同じ記憶容量をとる。なお、Aブロック7、Cブロック9及びEブロック11がブロック(ローテーションブロック)を構成する。
As shown in FIG. 2, the computer 5 is provided with a flash memory (Flash ROM) 6 as a memory for writing various data. The
本例のフラッシュメモリ6では、データ書き込みに際して、A〜Fのブロック7〜12のうち1つ飛びのA,C,Eの3つのブロック7,9,11をデータ書込先としてローテーションして使用する。ここで、これら3つのローテーションブロック7,9,11のうち、最初に使用するブロックを例えばAブロック7とすると、まずはAブロック7をデータ書き込み先として、操舵角検出装置3に関係する各種データを書き込んでいく。なお、このときにAブロック7に書き込まれるデータとしては、例えば車両1のイグニッションスイッチ(エンジンスイッチ)がイグニッションオン位置(IG ON位置)に操作されてエンジンが始動したときの時刻(ID1データ)や、イグニッションスイッチがオンしている間の時間(IDデータ2)や、ステアリングアングルセンサ4のセンサ出力値(ID3データ)等がある。
In the
ところで、フラッシュメモリ6にデータを書き込む際、フラッシュメモリ6の特性として、データ書き込み済みのアドレスにデータを上書きすることができない。このため、フラッシュメモリ6は、新規書き込みデータを受け付けた際、使用中のAブロック7において、その空き領域に受け付けデータを順次書き増ししていく動作をとる。そして、書込領域が一杯になると、使用ブロックを次使用ブロック(本例はCブロック9)に切り換え、ID1〜ID3の各データの最新値をCブロック9に書き込みつつ、データの書き込みをCブロック9で継続し、ブロックに空き領域が無くなる度にこの動作を繰り返すことにより、データ書き込みを実行する。なお、データ書き込みが一杯になったブロックは、次ローテーションが回ってくるまでの間に、データ書き込みやデータ読み取りを実行していない手の空いたときにデータ消去が実行される。
By the way, when data is written to the
図2に示すように、コンピュータ5には、同コンピュータ5を動作させるソフトウェアとして、操舵角検出装置3を動作させるための専用ソフトウェアであるアプリケーション13と、このアプリケーション13とOS(Operating System)との間の中間的な立場で機能するミドルウェア14と、フラッシュメモリ6を動作させるためのソフトウェアであるドライバ15と設けられている。アプリケーション13は、自身に入力される各種情報やデータに基づき、ミドルウェア14を介してドライバ15に動作指令を出力することにより、コンピュータ5を動作させる。また、アプリケーション13は、ドライバ15が複数存在する場合、これらドライバ15を統括管理することが可能となっている。
As shown in FIG. 2, the computer 5 includes, as software for operating the computer 5, an
ドライバ15は、アプリケーション13からミドルウェア14を介して動作指令を受け付けると、この動作指令に従って動いて、フラッシュメモリ6(ブロック7〜12)へのデータ書き込み、データ読み取り、データ消去等の各種処理を実行する。このとき、ドライバ15は、アプリケーション13からの動作指令をトリガとして受け付け、アプリケーション13が他動作を実行していても、この動作指令に基づく動作をアプリケーション13の動作状態に依らず実行する。また、ドライバ15によるブロック7〜12のデータ消去は、前述したようにドライバ15がデータ書き込みやデータ読み取りを行っていないときの手の空いたときに実行される。
When the
また、本例の場合、ローテーションの1つ飛ばしとしたB,D,Fのブロック8,10,12は、各々組をなすブロックに書き込まれたデータ群をミラーリングするミラーブロックとして使用されている。ミラーブロックである本例のブロック8,10,12は、組をなすローテーションブロックに書き込まれるデータと同じデータが、同じアドレス順で書き込まれるブロックである。本例においては、Bブロック8がAブロック7のミラーブロックであり、Dブロック10がCブロック9のミラーブロックであり、Fブロック12がEブロック11のミラーブロックである。なお、Bブロック8、Dブロック10、Fブロック12がブロック(ミラーブロック)を構成する。
In the case of this example, the B, D, and F blocks 8, 10, and 12, which are skipped by one rotation, are used as mirror blocks that mirror the data group written in each block. The
ドライバ15には、フラッシュメモリ6に対してミラーリングを実行するミラーリング処理部16が設けられている。ミラーリング処理部16は、フラッシュメモリ6のメモリ領域を論理的に2分割することにより、同じ構成のローテーションブロックがフラッシュメモリ6内に2つ生成されるように機能する。即ち、ミラーリング処理部16は、複数のブロック7〜12を2つずつ組として設定し、これら各々の組において、一方のブロックを実際のデータ読み書きに用いるローテーションブロック(本例はブロック7,9,11)として使用し、他方のブロックをミラーリングに用いるミラーブロック(本例はブロック8,10,12)として使用する。なお、ミラーリング処理部16がミラーリング処理手段に相当する。
The
各ブロック7〜12の最後尾には、自ブロックのミラーリング状態がどのような状態にあるのかを書き表す管理領域Eが用意されている。この管理領域Eには、自ブロックのミラーリング状態がどのような状態にあるのかを通知する管理情報17が書き込まれている。管理情報17としては、例えばミラーリング状態が正常であることをドライバ15に通知するミラー状態正常通知や、ミラーリング状態が異常であることをドライバ15に通知するミラー状態異常通知等がある。
At the end of each of the
また、ドライバ15には、使用ローテーションブロックに対してデータ消失の有無を確認するデータ消失有無確認部18が設けられている。本例のデータ消失有無確認部18は、ドライバ15が使用ローテーションブロックにデータ書き込みを実行している際、このデータ書き込みが正常に実行できているか否かを確認することにより、使用中のローテーションブロックに対する書き込みエラーの有無を確認し、例えば書き込み先のアドレスを見失うなどした際には、書き込みエラーが発生したと認識する。データ消失有無確認部18は、書き込みエラーを確認した際、管理情報17をそれまでのミラー状態正常通知からミラー状態異常通知に更新する。なお、データ消失有無確認部18が監視手段に相当する。
Further, the
ドライバ15には、データ消失有無確認部18がローテーションブロックで書き込みエラーを検出した際、そのエラー検出以降のデータ書き込みや読み込みを、組をなすミラーブロックにおいて実行するデータ処理継続部19が設けられている。例えば、データ処理継続部19は、Aブロック7でデータ書き込みを実行している際に、このAブロック7で書き込みエラーが発生したことを確認すると、Aブロック7のミラーブロックであるBブロック8で続きのデータ書き込みやデータ読み取りを実行する。なお、データ処理継続部19が保護実行手段、データ処理継続手段を構成する。
The
また、ドライバ15には、使用中のローテーションブロックに書き込みエラーが発生した際、これと対応するミラーブロックで保持したデータ群を使用して、ミラーリングを再構築するミラー再構築部20が設けられている。本例のミラー再構築部20は、例えばコンピュータ5の電源投入時等の管理情報17の読み取りタイミングにおいて管理情報17を確認しにいき、管理情報17からミラー状態異常を受け付けると、ミラーブロックに書き込んでおいたデータ群を、それと組をなすローテーションブロックにコピーすることにより、ミラーリングを再構築する。なお、ミラー再構築部20が保護実行手段、ミラー再構築手段を構成する。
Further, the
次に、本例のコンピュータ5(ドライバ15)が実行するミラーリングの動作を図3〜図6を用いて説明する。
例えば、ドライバ15がアプリケーション13からデータ書き込み指令を受け付けて、フラッシュメモリ6に対して新規にデータ書き込みを実行する場合、図3に示すように、ドライバ15は最先使用であるAブロック7の先頭から順にデータを書き込んでいく。なお、以降の説明においては、ドライバ15がAブロック7に順次書き込んでいくデータ(即ち、ID1〜ID3の各種データ)を、便宜上、データ書き込み順に第1データD1、第2データD2…と記載する。
Next, the mirroring operation executed by the computer 5 (driver 15) of this example will be described with reference to FIGS.
For example, when the
このとき、ミラーリング処理部16は、Aブロック7に書き込んだデータと同一のデータ内容を持つもの(即ち、第1データD1)を、Aブロック7のミラーブロックであるBブロック8に先頭から同じアドレス順で書き込み、このAブロック7をBブロック8によってミラーリングする。このとき、ミラーリング処理部16は、Bブロック8にAブロック7と同じ第1データD1を正常に書き込めたことを確認すると、ミラー状態が正常であると認識して、Aブロック7の末尾に設けた管理情報17としてミラー状態正常通知を記録しつつ、これもミラーリングして、同様のミラー状態正常通知をBブロック8の最後尾に記録する。そして、ドライバ15がAブロック7に順に第2データD2、第3データD3、第4データD4…を書き込む動作をとると、ミラーリング処理部16はこれらと同一のデータをBブロック8に同じアドレス順で順次書き込んでいく。
At this time, the mirroring processing unit 16 applies the same data content as the data written in the A block 7 (that is, the first data D1) to the
このデータ書き込み時、ドライバ15がアプリケーション13からデータ読み取り指令を受け付けると、ドライバ15はこの指令に従ってフラッシュメモリ6からのデータ読み取りを実行する。このとき、フラッシュメモリ6のデータ読み取りは、図4に示すように、ローテーションブロックであるAブロック7のみから実行する。これにより、データ読み取りは、Aブロック7及びBブロック8の両方からデータを読む動作はとらないので、データ読み込みの処理時間が短く済む。
When the
ところで、図5に示すように、例えばAブロック7のフォーマットに不具合が発生してしまっている場合など、データ書き込みの環境下に異常が発生すると、ドライバ15はアプリケーション13から書き込みデータを受け付けても、これをAブロック7に書き込むことができず、書き込みエラーが発生してしまう。このような書き込みエラー発生以降は、ローテーションブロックであるAブロック7にデータ書き込みを継続できず、これが結果としてデータ消失に繋がる懸念がある。
By the way, as shown in FIG. 5, if an abnormality occurs in the data writing environment, for example, when a problem occurs in the format of the
しかし、本例の場合は、書き込みエラーの発生有無がデータ消失有無確認部18で監視されている。そして、データ消失有無確認部18は、例えばドライバ15がAブロック7に書き込み動作に入ったにも拘わらず、一定時間を経ても書き込みが完了できないことを確認すると、ローテーションブロックに書き込みエラーが発生したと認識する。このとき、データ消失有無確認部18は、書き込みエラーを確認した際、管理情報17をそれまでのミラー状態正常通知からミラー状態異常通知に更新する。なお、ブロック7〜12は全体を一括でしか消去できないので、ミラー状態異常通知は管理領域Eの空き領域に書き増しされることでミラーブロックに書き加えられる。
However, in the case of this example, the presence or absence of a write error is monitored by the data loss presence check unit 18. Then, when the data loss presence / absence confirmation unit 18 confirms that the writing cannot be completed even after the predetermined time has elapsed even though the
また、データ処理継続部19は、データ消失有無確認部18で書き込みエラーを検出すると、これ以降はAブロック7の代わりに、Aブロック7のミラーブロックであるBブロック8でデータの読み書きを継続する。そして、これ以降はAブロック7を放置してデータ読み書きのローテーションから外し、Bブロック8をローテーションブロックとして使用する。即ち、Bブロック8での書き込みが一杯になると、これ以降はBブロック8→Dブロック10→Fブロック12の順でブロックがローテーション使用され、Fブロック12に空き容量が無くなると、書き込み先がBブロック8に復帰して、以上の動作が繰り返される。
In addition, when the data
ここで、コンピュータ5の電源がオフされた後に電源が再投入されると、ミラー再構築部20は、破壊されたミラーを再構築すべく、ミラーブロックの最後尾に書き込まれた管理情報17を確認しにいく。なお、このように電源再投入後の初期化時にミラー再構築を実行するのは、この初期化の際にブロック末尾の管理情報17を確認しにいく動作をドライバ15がとるためである。ミラー再構築部20は、この管理情報17の確認の際、ミラー状態正常通知を読み取ると、ミラーリングは破壊されていないと認識し、ミラー再構築の動作は実行しない。
Here, when the power is turned on again after the computer 5 is turned off, the
一方、ミラー再構築部20は、管理情報17の確認の際、ミラー状態異常通知を読み取ると、ミラーリングが破壊されていると認識し、図6に示す手順に沿って、破壊されたミラーの再構築に入る。このとき、フラッシュメモリ6はブロック単位でしかデータ消去できないので、まずミラー再構築部20はAブロック7を消去する。Aブロック7の消去後、ミラー再構築部20はBブロック8に保持してあるデータ内容を、そのまま全てAブロック7に書き込み、即ちコピーする。即ち、ミラー再構築部20は、ミラーブロックに書き込まれているデータ群を、アドレスが先のものから順番にローテーションブロックにコピーしていく動作を実行する。
On the other hand, when the
なお、このコピーはAブロック7にBブロック8のデータを順に書き込んでいくという時間を要する動作であるので、コピー途中に新たなデータ書き込み指令をアプリケーション13から受け付ける場合もある。このとき、ミラー再構築部20は、そのときに実行しているミラー再構築を一旦中断して、Aブロック7及びBブロック8の両方において空いている領域に、新規データ(図6では第5データD5)の書き込み、書き込み終了後にミラー再構築を続きから実行するように動作する。また、ミラー再構築部20は、ミラー再構築の際にアプリケーション13からデータ読み取り指令を受け付ける場合もあるが、このときもミラー再構築を一旦中断して、これに対応する。
Note that this copying is an operation that requires time to sequentially write the data of the
そして、全てのデータのコピーが終了すると、ミラー再構築部20はAブロック7及びBブロック8の両方の管理領域Eに対し、その空き領域にミラー状態正常の通知を書き込んで、管理情報17を更新し、ミラー状態が正常であることを記録する。これにより、電源再投入以降は、通常通りにAブロック7、Cブロック9、Eブロック11がローテーションされて、データの読み書きが実行される。なお、ここではAブロック7及びBブロック8のミラーリングについて説明したが、Cブロック9及びDブロック10のミラーリングと、Eブロック11及びFブロック12のミラーリングの両方とも動作は同じであるので、説明は省略する。
Then, when all the data has been copied, the
さて、本例においては、組をなす2つのブロックの一方をローテーションブロック、他方をミラーブロックとして使用することで、各々のローテーションブロックごとにデータをミラーリングするようにした。このため、例えばローテーションブロックに書き込みエラーが発生しても、これ以降のデータ書き込みはミラーブロックで継続されるので、データの書き漏らしが発生せず、結果としてデータの消失が防がれる。また、電源再投入後の初期化時に、ミラーが再構築されるので、ローテーションブロックを正規データが書き込まれた状態に復旧することが可能となるので、以降の動作も問題なく継続実行することが可能となる。 In this example, one of the two blocks forming the set is used as a rotation block, and the other is used as a mirror block, so that data is mirrored for each rotation block. For this reason, for example, even if a write error occurs in the rotation block, the subsequent data writing is continued in the mirror block, so that no data leakage occurs, and as a result, data loss is prevented. In addition, since the mirror is reconstructed at the initialization after the power is turned on again, it is possible to restore the rotation block to the state where the regular data has been written. It becomes possible.
本実施形態の構成によれば、以下に記載の効果を得ることができる。
(1)通常のデータ読み書きに使用するローテーションブロックと同じブロックをミラーブロックとして設け、使用中のローテーションブロックに書き込みエラーが発生した際には、これ以降はミラーブロックを使用してデータ読み書きを継続する。このため、ローテーションブロックに書き込みエラーが発生したとしても、データ書き込みを継続できずにデータが消失する状況を生じ難くすることができる。
According to the configuration of the present embodiment, the following effects can be obtained.
(1) The same block as the rotation block used for normal data read / write is provided as a mirror block, and when a write error occurs in the rotation block being used, data read / write is continued using the mirror block thereafter. . For this reason, even if a write error occurs in the rotation block, it is possible to make it difficult to cause a situation where data cannot be continuously written and data is lost.
(2)ミラーリングが破壊された際、電源投入後の初期化時にミラーリングの再構築が実行されるので、ローテーションブロックとミラーブロックとが同じデータ内容をとる元の状態にこれら2ブロックを復帰させることができる。 (2) When mirroring is destroyed, mirroring reconstruction is executed at initialization after power-on, so that these two blocks are restored to the original state in which the rotation block and mirror block have the same data contents. Can do.
(3)ミラーリングの再構築を実行している際に、新たなデータ書き込み指令がアプリケーション13から受け付けたときには、ミラーリングを一時中断して、新たなデータ書き込みを実行する。このため、ミラーリング再構築中に、新たなデータ書き込みの要求が発生しても、問題なくこれに対応することができる。
(3) When a new data write command is received from the
(4)フラッシュメモリ6からデータを読み取る際には、2つの対のブロックのうちローテーションブロックからのみデータ読み取りを実行する。このため、ローテーションブロックとミラーブロックとの両方からデータを読み取るという動作はとらないので、データ読み取りに時間を要さずに済む。
(4) When reading data from the
(5)ブロック7〜12の最後尾に、ミラー状態を通知する管理情報17を書き込み、この管理情報17を確認することにより、ミラーリングが正常か否かを判断する。このため、ミラー状態が正常か否かの確認を、管理情報17を見るという簡素な方式により実行することができる。
(5) The
なお、実施形態はこれまでに述べた構成に限らず、以下の態様に変更してもよい。
・ データ消失の対応は、必ずしも書き込みエラーが発生した際にミラーブロックでデータ書き込みの継続を行い、初期化時においてミラーを再構築する方式をとることに限定されない。例えば、ドライバ15が使用ブロックにおけるデータ消失を検出した際、それまでミラーブロックで保持しておいたデータを使用ブロックにコピーすることで、消去データを復旧するものでもよい。
Note that the embodiment is not limited to the configuration described so far, and may be modified as follows.
-Handling data loss is not necessarily limited to a method in which data writing is continued in the mirror block when a write error occurs and the mirror is reconstructed at initialization. For example, when the
・ アクセス異常の検出対象は、必ずしも書き込みエラーであることに限定されない。例えば、ドライバ15がフラッシュメモリ6に対するアクセス先を見失っているか否かを見ることや、フラッシュメモリ6(ブロック7〜9)が空になっていることや、フラッシュメモリ6に書き込まれているデータそのものが化けてしまっていることを確認するものでもよい。
-The target of detecting an access error is not necessarily limited to a write error. For example, the
・ 管理領域Eの位置は、必ずしもブロックの最後尾の領域に限らず、他の場所でもよい。
・ ミラーの再構築は、初期化時に限定されない。要は、管理情報17を読み取りにいくタイミングであれば、その実行時期は特に限定されない。
The position of the management area E is not necessarily limited to the last area of the block, but may be another place.
-Rebuilding a mirror is not limited to initialization. In short, as long as the
・ フラッシュメモリ6に書き込まれるデータは、ID1〜ID3で示すイグニッションオン開始時刻、イグニッションオン実行時間、ステアリングアングルセンサのセンサ値に限定されず、操舵角検出装置3の動作時にやり取りされるデータであれば、どのようなものでもよい。
The data written to the
・ ミドルウェア14は、必ずしも必要ではなく、これを省略してもよい。
・ フラッシュメモリ6のブロック数は、A〜Fの計6つに限定されず、これ以外の数をとるものでもよい。
The
The number of blocks of the
・ データ書き込みの最先使用ブロックは、必ずしもAブロック7に限定されず、Cブロック9やEブロック11でもよい。
・ アクセス保護の機能を持つ本例のコンピュータ5は、必ずしも操舵角検出装置3に搭載されることに限らず、メモリとしてフラッシュメモリ6を持つコンピュータ5を備えたものであれば、特に限定されるものではない。
The first use block for data writing is not necessarily limited to the
The computer 5 of this example having an access protection function is not limited to being mounted on the steering
次に、上記実施形態及び別例から把握できる技術的思想について、それらの効果とともに以下に追記する。
(1)請求項1〜3のいずれかにおいて、前記ブロックには、当該ブロックの現在状態を通知する管理情報が書き込まれ、前記保護実行手段は、前記管理情報を確認することにより、前記ローテーションに用いるブロックにおける前記異常の有無を確認する。この構成によれば、例えば使用中のローテーションブロックにおける異常有無の確認を、管理情報を見るという簡素な方式により実行することが可能となる。
Next, technical ideas that can be grasped from the above-described embodiment and other examples will be described below together with their effects.
(1) In any one of claims 1 to 3, management information for notifying a current state of the block is written in the block, and the protection execution unit checks the management information to perform the rotation. The presence or absence of the abnormality in the block to be used is confirmed. According to this configuration, for example, confirmation of the presence / absence of abnormality in the rotation block in use can be performed by a simple method of viewing the management information.
(2)請求項1〜3、前記技術的思想(1)のいずれかにおいて、前記アプリケーションからデータの読み取り指令を受け付けた際には、前記ローテーションブロック側のブロックからのみデータを読み取ることにより、データ読み取りを実行するデータ読取手段を備えた。この構成によれば、データ読み取りの際には、同じデータ群を保持する2つのブロックのうちローテーションブロック側からのみデータを読み取るので、データ読み取りの短時間化を図ることが可能となる。 (2) In any one of claims 1 to 3 and the technical idea (1), when a data read command is received from the application, data is read by reading data only from the block on the rotation block side. Data reading means for executing reading is provided. According to this configuration, when data is read, data is read only from the rotation block side of the two blocks holding the same data group, so that it is possible to shorten the data reading time.
6…フラッシュメモリ、7…ブロック(ローテーションブロック)を構成するAブロック、8…ブロック(ミラーブロック)を構成するBブロック、9…ブロック(ローテーションブロック)を構成するCブロック、10…ブロック(ミラーブロック)を構成するDブロック、11…ブロック(ローテーションブロック)を構成するEブロック、12…ブロック(ミラーブロック)を構成するFブロック、13…アプリケーション、15…ドライバ、16…ミラーリング処理手段としてのミラーリング処理部、18…監視手段としてのデータ消失有無確認部、19…保護実行手段、データ処理継続手段を構成するデータ処理継続部、20…保護実行手段、ミラー再構築手段を構成するミラー再構築部。 6 ... Flash memory, 7 ... A block constituting block (rotation block), 8 ... B block constituting block (mirror block), 9 ... C block constituting block (rotation block), 10 ... block (mirror block) ) Constituting D), 11... E block constituting block (rotation block), 12... F block constituting block (mirror block), 13... Application, 15. 18, a data loss presence / absence confirmation unit as a monitoring unit, 19 a protection execution unit, a data processing continuation unit constituting a data processing continuation unit, 20 a protection execution unit, and a mirror reconstruction unit constituting a mirror reconstruction unit.
Claims (4)
組として設定した2つの前記ブロックのうちの一方を、前記ローテーションにおいて用いるローテーションブロックとして使用し、もう一方を当該ローテーションブロックのミラーブロックとして使用するミラーリング処理手段と、
前記フラッシュメモリに対する前記ドライバのアクセスに対して異常があるか否かを監視する監視手段と、
前記監視手段で前記異常を確認した際に、前記ミラーブロックを使用して前記データの読み書きを継続させる保護実行手段と
を備えたことを特徴とするフラッシュメモリのデータ消失防止装置。 When a flash memory is used as a rewritable nonvolatile memory and a driver writes data to the flash memory in response to a write command from an application, a plurality of data erasing units are constructed while building the memory area of the flash memory. In the flash memory data loss prevention device that reads and writes data while rotating and using the blocks in order,
Mirroring processing means for using one of the two blocks set as a set as a rotation block used in the rotation and using the other as a mirror block of the rotation block;
Monitoring means for monitoring whether there is an abnormality with respect to access of the driver to the flash memory;
A flash memory data loss prevention apparatus, comprising: a protection execution unit that continues reading and writing of the data using the mirror block when the monitoring unit confirms the abnormality.
前記監視手段で前記異常を確認した際、前記ミラーブロックで前記データの読み書きを継続するデータ処理継続手段と、
前記異常によって破壊されたミラーリングを再構築するミラー再構築手段と
を備えたことを特徴とする請求項1に記載のフラッシュメモリのデータ消失防止装置。 The protection execution means
Data processing continuation means for continuing reading and writing of the data in the mirror block when the abnormality is confirmed by the monitoring means;
2. The flash memory data loss prevention apparatus according to claim 1, further comprising mirror rebuilding means for rebuilding mirroring destroyed by the abnormality.
組として設定した2つの前記ブロックのうちの一方を、前記ローテーションにおいて用いるローテーションブロックとして使用し、もう一方を当該ローテーションブロックのミラーブロックとして使用し、前記フラッシュメモリに対する前記ドライバのアクセスに対して異常があるか否かを監視手段で監視し、前記監視手段で前記異常を確認した際に、前記ミラーブロックを使用して前記データの読み書きを継続させることを特徴とするフラッシュメモリのデータ消失防止方法。 When a flash memory is used as a rewritable nonvolatile memory and a driver writes data to the flash memory in response to a write command from an application, a plurality of data erasing units are constructed while building the memory area of the flash memory. In the flash memory data loss prevention method that reads and writes data while rotating and using the blocks in order,
One of the two blocks set as a set is used as a rotation block used in the rotation, and the other is used as a mirror block of the rotation block, so that there is an abnormality in the driver access to the flash memory. A method for preventing data loss in a flash memory, wherein monitoring is performed by monitoring means, and when the abnormality is confirmed by the monitoring means, reading and writing of the data is continued using the mirror block.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2009015686A JP2010176201A (en) | 2009-01-27 | 2009-01-27 | Data loss prevention device for flash memory, and data loss prevention method for flash memory |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2009015686A JP2010176201A (en) | 2009-01-27 | 2009-01-27 | Data loss prevention device for flash memory, and data loss prevention method for flash memory |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2010176201A true JP2010176201A (en) | 2010-08-12 |
Family
ID=42707154
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2009015686A Pending JP2010176201A (en) | 2009-01-27 | 2009-01-27 | Data loss prevention device for flash memory, and data loss prevention method for flash memory |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2010176201A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2013130948A (en) * | 2011-12-20 | 2013-07-04 | Aisin Seiki Co Ltd | Method for writing data to flash memory |
JP2013130947A (en) * | 2011-12-20 | 2013-07-04 | Aisin Seiki Co Ltd | Method for writing data to flash memory |
WO2016001962A1 (en) * | 2014-06-30 | 2016-01-07 | 株式会社日立製作所 | Storage system and memory control method |
-
2009
- 2009-01-27 JP JP2009015686A patent/JP2010176201A/en active Pending
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2013130948A (en) * | 2011-12-20 | 2013-07-04 | Aisin Seiki Co Ltd | Method for writing data to flash memory |
JP2013130947A (en) * | 2011-12-20 | 2013-07-04 | Aisin Seiki Co Ltd | Method for writing data to flash memory |
WO2016001962A1 (en) * | 2014-06-30 | 2016-01-07 | 株式会社日立製作所 | Storage system and memory control method |
JPWO2016001962A1 (en) * | 2014-06-30 | 2017-04-27 | 株式会社日立製作所 | Storage system and storage control method |
US10061667B2 (en) | 2014-06-30 | 2018-08-28 | Hitachi, Ltd. | Storage system for a memory control method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4696171B2 (en) | Storage device, data storage method, and data storage program | |
JP6064608B2 (en) | Storage device, backup program, and backup method | |
JP3458804B2 (en) | Information recording apparatus and control method thereof | |
CN111158599B (en) | Method, device and equipment for writing data and storage medium | |
JP2014120179A (en) | Salvaging event trace information in power loss interruption scenarios | |
JP2012128643A (en) | Memory system | |
JP2004021811A5 (en) | ||
JP4712102B2 (en) | Storage device, data processing method, and data processing program | |
KR101548452B1 (en) | Method and apparatus for recovering metadata in electronic device based on non-volatile memeory | |
JP5040331B2 (en) | Storage device, storage device control method, and storage device control program | |
JP2010176201A (en) | Data loss prevention device for flash memory, and data loss prevention method for flash memory | |
JP4483876B2 (en) | Storage device control method in duplex system | |
JP5486193B2 (en) | Flash memory operation protection device and flash memory operation protection method | |
JP2007328438A (en) | Information processing apparatus and data backup and recovery method thereof | |
JP2007058873A (en) | Device control device using nonvolatile memory | |
CN103389943A (en) | Control device, storage device, and storage control method | |
JP6907976B2 (en) | Controller and data storage method | |
JP2010198314A (en) | Information management device | |
JP2003122644A (en) | Computer and its storage device | |
JP7568572B2 (en) | Surveillance equipment | |
KR101545077B1 (en) | Method and apparatus for recovering metadata in electronic device based on non-volatile memeory | |
JP6241373B2 (en) | Storage device, flash memory control device, and program | |
JP2019160080A (en) | Controller and abnormality detection method | |
JP6914430B2 (en) | Memory diagnostic device and memory diagnostic method | |
JPH10161942A (en) | Method, device for storing information, and information processor |