JP2015011524A - Electronic control device and method of controlling writing data into non-volatile memory - Google Patents

Electronic control device and method of controlling writing data into non-volatile memory Download PDF

Info

Publication number
JP2015011524A
JP2015011524A JP2013136417A JP2013136417A JP2015011524A JP 2015011524 A JP2015011524 A JP 2015011524A JP 2013136417 A JP2013136417 A JP 2013136417A JP 2013136417 A JP2013136417 A JP 2013136417A JP 2015011524 A JP2015011524 A JP 2015011524A
Authority
JP
Japan
Prior art keywords
data
writing
memory
write
importance
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2013136417A
Other languages
Japanese (ja)
Inventor
勇士 小坂
Yuji Kosaka
勇士 小坂
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 JP2013136417A priority Critical patent/JP2015011524A/en
Publication of JP2015011524A publication Critical patent/JP2015011524A/en
Pending legal-status Critical Current

Links

Images

Abstract

PROBLEM TO BE SOLVED: To decrease the frequency of writing into a writable non-volatile memory while reducing the risk accompanied by data loss.SOLUTION: A CPU 2 restricts writing of data A to D into each of memory blocks 5a to 5d of an EEPROM 5 so that the frequency of writing to the EEPROM 5 does not reach an upper limit early. When there is a writing request of data to each of the memory blocks 5a to 5d of the EEPROM 5, the CPU 2 performs restriction to retain execution of writing (not to write until the frequency of retainment reaches the frequency of no permission) on the basis of the frequency of no permission of writing set according to importance, frequency of data update, and an actual frequency of writing of the data A to D of each of the memory blocks 5a to 5d.

Description

本発明は、書換え可能な不揮発性メモリに対するデータの書込みを制限するようにした電子制御装置及び不揮発性メモリのデータ書込み制御方法に関する。   The present invention relates to an electronic control device and a data write control method for a nonvolatile memory that restrict data writing to a rewritable nonvolatile memory.

例えば車両用のエンジン制御装置等の電子制御装置に設けられるマイクロコンピュータは、CPU、ROM、RAM等に加え、EEPROM等の書換え可能な不揮発性メモリを備えて構成されている。この場合、RAMのバッファには、制御に利用されるデータ等が随時更新されながら記憶されるのであるが、電源遮断時のRAMのデータの喪失に対処できるように、書換え可能な不揮発性メモリには、バッファのデータが適宜書込まれる(書換えられる)ようになっている。   For example, a microcomputer provided in an electronic control device such as an engine control device for a vehicle includes a rewritable nonvolatile memory such as an EEPROM in addition to a CPU, a ROM, a RAM, and the like. In this case, the data used for control is stored in the RAM buffer while being updated as needed, but a rewritable non-volatile memory is provided so as to cope with the loss of RAM data when the power is cut off. The buffer data is appropriately written (rewritten).

ところで、EEPROM等の書換え可能な不揮発性メモリにあっては、書込み(書換え)の回数に上限(例えば10000回)が存在する事情がある。そのため、電子制御装置の製品寿命に対して、十分な寿命を確保するために、書換え可能な不揮発性メモリの書込み回数が早期に上限に至ることがないようにする工夫が考えられている。   By the way, in a rewritable nonvolatile memory such as an EEPROM, there is an upper limit (for example, 10,000 times) in the number of writing (rewriting). For this reason, in order to ensure a sufficient life for the product life of the electronic control device, a device is conceived so that the number of times of writing to the rewritable nonvolatile memory does not reach the upper limit early.

即ち、例えば特許文献1では、EEPROMの記憶領域を複数のメモリブロックに分け、あるメモリブロックの書込み回数が所定値に達した場合に、書込み回数の少ない別のメモリブロックと、記憶内容を入替えるようにしている。また、特許文献2では、EEPROMに記憶されるデータを、書換え頻度の高いデータXと書換え頻度の低いデータYとに分け、書換え頻度の低いデータYについては無条件に書換えを実行し、書換え頻度の高いデータXに関しては書換えに制限を加えるようにしている。この制限とは、当初は、10回の書換え要求に対して1回の書換えを実行し、書換え回数が2万回を越えると、35回の書換え要求に対して1回の書換えを実行するといったものである。   That is, for example, in Patent Document 1, the storage area of the EEPROM is divided into a plurality of memory blocks, and when the number of times of writing in a certain memory block reaches a predetermined value, the memory content is replaced with another memory block having a lower number of times of writing. I am doing so. In Patent Document 2, the data stored in the EEPROM is divided into data X having a high rewrite frequency and data Y having a low rewrite frequency, and rewriting is performed unconditionally for the data Y having a low rewrite frequency. For high data X, rewriting is restricted. This restriction means that, at first, one rewrite is executed for 10 rewrite requests, and when the number of rewrites exceeds 20,000, one rewrite is executed for 35 rewrite requests. Is.

特開平6−338195号公報JP-A-6-338195 特開2012−226575号公報JP 2012-226575 A

しかしながら、上記特許文献1の技術では、メモリブロック間での記憶内容の入替えを実現するために、マッピング回路や書込み回数カウンタ等の構成を付加する必要があるため、コストアップを招いてしまう問題がある。また、特許文献2の技術では、書換え回数が制限されるとはいうものの、単純に書換えの頻度だけで制限を加えているため、重要なデータもさほど重要でないデータも同様にデータ損失が起こる虞があり、データ損失によるリスク回避といった観点からは、十分に効果的とは言えないものとなっている。   However, in the technique disclosed in Patent Document 1, it is necessary to add a configuration such as a mapping circuit and a write count counter in order to exchange the stored contents between the memory blocks. is there. Further, although the technique of Patent Document 2 restricts the number of times of rewriting, since it is limited only by the frequency of rewriting, there is a risk that important data and less important data may be similarly lost. From the viewpoint of avoiding risks due to data loss, it is not sufficiently effective.

本発明は上記事情に鑑みてなされたものであり、その目的は、データ損失に伴うリスクを小さくできつつも、書換え可能な不揮発性メモリの書込み回数を減らして書込み回数が上限に至ることを抑制することができる電子制御装置及び不揮発性メモリのデータ書込み制御方法を提供することにある。   The present invention has been made in view of the above circumstances, and its purpose is to reduce the number of times of writing to a rewritable nonvolatile memory while reducing the risk associated with data loss and to prevent the number of times of writing from reaching the upper limit. It is an object of the present invention to provide an electronic control device and a data write control method for a non-volatile memory.

本発明の電子制御装置は、同じタイミングでデータの読書きを行うメモリブロックを複数有してなる書換え可能な不揮発性メモリの、各メモリブロックに対するバッファメモリのデータの書込みを制限する制限手段を備えると共に、前記制限手段は、前記不揮発性メモリの各メモリブロックに関するデータの重要度に応じて、それらメモリブロック毎にデータの書込みを制限するところに特徴を有する(請求項1の発明)。   An electronic control unit according to the present invention includes a restricting unit that restricts writing of data in a buffer memory to each memory block of a rewritable nonvolatile memory having a plurality of memory blocks that read and write data at the same timing. In addition, the restricting means is characterized in that data writing is restricted for each memory block in accordance with the importance of data related to each memory block of the nonvolatile memory (invention of claim 1).

また、本発明の不揮発性メモリのデータ書込み制御方法は、同じタイミングでデータの読書きを行うメモリブロックを複数有してなる書換え可能な不揮発性メモリに対し、バッファメモリのデータを書込む不揮発性メモリのデータ書込み制御方法であって、前記不揮発性メモリの各メモリブロックに関するデータの重要度に応じて、それらメモリブロック毎にデータの書込みを制限するところに特徴を有する(請求項5の発明)。   The nonvolatile memory data write control method of the present invention is a nonvolatile memory for writing buffer memory data to a rewritable nonvolatile memory having a plurality of memory blocks for reading and writing data at the same timing. A data write control method for a memory, characterized in that data write is limited for each memory block in accordance with the importance of data related to each memory block of the nonvolatile memory (invention of claim 5). .

本発明においては、書換え可能な不揮発性メモリに対して、データ書込み要求があった場合でも、制限手段により、データの書込みを実施しない(間引く)制御が行われることになる。これにより、書換え可能な不揮発性メモリにあって、書込み(書換え)の回数に上限が存在する事情があっても、早期に書込み回数が上限に至ることが防止される。そしてこのとき、制限手段は、不揮発性メモリの各メモリブロックに関するデータの重要度に応じて、メモリブロック毎にデータの書込みを制限するので、重要なデータの損失によるリスクを小さくすることができる。   In the present invention, even when there is a data write request to a rewritable nonvolatile memory, control is performed not to perform (thinning out) data writing by the limiting means. Thereby, even in a rewritable nonvolatile memory, even if there is an upper limit on the number of times of writing (rewriting), the upper limit of the number of times of writing is prevented. At this time, the restricting means restricts data writing for each memory block in accordance with the importance of the data related to each memory block of the nonvolatile memory, so that the risk due to loss of important data can be reduced.

尚、本発明にいうデータの重要度とは、そのデータの損失に伴うリスクの程度(リスクが大きいほど重要度も高い)によって決めることができる。但し、重要度が高いデータを記憶するメモリブロックも、重要度がさほど高くないデータを記憶するメモリブロックも、書込み回数の上限は同等に存在するので、制限手段によりデータの重要度に応じた書込みの制限を加える場合には、実際には、上限に至るまでに、どのようなパターンで制限を加えるかといったことが大事になる。   The importance of data referred to in the present invention can be determined by the degree of risk associated with the loss of data (the greater the risk, the higher the importance). However, the upper limit of the number of times of writing is the same for both the memory block that stores highly important data and the memory block that stores less important data. In practice, it is important to determine what kind of pattern is used before reaching the upper limit.

例えば、製品寿命の長さ全体に対し、使用開始当初は制限を小さくして書換えの頻度を高く保ち、上限回数に近くなったところで制限を大きくするパターン、つまり比較的早期に上限回数に近付くが使用前半においてデータの損失に伴うリスクを小さくするパターン、それとは逆に、当初は制限を大きくし、後半において制限を小さくして書換えの頻度を高くするパターン、つまり、使用前半ではデータの損失に伴うリスクが比較的大きくなるものの、使用後半においてリスクを小さくするパターン、それらの中間的なパターン、つまり平均的な書換え頻度を続けてデータの損失に伴うリスクを使用全体に渡って均等にするパターン、等が考えられる。   For example, the pattern of increasing the limit when the limit is reduced by reducing the limit at the beginning of use and keeping the frequency of rewriting high at the beginning of use for the entire length of the product life, that is, approaching the upper limit count relatively early. A pattern that reduces the risk associated with data loss in the first half of usage, and conversely, a pattern that initially increases the limit and decreases the limit in the second half to increase the frequency of rewriting. Although the risk involved is relatively large, the pattern that reduces the risk in the second half of use, the intermediate pattern, that is, the pattern that keeps the average rewriting frequency to equalize the risk associated with data loss throughout the use , Etc. are conceivable.

本発明の一実施例を示すもので、マイクロコンピュータの電気的構成を概略的に示すブロック図The block diagram which shows one Example of this invention and shows the electrical structure of a microcomputer roughly EEPROMのメモリブロックと各データとの対応関係を模式的に示す図The figure which shows typically the correspondence between the memory block of EEPROM, and each data CPUの実行するデータ書込み制御の全体の処理手順を示すフローチャートThe flowchart which shows the whole process sequence of the data write control which CPU performs. 書込み実施判定の詳細な処理手順を示すフローチャートFlow chart showing the detailed processing procedure of write execution determination 重要度1の場合の不許可回数テーブルの例を示す図The figure which shows the example of the non-permission count table in the case of importance 1

以下、本発明を、車両(自動車)用のエンジン制御装置に適用した一実施例について、図面を参照しながら説明する。電子制御装置としての車両用のエンジン制御装置は、図1に示すように、マイクロコンピュータ1を含んで構成されている。このマイクロコンピュータ1は、CPU2、ROM3、RAM4、書換え可能な不揮発性メモリたるEEPROM5を備えている。尚、このマイクロコンピュータ1(RAM4)には、車載バッテリからの動作電源が常に供給されるようになっている。   Hereinafter, an embodiment in which the present invention is applied to an engine control device for a vehicle (automobile) will be described with reference to the drawings. As shown in FIG. 1, an engine control device for a vehicle as an electronic control device includes a microcomputer 1. The microcomputer 1 includes a CPU 2, a ROM 3, a RAM 4, and an EEPROM 5, which is a rewritable nonvolatile memory. The microcomputer 1 (RAM 4) is always supplied with operating power from an in-vehicle battery.

詳しい図示及び説明は省略するが、マイクロコンピュータ1(CPU2)には、入出力回路が接続され、エンジン制御開連の各種センサからの信号が入力されるようになっている。そして、マイクロコンピュータ1(CPU2)は、ROM3に記憶されている制御プログラムに従って、各種センサからの信号に基づいて、エンジンに対する燃料噴射制御、点火時期制御等の各種制御を実行するようになっている。この場合、RAM4のバッファメモリには、ダイアグデータや各種センサのデータ等の、制御に利用されるデータ等が随時更新されながら記憶される。   Although detailed illustration and description are omitted, an input / output circuit is connected to the microcomputer 1 (CPU 2), and signals from various sensors that are open to engine control are input. The microcomputer 1 (CPU 2) executes various controls such as fuel injection control and ignition timing control for the engine based on signals from various sensors in accordance with a control program stored in the ROM 3. . In this case, data used for control, such as diagnostic data and data of various sensors, is stored in the buffer memory of the RAM 4 while being updated as needed.

そして、電源遮断時のRAM4のデータの喪失に対処できるように、前記EEPROM5には、バッファメモリのデータが適宜書込まれる(書換えられる)ようになっている。このとき、EEPROM5は、内部の記憶部に、同じタイミングでデータの読書きを行うメモリブロックを複数有して構成されており、各メモリブロックに、夫々バッファメモリのデータが書込まれるようになっている。尚、図2では、EEPROM5に、4個のメモリブロック、即ち、第1〜第4のメモリブロック5a〜5dが設けられる場合を例示しており、それら各メモリブロック5a〜5dには、夫々データA〜Dが書込まれている。   The data in the buffer memory is appropriately written (rewritten) in the EEPROM 5 so as to cope with the loss of data in the RAM 4 when the power is shut off. At this time, the EEPROM 5 is configured to have a plurality of memory blocks for reading and writing data at the same timing in the internal storage unit, and the data of the buffer memory is written in each memory block. ing. FIG. 2 shows an example in which the EEPROM 5 is provided with four memory blocks, that is, first to fourth memory blocks 5a to 5d, and each of the memory blocks 5a to 5d has data. A to D are written.

前記CPU2は、RAM4のバッファメモリのデータが更新された場合や、1トリップ(自動車の1回のエンジン起動から停止まで)の終了時等に発生する書込み要求に応じて、RAM4のバッファメモリに格納されているデータを、EEPROM5の該当するメモリブロック5a〜5dに書込む(書換える)処理を実行する。従って、CPU2がデータ書込み手段として機能する。   The CPU 2 stores the data in the buffer memory of the RAM 4 in response to a write request that occurs when the data in the buffer memory of the RAM 4 is updated or when one trip (from one engine start to stop of the vehicle) ends. A process of writing (rewriting) the stored data into the corresponding memory blocks 5a to 5d of the EEPROM 5 is executed. Therefore, the CPU 2 functions as data writing means.

さて、前記EEPROM5にあっては、各メモリブロック5a〜5dに対する書込み(書換え)の回数に上限(例えば10000回)が存在する事情がある。そのため、EEPROM5に対し無制限にデータの書込みを行うとすると、製品(自動車)の寿命に対し、十分な寿命が得られなくなる虞がある。そこで、本実施例では、EEPROM5に対する書込み回数が早期に上限に至ることがないように、前記CPU2は、EEPROM5の各メモリブロック5a〜5dに対するデータA〜Dの書込みを制限する。   In the EEPROM 5, there is an upper limit (for example, 10,000 times) in the number of times of writing (rewriting) to each of the memory blocks 5a to 5d. Therefore, if unlimited writing of data to the EEPROM 5 is performed, there is a possibility that a sufficient life cannot be obtained with respect to the life of the product (automobile). Therefore, in this embodiment, the CPU 2 limits the writing of the data A to D to the memory blocks 5a to 5d of the EEPROM 5 so that the number of times of writing to the EEPROM 5 does not reach the upper limit early.

後の作用説明(フローチャート説明)でも述べるように、CPU2は、EEPROM5の各メモリブロック5a〜5dに対するデータ書込み要求があった場合に、各メモリブロック5a〜5dのデータA〜Dの重要度等に応じて設定される書込み不許可回数に基づいて、書込みの実行を保留する(保留回数が不許可回数に至るまで書込みしない)ことにより、制限を行うようになっている。本実施例では、各メモリブロック5a〜5dのデータA〜Dの重要度に加えて、該当するデータA〜D(各メモリブロック5a〜5d)のデータ更新頻度、並びに、該当するメモリブロック5a〜5dにおいて過去に実際に書込みを行った実書込み回数、に応じて不許可回数が設定される。   As will be described later in the explanation of the operation (flowchart explanation), when there is a data write request to each of the memory blocks 5a to 5d of the EEPROM 5, the CPU 2 determines the importance of the data A to D of each of the memory blocks 5a to 5d. Based on the number of write disapproval times set accordingly, the execution of the write is deferred (not written until the hold number reaches the non-permission number), thereby limiting. In the present embodiment, in addition to the importance of the data A to D of the memory blocks 5a to 5d, the data update frequency of the corresponding data A to D (each of the memory blocks 5a to 5d), and the corresponding memory block 5a to 5d. In 5d, the number of non-permissions is set according to the actual number of times of writing actually performed in the past.

このとき、図2に示すように、EEPROM5の第1〜第4の各メモリブロック5a〜5dに関し、付属情報として、記憶されるデータA〜Dの重要度、データA〜Dのデータ更新頻度、実書込み回数、書込み保留回数、のデータが記憶されるようになっている。そのうちデータ更新頻度とは、該当するデータA〜Dが、1トリップ間で平均的に何回程度更新されるかを示すもので、例えば1〜5の5段階で設定される。データ更新頻度が多いほど、不許可回数が多くなるように設定される。   At this time, as shown in FIG. 2, regarding the first to fourth memory blocks 5a to 5d of the EEPROM 5, as the attached information, the importance of the stored data A to D, the data update frequency of the data A to D, Data of the actual write count and write hold count is stored. Among them, the data update frequency indicates how many times the corresponding data A to D are updated on average in one trip, and is set, for example, in five stages of 1 to 5. The higher the data update frequency, the greater the number of non-permissions.

前記第1〜第4の各メモリブロック5a〜5dのデータA〜Dの重要度、及び、第1〜第4の各メモリブロック5a〜5dのデータA〜Dのデータ更新頻度のデータについては、予め制御条件から決まる固定的なデータであるため、ROM3に記憶されている。また、実書込み回数のデータについては、EEPROM5の該当するメモリブロック5a〜5dに記憶され、データの書換えと併せて書換えられる。さらに、各メモリブロック5a〜5dの書込み保留回数のデータについては、RAM4に記憶され、順次更新されるようになっている。   Regarding the importance of the data A to D of the first to fourth memory blocks 5a to 5d and the data update frequency data of the data A to D of the first to fourth memory blocks 5a to 5d, Since it is fixed data determined in advance from the control conditions, it is stored in the ROM 3. Further, the data of the actual write count is stored in the corresponding memory blocks 5a to 5d of the EEPROM 5, and is rewritten together with the data rewrite. Furthermore, the write pending count data of each of the memory blocks 5a to 5d is stored in the RAM 4 and is sequentially updated.

ここで、前記各メモリブロック5a〜5dのデータA〜Dの重要度については、該当するデータの損失に伴うリスクの程度(リスクが大きいほど重要度も高い)によって決めることができる。但し、重要度が高いデータを記憶するメモリブロックも、重要度がさほど高くないデータを記憶するメモリブロックも、書込み回数の上限は同等に存在するので、本実施例では、上限回数に至るまでに、実際にどのようなパターンで制限を加えるかによって、重要度が1,2,3の3段階に設定(決定)される。   Here, the importance of the data A to D of each of the memory blocks 5a to 5d can be determined by the degree of risk associated with the loss of the corresponding data (the greater the risk, the higher the importance). However, since the upper limit of the number of writings is the same for both the memory block that stores highly important data and the memory block that stores data that is not very important, in this embodiment, the upper limit is reached. The importance is set (determined) in three levels of 1, 2, and 3 depending on the pattern in which the restriction is actually applied.

重要度1とは、例えば、製品寿命の長さ全体に対し、使用開始当初は制限を小さくして書換えの頻度を比較的高く保ち、上限回数に近くなったところで制限を大きくするパターン、つまり比較的早期に上限回数に近付くが使用前半においてデータの損失に伴うリスクを小さくするパターンとされる。重要度3では、それとは逆に、当初は制限を大きくし、後半において制限を小さくして書換えの頻度を高くするパターン、つまり、使用前半ではデータの損失に伴うリスクが比較的大きくなるものの、使用後半においてリスクを比較的小さくするパターンとされる。重要度2は、それらの中間的なパターン、つまり平均的な書換え頻度を続けてデータの損失に伴うリスクを使用期間全体に渡って均等化するパターンとされる。   Importance level 1 is, for example, a pattern in which the limit is reduced at the beginning of use and the rewrite frequency is kept relatively high for the entire product life, and the limit is increased when the upper limit is approached. Although it approaches the upper limit number of times as early as possible, it is a pattern that reduces the risk associated with data loss in the first half of use. In severity 3, on the contrary, a pattern that increases the limit at the beginning and decreases the limit in the second half to increase the frequency of rewriting, that is, although the risk associated with data loss is relatively large in the first half, It is a pattern that makes the risk relatively small in the second half of use. The importance level 2 is an intermediate pattern, that is, a pattern in which the average rewrite frequency is continued and the risk associated with data loss is equalized over the entire period of use.

そして、上記不許可回数は、図5に示すような、予めROM3に記憶されている不許可回数テーブルに従って設定されるようになっている。図5は、重要度1の場合に、データ更新頻度及び実書込み回数のデータに応じて設定される不許可回数の一例を示している。ここでは、更新頻度が例えば1(最も少ない)の場合には、実書込み回数が2000回までは不許可回数が1回、実書込み回数が2000回を超えて4000回までは不許可回数が2回、というふうに不許可回数が設定される。実書込み回数が8000回を超えると、不許可回数が急激に増大する。また、更新頻度が、2,3,4,5と大きくなるにつれ、不許可回数も比例的(段階的)に多くなる。   The non-permission count is set according to a non-permission count table stored in advance in the ROM 3 as shown in FIG. FIG. 5 shows an example of the number of non-permissions set in accordance with data of the data update frequency and the actual write count when the importance level is 1. Here, for example, when the update frequency is 1 (the least), the number of non-permissions is 1 until the actual write count is 2000, and the number of disapprovals is 2 when the actual write count exceeds 2000 and reaches 4000. The number of times of disapproval is set. When the actual number of writes exceeds 8000, the number of non-permissions increases rapidly. Further, as the update frequency increases to 2, 3, 4, and 5, the number of non-permissions increases proportionally (stepwise).

尚、図示はしていないが、重要度3の場合には、重要度1の場合とは逆に、実書込み回数が2000回までにおける不許可回数が比較的大きく設定されるが、それ以降の実書込み回数が増えるにつれての不許可回数の増加の度合いは、比較的小さくなる。重要度2の場合は、それらの中間的な値(不許可回数の増加の度合い)とされる。従って、CPU2が本発明にいう制限手段としても機能し、また、CPU2により、本実施例に係るデータ書込み制御方法が実行される。   Although not shown in the figure, in the case of the importance level 3, contrary to the case of the importance level 1, the number of non-permissions is set to be relatively large when the actual write count is 2000 times. The degree of increase in the number of non-permissions as the number of actual writes increases is relatively small. In the case of importance 2, the intermediate value (degree of increase in the number of non-permissions) is used. Therefore, the CPU 2 also functions as a limiting unit according to the present invention, and the data write control method according to the present embodiment is executed by the CPU 2.

次に、上記構成の作用について、図3及び図4も参照して説明する。図3のフローチャートは、データ書込み要求があった場合に、CPU2が実行する、EEPROM5のメモリブロック5a〜5dに対するデータ書込みの全体の処理の流れを示している。また、図4のフローチャートは、図3のフローチャートのステップS2の書込み実施判定の処理の、詳細な手順を示している。   Next, the operation of the above configuration will be described with reference to FIGS. The flowchart of FIG. 3 shows the flow of the entire process of data writing to the memory blocks 5a to 5d of the EEPROM 5, which is executed by the CPU 2 when there is a data write request. The flowchart of FIG. 4 shows the detailed procedure of the write execution determination process in step S2 of the flowchart of FIG.

即ち、図3において、データ書込み要求があったときには、まずステップS1にて、当該データを書込むメモリブロック5a〜5d(データA〜D)における、実書込み回数、書込み保留回数、データ更新頻度、重要度、のデータが取得される。次のステップS2では、書込みを実施するかどうかの判定が実行される。このステップS2の判定の処理の詳細については、後述(図4のフローチャート)する。ステップS3では、書込みを実施するかが判断され、書込みを実施しない(保留する)場合には(ステップS3にてNo)、次のステップS4にて、書込み保留回数がカウントアップされ、そのまま終了する。   That is, in FIG. 3, when there is a data write request, first, in step S1, the actual write count, write hold count, data update frequency in the memory blocks 5a to 5d (data A to D) to which the data is written, Data of importance is acquired. In the next step S2, it is determined whether or not writing is performed. Details of the determination processing in step S2 will be described later (the flowchart in FIG. 4). In step S3, it is determined whether or not writing is to be performed. If writing is not performed (suspended) (No in step S3), the number of write suspensions is counted up in the next step S4, and the process ends. .

これに対し、書込みを実施する場合には(ステップS3にてYes)、ステップS5にて、該当するメモリブロックの実書込み回数がカウントアップされると共に、ステップS6にて、該当するメモリブロックにデータが書込まれる。そして、ステップS7にて、RAM4の書込み保留回数がクリアされ、処理が終了する。   On the other hand, when writing is performed (Yes in step S3), the actual write count of the corresponding memory block is counted up in step S5, and data is stored in the corresponding memory block in step S6. Is written. In step S7, the write suspension count in the RAM 4 is cleared, and the process ends.

次に、上記ステップS2の書込み実施判定の詳細な処理手順を示す図4において、ステップS11では、上記ステップS1で取込んだ実書込み回数、データ更新頻度、重要度のデータから、図5に例示するような不許可回数テーブルを参照して、不許可回数が求められる。次のステップS12では、RAM4に記憶されている現在の書込み保留回数が、ステップS11で求められた不許可回数以上であるかどうかが判断される。書込み保留回数が不許可回数以上であった場合には(ステップS12にてYes)、ステップS13にて、「書込み実施する」と判定される。書込み保留回数が不許可回数未満の場合には(ステップS12にてNo)、ステップS14にて、「書込み実施しない」と判定される。   Next, in FIG. 4 which shows the detailed processing procedure of the writing execution determination of the said step S2, in step S11, it illustrates in FIG. 5 from the data of the real write frequency, data update frequency, and importance which were taken in in the said step S1. The number of non-permissions is obtained by referring to the non-permission number table. In the next step S12, it is determined whether or not the current write suspension count stored in the RAM 4 is equal to or greater than the non-permission count determined in step S11. If the write suspension count is equal to or greater than the non-permission count (Yes in step S12), it is determined in step S13 that “write is performed”. If the number of write suspensions is less than the number of non-permissions (No in step S12), it is determined in step S14 that "write is not performed".

図5に示した重要度1の場合において、具体例を挙げてみると、例えば更新頻度が1で、実書込み回数が2000回までの場合、不許可回数が1回となる。従って、1回目のデータ書込み要求では、書込みが保留されるが、2回目のデータ書込み要求があった場合には、データの書込みが行われる。例えば更新頻度が4で、実書込み回数が4001〜6000回の場合、不許可回数が12回となり、データ書込み要求があっても、12回目まではデータの書込みが保留され、13回目のデータ書込み要求で、やっとデータの書込みが実行されることになる。また、実書込み回数が8000回を越えた場合には、どの更新頻度であっても、不許可回数がそれまでに比べて一段と多く設定されるようになる。   In the case of the importance level 1 shown in FIG. 5, when a specific example is given, for example, when the update frequency is 1 and the actual write count is up to 2000, the non-permission count is 1. Accordingly, writing is suspended in the first data write request, but when there is a second data write request, data is written. For example, if the update frequency is 4 and the actual write count is 4001 to 6000, the non-permission count is 12, and even if there is a data write request, the data write is suspended until the 12th and the 13th data write At the request, data writing is finally executed. Further, when the actual number of writes exceeds 8000, the number of non-permissions is set much higher than before regardless of the update frequency.

このように本実施例の電子制御装置及び不揮発性メモリのデータ書込み制御方法によれば、EEPROM5に対して、データ書込み要求があった場合でも、CPU2により、データの書込みを実施しない(間引く)制御が行われる。これにより、EEPROM5に書込み(書換え)の回数に上限が存在する事情があっても、書込み回数を減らすことができて早期に書込み回数が上限に至ることが防止される。そしてこのとき、CPU2は、EEPROM5の各メモリブロック5a〜5dに関するデータの重要度に応じて、当該メモリブロック5a〜5d毎にデータの書込みを制限するので、重要なデータの損失によるリスクを小さくすることができる。   As described above, according to the electronic controller and nonvolatile memory data write control method of the present embodiment, even when there is a data write request to the EEPROM 5, the CPU 2 does not write (thin) the data. Is done. As a result, even if there is an upper limit on the number of times of writing (rewriting) to the EEPROM 5, the number of times of writing can be reduced and the number of times of writing can be prevented from reaching the upper limit at an early stage. At this time, the CPU 2 limits the writing of data for each of the memory blocks 5a to 5d in accordance with the importance of the data relating to the memory blocks 5a to 5d of the EEPROM 5, thereby reducing the risk of loss of important data. be able to.

