JP5332800B2 - Storage device - Google Patents
Storage device Download PDFInfo
- Publication number
- JP5332800B2 JP5332800B2 JP2009077136A JP2009077136A JP5332800B2 JP 5332800 B2 JP5332800 B2 JP 5332800B2 JP 2009077136 A JP2009077136 A JP 2009077136A JP 2009077136 A JP2009077136 A JP 2009077136A JP 5332800 B2 JP5332800 B2 JP 5332800B2
- Authority
- JP
- Japan
- Prior art keywords
- data
- block
- cpu
- application software
- 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.)
- Active
Links
Images
Landscapes
- Read Only Memory (AREA)
Description
本発明は、フラッシュメモリを備えた記憶装置に関するものである。 The present invention relates to a memory device having a flash memory.
データを一括消去する単位となるブロックを複数有するとともに、各ブロックが、データ書き込み/読み出し領域であるレコード(ページとも言う)を複数含むフラッシュメモリへのデータ書き込み方法として、例えば特許文献1に示される方法が知られている。
For example,
このデータ書き込み方法では、書き込み処理対象である書き込み対象ブロックにおいて、空き(データ未記憶)のレコードが残っている場合、新しいデータを、書き込み済みのレコードの次のアドレスの未記憶レコードから順に追記する。また、全てのレコードにデータが記憶されると、有効なレコードのデータのみをRAMに一時保存し、上記書き込み対象ブロックの全データを消去する。そして、データを消去して空き状態となった書き込み対象ブロックに対し、RAMに一時保存した有効データを先頭のレコードから再書込みし、再書込みされたレコードの次のアドレスの未記憶レコードから順に、新たなデータを追記するようにしている。 In this data writing method, when there is an empty (data not stored) record in the writing target block that is the target of the writing process, new data is added in order from the unstored record at the address next to the written record. . When data is stored in all records, only valid record data is temporarily stored in the RAM, and all data in the write target block is erased. Then, for the write target block that has been emptied by erasing the data, the valid data temporarily stored in the RAM is rewritten from the first record, and in order from the unrecorded record at the next address of the rewritten record, New data is added.
一方、別のデータ書き込み方法として、書き込み対象ブロックにおいて、全てのレコードにデータが記憶されると、有効なレコードのデータのみを、上記ブロックとは別の空き状態にある空きブロックにコピーする方法も考えられる。この場合、データをコピーしたブロックを新たな書き込み対象ブロックとし、このブロックにおいて、データがコピーされたレコードの次のアドレスの未記憶レコードから順に、新たなデータを追記するようにするとともに、コピー元のブロックの全データを消去して空きブロックとし、次のデータ移行に備えることとなる。 On the other hand, as another data writing method, when data is stored in all records in the writing target block, only valid record data is copied to a free block in a free state different from the above block. Conceivable. In this case, the block to which the data is copied is set as a new write target block, and in this block, new data is added in order from the unrecorded record at the address next to the record to which the data is copied, and the copy source All the data in this block is erased to become an empty block, and is prepared for the next data migration.
しかしながら、上記したいずれの方法においても、書き込み対象ブロックにおいて全レコードにデータが書き込まれた状態となった時点で、有効なレコードのデータを、RAMや別のブロックなど、書き込み対象のブロックとは別の記憶領域にコピーするとともに、元のブロックの全データを消去して空きブロックを生成する。したがって、例えばデータ書き込みの途中で、書き込み対象ブロックの全レコードが書き込み状態(空きレコードのない状態)となると、データの書き込み途中にも係わらず、データの消去動作が発生してしまい、これにより、書き込み動作が中断して、結果、書き込み時間が長くなってしまう。 However, in any of the above-described methods, when data is written in all records in the write target block, the data of the valid record is separated from the write target block such as RAM or another block. And erasing all data in the original block to generate a free block. Therefore, for example, when all the records in the writing target block are in a writing state (a state where there is no empty record) in the middle of data writing, an erasing operation of the data occurs regardless of the data writing in progress. The write operation is interrupted, resulting in a long write time.
また、アプリケーション(電子機器の制御処理を司る制御用ソフトウェア)側では、どのタイミングで、データのコピー及び元ブロックデータの消去がなされるか分からないため、想定外のタイミングでデータのコピー及び元ブロックデータの消去が生じると、アプリケーションの実行に基づく所定処理を実行できない恐れもある。 In addition, since the application (control software for controlling the electronic device) does not know when the data is copied and the original block data is erased, the data can be copied and the original block at an unexpected timing. If the data is erased, there is a possibility that a predetermined process based on the execution of the application cannot be executed.
本発明は上記問題点に鑑み、データコピー及び元ブロックデータ消去に伴うデータ書き込み時間の遅延を抑制できる記憶装置を提供することを目的とする。 In view of the above problems, and an object thereof is to provide a storage peripherals that can suppress a delay in data writing time associated with data copy and the original block data erase.
上記目的を達成する為に請求項1に記載の発明は、CPUと、記憶領域が複数のブロックに分割され、ブロック単位でデータ消去が可能であり、ブロックが複数のレコードを含み、レコード単位でデータ書き込みが可能なフラッシュメモリと、CPUが実行するプログラムとしてROMに格納された、フラッシュメモリに対してCPUが実行するプログラムであるドライバソフト、及び、電子機器の制御処理を司るプログラムであるアプリケーションソフトと、を備え、アプリケーションソフト側の指示に基づき、CPUは、ドライバソフトを実行することで、アプリケーションソフトのデータを、アプリケーションソフトに対応するブロックの未記憶レコードに書き込む処理を実行し、CPUは、ドライバソフトを実行することで、データ書き込みとは異なるタイミングで、ブロックにおけるデータ書き込み状態を検出し、CPUは、ドライバソフトを実行することで、検出した書き込み状態が、予め設定された所定の書き込み状態に対応するデータ移行条件と合致する場合、該当するブロックのレコードのうち、有効なレコードのデータのみを、ブロックとは別の記憶媒体に移行するタイミングである旨の通知をアプリケーションソフト側に行い、CPUは、アプリケーションソフトを実行することで、通知を受け、且つ、対応するアプリケーションソフトの移行条件と合致すると、データの移行を前記ドライバソフト側に許可し、CPUは、ドライバソフトを実行することで、許可を受けて、ブロックのレコードのうち、有効なレコードのデータのみを、記憶媒体にコピーするとともに、データコピー元のブロックのデータを消去することを特徴とする。 In order to achieve the above object, according to the first aspect of the present invention, the CPU and the storage area are divided into a plurality of blocks, the data can be erased in units of blocks, the blocks include a plurality of records, Flash memory capable of writing data , driver software stored in ROM as a program executed by the CPU, which is a program executed by the CPU with respect to the flash memory, and application software which is a program for controlling electronic devices The CPU executes the driver software on the basis of the instruction on the application software side to execute the process of writing the data of the application software in the unstored record of the block corresponding to the application software. By running the driver software, data The data writing state in the block is detected at a timing different from the writing, and the CPU executes the driver software so that the detected writing state matches the data migration condition corresponding to the predetermined writing state set in advance. In such a case, the application software is notified that it is time to transfer only valid record data of the corresponding block records to a storage medium different from the block, and the CPU executes the application software. When the notification is received and the migration condition of the corresponding application software is met, the data migration is permitted to the driver software side, and the CPU receives the permission by executing the driver software and records the block. Copy only valid record data to the storage medium. Together, characterized by erasing the data of the data copy source block.
本発明では、書き込みとは異なるタイミングで、ブロックにおけるデータ書き込み状態を検出し、検出した書き込み状態がデータ移行条件と合致すると、合致したブロックに対応するアプリケーションソフト側に、別の記憶媒体に移行するタイミングである旨を通知する。これにより、アプリケーションソフト側が、データ移行が必要なタイミングを、書き込みとは異なるタイミング、すなわち書き込み前に事前に把握することができる。 In the present invention, the data writing state in the block is detected at a timing different from the writing, and when the detected writing state matches the data migration condition, the application software corresponding to the matched block is transferred to another storage medium. Notify that it is timing. As a result, the application software side can grasp in advance the timing at which data migration is necessary at a timing different from writing, that is, before writing.
また、通知を受け、且つ、アプリケーションソフトの移行条件を満たすと、アプリケーションソフト側はデータ移行の指示(データ移行要求)を出す。そして、この要求に基づき、該当するブロックのうち、有効なレコードのデータのみを、ブロックとは別の記憶媒体にコピーするとともに、データコピー元のブロックのデータを消去する処理が実施される。このように、アプリケーションソフトごとの移行条件を満たすタイミングで、データ移行処理を実施することができる。すなわち、データ移行処理を行うタイミングを、アプリケーションソフト側にて設定することができる。 When the notification is received and the application software migration condition is satisfied, the application software issues a data migration instruction (data migration request). Based on this request, a process of copying only valid record data of the corresponding block to a storage medium different from the block and erasing the data of the data copy source block is performed. In this way, the data migration process can be performed at a timing that satisfies the migration condition for each application software . That is, the timing for performing data migration processing, it is possible to manually set in the application software side.
以上から、本発明によれば、書き込み動作の途中で、データ移行処理が実行されるのを抑制することができる。すなわち、データ移行処理に伴うデータ書き込み時間の遅延を抑制することができる。また、意図しない書き込み時間の遅延を回避することができる。本発明は、特に書き込み時間の制約が厳しいアプリケーションソフトのデータの書き込みに有効である。 As described above, according to the present invention, it is possible to suppress the data migration process from being executed during the writing operation. That is, it is possible to suppress a delay in data writing time associated with the data migration process. Further, an unintended write time delay can be avoided. The present invention is particularly effective for writing data of application software with severe restrictions on write time.
請求項2に記載のように、記憶媒体とは、データコピー元のブロックとは別の空きブロックであり、CPUは、ドライバソフトを実行することで、有効なレコードのデータがコピーされたコピー先のブロックを、アプリケーションソフトに対応するデータ書き込み用のブロックとして、該ブロックの未記憶レコードに、新たなデータを追記しても良い。
As described in
本発明では、データ書き込み用のブロックと、コピー用の少なくとも1つの空きブロックとを備えており、データ移行処理すると、コピー先のブロックを、アプリケーションソフトに対応するデータ書き込み用のブロックとするとともに、コピー元のデータ消去したブロックをコピー用の空きブロックとする。そして、データの書き込み時には、コピー先のブロック、すなわち新たなデータ書き込み用のブロックに対し、未記憶レコードに、新たなデータを追記するので、書き込み時間の遅延を抑制することができる。 In the present invention, it is provided with a data writing block and at least one free block for copying, and when data migration processing is performed, the copy destination block is made a data writing block corresponding to the application software , A block from which data at the copy source has been erased is designated as a free block for copying. When data is written, new data is added to an unstored record with respect to a copy destination block, that is, a new data write block, so that a delay in write time can be suppressed.
また、データコピー元のブロックとは別の空きブロックに有効なレコードのデータをコピーするので、瞬断(電源が瞬間的に落ちる)などが生じても、コピーしたデータを保持することができる。また、スペース的に大容量のRAMを確保できない場合であっても、書き込み時間の遅延を抑制することができる。特に、民生に比べてスペース上の制約が厳しく、使用条件も過酷である車載用途に好適である。 In addition, since valid record data is copied to an empty block different from the data copy source block, the copied data can be retained even if an instantaneous interruption (power supply momentarily drops) or the like occurs. Even when a large-capacity RAM cannot be secured in terms of space, a delay in writing time can be suppressed. In particular, it is suitable for in-vehicle applications in which space restrictions are stricter than those of consumer and the use conditions are severe.
一方、請求項3に記載のように、記憶媒体としてのRAMを備え、CPUは、ドライバソフトを実行することで、データを消去したブロックに対し、複数のレコードの先頭から、RAMに保存した有効なレコードのデータを順に再書き込みするとともに、有効なレコードのデータが再書込みされたブロックの未記憶レコードに、新たなデータを追記しても良い。これによれば、有効なレコードのデータをRAMに一時保存するので、請求項2に記載の発明のように空きブロックを必要としない。 Meanwhile storage, as described in claim 3, comprising a RAM of the storage medium, CPU by executing the driver software, to block erasing the data, from the head of the plurality of records, in the RAM thereby sequentially rewriting the data valid records, data valid records in the unstored record rewriting blocks, may add new data. According to this, since valid record data is temporarily stored in the RAM, an empty block is not required as in the second aspect of the present invention.
以下、本発明の実施の形態を、図面を参照して説明する。
(第1実施形態)
図1は、第1実施形態に係る記憶装置を適用した電子制御装置の概略構成を示すブロック図である。図2は、フラッシュメモリの概略構成を示す図である。
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
(First embodiment)
FIG. 1 is a block diagram illustrating a schematic configuration of an electronic control device to which the storage device according to the first embodiment is applied. FIG. 2 is a diagram showing a schematic configuration of the flash memory.
図1に示すように、ECU10は、CPU(Central Processing Unit)11からなる主制御部を有し、車両に搭載される電子機器の制御処理を該主制御部による予め定められたアプリケーションソフトの実行に基づいて実施するものであり、CPU11、ROM12、RAM13、フラッシュメモリ14、及び入出力部(I/Oポート)15がバス接続されたマイクロプロセッサからなる。本実施形態では、ECU10が、自動車のボデー系の制御を司るボデー系ECUとして構成されている。また、本実施形態では、CPU11が、フラッシュメモリ14のアクセスの制御を行うコントローラの機能も有している。
As shown in FIG. 1, the
ROM12には、例えば起動時にCPU11が実行する各種プログラムが格納されており、これらプログラムとして、フラッシュメモリ14のドライバソフト20と、上記したアプリケーションソフト21を含んでいる。
The
フラッシュドライバソフト20(以下、単にドライバソフト20と示す)は、フラッシュメモリ14に対してCPU11が実行するプログラムである。一方、アプリケーションソフト21は、車両利用者による車両各部の操作に係る機能であるボデー系機能を実現するプログラムである。ここで、ボデー系機能とは、例えばドア開閉に伴う制御、窓開閉に伴う制御、ライトスイッチのオン/オフに伴う制御、キーレスエントリ方式等に採用されるワイヤレスドアロック機構の制御、シート位置の制御などである。
Flash driver software 20 (hereinafter simply referred to as driver software 20) is a program executed by the
RAM13は、CPU11がROM12に格納された各プログラムにしたがって実行する各種演算のための作業領域として用いられ、プログラムごとに個別のワークエリアが確保されている。本実施形態では、一例として、RAM13が、上記ワークエリアとして、後述する物理アドレスと論理アドレスとの対応関係を示すアドレス変換テーブル(マッピングテーブル)を含んでいる。このように、アドレス変換テーブルはRAM13に格納されるため、電源投入時に、フラッシュメモリ14にアクセスし、アドレス変換テーブルの回復が行われる。
The
フラッシュメモリ14は、周知のように半導体による不揮発性の記憶素子であり、上記した各プログラムに対応する設定データを記憶する部位である。本実施形態では、CPU11が利用する各種のシステムデータなども記憶されている。このフラッシュメモリ14の記憶領域は、例えば図2に示すように、所定の固定長による複数のブロック(ブロック0〜ブロックn)を有している。フラッシュメモリ14では、周知のごとくデータの上書きができず、上記したブロックが、一括消去の単位となっている。また、ブロックごとに対応して物理アドレス0〜nが割り当てられている。本実施形態では、1つのブロックの容量が数kB程度となっている。
As is well known, the
また、各ブロックは、図2に示す(ブロック2で例示する)ようにして、複数のレコード(レコード0〜レコードm)を有している。各レコードは固定長であり、所定サイズのデータ部と冗長部よりなる。なお、データ部にはデータが格納され、冗長部には、ECCデータや各種の管理情報(論理アドレス情報)などが格納される。そして、このレコードが、フラッシュメモリ14における書き込み・読み出しの単位となっており、レコードにも、物理アドレス0〜mが割り当てられている。本実施形態では、1つのレコードの容量が数十B程度となっている。
Each block has a plurality of records (
このように、フラッシュメモリ14では、データの消去がブロック単位で行われ、データの書き込み・読み出しがレコード単位で行われるようになっており、データ消去単位とデータ書込単位のデータサイズが相互に異なっている。
As described above, in the
なお、上記したECU10のうち、CPU11、ROM12に格納されたフラッシュドライバソフト20、RAM13、及びフラッシュメモリ14が、特許請求の範囲に記載の記憶装置に相当する。
Of the
次に、データ移行処理及びデータ書き込み処理の概念について説明する。図3は、データ移行処理及びデータ書き込み処理の概念図であり、(a)は比較例、(b)は本実施形態を示している。図3(a)では、図3(b)に示す要素と関連する要素の符号に100を付加して示している。なお、図3(a),(b)のいずれの動作においても、CPU11が関与するが、図では省略している。
Next, the concept of data migration processing and data writing processing will be described. FIG. 3 is a conceptual diagram of data migration processing and data writing processing, where (a) shows a comparative example and (b) shows this embodiment. In FIG. 3A, 100 is added to the reference numerals of elements related to the elements shown in FIG. 3A and 3B, the
先ず、比較例(従来例)について説明する。図3(a)に示すように、所定のアプリケーションソフト121を実行時、ユーザが設定値を変更すると、CPUはドライバソフト120(フラッシュメモリ114)側に、変更された設定値のデータの書き込みを要求する。すると、CPUは、ドライバソフト120を実行し、フラッシュメモリ114のうち、上記アプリケーションソフト121に対応する所定の物理アドレスの書き込み対象ブロックに対し、データが記憶されていない未記憶レコードのうちの先頭から順にデータを書き込む処理を実行する。例えば、書き込み対象ブロックの全レコードが空き状態の場合、物理アドレスが先頭(0)のレコードから順にデータを書き込む。なお、レコードのデータ書き込み有無は、一例として、冗長部における書き込み状態確認領域(第1フラグ)により確認することができる。本実施形態では、データが書き込まれると上記第1フラグが「0」とされ、データが書き込まれていないと「1」とされる。
First, a comparative example (conventional example) will be described. As shown in FIG. 3A, when the user changes the setting value when executing the
ここで、データ書き込みの途中で、書き込み対象ブロックの全レコードが書き込み状態である、すなわち空きレコードのない状態であることを、ドライバソフト120を実行するCPUが、例えば上記第1フラグに基づき検出すると、CPUは、書き込み対象ブロックに記憶されたデータのうち、有効なレコードのデータのみを、アプリケーションソフト121に対応するデータ移行用の空きブロックにコピーする処理を実行する。また、書き込み対象ブロックの全データを消去して空きブロックを生成する処理を実行する。そして、元の書き込み対象ブロックの物理アドレスに対応する論理アドレスと、元のデータ移行用の空きブロックの物理アドレスに対応する論理アドレスとを、入れ替える処置を実行する。すなわち、元の書き込み対象ブロックを新たなデータ移行用の空きブロックとし、元の空きブロックを新たな書き込み対象ブロックとする。なお、データの有効・無効については、一例として、冗長部における有効性確認領域(第2フラグ)により確認することができる。本実施形態では、データが有効であると上記第2フラグが「1」とされ、データが無効であると「0」とされる。
Here, during the data writing, when the CPU executing the
データ移行処理が完了すると、ドライバソフト120を実行するCPUは、残りのデータを、新たな書き込み対象ブロックにおいて、データがコピーされたレコードの次のアドレスのレコード、すなわちデータが記憶されていない未記憶レコードのうちの先頭から順にデータを書き込む処理を実行する。そして、データの書き込みが完了すると、ドライバソフト120を実行するCPUは、アプリケーションソフト121側に、書き込みが完了した旨を通知する処理を実行する。
When the data migration processing is completed, the CPU that executes the
このように、従来では、書き込み対象ブロックの全レコードが書き込み状態(空きレコードのない状態)となると、データの書き込み途中にも係わらず、データの移行処理が発生するため、これにより、書き込み動作が中断して、結果、データの書き込み時間T1が長くなるという問題があった。 As described above, conventionally, when all the records in the write target block are in a write state (a state in which there is no empty record), a data migration process occurs regardless of the data being written. As a result, there is a problem that the data writing time T1 becomes longer.
また、アプリケーションソフト121側では、どのタイミングで、データの移行処理が生じるか分からないため、所定時間内に書き込み処理がなされないがために、アプリケーションソフト121の実行に基づく所定処理を実行できない恐れがあった。
Further, since the
これに対し、本実施形態では、図3(b)に示すように、アプリケーションソフト21が実行されない所定のタイミング(データの書き込みタイミングとは異なるタイミング)で、データ移行処理を実施する。すなわち、データ書き込み処理の前に、必要に応じて事前にデータ移行処理をする。これにより、データの書き込み途中で、書き込み対象ブロックの全レコードが書き込み状態となり、これに伴ってデータの移行処理が発生するのが抑制される。そして、データの書き込み時間T2を、上記した書き込み時間T1よりも短くすることができる。
On the other hand, in this embodiment, as shown in FIG. 3B, the data migration process is performed at a predetermined timing (a timing different from the data writing timing) when the
また、アプリケーションソフト21任意のタイミングで、データ移行処理を実施するため、意図しないタイミングで、アプリケーションソフト21の実行に基づく所定処理の実行がなされない、という不具合を解消することができる。
Further, since the data migration process is performed at an arbitrary timing of the
以下に、本実施形態に係るデータ移行処理の詳細について説明する。図4は、本実施形態に係るデータ移行処理を説明するフローチャートである。図5は、本実施形態に係るデータ移行処理を示す模式的な図であり、(a)はデータ移行処理前、(b)はデータ移行処理後を示している。 Details of the data migration processing according to this embodiment will be described below. FIG. 4 is a flowchart for explaining data migration processing according to this embodiment. FIG. 5 is a schematic diagram showing the data migration process according to the present embodiment, where (a) shows before the data migration process and (b) shows after the data migration process.
このデータ移行処理は、ECU10の電源が投入された状態で、フラッシュメモリ14へのデータの書き込みタイミング(及び読み出しタイミング)とは異なるタイミングで実行される。図4に示すように、先ず、書き込み対象ブロックの書き込み状態を検出する(ステップ10)。このステップ10は、特許請求の範囲に記載の第1ステップに相当する。具体的には、CPU11がドライバソフト20を実行し、データの書き込みタイミング(及び読み出しタイミング)とは異なるタイミングで、書き込み対象ブロックの書き込み状態を検出する。すなわち、ドライバソフト20を実行するCPU11が、書き込み状態検出手段に相当する。この書き込み状態の検出では、書き込み対象ブロックを構成する全レコードのうち、どのレコードまで書き込みがなされているか、全レコードのうちのどの程度が書き込み状態となっているか、全レコードのうち空きレコードがどの程度残っているのか、などを検出する。
This data migration processing is executed at a timing different from the timing of writing data (and reading timing) to the
書き込み状態の検出対象としては、各アプリケーションソフト21に対応する全ての書き込み対象ブロックでも良いし、所定のアプリケーションソフト21に対応する1つの書き込み対象ブロックでも良い。また検出タイミングとしては、アプリケーションソフト21がいずれも実行されていないタイミングであれば良い。例えばアプリケーションソフト21のデータ書き込み処理が完了した直後や、完了してから所定時間経過後に実施することができる。また、センサ等の信号を元に決定することもできる。
The detection target of the writing state may be all writing target blocks corresponding to each
書き込み状態の検出方法としては、特に限定されるものではない。例えば上記した第1フラグに基づき検出する方法や、書き込み状態にある最後のレコードの物理アドレスに対応する論理アドレスに基づいて検出する方法(所定物理アドレスのレコードにデータが書き込まれたらアラートをあげる)などを適用することができる。 The method for detecting the writing state is not particularly limited. For example, a detection method based on the first flag described above, or a detection method based on a logical address corresponding to the physical address of the last record in a write state (alert is given when data is written to a record at a predetermined physical address) Etc. can be applied.
そして、CPU11は、ドライバソフト20のプログラムに基づき、検出した書き込み状態が、データ移行条件と合致するか否かを判定する(ステップ11)。このデータ移行条件は、書き込み対象ブロックが、空きレコードを所定数残した状態に対応して、予め設定される。
Then, the
ここで、図5(a)に示す例では、所定のアプリケーションソフト21(例えばアプリケーションソフト2)に対応するブロックとして、書き込み対象ブロックであるブロック4と、データ移行用の空きブロックであるブロック5を有しており、各ブロックが7つのレコードをそれぞれ有している。そして、ブロック4において、5つ目のレコードにデータが書き込まれた状態がデータ移行条件となっている。すなわち、図5(a)に示す例では、書き込み対象ブロックであるブロック4の書き込み状態が、まさにデータ移行条件と合致した状態となっている。なお、図5(a)では、データの書き込まれた5つのレコードのうち、3つのレコードのデータ(a、ddd、xx)が有効、2つのレコードのデータ(b、abc)が無効となっている。 Here, in the example shown in FIG. 5A, as a block corresponding to predetermined application software 21 (for example, application software 2), a block 4 that is a write target block and a block 5 that is a free block for data migration are included. Each block has seven records. In block 4, the state in which data is written in the fifth record is the data migration condition. That is, in the example shown in FIG. 5A, the write state of the block 4 that is the write target block is exactly in a state that matches the data migration condition. In FIG. 5A, data (a, ddd, xx) of three records among the five records written with data is valid, and data (b, abc) of two records are invalid. Yes.
ステップ11にて、データ移行条件と合致しないと、書き込み対象ブロックの書き込み状態(空きレコード)に余裕があるものとされ、本タイミングでのデータ移行処理を終了する。一方、データ移行条件と合致すると、ドライバソフト20のプログラムに基づき、CPU11は、対応するアプリケーションソフト21側に、データ移行条件と合致している旨、換言すればデータ移行すべき旨を通知する。(ステップ12)。すなわち、ドライバソフト20を実行するCPU11が、通知手段に相当する。
If the data migration condition is not met in
通知方法としては、特に限定されるものではない。本実施形態では、一例として、ドライバソフト20のプログラムに基づき、CPU11が、上記判定結果をRAM13の所定領域(第3フラグ)に書き込む処理を実行する。具体的には、データ移行条件と合致していると「1」とし、合致していない場合には「0」とする。また、RAM13への書き込み後、CPU11は、アプリケーションソフト21を実行し、RAM13の第3フラグを確認する処理を実行する。そして、第3フラグが「1」の場合、対応するアプリケーションソフト21側に、データ移行条件と合致している旨を通知した状態となる。以上が、特許請求の範囲に記載の第2ステップに相当する。
The notification method is not particularly limited. In this embodiment, as an example, based on the program of the
アプリケーションソフト21を実行状態で、CPU11は、書き込み対象ブロックが移行すべき状態にあることを知ると、該アプリケーションソフト21の移行条件を満たしているか否かを判定する(ステップ13)。この移行条件は、アプリケーションソフト21ごとに適宜設定されている。
When the
ステップ13にて、対応するアプリケーションソフト21の移行条件を満たさないと、本タイミングでのデータ移行処理を終了する。一方、対応するアプリケーションソフト21の移行条件を満たすと、アプリケーションソフト21のプログラムに基づき、CPU11は、ドライバソフト20(フラッシュメモリ14)側に、データ移行処理を要求する(ステップ14)。すなわち、アプリケーションソフト21を実行するCPU11が、許可手段に相当する。すると、CPU11は、ドライバソフト20を実行し、フラッシュメモリ14のうち、上記アプリケーションソフト21に対応する所定アドレスの書き込み対象ブロックに記憶されたデータのうち、有効なレコードのデータのみを、アプリケーションソフト21に対応するデータ移行用の空きブロックにコピーする処理を実行する(ステップ15)。また、書き込み対象のブロックの全データを消去して空きブロックを生成する処理を実行する(ステップ16)。すなわち、ドライバソフト20を実行するCPU11が、データ移行手段に相当する。また、この処理にともない、元の書き込み対象ブロックの物理アドレスに対応する論理アドレスと、元のデータ移行用の空きブロックの物理アドレスに対応する論理アドレスとを、入れ替える処置を実行する。すなわち、元の書き込み対象ブロックを新たなデータ移行用の空きブロックとし、元の空きブロックを新たな書き込み対象のブロックとする。なお、データの有効・無効については、例えば上記したように、冗長部における有効性確認領域(第2フラグ)により確認することができる。以上が、特許請求の範囲に記載の第3ステップに相当する。
If the migration condition of the
図5(b)では、ステップ16が完了した状態、すなわちデータ移行が完了した状態を示している。図5(b)では、データ移行前に空きブロックであったブロック5に有効データがコピーされて、ブロック5が新たな書き込み対象ブロックとなり、データ移行前に書き込み対象ブロックであったブロック4のデータが消去されて、ブロック4が新たなデータ移行用の空きブロックとなっている。 FIG. 5B shows a state where step 16 is completed, that is, a state where data migration is completed. In FIG. 5B, the valid data is copied to the block 5 which was an empty block before data migration, and the block 5 becomes a new write target block, and the data of the block 4 which was the write target block before data migration. Are deleted, and the block 4 becomes a new empty block for data migration.
このようにして、データ移行処理が完了すると、ドライバソフト20を実行するCPU11は、アプリケーションソフト21側に、データ移行処理が完了した旨を通知する処理を実行する(ステップ17)。
Thus, when the data migration process is completed, the
したがって、ブロック4,5に対応するアプリケーションソフト21を実行し、新たにデータの書き込み(追記)をする場合には、図5(b)に示すように、ブロック5のレコードのうち、データが記憶されていないレコードのうちの先頭(4つ目のレコード)から順にデータを書き込むこととなる。
Therefore, when the
次に、本実施形態に係る特徴部分の効果について説明する。本実施形態では、データ書き込みとは異なるタイミングで、書き込み対象ブロックのデータ書き込み状態を検出する。そして、検出した書き込み状態が、予め設定された所定の書き込み状態に対応するデータ移行条件と合致する場合、合致した書き込み対象ブロックに対応するアプリケーションソフト21の実行手段であるCPU11に、合致した書き込み対象ブロックのうちの有効データをのみを、該ブロックとは別の記憶媒体(本実施形態では、上記アプリケーションソフト21に対応する空きブロック)に移行するタイミングである旨を通知するようにしている。したがって、アプリケーションソフト21側が、対応する書き込み対象ブロックがデータ移行すべき書き込み状態にあることを、書き込みとは異なるタイミング、すなわち書き込み前に事前に把握することができる。
Next, the effect of the characteristic part which concerns on this embodiment is demonstrated. In this embodiment, the data write state of the write target block is detected at a timing different from the data write. If the detected writing state matches the data migration condition corresponding to the predetermined writing state set in advance, the
また、上記通知を受け、且つ、対応するアプリケーションソフト21の移行条件を満たすと、アプリケーションソフト21を実行するCPU11が、データ移行要求を出す。そして、この要求に基づき、上記合致した書き込み対象ブロックの有効データを、該ブロックとは別の空きブロックにコピーするとともに、データコピー元のブロックのデータを消去する。したがって、アプリケーションソフト21ごとに適宜設定された移行条件を満たすタイミングで、データ移行処理を実施することができる。
When the notification is received and the migration condition of the
以上から、本実施形態に示すフラッシュメモリ14のデータ処理方法、及び、該方法を適用する記憶装置(を備えたECU10)によれば、書き込み動作の途中で、データ移行処理が実行されるのを抑制することができる。すなわち、データ移行処理に伴うデータ書き込み時間の遅延を抑制することができる。また、意図しない書き込み時間の遅延を回避することができる。換言すれば、アプリケーションソフト21に応じた任意のタイミング(各アプリケーションソフト21の好ましいタイミング)で、データ移行処理を実施することができる。したがって、特に書き込み時間の制約が厳しいアプリケーションソフト21のデータの書き込みに効果的である。
From the above, according to the data processing method of the
また、本実施形態では、フラッシュメモリ14が、1つのアプリケーションソフト21につき、データ書き込み用の書き込み対象ブロックと、コピー用の少なくとも1つの空きブロックとを備えており、データ移行処理を実行すると、コピー先のブロックを、新たな書き込み対象ブロックとするとともに、コピー元のデータ消去したブロックを新たなコピー用の空きブロックとする。そして、データの書き込み時には、コピー先のブロック、すなわち新たなデータ書き込み対象ブロックに対し、未記憶レコードに、新たなデータを追記するようにしている。このように、有効データを、アプリケーションソフト21に対応する空きブロックにコピーするので、瞬断などが生じても、コピーしたデータを保持することができる。また、スペース的に大容量のRAM13を確保できない場合であっても、書き込み時間の遅延を抑制することができる。したがって、民生に比べてスペース上の制約が厳しく、使用条件も過酷である車載用途に特に好適である。
In the present embodiment, the
なお、本実施形態では、データ移行処理を示すステップ13で、対応するアプリケーションソフト21の移行条件を満たさないと、本タイミングでのデータ移行処理を終了する例を示した。しかしながら、例えば所定時間が経過するまで、ステップ13の判定を繰り返し、所定時間経過後、本タイミングでのデータ移行処理を終了するようにしても良い。また、所定回数までステップ13の判定を繰り返し、所定回数繰り返しら、本タイミングでのデータ移行処理を終了するようにしても良い。
In the present embodiment, the example in which the data migration process at this timing is terminated when the migration condition of the
(第2実施形態)
次に、本発明の第2実施形態を、図6に基づいて説明する。図6は、第2実施形態に係るデータ移行処理を示すフローチャートである。
(Second Embodiment)
Next, a second embodiment of the present invention will be described based on FIG. FIG. 6 is a flowchart showing data migration processing according to the second embodiment.
本実施形態に係るフラッシュメモリのデータ処理(データ移行処理)方法、及び、該方法を適用する記憶装置を備えたECUの構成は、第1実施形態によるものと共通するところが多いので、以下、共通部分については詳しい説明は省略し、異なる部分を重点的に説明する。 The flash memory data processing (data migration processing) method according to the present embodiment and the configuration of the ECU including the storage device to which the method is applied are often in common with those according to the first embodiment. Detailed explanations of the parts are omitted, and different parts are explained mainly.
本実施形態に係るフラッシュメモリ14のデータ移行処理は、図6に示すステップ24のデータ移行処理の要求までが、第1実施形態(図4参照)に示したデータ移行処理の要求(ステップ14)までと一致している。また、ECU10の構成は、第1実施形態とほぼ同じ構成となっており、異なる点は、フラッシュメモリ14が、データ移行処理に用いるデータ移行用の空きブロックを有していない点である。
In the data migration process of the
アプリケーションソフト21のプログラムに基づき、CPU11が、ドライバソフト20(フラッシュメモリ14)側に、データ移行処理を要求する(ステップ24)と、CPU11は、ドライバソフト20を実行し、フラッシュメモリ14のうち、上記アプリケーションソフト21に対応する所定の物理アドレスの書き込み対象ブロックの有効データを、RAM13の対応する領域にコピー(一時保存)する処理を実行する(ステップ25)。また、書き込み対象ブロックの全データを消去して空きブロックを生成する処理を実行する(ステップ26)。
When the
そして、データを消去して空きブロックとなった書き込み対象ブロックに対し、RAM13に一時保存した有効データを、先頭のレコードから順に書き込む処理、すなわち再書込み処理を実行する(ステップ27)。なお、データの有効・無効については、例えば上記したように、冗長部における有効性確認領域(第2フラグ)により確認することができる。以上が、特許請求の範囲に記載の第5ステップに相当する。
Then, a process of writing the valid data temporarily stored in the
このようにして、データ移行処理が完了すると、ドライバソフト20を実行するCPU11は、アプリケーションソフト21側に、データ移行処理が完了した旨を通知する処理を実行する(ステップ28)。
In this way, when the data migration process is completed, the
このように本実施形態に示すフラッシュメモリのデータ処理(データ移行処理)方法、及び、該方法を適用する記憶装置を備えたECU10によっても、第1実施形態に示したように、書き込み動作の途中で、データ移行処理が実行されるのを抑制することができる。すなわち、データ移行処理に伴うデータ書き込み時間の遅延を抑制することができる。また、意図しない書き込み時間の遅延を回避することができる。換言すれば、アプリケーションソフト21に応じた任意のタイミング(各アプリケーションソフト21の好ましいタイミング)で、データ移行処理を実施することができる。したがって、特に書き込み時間の制約が厳しいアプリケーションソフト21のデータの書き込みに効果的である。
As described in the first embodiment, the flash memory data processing method (data migration processing) method and the
また、本実施形態では、有効なレコードのデータをRAM13に一時保存するので、データコピー用の記憶媒体として、フラッシュメモリ14が空きブロックを必要としない構成とすることができる。
In the present embodiment, since valid record data is temporarily stored in the
以上、本発明の好ましい実施形態について説明したが、本発明は上記した実施形態になんら制限されることなく、本発明の主旨を逸脱しない範囲において、種々変形して実施することが可能である。 The preferred embodiments of the present invention have been described above. However, the present invention is not limited to the above-described embodiments, and various modifications can be made without departing from the spirit of the present invention.
本実施形態では、フラッシュメモリのデータ処理(データ移行処理)方法を適用する記憶装置を備えたECU10として、自動車のボデー系の制御を司るボデー系ECUの例を示した。しかしながら、ECU10の用途は、上記例に限定されるものではない。また、車載用途に限定されるものでもなく、民生の電子機器に適用することもできる。
In the present embodiment, an example of a body system ECU that controls the body system of an automobile is shown as the
また、アプリケーションソフト21の移行条件は、適宜設定されればよい。例えば、車速が所定値以上であることや、ライトが点等していることなどを移行条件としても良い。また、インターフェースを介してCPU11と電気的に接続された表示装置(例えばモニタ)に、データ移行状態であることを表示(通知)し、これを見たユーザ(作業者)かたデータ移行処理を要求するキー操作がされたことを、移行条件としても良い。
Further, the migration condition of the
10・・・電子制御装置(ECU)
11・・・CPU
12・・・ROM
13・・・RAM
14・・・フラッシュメモリ
21・・・アプリケーションソフト(アプリケーション)
10 ... Electronic control unit (ECU)
11 ... CPU
12 ... ROM
13 ... RAM
14: Flash memory 21: Application software (application)
Claims (3)
記憶領域が複数のブロックに分割され、前記ブロック単位でデータ消去が可能であり、前記ブロックが複数のレコードを含み、前記レコード単位でデータ書き込みが可能なフラッシュメモリと、
前記CPUが実行するプログラムとしてROMに格納された、前記フラッシュメモリに対して前記CPUが実行するプログラムであるドライバソフト、及び、電子機器の制御処理を司るプログラムであるアプリケーションソフトと、を備え、
前記アプリケーションソフト側の指示に基づき、前記CPUは、前記ドライバソフトを実行することで、前記アプリケーションソフトのデータを、前記アプリケーションソフトに対応するブロックの未記憶レコードに書き込む処理を実行し、
前記CPUは、前記ドライバソフトを実行することで、データ書き込みとは異なるタイミングで、前記ブロックにおけるデータ書き込み状態を検出し、
前記CPUは、前記ドライバソフトを実行することで、検出した書き込み状態が、予め設定された所定の書き込み状態に対応するデータ移行条件と合致する場合、該当する前記ブロックのレコードのうち、有効なレコードのデータのみを、前記ブロックとは別の記憶媒体に移行するタイミングである旨の通知を前記アプリケーションソフト側に行い、
前記CPUは、前記アプリケーションソフトを実行することで、前記通知を受け、且つ、対応する前記アプリケーションソフトの移行条件と合致すると、データの移行を前記ドライバソフト側に許可し、
前記CPUは、前記ドライバソフトを実行することで、前記許可を受けて、前記ブロックのレコードのうち、有効なレコードのデータのみを、前記記憶媒体にコピーするとともに、データコピー元の前記ブロックのデータを消去することを特徴とする記憶装置。 CPU,
A storage area is divided into a plurality of blocks, data can be erased in units of the blocks, the block includes a plurality of records, and a flash memory capable of writing data in units of the records;
Driver software that is stored in ROM as a program executed by the CPU and that is a program executed by the CPU with respect to the flash memory, and application software that is a program for controlling electronic devices.
Based on an instruction of the application software side, the CPU, by executing the driver software, the data of the application software, executes a process of writing the unstored record block corresponding to the application software,
The CPU, by executing the driver software, at different timings from the data writing, to detect the data write state in said block,
The CPU executes the driver software, and when the detected write state matches a data migration condition corresponding to a predetermined write state set in advance, a valid record among the records of the corresponding block only, it has rows notification that the a block is a timing shifts to another storage medium to the application software side of the data,
The CPU, by executing the application software, receives the notification, and, if matches the transition condition of the application software corresponding permits the migration of data to the driver software side,
The CPU executes the driver software, receives the permission, and copies only the valid record data of the block records to the storage medium, and the data of the block of the data copy source storage apparatus characterized by erasing.
前記CPUは、前記ドライバソフトを実行することで、有効なレコードのデータがコピーされたコピー先の前記ブロックを、前記アプリケーションソフトに対応するデータ書き込み用のブロックとして、該ブロックの未記憶レコードに、新たなデータを追記することを特徴とする請求項1に記載の記憶装置。 The storage medium is an empty block different from the block of the data copy source,
The CPU executes the driver software so that the copy destination block to which valid record data has been copied is used as a data write block corresponding to the application software in an unstored record of the block. The storage device according to claim 1 , wherein new data is additionally written.
前記CPUは、前記ドライバソフトを実行することで、データを消去した前記ブロックに対し、複数の前記レコードの先頭から、前記RAMに保存した有効なレコードのデータを順に再書き込みするとともに、有効なレコードのデータが再書込みされた前記ブロックの未記憶レコードに、新たなデータを追記することを特徴とする請求項1に記載の記憶装置。 A RAM as the storage medium;
The CPU re-writes data of valid records stored in the RAM in order from the top of the plurality of records to the block from which data has been erased by executing the driver software , and the valid records 2. The storage device according to claim 1 , wherein new data is added to an unstored record of the block in which the data is rewritten.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2009077136A JP5332800B2 (en) | 2009-03-26 | 2009-03-26 | Storage device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2009077136A JP5332800B2 (en) | 2009-03-26 | 2009-03-26 | Storage device |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2010231416A JP2010231416A (en) | 2010-10-14 |
JP5332800B2 true JP5332800B2 (en) | 2013-11-06 |
Family
ID=43047177
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2009077136A Active JP5332800B2 (en) | 2009-03-26 | 2009-03-26 | Storage device |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5332800B2 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112466371B (en) * | 2020-12-17 | 2022-09-09 | 宁波拓普集团股份有限公司 | Method for circularly utilizing analog byte erasing function of flash memory |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP3703181B2 (en) * | 1995-09-28 | 2005-10-05 | キヤノン株式会社 | Flash ROM management method and apparatus |
JP3919261B2 (en) * | 1996-07-31 | 2007-05-23 | キヤノン株式会社 | Memory control device and memory access method |
JPH10150627A (en) * | 1996-11-18 | 1998-06-02 | Konica Corp | Digital still camera |
JP2002032256A (en) * | 2000-07-19 | 2002-01-31 | Matsushita Electric Ind Co Ltd | Terminal |
JP4280055B2 (en) * | 2001-11-28 | 2009-06-17 | 株式会社Access | Memory control method and apparatus |
JP5162846B2 (en) * | 2005-07-29 | 2013-03-13 | ソニー株式会社 | Storage device, computer system, and storage system |
-
2009
- 2009-03-26 JP JP2009077136A patent/JP5332800B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2010231416A (en) | 2010-10-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
TWI375962B (en) | Data writing method for flash memory and storage system and controller using the same | |
JP5021220B2 (en) | Nonvolatile memory device and multipage copyback method thereof | |
TWI473117B (en) | Flash storage device with data correction function | |
US10310764B2 (en) | Semiconductor memory device and storage apparatus comprising semiconductor memory device | |
JPH11126488A (en) | Method and device for storing and controlling data of external memory using plural flash memories | |
EP3633517B1 (en) | Storage device and method of operating storage device | |
JP2004152302A (en) | Method and device for executing block cache in nonvolatile memory system | |
JP2006323751A (en) | Information processing apparatus, life monitoring method and program | |
JP4745465B1 (en) | Semiconductor memory device and method for controlling semiconductor memory device | |
TWI454922B (en) | Memory storage device and memory controller and data writing method thereof | |
JP2010086009A (en) | Storage device and memory control method | |
US9948809B2 (en) | Image forming apparatus, memory management method for image forming apparatus, and program, using discretely arranged blocks in prioritizing information | |
JP4242245B2 (en) | Flash ROM control device | |
JP2020191055A (en) | Recovery processing method and device from instantaneous interruption, and computer readable storage medium | |
JP4661369B2 (en) | Memory controller | |
JP5332800B2 (en) | Storage device | |
WO2012172708A1 (en) | Backup device and operating method for backup device | |
JP2014106918A (en) | Information processing apparatus, and control method and program thereof | |
JPH11272569A (en) | Data restoration system for outer storage device using flash memory | |
TW201621668A (en) | Data storage device and data writing method thereof | |
JP5204265B2 (en) | Semiconductor memory device and method for controlling semiconductor memory device | |
JP2005115562A (en) | Flash rom controller | |
JP2010176201A (en) | Data loss prevention device for flash memory, and data loss prevention method for flash memory | |
JP2009223435A (en) | Data storage method and device, and program | |
JP2008097339A (en) | Memory controller, flash memory system having memory controller, and control method of flash memory |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20110920 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20130319 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20130514 |
|
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: 20130702 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20130715 |
|
R151 | Written notification of patent or utility model registration |
Ref document number: 5332800 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R151 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |