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 PDF

Info

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
Application number
JP2009015686A
Other languages
Japanese (ja)
Inventor
Keita Yoshikawa
啓太 吉川
Takeshi Kondo
毅 近藤
Akio Sakai
明夫 酒井
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.)
Tokai Rika Co Ltd
Original Assignee
Tokai Rika Co Ltd
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 Tokai Rika Co Ltd filed Critical Tokai Rika Co Ltd
Priority to JP2009015686A priority Critical patent/JP2010176201A/en
Publication of JP2010176201A publication Critical patent/JP2010176201A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a data loss prevention device for a flash memory and a data loss prevention method for the flash memory, preventing the occurrence of data loss in the flash memory. <P>SOLUTION: One of a pair of blocks of the flash memory 6 is used as a rotation block for use in normal data writing, and the other is used as a mirror block for writing the same data as the rotation block. When an write error occurs in the rotation block in use, subsequent data read/write is carried out in the mirror block to continue data read/write after the occurrence of the write error. During initialization after a power supply is turned on again, a data group written into the mirror block is copied to the rotation block, and a mirror is reconstructed. <P>COPYRIGHT: (C)2010,JPO&INPIT

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 flash memory 81 is constructed by an aggregate of a plurality of blocks 82 to 85 (four in FIG. 7 from A to D) as a data writing destination, and data can be erased for each block unit. These blocks 82 to 85 are also referred to as erase blocks because they are data erasure units. Data reading / writing with respect to the flash memory 81 is managed by a driver 87 that operates according to a command from the application 86.

ところで、フラッシュメモリ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 flash memory 81, have an overwrite function capable of sequentially writing data on the same address, so that data has already been written. Even if a data write command is issued to this address, data can be sequentially written to this address. However, the above-described flash memory 81 has a characteristic that, when new data is written to an address where data has been written, this operation cannot be executed unless the entire block is erased once. There is.

よって、この種のフラッシュメモリ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 flash memory 81, when data is written, the blocks 82 to 85 of A to D are rotated and used as shown in FIGS. At this time, when new data is first written to the flash memory 81, the driver 87 sequentially writes data in the empty area of the used block (A block 82 in FIG. 8) as shown in FIG. Then, when there is no free space in the A block 82, as shown in FIG. 9, the latest value in each data (ID1 to ID3 in FIG. 9) is copied to the next used block B block 83, and this B block 83 is used as a new data writing destination, and data writing is performed by sequentially repeating this operation each time there is no empty area in the used block. In addition, data is erased from a used block whose free area has run out before the next rotation.

特開2008−243347号公報JP 2008-243347 A

ところで、種々の要因によって、図10に示すようにドライバ87に使用ブロックへの書き込みエラーが発生すると、それ以降においてドライバ87は使用ブロックにデータ書き込みを実行することができなくなる。これにより、仮にドライバ87はアプリケーション86から新規データを受け付けても、この新規データをフラッシュメモリ81に書き込む動作をとることができず、結果としてこれがデータ消失という問題に繋がっていた。また、このデータ消失という問題は、使用ブロックに書き込んでおいたデータが、エラー動作したドライバ87によって消去されてしまうことも広義として含み、要はフラッシュメモリ81に対する正常なデータ保持が可能な新たな対策が要望されていた。   By the way, when a write error to the used block occurs in the driver 87 as shown in FIG. 10 due to various factors, the driver 87 cannot execute data writing to the used block thereafter. As a result, even if the driver 87 receives new data from the application 86, the driver 87 cannot perform an operation of writing the new data to the flash memory 81, resulting in a problem of data loss. In addition, the problem of data loss includes, in a broad sense, that the data written in the used block is erased by the driver 87 that has operated in error. In short, it is a new data that can normally hold data in the flash memory 81. A countermeasure was requested.

本発明の目的は、フラッシュメモリにおいてデータ消失を発生し難くすることができるフラッシュメモリのデータ消失防止装置及びフラッシュメモリのデータ消失防止方法を提供することにある。   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.