また、特に本実施例では、データの重要度に加えて、該当するデータのデータ更新頻度、並びに実書込み回数に応じて、各メモリブロック5a〜5dに対するデータの書込みを制限するようにしたので、よりきめ細かい制御を行うことが可能となる。更に、本実施例によれば、上記制御を行うために、特に構成の複雑化(ハードウエア構成の増加)を招いてしまうことがないことは勿論である。   In particular, in the present embodiment, in addition to the importance of data, the data update frequency of the corresponding data and the actual write count are limited, so that the data writing to each of the memory blocks 5a to 5d is limited. It becomes possible to perform finer control. Furthermore, according to the present embodiment, of course, in order to perform the above control, there is no particular complication of the configuration (increase in hardware configuration).

尚、上記した実施例では、データの重要度に加えて、データ更新頻度及び実書込み回数に応じてデータの書込みを制限するようにしたが、重要度のみで制限を行うようにしたり、重要度及び実書込み回数に応じて制限を行うようにしたり、重要度及びデータ更新頻度に応じて制限を行うようにしても良い。上記実施例における、具体的数値(図5)等はあくまでも一例を示したものに過ぎず、適宜設定が可能である。その他、書換え可能な不揮発性メモリとしては、EEPROMに限らずフラッシュメモリ等であっても同様に実施でき、また、本発明は、車両のエンジン制御装置以外にも電子制御装置全般に適用することができるなど、要旨を逸脱しない範囲内で種々の変更が可能である。   In the above-described embodiment, the data writing is restricted according to the data update frequency and the actual number of times of writing in addition to the importance of the data. Further, the restriction may be performed according to the actual number of times of writing, or the restriction may be performed according to the importance and the data update frequency. Specific numerical values (FIG. 5) and the like in the above embodiment are merely examples, and can be set as appropriate. In addition, the rewritable non-volatile memory is not limited to the EEPROM, and can be implemented in the same manner even if it is a flash memory. The present invention can be applied to all electronic control devices other than the engine control device of the vehicle. Various modifications can be made without departing from the scope of the invention.

図面中、1はマイクロコンピュータ(電子制御装置)、2はCPU、3はROM、4はRAM、5はEEPROM(書換え可能な不揮発性メモリ)、5a〜5dはメモリブロックを示す。   In the drawings, 1 is a microcomputer (electronic control unit), 2 is a CPU, 3 is a ROM, 4 is a RAM, 5 is an EEPROM (rewritable nonvolatile memory), and 5 a to 5 d are memory blocks.

Claims (8)

