JP5332800B2 - Storage device - Google Patents

Storage device Download PDF

Info

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
Application number
JP2009077136A
Other languages
Japanese (ja)
Other versions
JP2010231416A (en
Inventor
常雄 山本
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Denso Corp
Original Assignee
Denso Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Denso Corp filed Critical Denso Corp
Priority to JP2009077136A priority Critical patent/JP5332800B2/en
Publication of JP2010231416A publication Critical patent/JP2010231416A/en
Application granted granted Critical
Publication of JP5332800B2 publication Critical patent/JP5332800B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Read Only Memory (AREA)

Description

本発明は、フラッシュメモリを備えた記憶装置に関するものである。 The present invention relates to a memory device having a flash memory.

データを一括消去する単位となるブロックを複数有するとともに、各ブロックが、データ書き込み/読み出し領域であるレコード(ページとも言う)を複数含むフラッシュメモリへのデータ書き込み方法として、例えば特許文献1に示される方法が知られている。   For example, Patent Document 1 discloses a method for writing data to a flash memory having a plurality of blocks as a unit for collectively erasing data and each block including a plurality of records (also referred to as pages) which are data write / read areas. The method is known.

このデータ書き込み方法では、書き込み処理対象である書き込み対象ブロックにおいて、空き(データ未記憶)のレコードが残っている場合、新しいデータを、書き込み済みのレコードの次のアドレスの未記憶レコードから順に追記する。また、全てのレコードにデータが記憶されると、有効なレコードのデータのみを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.

特開2000−243093号公報JP 2000-243093 A

一方、別のデータ書き込み方法として、書き込み対象ブロックにおいて、全てのレコードにデータが記憶されると、有効なレコードのデータのみを、上記ブロックとは別の空き状態にある空きブロックにコピーする方法も考えられる。この場合、データをコピーしたブロックを新たな書き込み対象ブロックとし、このブロックにおいて、データがコピーされたレコードの次のアドレスの未記憶レコードから順に、新たなデータを追記するようにするとともに、コピー元のブロックの全データを消去して空きブロックとし、次のデータ移行に備えることとなる。   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 claim 2, the storage medium is a free block different from the data copy source block, and the CPU executes the driver software to copy the valid record data to the copy destination. the block as a block for writing data corresponding to the application software, the unstored record of the blocks, may add new data.

本発明では、データ書き込み用のブロックと、コピー用の少なくとも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実施形態に係る記憶装置を適用した電子制御装置の概略構成を示すブロック図である。It is a block diagram which shows schematic structure of the electronic controller which applied the memory | storage device which concerns on 1st Embodiment. フラッシュメモリの概略構成を示す図である。It is a figure which shows schematic structure of a flash memory. データ移行処理及びデータ書き込み処理の概念図であり、(a)は比較例、(b)は第1実施形態を示している。It is a conceptual diagram of a data migration process and a data write process, (a) shows a comparative example, (b) shows the first embodiment. データ移行処理を説明するフローチャートである。It is a flowchart explaining a data transfer process. データ移行処理を示す模式的な図であり、(a)はデータ移行処理前、(b)はデータ移行処理後を示している。It is a schematic diagram which shows a data transfer process, (a) shows before data transfer process, (b) shows after data transfer process. 第2実施形態に係るデータ移行処理を示すフローチャートである。It is a flowchart which shows the data migration process which concerns on 2nd Embodiment.

以下、本発明の実施の形態を、図面を参照して説明する。
(第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 ECU 10 includes a main control unit composed of a CPU (Central Processing Unit) 11, and executes control processing of electronic equipment mounted on the vehicle by executing predetermined application software by the main control unit. The CPU 11, the ROM 12, the RAM 13, the flash memory 14, and the input / output unit (I / O port) 15 are composed of a microprocessor connected by a bus. In the present embodiment, the ECU 10 is configured as a body system ECU that controls the body system of the automobile. In the present embodiment, the CPU 11 also has a controller function for controlling access to the flash memory 14.

ROM12には、例えば起動時にCPU11が実行する各種プログラムが格納されており、これらプログラムとして、フラッシュメモリ14のドライバソフト20と、上記したアプリケーションソフト21を含んでいる。   The ROM 12 stores various programs executed by the CPU 11 at the time of startup, for example, and includes the driver software 20 of the flash memory 14 and the application software 21 described above as these programs.

フラッシュドライバソフト20(以下、単にドライバソフト20と示す)は、フラッシュメモリ14に対してCPU11が実行するプログラムである。一方、アプリケーションソフト21は、車両利用者による車両各部の操作に係る機能であるボデー系機能を実現するプログラムである。ここで、ボデー系機能とは、例えばドア開閉に伴う制御、窓開閉に伴う制御、ライトスイッチのオン/オフに伴う制御、キーレスエントリ方式等に採用されるワイヤレスドアロック機構の制御、シート位置の制御などである。   Flash driver software 20 (hereinafter simply referred to as driver software 20) is a program executed by the CPU 11 for the flash memory 14. On the other hand, the application software 21 is a program that realizes a body function that is a function related to operation of each part of the vehicle by a vehicle user. Here, the body functions include, for example, control associated with opening / closing of a door, control associated with opening / closing of a window, control associated with turning on / off of a light switch, control of a wireless door lock mechanism employed in a keyless entry method, etc. Such as control.

RAM13は、CPU11がROM12に格納された各プログラムにしたがって実行する各種演算のための作業領域として用いられ、プログラムごとに個別のワークエリアが確保されている。本実施形態では、一例として、RAM13が、上記ワークエリアとして、後述する物理アドレスと論理アドレスとの対応関係を示すアドレス変換テーブル(マッピングテーブル)を含んでいる。このように、アドレス変換テーブルはRAM13に格納されるため、電源投入時に、フラッシュメモリ14にアクセスし、アドレス変換テーブルの回復が行われる。   The RAM 13 is used as a work area for various calculations executed by the CPU 11 in accordance with each program stored in the ROM 12, and an individual work area is secured for each program. In the present embodiment, as an example, the RAM 13 includes an address conversion table (mapping table) indicating a correspondence relationship between a physical address and a logical address, which will be described later, as the work area. Thus, since the address conversion table is stored in the RAM 13, when the power is turned on, the flash memory 14 is accessed and the address conversion table is recovered.

フラッシュメモリ14は、周知のように半導体による不揮発性の記憶素子であり、上記した各プログラムに対応する設定データを記憶する部位である。本実施形態では、CPU11が利用する各種のシステムデータなども記憶されている。このフラッシュメモリ14の記憶領域は、例えば図2に示すように、所定の固定長による複数のブロック(ブロック0〜ブロックn)を有している。フラッシュメモリ14では、周知のごとくデータの上書きができず、上記したブロックが、一括消去の単位となっている。また、ブロックごとに対応して物理アドレス0〜nが割り当てられている。本実施形態では、1つのブロックの容量が数kB程度となっている。   As is well known, the flash memory 14 is a non-volatile storage element made of a semiconductor, and is a part that stores setting data corresponding to each program described above. In the present embodiment, various system data used by the CPU 11 are also stored. The storage area of the flash memory 14 has a plurality of blocks (block 0 to block n) having a predetermined fixed length, for example, as shown in FIG. In the flash memory 14, data cannot be overwritten as is well known, and the block described above is a unit for batch erasure. Also, physical addresses 0 to n are assigned corresponding to each block. In this embodiment, the capacity of one block is about several kB.

また、各ブロックは、図2に示す(ブロック2で例示する)ようにして、複数のレコード(レコード0〜レコードm)を有している。各レコードは固定長であり、所定サイズのデータ部と冗長部よりなる。なお、データ部にはデータが格納され、冗長部には、ECCデータや各種の管理情報(論理アドレス情報)などが格納される。そして、このレコードが、フラッシュメモリ14における書き込み・読み出しの単位となっており、レコードにも、物理アドレス0〜mが割り当てられている。本実施形態では、1つのレコードの容量が数十B程度となっている。   Each block has a plurality of records (record 0 to record m) as shown in FIG. 2 (illustrated by block 2). Each record has a fixed length and is composed of a data part having a predetermined size and a redundant part. Data is stored in the data portion, and ECC data, various management information (logical address information), and the like are stored in the redundant portion. This record is a unit of writing / reading in the flash memory 14, and physical addresses 0 to m are also assigned to the record. In this embodiment, the capacity of one record is about several tens of B.

このように、フラッシュメモリ14では、データの消去がブロック単位で行われ、データの書き込み・読み出しがレコード単位で行われるようになっており、データ消去単位とデータ書込単位のデータサイズが相互に異なっている。   As described above, in the flash memory 14, data is erased in units of blocks, and data writing / reading is performed in units of records. The data sizes of the data erase unit and the data write unit are mutually different. Is different.

なお、上記したECU10のうち、CPU11、ROM12に格納されたフラッシュドライバソフト20、RAM13、及びフラッシュメモリ14が、特許請求の範囲に記載の記憶装置に相当する。   Of the ECU 10, the CPU 11, the flash driver software 20, the RAM 13, and the flash memory 14 stored in the ROM 12 correspond to the storage device described in the claims.

次に、データ移行処理及びデータ書き込み処理の概念について説明する。図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 CPU 11 is involved, but is omitted in the figure.

先ず、比較例(従来例)について説明する。図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 predetermined application software 121, the CPU writes the data of the changed setting value to the driver software 120 (flash memory 114) side. Request. Then, the CPU executes the driver software 120, and from the beginning of the unstored records in which no data is stored for the write target block of the predetermined physical address corresponding to the application software 121 in the flash memory 114. Processing to write data in order is executed. For example, when all the records of the block to be written are empty, data is written in order from the record with the physical address at the head (0). In addition, the presence or absence of the data writing of a record can be confirmed by the write state confirmation area | region (1st flag) in a redundant part as an example. In the present embodiment, the first flag is set to “0” when data is written, and is set to “1” when data is not written.

ここで、データ書き込みの途中で、書き込み対象ブロックの全レコードが書き込み状態である、すなわち空きレコードのない状態であることを、ドライバソフト120を実行するCPUが、例えば上記第1フラグに基づき検出すると、CPUは、書き込み対象ブロックに記憶されたデータのうち、有効なレコードのデータのみを、アプリケーションソフト121に対応するデータ移行用の空きブロックにコピーする処理を実行する。また、書き込み対象ブロックの全データを消去して空きブロックを生成する処理を実行する。そして、元の書き込み対象ブロックの物理アドレスに対応する論理アドレスと、元のデータ移行用の空きブロックの物理アドレスに対応する論理アドレスとを、入れ替える処置を実行する。すなわち、元の書き込み対象ブロックを新たなデータ移行用の空きブロックとし、元の空きブロックを新たな書き込み対象ブロックとする。なお、データの有効・無効については、一例として、冗長部における有効性確認領域(第2フラグ)により確認することができる。本実施形態では、データが有効であると上記第2フラグが「1」とされ、データが無効であると「0」とされる。   Here, during the data writing, when the CPU executing the driver software 120 detects that all the records of the writing target block are in a written state, that is, in a state where there is no empty record, based on the first flag, for example. The CPU executes a process of copying only valid record data among the data stored in the write target block to a data migration free block corresponding to the application software 121. In addition, a process of erasing all data in the write target block to generate an empty block is executed. The logical address corresponding to the physical address of the original writing target block and the logical address corresponding to the physical address of the original empty block for data migration are then exchanged. That is, the original write target block is set as a new data migration free block, and the original free block is set as a new write target block. As an example, the validity / invalidity of data can be confirmed in the validity confirmation area (second flag) in the redundant portion. In the present embodiment, the second flag is set to “1” when the data is valid, and is set to “0” when the data is invalid.

データ移行処理が完了すると、ドライバソフト120を実行するCPUは、残りのデータを、新たな書き込み対象ブロックにおいて、データがコピーされたレコードの次のアドレスのレコード、すなわちデータが記憶されていない未記憶レコードのうちの先頭から順にデータを書き込む処理を実行する。そして、データの書き込みが完了すると、ドライバソフト120を実行するCPUは、アプリケーションソフト121側に、書き込みが完了した旨を通知する処理を実行する。   When the data migration processing is completed, the CPU that executes the driver software 120 transfers the remaining data in the new write target block, the record at the address next to the record in which the data is copied, that is, the data is not stored. A process of writing data in order from the beginning of the record is executed. When the data writing is completed, the CPU that executes the driver software 120 executes processing for notifying the application software 121 that the writing has been completed.

このように、従来では、書き込み対象ブロックの全レコードが書き込み状態(空きレコードのない状態)となると、データの書き込み途中にも係わらず、データの移行処理が発生するため、これにより、書き込み動作が中断して、結果、データの書き込み時間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 application software 121 does not know at what timing the data migration process occurs, the writing process is not performed within a predetermined time, and therefore the predetermined process based on the execution of the application software 121 may not be executed. there were.

これに対し、本実施形態では、図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 application software 21 is not executed. That is, before the data writing process, the data migration process is performed in advance as necessary. As a result, during the data writing, all records of the writing target block are in a writing state, and the data migration process is suppressed from occurring accordingly. The data writing time T2 can be made shorter than the above-described writing time T1.

また、アプリケーションソフト21任意のタイミングで、データ移行処理を実施するため、意図しないタイミングで、アプリケーションソフト21の実行に基づく所定処理の実行がなされない、という不具合を解消することができる。   Further, since the data migration process is performed at an arbitrary timing of the application software 21, it is possible to solve the problem that the predetermined process based on the execution of the application software 21 is not performed at an unintended timing.

以下に、本実施形態に係るデータ移行処理の詳細について説明する。図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 flash memory 14 with the ECU 10 powered on. As shown in FIG. 4, first, the write state of the write target block is detected (step 10). This step 10 corresponds to the first step described in the claims. Specifically, the CPU 11 executes the driver software 20 and detects the write state of the write target block at a timing different from the data write timing (and read timing). That is, the CPU 11 that executes the driver software 20 corresponds to a writing state detection unit. In this detection of the write state, up to which record is written among all the records constituting the block to be written, how much of all the records are in the write state, and which of the all records are free records Detect if there is any remaining.

書き込み状態の検出対象としては、各アプリケーションソフト21に対応する全ての書き込み対象ブロックでも良いし、所定のアプリケーションソフト21に対応する1つの書き込み対象ブロックでも良い。また検出タイミングとしては、アプリケーションソフト21がいずれも実行されていないタイミングであれば良い。例えばアプリケーションソフト21のデータ書き込み処理が完了した直後や、完了してから所定時間経過後に実施することができる。また、センサ等の信号を元に決定することもできる。   The detection target of the writing state may be all writing target blocks corresponding to each application software 21 or one writing target block corresponding to predetermined application software 21. The detection timing may be any timing when none of the application software 21 is executed. For example, it can be performed immediately after the data writing process of the application software 21 is completed, or after a predetermined time has elapsed since completion. It can also be determined based on a signal from a sensor or the like.

書き込み状態の検出方法としては、特に限定されるものではない。例えば上記した第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 CPU 11 determines whether or not the detected writing state matches the data migration condition based on the program of the driver software 20 (step 11). This data migration condition is set in advance corresponding to a state in which a predetermined number of empty records remain in the write target block.

ここで、図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 step 11, the write status (empty record) of the block to be written has a margin, and the data migration process at this timing is terminated. On the other hand, if the data migration condition is met, based on the program of the driver software 20, the CPU 11 notifies the corresponding application software 21 that the data migration condition is met, in other words, data migration is to be performed. (Step 12). That is, the CPU 11 that executes the driver software 20 corresponds to notification means.

通知方法としては、特に限定されるものではない。本実施形態では、一例として、ドライバソフト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 driver software 20, the CPU 11 executes a process of writing the determination result in a predetermined area (third flag) of the RAM 13. Specifically, “1” is set if the data migration condition is met, and “0” is set if the data migration condition is not met. Further, after writing to the RAM 13, the CPU 11 executes the application software 21 and executes a process of checking the third flag of the RAM 13. When the third flag is “1”, the corresponding application software 21 is notified that the data migration condition is met. The above corresponds to the second step described in the claims.

アプリケーションソフト21を実行状態で、CPU11は、書き込み対象ブロックが移行すべき状態にあることを知ると、該アプリケーションソフト21の移行条件を満たしているか否かを判定する(ステップ13)。この移行条件は、アプリケーションソフト21ごとに適宜設定されている。   When the CPU 11 knows that the write target block is in a state to be transferred while the application software 21 is in an execution state, the CPU 11 determines whether or not the transfer condition of the application software 21 is satisfied (step 13). This transition condition is appropriately set for each application software 21.

ステップ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 corresponding application software 21 is not satisfied in step 13, the data migration process at this timing is terminated. On the other hand, if the migration condition of the corresponding application software 21 is satisfied, the CPU 11 requests the data migration processing from the driver software 20 (flash memory 14) side based on the program of the application software 21 (step 14). That is, the CPU 11 that executes the application software 21 corresponds to a permission unit. Then, the CPU 11 executes the driver software 20, and only the valid record data among the data stored in the write target block at the predetermined address corresponding to the application software 21 in the flash memory 14 is applied to the application software 21. A process of copying to an empty block for data migration corresponding to is executed (step 15). In addition, a process of erasing all data in the writing target block to generate an empty block is executed (step 16). That is, the CPU 11 that executes the driver software 20 corresponds to data migration means. Further, in accordance with this processing, a process of exchanging the logical address corresponding to the physical address of the original writing target block and the logical address corresponding to the physical address of the original empty block for data migration is executed. That is, the original write target block is set as a new data migration free block, and the original free block is set as a new write target block. The validity / invalidity of the data can be confirmed by, for example, the validity confirmation area (second flag) in the redundant part as described above. The above corresponds to the third step described in the claims.

図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 CPU 11 executing the driver software 20 executes a process of notifying the application software 21 that the data migration process is completed (step 17).

したがって、ブロック4,5に対応するアプリケーションソフト21を実行し、新たにデータの書き込み(追記)をする場合には、図5(b)に示すように、ブロック5のレコードのうち、データが記憶されていないレコードのうちの先頭(4つ目のレコード)から順にデータを書き込むこととなる。   Therefore, when the application software 21 corresponding to the blocks 4 and 5 is executed and data is newly written (added), the data stored in the record of the block 5 is stored as shown in FIG. Data is written sequentially from the beginning (fourth record) of the records that have not been recorded.

次に、本実施形態に係る特徴部分の効果について説明する。本実施形態では、データ書き込みとは異なるタイミングで、書き込み対象ブロックのデータ書き込み状態を検出する。そして、検出した書き込み状態が、予め設定された所定の書き込み状態に対応するデータ移行条件と合致する場合、合致した書き込み対象ブロックに対応するアプリケーションソフト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 CPU 11 that is the execution means of the application software 21 corresponding to the matching writing target block is notified to the matching writing target. It is notified that it is time to transfer only valid data in the block to a storage medium different from the block (in this embodiment, an empty block corresponding to the application software 21). Therefore, the application software 21 can recognize in advance that the corresponding write target block is in a write state in which data is to be migrated, that is, at a timing different from that of writing, that is, before writing.

また、上記通知を受け、且つ、対応するアプリケーションソフト21の移行条件を満たすと、アプリケーションソフト21を実行するCPU11が、データ移行要求を出す。そして、この要求に基づき、上記合致した書き込み対象ブロックの有効データを、該ブロックとは別の空きブロックにコピーするとともに、データコピー元のブロックのデータを消去する。したがって、アプリケーションソフト21ごとに適宜設定された移行条件を満たすタイミングで、データ移行処理を実施することができる。   When the notification is received and the migration condition of the corresponding application software 21 is satisfied, the CPU 11 that executes the application software 21 issues a data migration request. Then, based on this request, the valid data of the matched write target block is copied to a free block different from the block, and the data of the data copy source block is erased. Therefore, the data migration process can be performed at a timing that satisfies the migration conditions set appropriately for each application software 21.

以上から、本実施形態に示すフラッシュメモリ14のデータ処理方法、及び、該方法を適用する記憶装置(を備えたECU10)によれば、書き込み動作の途中で、データ移行処理が実行されるのを抑制することができる。すなわち、データ移行処理に伴うデータ書き込み時間の遅延を抑制することができる。また、意図しない書き込み時間の遅延を回避することができる。換言すれば、アプリケーションソフト21に応じた任意のタイミング(各アプリケーションソフト21の好ましいタイミング)で、データ移行処理を実施することができる。したがって、特に書き込み時間の制約が厳しいアプリケーションソフト21のデータの書き込みに効果的である。   From the above, according to the data processing method of the flash memory 14 and the storage device (including the ECU 10) to which the method is applied according to the present embodiment, the data migration process is executed during the writing operation. Can be suppressed. 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. In other words, the data migration process can be performed at an arbitrary timing according to the application software 21 (preferred timing of each application software 21). Therefore, it is effective for writing data of the application software 21 that has particularly severe restrictions on the writing time.

また、本実施形態では、フラッシュメモリ14が、1つのアプリケーションソフト21につき、データ書き込み用の書き込み対象ブロックと、コピー用の少なくとも1つの空きブロックとを備えており、データ移行処理を実行すると、コピー先のブロックを、新たな書き込み対象ブロックとするとともに、コピー元のデータ消去したブロックを新たなコピー用の空きブロックとする。そして、データの書き込み時には、コピー先のブロック、すなわち新たなデータ書き込み対象ブロックに対し、未記憶レコードに、新たなデータを追記するようにしている。このように、有効データを、アプリケーションソフト21に対応する空きブロックにコピーするので、瞬断などが生じても、コピーしたデータを保持することができる。また、スペース的に大容量のRAM13を確保できない場合であっても、書き込み時間の遅延を抑制することができる。したがって、民生に比べてスペース上の制約が厳しく、使用条件も過酷である車載用途に特に好適である。   In the present embodiment, the flash memory 14 includes a write target block for data writing and at least one free block for copying for each application software 21, and when data migration processing is executed, copying is performed. The previous block is set as a new write target block, and the block from which the data at the copy source is erased is set as a new 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 target block. As described above, since the valid data is copied to the empty block corresponding to the application software 21, the copied data can be retained even if an instantaneous interruption occurs. Moreover, even when it is not possible to secure a large-capacity RAM 13 in terms of space, a delay in writing time can be suppressed. Therefore, it is particularly suitable for in-vehicle applications where space restrictions are severe and usage conditions are severe compared to consumer.

なお、本実施形態では、データ移行処理を示すステップ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 corresponding application software 21 is not satisfied in step 13 indicating the data migration process. However, for example, the determination in step 13 may be repeated until a predetermined time elapses, and after the predetermined time elapses, the data migration processing at this timing may be terminated. Alternatively, the determination in step 13 may be repeated up to a predetermined number of times, and the data migration process at this timing may be terminated after repeating the predetermined number of times.

(第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 flash memory 14 according to the present embodiment, the request for the data migration process shown in the first embodiment (see FIG. 4) up to the request for the data migration process in step 24 shown in FIG. 6 (step 14). Is consistent with. Further, the configuration of the ECU 10 is substantially the same as that of the first embodiment, and the difference is that the flash memory 14 does not have an empty block for data migration used for data migration processing.

アプリケーションソフト21のプログラムに基づき、CPU11が、ドライバソフト20(フラッシュメモリ14)側に、データ移行処理を要求する(ステップ24)と、CPU11は、ドライバソフト20を実行し、フラッシュメモリ14のうち、上記アプリケーションソフト21に対応する所定の物理アドレスの書き込み対象ブロックの有効データを、RAM13の対応する領域にコピー(一時保存)する処理を実行する(ステップ25)。また、書き込み対象ブロックの全データを消去して空きブロックを生成する処理を実行する(ステップ26)。   When the CPU 11 requests the driver software 20 (flash memory 14) to perform data migration processing based on the program of the application software 21 (step 24), the CPU 11 executes the driver software 20 and A process of copying (temporarily saving) valid data of a write target block having a predetermined physical address corresponding to the application software 21 to a corresponding area of the RAM 13 is executed (step 25). In addition, a process of generating an empty block by erasing all data in the write target block is executed (step 26).

そして、データを消去して空きブロックとなった書き込み対象ブロックに対し、RAM13に一時保存した有効データを、先頭のレコードから順に書き込む処理、すなわち再書込み処理を実行する(ステップ27)。なお、データの有効・無効については、例えば上記したように、冗長部における有効性確認領域(第2フラグ)により確認することができる。以上が、特許請求の範囲に記載の第5ステップに相当する。   Then, a process of writing the valid data temporarily stored in the RAM 13 in order from the first record, that is, a rewrite process, is executed on the write target block which has been erased and becomes an empty block (step 27). The validity / invalidity of the data can be confirmed by, for example, the validity confirmation area (second flag) in the redundant part as described above. The above corresponds to the fifth step recited in the claims.

このようにして、データ移行処理が完了すると、ドライバソフト20を実行するCPU11は、アプリケーションソフト21側に、データ移行処理が完了した旨を通知する処理を実行する(ステップ28)。   In this way, when the data migration process is completed, the CPU 11 executing the driver software 20 executes a process of notifying the application software 21 that the data migration process is completed (step 28).

このように本実施形態に示すフラッシュメモリのデータ処理(データ移行処理)方法、及び、該方法を適用する記憶装置を備えたECU10によっても、第1実施形態に示したように、書き込み動作の途中で、データ移行処理が実行されるのを抑制することができる。すなわち、データ移行処理に伴うデータ書き込み時間の遅延を抑制することができる。また、意図しない書き込み時間の遅延を回避することができる。換言すれば、アプリケーションソフト21に応じた任意のタイミング(各アプリケーションソフト21の好ましいタイミング)で、データ移行処理を実施することができる。したがって、特に書き込み時間の制約が厳しいアプリケーションソフト21のデータの書き込みに効果的である。   As described in the first embodiment, the flash memory data processing method (data migration processing) method and the ECU 10 including the storage device to which the method is applied are also in the middle of the write operation as described in the first embodiment. Thus, the execution of the data migration process can be suppressed. 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. In other words, the data migration process can be performed at an arbitrary timing according to the application software 21 (preferred timing of each application software 21). Therefore, it is effective for writing data of the application software 21 that has particularly severe restrictions on the writing time.

また、本実施形態では、有効なレコードのデータをRAM13に一時保存するので、データコピー用の記憶媒体として、フラッシュメモリ14が空きブロックを必要としない構成とすることができる。   In the present embodiment, since valid record data is temporarily stored in the RAM 13, the flash memory 14 can be configured not to require an empty block as a data copy storage medium.

以上、本発明の好ましい実施形態について説明したが、本発明は上記した実施形態になんら制限されることなく、本発明の主旨を逸脱しない範囲において、種々変形して実施することが可能である。   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 ECU 10 including a storage device to which a data processing (data migration processing) method of a flash memory is applied. However, the use of the ECU 10 is not limited to the above example. Further, the present invention is not limited to in-vehicle use, and can be applied to consumer electronic devices.

また、アプリケーションソフト21の移行条件は、適宜設定されればよい。例えば、車速が所定値以上であることや、ライトが点等していることなどを移行条件としても良い。また、インターフェースを介してCPU11と電気的に接続された表示装置(例えばモニタ)に、データ移行状態であることを表示(通知)し、これを見たユーザ(作業者)かたデータ移行処理を要求するキー操作がされたことを、移行条件としても良い。   Further, the migration condition of the application software 21 may be set as appropriate. For example, the transition condition may be that the vehicle speed is equal to or higher than a predetermined value or that the light is on. In addition, a data transfer state is displayed (notified) on a display device (for example, a monitor) electrically connected to the CPU 11 via the interface, and data transfer processing is performed by a user (worker) who has seen the data transfer state. The transition condition may be that the requested key operation has been performed.

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と、
記憶領域が複数のブロックに分割され、前記ブロック単位でデータ消去が可能であり、前記ブロックが複数のレコードを含み、前記レコード単位でデータ書き込みが可能なフラッシュメモリと、
前記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.
前記記憶媒体としてのRAMを備え、
前記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.
JP2009077136A 2009-03-26 2009-03-26 Storage device Active JP5332800B2 (en)

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)

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

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

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