一実施形態における車内運転席の外観を示す斜視図。The perspective view which shows the external appearance of the driver's seat in a vehicle in one Embodiment. コンピュータのソフトウェア構成を含めた概略構成を示すブロック図。The block diagram which shows schematic structure including the software configuration of a computer. ブロックにデータが書き込まれるときの動作推移を示す説明図。Explanatory drawing which shows operation | movement transition when data are written in a block. ブロックからデータを読み取るときの具体例を示す説明図。Explanatory drawing which shows the specific example when reading data from a block. ブロックに書き込みエラーが発生したときの状態を示す説明図。Explanatory drawing which shows a state when the write error generate | occur | produced in the block. ミラーリングを再構築するときの動作推移を示す説明図。Explanatory drawing which shows operation | movement transition when rebuilding mirroring. 従来におけるコンピュータの概略構成を示すブロック図。The block diagram which shows schematic structure of the computer in the past. フラッシュメモリのブロックにデータを書き込むときの動作を示す説明図。Explanatory drawing which shows operation | movement when writing data in the block of flash memory. フラッシュメモリのブロックからデータを消去するときの動作を示す説明図。Explanatory drawing which shows operation | movement when erasing data from the block of flash memory. 書き込みエラーが発生したときの状態を示す説明図。Explanatory drawing which shows a state when a write error has occurred.

以下、本発明を具体化したフラッシュメモリのデータ消失防止装置及びフラッシュメモリのデータ消失防止方法の一実施形態を図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 angle detection device 3 that detects the steering angle of the steering wheel 2. The steering angle detection device 3 includes a steering angle sensor 4 as a sensor component (for example, a magnetic sensor) of the device 3 and a computer 5 as a control unit of the steering angle detection device 3. The computer 5 calculates the steering angle of the steering wheel 2 based on the sensor output value acquired from the steering angle sensor 4, and uses the calculated steering angle (calculated steering angle value) to other in-vehicle devices that need it. Output via a LAN (Local Area Network).

図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 flash memory 6 is a kind of nonvolatile memory capable of rewriting data in its own memory area. As described in the background art, the flash memory 6 is divided into a plurality of data erase units (in this example, A to F 6). Block) 7-12. That is, this type of flash memory 6 is a memory having a characteristic that data erasure can be executed only in block units, although data written in its own memory area can be rewritten. These blocks 7 to 12 have the same storage capacity by equally dividing the memory area of the flash memory 6. The A block 7, the C block 9 and the E block 11 constitute a block (rotation block).

本例のフラッシュメモリ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 flash memory 6 of this example, when data is written, three blocks A, C, and E, one of the blocks A to F that are skipped, are rotated and used as data write destinations. To do. Here, of these three rotation blocks 7, 9, and 11, if the first block to be used is, for example, A block 7, first, various data related to the steering angle detection device 3 are set using the A block 7 as a data write destination. Write. The data written in the A block 7 at this time includes, for example, the time (ID1 data) when the engine is started by operating the ignition switch (engine switch) of the vehicle 1 to the ignition on position (IG ON position). The time during which the ignition switch is on (ID data 2), the sensor output value of the steering angle sensor 4 (ID3 data), and the like.

ところで、フラッシュメモリ6にデータを書き込む際、フラッシュメモリ6の特性として、データ書き込み済みのアドレスにデータを上書きすることができない。このため、フラッシュメモリ6は、新規書き込みデータを受け付けた際、使用中のAブロック7において、その空き領域に受け付けデータを順次書き増ししていく動作をとる。そして、書込領域が一杯になると、使用ブロックを次使用ブロック(本例はCブロック9)に切り換え、ID1〜ID3の各データの最新値をCブロック9に書き込みつつ、データの書き込みをCブロック9で継続し、ブロックに空き領域が無くなる度にこの動作を繰り返すことにより、データ書き込みを実行する。なお、データ書き込みが一杯になったブロックは、次ローテーションが回ってくるまでの間に、データ書き込みやデータ読み取りを実行していない手の空いたときにデータ消去が実行される。   By the way, when data is written to the flash memory 6, the data cannot be overwritten on the data-written address as a characteristic of the flash memory 6. Therefore, when new write data is received, the flash memory 6 performs an operation of sequentially increasing the received data in the empty area in the A block 7 in use. When the writing area becomes full, the used block is switched to the next used block (C block 9 in this example), and the latest value of each data of ID1 to ID3 is written to the C block 9 while writing the data to the C block. The data write is executed by continuing this operation and repeating this operation every time there is no free area in the block. It should be noted that data erasure is executed for a block in which data writing is full, when there is no free time during which data writing or data reading is not performed, until the next rotation starts.