同じタイミングでデータの読書きを行うメモリブロックを複数有してなる書換え可能な不揮発性メモリと、
前記不揮発性メモリに書込むためのデータを記憶するバッファメモリと、
前記バッファメモリのデータを前記不揮発性メモリに書込むデータ書込み手段と、
前記不揮発性メモリの各メモリブロックに対するデータの書込みを制限する制限手段とを備えると共に、
前記制限手段は、前記不揮発性メモリの各メモリブロックに関するデータの重要度に応じて、それらメモリブロック毎にデータの書込みを制限することを特徴とする電子制御装置。
A rewritable nonvolatile memory having a plurality of memory blocks for reading and writing data at the same timing;
A buffer memory for storing data for writing to the nonvolatile memory;
Data writing means for writing data of the buffer memory into the nonvolatile memory;
Limiting means for limiting data writing to each memory block of the non-volatile memory, and
The electronic control device according to claim 1, wherein the restricting means restricts data writing for each memory block in accordance with the importance of the data related to each memory block of the nonvolatile memory.
前記制限手段は、前記不揮発性メモリの各メモリブロックに対し、前記データの重要度に応じて設定される書込み不許可回数に基づいて、データ書込み要求に対する書込みの実行を保留することを特徴とする請求項1記載の電子制御装置。   The restricting unit suspends execution of writing in response to a data write request based on the number of write disapprovals set according to the importance of the data for each memory block of the nonvolatile memory. The electronic control device according to claim 1. 前記制限手段は、前記データの重要度に加えて、前記バッファメモリにおける該当するデータのデータ更新頻度に応じて、該データ更新頻度が大ききほど書込み回数を少なくするように、前記各メモリブロックに対するデータの書込みを制限することを特徴とする請求項1又は2記載の電子制御装置。   In accordance with the data update frequency of the corresponding data in the buffer memory, in addition to the importance of the data, the restricting unit may reduce the number of times of writing as the data update frequency increases. 3. The electronic control device according to claim 1, wherein data writing is restricted. 前記制限手段は、前記データの重要度に加えて、前記不揮発性メモリの該当するメモリブロックにおいて書込みを行った実書込み回数に応じて、該実書込み回数が多いほど書込み回数を少なくするように、前記各メモリブロックに対するデータの書込みを制限することを特徴とする請求項1から3のいずれか一項に記載の電子制御装置。   The limiting means, in addition to the importance of the data, according to the actual number of times of writing performed in the corresponding memory block of the nonvolatile memory, so that the larger the number of actual writes, the smaller the number of writes, The electronic control device according to claim 1, wherein data writing to each memory block is restricted. 同じタイミングでデータの読書きを行うメモリブロックを複数有してなる書換え可能な不揮発性メモリに対し、バッファメモリのデータを書込む不揮発性メモリのデータ書込み制御方法であって、
前記不揮発性メモリの各メモリブロックに関するデータの重要度に応じて、それらメモリブロック毎にデータの書込みを制限することを特徴とする不揮発性メモリのデータ書込み制御方法。
A non-volatile memory data write control method for writing buffer memory data to a rewritable non-volatile memory having a plurality of memory blocks for reading and writing data at the same timing,
A data writing control method for a nonvolatile memory, wherein data writing is restricted for each memory block in accordance with the importance of data relating to each memory block of the nonvolatile memory.
前記不揮発性メモリのメモリブロック毎に、前記データの重要度に応じて設定される書込み不許可回数に基づいて、データ書込み要求に対する書込みの実行を保留することにより、前記各メモリブロックに対するデータの書込みを制限することを特徴とする請求項5記載の不揮発性メモリのデータ書込み制御方法。   Write data to each memory block by deferring execution of data write requests based on the number of write disapprovals set according to the importance of the data for each memory block of the nonvolatile memory The data write control method for a nonvolatile memory according to claim 5, wherein: 前記データの重要度に加えて、前記バッファメモリにおける該当するデータのデータ更新頻度に応じて、該データ更新頻度が大ききほど書込み回数を少なくするように、前記各メモリブロックに対するデータの書込みを制限することを特徴とする請求項5又は6記載の不揮発性メモリのデータ書込み制御方法。   In addition to the importance of the data, according to the data update frequency of the corresponding data in the buffer memory, the data writing to each memory block is limited so that the number of times of writing decreases as the data update frequency increases. The data write control method for a non-volatile memory according to claim 5 or 6. 前記データの重要度に加えて、前記不揮発性メモリの該当するメモリブロックにおいて書込みを行った実書込み回数に応じて、該実書込み回数が多いほど書込み回数を少なくするように、前記各メモリブロックに対するデータの書込みを制限することを特徴とする請求項5から7のいずれか一項に記載の不揮発性メモリのデータ書込み制御方法。   In addition to the importance of the data, according to the actual number of times of writing performed in the corresponding memory block of the nonvolatile memory, the number of times of writing is decreased as the actual number of times of writing increases. 8. The data write control method for a nonvolatile memory according to claim 5, wherein data write is limited.
JP2013136417A 2013-06-28 2013-06-28 Electronic control device and method of controlling writing data into non-volatile memory Pending JP2015011524A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2013136417A JP2015011524A (en) 2013-06-28 2013-06-28 Electronic control device and method of controlling writing data into non-volatile memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2013136417A JP2015011524A (en) 2013-06-28 2013-06-28 Electronic control device and method of controlling writing data into non-volatile memory

Publications (1)

Publication Number Publication Date
JP2015011524A true JP2015011524A (en) 2015-01-19

Family

ID=52304636

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013136417A Pending JP2015011524A (en) 2013-06-28 2013-06-28 Electronic control device and method of controlling writing data into non-volatile memory

Country Status (1)

Country Link
JP (1) JP2015011524A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113168859A (en) * 2019-09-27 2021-07-23 西部数据技术公司 Write efficiency in magnetoresistive random access memory

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113168859A (en) * 2019-09-27 2021-07-23 西部数据技术公司 Write efficiency in magnetoresistive random access memory

Similar Documents

Publication Publication Date Title
US10140026B2 (en) Data storage device and data maintenance method thereof
JP7020989B2 (en) Non-volatile storage device, memory control device, and memory control method
CN112344524B (en) Control method of air conditioner, air conditioner and storage medium
JP5045584B2 (en) Program rewriting device
US9948809B2 (en) Image forming apparatus, memory management method for image forming apparatus, and program, using discretely arranged blocks in prioritizing information
JP2012226575A (en) Method for storing data in non-volatile memory and control device
JP6009290B2 (en) Electronic control device for vehicle
JP2014215628A (en) Data storage device
JP5504604B2 (en) RAM diagnostic device
JP2015011524A (en) Electronic control device and method of controlling writing data into non-volatile memory
JP5915490B2 (en) Electronic control unit
JP2009223435A (en) Data storage method and device, and program
US9773562B2 (en) Storage apparatus, flash memory control apparatus, and program
JP4542556B2 (en) Semiconductor memory system
EP2916232B1 (en) Electronic control device for vehicle
JP2012238277A (en) Flash memory device
JP2006291720A (en) Control device
JP6832448B2 (en) Program update method and device
JP2018063527A (en) Electronic control apparatus
JP2013182378A (en) Non-volatile memory data storage method
JP2009048749A (en) File system management method, file system management device, and recording medium with file system management program recorded thereon
JP2023102933A (en) Electronic control device and data writing control method
JP2006163933A (en) Control data storage device
JP2016071447A (en) Nonvolatile storage and control method thereof
JP2016062349A (en) Automobile electronic controller and method for data storage