図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 application 13, which is dedicated software for operating the steering angle detection device 3, and an application 13 and an OS (Operating System). There are provided middleware 14 that functions in an intermediate position, and a driver 15 that is software for operating the flash memory 6. The application 13 operates the computer 5 by outputting an operation command to the driver 15 via the middleware 14 based on various information and data input to the application 13. In addition, when there are a plurality of drivers 15, the application 13 can collectively manage these drivers 15.

ドライバ15は、アプリケーション13からミドルウェア14を介して動作指令を受け付けると、この動作指令に従って動いて、フラッシュメモリ6(ブロック7〜12)へのデータ書き込み、データ読み取り、データ消去等の各種処理を実行する。このとき、ドライバ15は、アプリケーション13からの動作指令をトリガとして受け付け、アプリケーション13が他動作を実行していても、この動作指令に基づく動作をアプリケーション13の動作状態に依らず実行する。また、ドライバ15によるブロック7〜12のデータ消去は、前述したようにドライバ15がデータ書き込みやデータ読み取りを行っていないときの手の空いたときに実行される。   When the driver 15 receives an operation command from the application 13 via the middleware 14, the driver 15 operates according to the operation command and executes various processes such as data writing, data reading, and data erasing to the flash memory 6 (blocks 7 to 12). To do. At this time, the driver 15 receives an operation command from the application 13 as a trigger, and executes an operation based on this operation command regardless of the operation state of the application 13 even if the application 13 is executing another operation. Further, the data erasure of the blocks 7 to 12 by the driver 15 is executed when the driver 15 is free when the driver 15 is not performing data writing or data reading as described above.

また、本例の場合、ローテーションの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 blocks 8, 10, and 12 in this example, which are mirror blocks, are blocks in which the same data as the data written in the rotation blocks forming a set is written in the same address order. In this example, the B block 8 is a mirror block of the A block 7, the D block 10 is a mirror block of the C block 9, and the F block 12 is a mirror block of the E block 11. The B block 8, D block 10, and F block 12 form a block (mirror block).

ドライバ15には、フラッシュメモリ6に対してミラーリングを実行するミラーリング処理部16が設けられている。ミラーリング処理部16は、フラッシュメモリ6のメモリ領域を論理的に2分割することにより、同じ構成のローテーションブロックがフラッシュメモリ6内に2つ生成されるように機能する。即ち、ミラーリング処理部16は、複数のブロック7〜12を2つずつ組として設定し、これら各々の組において、一方のブロックを実際のデータ読み書きに用いるローテーションブロック(本例はブロック7,9,11)として使用し、他方のブロックをミラーリングに用いるミラーブロック(本例はブロック8,10,12)として使用する。なお、ミラーリング処理部16がミラーリング処理手段に相当する。   The driver 15 is provided with a mirroring processing unit 16 that performs mirroring on the flash memory 6. The mirroring processing unit 16 functions so that two rotation blocks having the same configuration are generated in the flash memory 6 by logically dividing the memory area of the flash memory 6 into two. That is, the mirroring processing unit 16 sets a plurality of blocks 7 to 12 as a set of two, and in each of these sets, a rotation block that uses one block for actual data reading / writing (in this example, blocks 7, 9, 11), and the other block is used as a mirror block (blocks 8, 10, and 12 in this example) used for mirroring. The mirroring processing unit 16 corresponds to a mirroring processing unit.

各ブロック7〜12の最後尾には、自ブロックのミラーリング状態がどのような状態にあるのかを書き表す管理領域Eが用意されている。この管理領域Eには、自ブロックのミラーリング状態がどのような状態にあるのかを通知する管理情報17が書き込まれている。管理情報17としては、例えばミラーリング状態が正常であることをドライバ15に通知するミラー状態正常通知や、ミラーリング状態が異常であることをドライバ15に通知するミラー状態異常通知等がある。   At the end of each of the blocks 7 to 12, a management area E that describes what the mirroring state of the block is is prepared. In this management area E, management information 17 for notifying what state the mirroring state of the own block is in is written. The management information 17 includes, for example, a mirror state normal notification that notifies the driver 15 that the mirroring state is normal, and a mirror state abnormality notification that notifies the driver 15 that the mirroring state is abnormal.

また、ドライバ15には、使用ローテーションブロックに対してデータ消失の有無を確認するデータ消失有無確認部18が設けられている。本例のデータ消失有無確認部18は、ドライバ15が使用ローテーションブロックにデータ書き込みを実行している際、このデータ書き込みが正常に実行できているか否かを確認することにより、使用中のローテーションブロックに対する書き込みエラーの有無を確認し、例えば書き込み先のアドレスを見失うなどした際には、書き込みエラーが発生したと認識する。データ消失有無確認部18は、書き込みエラーを確認した際、管理情報17をそれまでのミラー状態正常通知からミラー状態異常通知に更新する。なお、データ消失有無確認部18が監視手段に相当する。   Further, the driver 15 is provided with a data loss presence / absence confirmation unit 18 for confirming whether or not there is data loss with respect to the used rotation block. The data loss presence / absence confirmation unit 18 of the present example confirms whether or not the data writing can be normally executed when the driver 15 is executing data writing to the rotation block being used, thereby checking the rotation block being used. For example, when a write destination address is lost, it is recognized that a write error has occurred. When confirming a write error, the data loss presence / absence confirmation unit 18 updates the management information 17 from the previous mirror state normal notification to the mirror state abnormal notification. In addition, the data loss presence / absence confirmation unit 18 corresponds to a monitoring unit.

ドライバ15には、データ消失有無確認部18がローテーションブロックで書き込みエラーを検出した際、そのエラー検出以降のデータ書き込みや読み込みを、組をなすミラーブロックにおいて実行するデータ処理継続部19が設けられている。例えば、データ処理継続部19は、Aブロック7でデータ書き込みを実行している際に、このAブロック7で書き込みエラーが発生したことを確認すると、Aブロック7のミラーブロックであるBブロック8で続きのデータ書き込みやデータ読み取りを実行する。なお、データ処理継続部19が保護実行手段、データ処理継続手段を構成する。   The driver 15 is provided with a data processing continuation unit 19 that executes data writing and reading after the error detection in the mirror block forming a pair when the data loss presence / absence confirmation unit 18 detects a writing error in the rotation block. Yes. For example, when the data processing continuation unit 19 performs data writing in the A block 7 and confirms that a writing error has occurred in the A block 7, the data processing continuation unit 19 uses the B block 8 that is a mirror block of the A block 7. Continue to write or read data. The data processing continuation unit 19 constitutes a protection execution unit and a data processing continuation unit.

また、ドライバ15には、使用中のローテーションブロックに書き込みエラーが発生した際、これと対応するミラーブロックで保持したデータ群を使用して、ミラーリングを再構築するミラー再構築部20が設けられている。本例のミラー再構築部20は、例えばコンピュータ5の電源投入時等の管理情報17の読み取りタイミングにおいて管理情報17を確認しにいき、管理情報17からミラー状態異常を受け付けると、ミラーブロックに書き込んでおいたデータ群を、それと組をなすローテーションブロックにコピーすることにより、ミラーリングを再構築する。なお、ミラー再構築部20が保護実行手段、ミラー再構築手段を構成する。   Further, the driver 15 is provided with a mirror reconstruction unit 20 for reconstructing mirroring using a data group held in a mirror block corresponding to a write error in a rotation block in use. Yes. The mirror rebuilding unit 20 of this example checks the management information 17 at the read timing of the management information 17 such as when the computer 5 is turned on, and writes a mirror state abnormality into the mirror block when receiving a mirror status abnormality from the management information 17. The mirroring is reconstructed by copying the data group stored in step 4 to the rotation block that is paired with it. The mirror reconstruction unit 20 constitutes a protection execution unit and a mirror reconstruction unit.

次に、本例のコンピュータ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 driver 15 receives a data write command from the application 13 and newly writes data to the flash memory 6, as shown in FIG. Data is written in order. In the following description, the data that the driver 15 sequentially writes in the A block 7 (that is, various data of ID1 to ID3) is described as the first data D1, the second data D2,. .

このとき、ミラーリング処理部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 B block 8 which is the mirror block of the A block 7 from the same address from the top. The data is written in order, and this A block 7 is mirrored by the B block 8. At this time, when the mirroring processing unit 16 confirms that the same first data D1 as that in the A block 7 can be normally written in the B block 8, the mirroring unit 16 recognizes that the mirror state is normal, and is provided at the end of the A block 7. The mirror state normal notification is recorded as the management information 17 and is also mirrored, and the same mirror state normal notification is recorded at the end of the B block 8. Then, when the driver 15 takes the operation of writing the second data D2, the third data D3, the fourth data D4,... In the A block 7 in order, the mirroring processing unit 16 sends the same data to the B block 8 in the same address order. Write sequentially.

このデータ書き込み時、ドライバ15がアプリケーション13からデータ読み取り指令を受け付けると、ドライバ15はこの指令に従ってフラッシュメモリ6からのデータ読み取りを実行する。このとき、フラッシュメモリ6のデータ読み取りは、図4に示すように、ローテーションブロックであるAブロック7のみから実行する。これにより、データ読み取りは、Aブロック7及びBブロック8の両方からデータを読む動作はとらないので、データ読み込みの処理時間が短く済む。   When the driver 15 receives a data read command from the application 13 during the data writing, the driver 15 reads data from the flash memory 6 according to the command. At this time, data reading of the flash memory 6 is executed only from the A block 7 which is a rotation block, as shown in FIG. As a result, the data read operation does not take the operation of reading data from both the A block 7 and the B block 8, so that the data read processing time can be shortened.

ところで、図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 A block 7, the driver 15 may accept write data from the application 13. This cannot be written into the A block 7, and a write error occurs. After such a writing error occurs, data writing cannot be continued in the A block 7 that is a rotation block, which may lead to data loss as a result.

しかし、本例の場合は、書き込みエラーの発生有無がデータ消失有無確認部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 driver 15 enters the writing operation to the A block 7, for example, a writing error has occurred in the rotation block. Recognize. At this time, when confirming a write error, the data loss presence / absence confirmation unit 18 updates the management information 17 from the previous mirror state normal notification to the mirror state abnormal notification. Since the entire blocks 7 to 12 can be erased only in a lump, the mirror state abnormality notification is added to the empty area of the management area E and added to the mirror block.

また、データ処理継続部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 processing continuation unit 19 detects a write error in the data loss presence / absence confirmation unit 18, data reading / writing is continued in the B block 8 that is a mirror block of the A block 7 instead of the A block 7 thereafter. . Thereafter, the A block 7 is left to be removed from the data read / write rotation, and the B block 8 is used as the rotation block. That is, when the writing in the B block 8 is full, the blocks are used in the order of the B block 8 → D block 10 → F block 12, and when the F block 12 runs out of free space, the write destination becomes B Returning to block 8, the above operation is repeated.

ここで、コンピュータ5の電源がオフされた後に電源が再投入されると、ミラー再構築部20は、破壊されたミラーを再構築すべく、ミラーブロックの最後尾に書き込まれた管理情報17を確認しにいく。なお、このように電源再投入後の初期化時にミラー再構築を実行するのは、この初期化の際にブロック末尾の管理情報17を確認しにいく動作をドライバ15がとるためである。ミラー再構築部20は、この管理情報17の確認の際、ミラー状態正常通知を読み取ると、ミラーリングは破壊されていないと認識し、ミラー再構築の動作は実行しない。   Here, when the power is turned on again after the computer 5 is turned off, the mirror rebuilding unit 20 stores the management information 17 written at the end of the mirror block in order to rebuild the broken mirror. I'll go check. The reason why the mirror reconstruction is executed at the initialization after the power is turned back on is that the driver 15 takes an operation to check the management information 17 at the end of the block at the initialization. When the mirror reconstruction unit 20 confirms the management information 17 and reads the mirror state normality notification, the mirror reconstruction unit 20 recognizes that the mirroring is not broken and does not execute the mirror reconstruction operation.

一方、ミラー再構築部20は、管理情報17の確認の際、ミラー状態異常通知を読み取ると、ミラーリングが破壊されていると認識し、図6に示す手順に沿って、破壊されたミラーの再構築に入る。このとき、フラッシュメモリ6はブロック単位でしかデータ消去できないので、まずミラー再構築部20はAブロック7を消去する。Aブロック7の消去後、ミラー再構築部20はBブロック8に保持してあるデータ内容を、そのまま全てAブロック7に書き込み、即ちコピーする。即ち、ミラー再構築部20は、ミラーブロックに書き込まれているデータ群を、アドレスが先のものから順番にローテーションブロックにコピーしていく動作を実行する。   On the other hand, when the mirror reconstruction unit 20 confirms the management information 17 and reads the mirror state abnormality notification, the mirror reconstruction unit 20 recognizes that the mirroring has been broken, and reconstructs the broken mirror according to the procedure shown in FIG. Start building. At this time, since the flash memory 6 can erase data only in units of blocks, the mirror reconstruction unit 20 first erases the A block 7. After erasing the A block 7, the mirror reconstruction unit 20 writes all the data contents held in the B block 8 into the A block 7 as they are, that is, copies them. In other words, the mirror reconstruction unit 20 performs an operation of copying the data group written in the mirror block to the rotation block in order from the first address.

なお、このコピーは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 B block 8 to the A block 7, so that a new data write command may be received from the application 13 during the copying. At this time, the mirror reconstruction unit 20 temporarily interrupts the mirror reconstruction being performed at that time, and new data (the fifth in FIG. 6) is added to the vacant area in both the A block 7 and the B block 8. After the data D5) is written and written, the mirror reconstruction is continued. The mirror rebuilding unit 20 may receive a data read command from the application 13 at the time of mirror rebuilding. At this time, the mirror rebuilding is temporarily interrupted to cope with this.

そして、全てのデータのコピーが終了すると、ミラー再構築部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 mirror reconstruction unit 20 writes a mirror state normality notification to the management area E of both the A block 7 and the B block 8, and stores the management information 17 Update and record that the mirror status is normal. Thereby, after the power is turned on again, the A block 7, the C block 9, and the E block 11 are rotated as usual, and the reading and writing of data is executed. In addition, although the mirroring of A block 7 and B block 8 was demonstrated here, since operation of both mirroring of C block 9 and D block 10 and mirroring of E block 11 and F block 12 is the same, explanation is Omitted.

さて、本例においては、組をなす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 application 13 while the mirroring reconstruction is being executed, the mirroring is temporarily interrupted and a new data write is executed. Therefore, even if a new data write request is generated during mirroring reconstruction, it can be handled without any problem.

(4)フラッシュメモリ6からデータを読み取る際には、2つの対のブロックのうちローテーションブロックからのみデータ読み取りを実行する。このため、ローテーションブロックとミラーブロックとの両方からデータを読み取るという動作はとらないので、データ読み取りに時間を要さずに済む。   (4) When reading data from the flash memory 6, data is read only from the rotation block of the two pairs of blocks. For this reason, since the operation of reading data from both the rotation block and the mirror block is not performed, it does not take time to read the data.

(5)ブロック7〜12の最後尾に、ミラー状態を通知する管理情報17を書き込み、この管理情報17を確認することにより、ミラーリングが正常か否かを判断する。このため、ミラー状態が正常か否かの確認を、管理情報17を見るという簡素な方式により実行することができる。   (5) The management information 17 for notifying the mirror state is written at the end of the blocks 7 to 12, and the management information 17 is checked to determine whether the mirroring is normal. Therefore, confirmation of whether the mirror state is normal can be executed by a simple method of viewing the management information 17.

なお、実施形態はこれまでに述べた構成に限らず、以下の態様に変更してもよい。
・ データ消失の対応は、必ずしも書き込みエラーが発生した際にミラーブロックでデータ書き込みの継続を行い、初期化時においてミラーを再構築する方式をとることに限定されない。例えば、ドライバ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 driver 15 detects data loss in the used block, the erased data may be recovered by copying the data previously held in the mirror block to the used block.

・ アクセス異常の検出対象は、必ずしも書き込みエラーであることに限定されない。例えば、ドライバ15がフラッシュメモリ6に対するアクセス先を見失っているか否かを見ることや、フラッシュメモリ6(ブロック7〜9)が空になっていることや、フラッシュメモリ6に書き込まれているデータそのものが化けてしまっていることを確認するものでもよい。   -The target of detecting an access error is not necessarily limited to a write error. For example, the driver 15 sees whether or not the access destination for the flash memory 6 has been lost, the flash memory 6 (blocks 7 to 9) is empty, and the data written in the flash memory 6 itself. It may be a thing to confirm that has become garbled.

・ 管理領域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 management information 17 is read, the execution time is not particularly limited.

・ フラッシュメモリ6に書き込まれるデータは、ID1〜ID3で示すイグニッションオン開始時刻、イグニッションオン実行時間、ステアリングアングルセンサのセンサ値に限定されず、操舵角検出装置3の動作時にやり取りされるデータであれば、どのようなものでもよい。   The data written to the flash memory 6 is not limited to the ignition on start time, the ignition on execution time, and the sensor value of the steering angle sensor indicated by ID1 to ID3, and may be data exchanged during operation of the steering angle detection device 3. Anything can be used.

・ ミドルウェア14は、必ずしも必要ではなく、これを省略してもよい。
・ フラッシュメモリ6のブロック数は、A〜Fの計6つに限定されず、これ以外の数をとるものでもよい。
The middleware 14 is not always necessary and may be omitted.
The number of blocks of the flash memory 6 is not limited to a total of 6 from A to F, and may take other numbers.

・ データ書き込みの最先使用ブロックは、必ずしもAブロック7に限定されず、Cブロック9やEブロック11でもよい。
・ アクセス保護の機能を持つ本例のコンピュータ5は、必ずしも操舵角検出装置3に搭載されることに限らず、メモリとしてフラッシュメモリ6を持つコンピュータ5を備えたものであれば、特に限定されるものではない。
The first use block for data writing is not necessarily limited to the A block 7, and may be the C block 9 or the E block 11.
The computer 5 of this example having an access protection function is not limited to being mounted on the steering angle detection device 3 and is particularly limited as long as it includes the computer 5 having the flash memory 6 as a memory. It is not a thing.

次に、上記実施形態及び別例から把握できる技術的思想について、それらの効果とともに以下に追記する。
(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 the mirror rebuilding unit receives a new data write command from the application during the rebuilding of the mirroring, the mirror rebuilding unit temporarily interrupts the rebuilding and writes the data to the free memory area. 3. The flash memory data loss prevention apparatus according to claim 2, wherein data writing during mirroring reconstruction is possible. データ書き換え可能な不揮発性メモリとしてフラッシュメモリを使用し、アプリケーションからの書き込み指令によりドライバが前記フラッシュメモリにデータ書き込みを行う際、当該フラッシュメモリのメモリ領域を構築しつつデータ消去単位となっている複数のブロックを、順番にローテーションして使用しながらデータの読み書きを実行するフラッシュメモリのデータ消失防止方法において、
組として設定した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.
JP2009015686A 2009-01-27 2009-01-27 Data loss prevention device for flash memory, and data loss prevention method for flash memory Pending JP2010176201A (en)

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)

* Cited by examiner, † Cited by third party
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

Cited By (5)

* Cited by examiner, † Cited by third party
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
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
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
KR101548452B1 (en) Method and apparatus for recovering metadata in electronic device based on non-volatile memeory
JP4483876B2 (en) Storage device control method in duplex system
JPH08115257A (en) Magnetic disk controller
JP2007328438A (en) Information processor, its data backup, and restoration method
JP5486193B2 (en) Flash memory operation protection device and flash memory operation protection method
JP2007058873A (en) Device control device using nonvolatile memory
JP6907976B2 (en) Controller and data storage method
JP2010198314A (en) Information management device
JP2003122644A (en) Computer and its storage device
KR101545077B1 (en) Method and apparatus for recovering metadata in electronic device based on non-volatile memeory
JP2019160080A (en) Controller and abnormality detection method
JP6241373B2 (en) Storage device, flash memory control device, and program
JP6914430B2 (en) Memory diagnostic device and memory diagnostic method
JP7219813B2 (en) Arithmetic processing device, vehicle control device and update method
JP2011025781A (en) Controller for vehicle
JP7074291B2 (en) Information processing equipment, information processing methods and programs