[go: up one dir, main page]

JP2011198049A - Storage device, electronic control unit and storage method - Google Patents

Storage device, electronic control unit and storage method Download PDF

Info

Publication number
JP2011198049A
JP2011198049A JP2010064217A JP2010064217A JP2011198049A JP 2011198049 A JP2011198049 A JP 2011198049A JP 2010064217 A JP2010064217 A JP 2010064217A JP 2010064217 A JP2010064217 A JP 2010064217A JP 2011198049 A JP2011198049 A JP 2011198049A
Authority
JP
Japan
Prior art keywords
data
area
storage
stored
target data
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
JP2010064217A
Other languages
Japanese (ja)
Inventor
Yasuaki Morita
康明 森田
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.)
Toyota Motor Corp
Original Assignee
Toyota Motor 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 Toyota Motor Corp filed Critical Toyota Motor Corp
Priority to JP2010064217A priority Critical patent/JP2011198049A/en
Publication of JP2011198049A publication Critical patent/JP2011198049A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Memory System (AREA)

Abstract

【課題】データが記憶されるEEPROMの容量の増加を抑制しながら、空き容量の余裕がなくなった場合にも対応可能な記憶装置、電子制御ユニット及び記憶方法を提供すること。
【解決手段】複数の領域に区分された不揮発メモリ100にデータを記憶する記憶装置50であって、プログラムがアクセスする記憶対象データと前記領域の対応を、前記記憶対象データの記憶期間に応じて定めた対応情報31と、対応情報に基づき、前記記憶対象データの記憶先の前記領域を決定する領域決定手段34と、領域決定手段が決定した領域に記憶対象データを格納するデータ格納手段37と、を有することを特徴とする。
【選択図】図2
To provide a storage device, an electronic control unit, and a storage method capable of dealing with a case where there is no more free space while suppressing an increase in the capacity of an EEPROM in which data is stored.
The storage device stores data in a non-volatile memory divided into a plurality of areas, and the correspondence between the storage target data accessed by the program and the areas is determined according to the storage period of the storage target data. Based on the determined correspondence information 31, based on the correspondence information, a region determination unit 34 that determines the storage destination region of the storage target data, and a data storage unit 37 that stores the storage target data in the region determined by the region determination unit It is characterized by having.
[Selection] Figure 2

Description

本発明は、ECUが有する記憶装置に関し、特に、データの書き換えが可能な記憶装置、電子制御ユニット及び記憶方法に関する。   The present invention relates to a storage device included in an ECU, and more particularly to a storage device capable of rewriting data, an electronic control unit, and a storage method.

車両には車載装置を電子制御するための電子制御ユニット(以下、ECUという)が搭載されている。ECUは、例えば、ECUの診断結果や、AV装置の設定値、ドライブレコーダの映像データ、各種のアプリケーションが使用するアプリデータ等、各種のデータを処理する。そして、このデータを不揮発性のメモリに保存しておく場合がある。   The vehicle is equipped with an electronic control unit (hereinafter referred to as ECU) for electronically controlling the in-vehicle device. The ECU processes various types of data such as ECU diagnosis results, AV device setting values, drive recorder video data, and application data used by various applications. In some cases, this data is stored in a nonvolatile memory.

ここで、ECUがデータを記憶するためにハードディスクドライブのような大容量の記憶装置を搭載することもあるが、多くのECUでは、EEPROMなど高速だが比較的小容量の記憶装置を搭載することが多い。   Here, the ECU may be equipped with a large-capacity storage device such as a hard disk drive for storing data, but many ECUs may be equipped with a high-speed but relatively small-capacity storage device such as an EEPROM. Many.

従来、ECUはEEPROMに書き込んだデータを上書きすることはなかったが、ECUが扱うデータがそれほど多くない状況では、上書きをしなくても目立った不都合は生じなかった。   Conventionally, the ECU has not overwritten the data written in the EEPROM. However, in the situation where the ECU does not have so much data, there is no noticeable inconvenience without overwriting.

しかしながら、車載装置の電子化が進むにつれ、ECUが扱うデータは多様化し、また、データ量も増加傾向にある。また、ECUに搭載されるマイコンにマルチコア型やマルチスレッド型のCPUが搭載されるようになってきたことも、1つのECUが扱うデータを増加させる傾向をもたらす。   However, as the in-vehicle devices become more and more electronic, the data handled by the ECU is diversified and the amount of data is also increasing. In addition, the fact that a multi-core type or multi-thread type CPU has been mounted on a microcomputer mounted on an ECU also tends to increase data handled by one ECU.

このため、EEPROMに書き込んだデータを上書きしないままでは、EEPROMの容量が不足するおそれがある。そこで、ECUが扱うデータの量に応じて、単純にECUが搭載するEEPROMの容量を増大させることが考えられる(例えば、特許文献1参照。)。特許文献1には、EEPROMを複数の領域に分けて、ABSが作動する毎に異なる領域にデータを記憶すると共に、データが書き込まれた領域への書き込みを禁止する車両の制御装置が開示されている。   For this reason, there is a possibility that the capacity of the EEPROM will be insufficient if the data written in the EEPROM is not overwritten. Thus, it is conceivable to simply increase the capacity of the EEPROM mounted on the ECU in accordance with the amount of data handled by the ECU (see, for example, Patent Document 1). Patent Document 1 discloses a vehicle control device that divides an EEPROM into a plurality of areas, stores data in different areas each time the ABS operates, and prohibits writing to the areas in which data is written. Yes.

特開平11−139296号公報JP 11-139296 A

しかしながら、EEPROMの容量を増大させると、コスト増や実装面積の増加をもたらすだけでなく、次のような問題が指摘される。   However, when the capacity of the EEPROM is increased, not only the cost and the mounting area are increased, but also the following problems are pointed out.

図1は、EEPROMの容量を増大させた際の問題を説明する図の一例である。図1は、EEPROMの容量の増大によるタクトタイムの増加を示している。タクトタイムとは、一工程で認められる作業時間である。EEPROMに対しても、記憶素子に異常がないことを検査するためのタクトタイムが定められている。   FIG. 1 is an example of a diagram for explaining a problem when the capacity of an EEPROM is increased. FIG. 1 shows an increase in tact time due to an increase in the capacity of the EEPROM. The takt time is the working time allowed in one process. Also for the EEPROM, a tact time for inspecting that there is no abnormality in the storage element is determined.

EEPROMの記憶素子を全量又は決まった比率で特定し、読み書きするような検査の場合、EEPROMの容量に比例して検査時間が増大する。例えば、EEPROMの容量が2倍になれば、検査時間も2倍になる。タクトタイムが図示するように決まっている場合、EEPROMの容量が増加する前はタクトタイムに収まっていた検査時間が、EEPROMの容量が増加することで、タクトタイムに収まらなくなる。   In the case of an inspection in which the memory elements of the EEPROM are specified in a total amount or at a fixed ratio and read / write is performed, the inspection time increases in proportion to the capacity of the EEPROM. For example, if the capacity of the EEPROM is doubled, the inspection time is also doubled. When the tact time is determined as shown in the figure, the inspection time that was within the tact time before the capacity of the EEPROM is increased cannot be accommodated in the tact time because the capacity of the EEPROM is increased.

また、特許文献1に開示された制御装置のように、領域を区分して、データが書き込まれた領域への書き込みを禁止するだけでは、全ての領域にデータが書き込まれた後、さらに次のデータをどのように記憶するかを特定できないという問題がある。   Further, as in the control device disclosed in Patent Document 1, it is only necessary to divide the area and prohibit writing to the area where the data has been written. There is a problem that it is impossible to specify how data is stored.

本発明は、データが記憶されるEEPROMの容量の増加を抑制しながら、空き容量の余裕がなくなった場合にも対応可能な記憶装置、電子制御ユニット及び記憶方法を提供することを目的とする。   An object of the present invention is to provide a storage device, an electronic control unit, and a storage method that can cope with a case where there is no more free space while suppressing an increase in the capacity of an EEPROM in which data is stored.

本発明は、複数の領域に区分された各領域のアドレス情報を記憶する不揮発メモリと、プログラムがアクセスする記憶対象データと前記領域の対応を、前記記憶対象データの記憶期間に応じて定めた対応情報と、前記対応情報に基づき、前記記憶対象データの記憶先の前記領域を決定する領域決定手段と、前記領域決定手段が決定した前記領域に前記記憶対象データを格納するデータ格納手段と、を有することを特徴とする記憶装置を提供する。   The present invention relates to a non-volatile memory that stores address information of each area divided into a plurality of areas, a correspondence between the storage target data accessed by the program and the area, according to a storage period of the storage target data Area determining means for determining the storage destination area of the storage target data based on the information and the correspondence information; and a data storage means for storing the storage target data in the area determined by the area determination means. A storage device including the storage device is provided.

データが記憶されるEEPROMの容量の増加を抑制しながら、空き容量の余裕がなくなった場合にも対応可能な記憶装置、電子制御ユニット及び記憶方法を提供することができる。   It is possible to provide a storage device, an electronic control unit, and a storage method that can cope with a case where there is no more free space while suppressing an increase in the capacity of an EEPROM in which data is stored.

EEPROMの容量を増大した際の問題を説明する図の一例である。It is an example of the figure explaining the problem at the time of increasing the capacity | capacitance of EEPROM. EEPROMの記憶構造を模式的に説明する図の一例である。FIG. 3 is an example of a diagram schematically illustrating a storage structure of an EEPROM. ECUの機能統合について説明する図の一例である。It is an example of the figure explaining functional integration of ECU. EEPROMのデータ構造の一例を示す図である。It is a figure which shows an example of the data structure of EEPROM. 各領域に記憶されたデータの遷移を模式的に説明する図の一例である。It is an example of the figure which illustrates typically the transition of the data memorize | stored in each area | region. EEPROM管理プログラムの機能ブロック図の一例である。It is an example of a functional block diagram of an EEPROM management program. ソート手段によるソート結果を模式的に示す図の一例である。It is an example of the figure which shows the sorting result by a sorting means typically. EEPROM管理プログラムがEEPROMにデータを記憶する手順を示すフローチャート図の一例である。It is an example of the flowchart figure which shows the procedure in which an EEPROM management program memorize | stores data in EEPROM. EEPROMの記憶構造を模式的に説明する図の一例である(実施例2)。FIG. 3 is an example of a diagram schematically illustrating a storage structure of an EEPROM (second embodiment). 各領域の遷移を模式的に説明する図の一例である(実施例2)(Example 2) which is an example of the figure which illustrates typically the transition of each area | region. EEPROM管理プログラムの機能ブロック図の一例である(実施例2)。It is an example of the functional block diagram of an EEPROM management program (Example 2). ソート手段によるソート結果を模式的に示す図の一例である(実施例2)。It is an example of the figure which shows the sorting result by a sorting means typically (Example 2). EEPROM管理プログラムがEEPROMにデータを記憶する手順を示すフローチャート図の一例である。It is an example of the flowchart figure which shows the procedure in which an EEPROM management program memorize | stores data in EEPROM.

以下、本発明を実施するための最良の形態について図面を参照しながら実施例を挙げて説明する。   Hereinafter, the best mode for carrying out the present invention will be described with reference to the drawings.

図2は、EEPROM100の記憶構造を模式的に説明する図の一例である。本実施例のEEPROM100は以下の特徴を有する。
(1)EEPROM100の領域が区分されており、各アプリはその重要度に応じてデータを領域A〜Cに格納する。
(2)ある領域に空き容量がなくなると、各アプリは、記憶時から最も時間が経過しているデータを特定し、そのデータが領域に応じた重要度を保っているか否かを判定する。
(3)そのデータが領域に応じた重要度を保っている場合、アプリはそのデータを相対的に重要度の低い領域に移動する。
FIG. 2 is an example of a diagram for schematically explaining the storage structure of the EEPROM 100. The EEPROM 100 of this embodiment has the following features.
(1) The area of the EEPROM 100 is divided, and each application stores data in the areas A to C according to its importance.
(2) When there is no more free space in a certain area, each application identifies data that has passed the most time since storage, and determines whether or not the data maintains the importance corresponding to the area.
(3) If the data maintains the importance corresponding to the area, the app moves the data to a relatively less important area.

例えば、EEPROM100がX領域、A領域、B領域及びC領域に区分されており、X(書き込み不可)>A>B>Cの順で、重要度が高いデータが記憶される領域であるとする。アプリXはEEPROM100に記憶すべきデータXA、X、Xを扱い、データXAは重要であるためA領域に、データXはそれほど重要でないためB領域に、データXは重要でないため領域Cに、それぞれ記憶する。 For example, the EEPROM 100 is divided into an X area, an A area, a B area, and a C area, and is an area in which highly important data is stored in the order of X (unwritable)>A>B> C. . The application X handles data X A , X B , and X C to be stored in the EEPROM 100. The data X A is important, so the data X B is not so important, so the data X C is not important. Therefore, it is stored in area C.

一方、アプリYはEEPROM100に記憶すべきデータY、Y、Yを扱い、データYは重要であるためA領域に、データYはそれほど重要でないためB領域に、データYは重要でないため領域Cに、それぞれ記憶する。 On the other hand, application Y treats data Y A to be stored in the EEPROM 100, Y B, and Y C, the A region for data Y A is important in B area for data Y B is not so important, the data Y C is Since it is not important, it is stored in area C.

アプリXがデータXをB領域に記憶した後、B領域の空き容量がなくなったものとする。アプリYがデータYをB領域に記憶する際、アプリYは、B領域で最も時間が経過したデータ(説明のため、データXとする)を特定し、B領域に応じた重要度を保っているか否かを判定する。具体的には、データXがB領域に記憶されてからの経過時間が、閾値を超えるか否かを判定する。 After the application X and stored by the data X B in the B region, it is assumed that the free space in the B region has disappeared. When the application Y stores the data Y B in the B area, the application Y specifies the data that has passed the most time in the B area (for the sake of explanation, it is referred to as data X B ), and determines the importance according to the B area. It is determined whether or not it is kept. More specifically, the data X B is the amount of time elapsed since the stored B area to determine whether more than a threshold value.

データXがB領域に応じた重要度を保ってる場合、アプリYは、データXをB領域からC領域に移動する。こうすることで、B領域に空き領域が生まれる。アプリYはデータYを領域Bに格納することができる。 When the data X B maintains the importance according to the B area, the application Y moves the data X B from the B area to the C area. By doing so, an empty area is created in the B area. App Y may store data Y B in the region B.

したがって、データの重要度に応じて記憶する初期の領域を変える、また、各領域の保存期間(上記の閾値)を重要度の高い領域ほど長くすることで、重要度の高いデータほど長くEEPROM100に記憶させておくことができる。換言すれば、EEPROM100に記憶すべきデータ量が多くても、重要でないデータほど早く消えていくので、EEPROM100の全容量をそれほど大きくしなくても、記憶すべきデータ量の増大に対応することができる。   Therefore, the initial area to be stored is changed according to the importance of the data, and the storage period (the above threshold) of each area is lengthened for the area with higher importance, so that the data with higher importance becomes longer in the EEPROM 100. It can be memorized. In other words, even if the amount of data to be stored in the EEPROM 100 is large, the data that is not important disappears earlier, so even if the total capacity of the EEPROM 100 is not increased so much, it can cope with the increase in the amount of data to be stored. it can.

〔ECU(electronic control unit)の統合〕
次に、図3を用いてECUの機能統合について説明する。図3(a)は、機能統合される2つのECUを模式的に示す図である。ECU_AとECU_BがCANバスを介して接続されている。ECU_Aは例えばAV装置のECUであり、ECU_Bは例えば警告用ECUである。
[Integration of ECU (electronic control unit)]
Next, functional integration of the ECU will be described using FIG. FIG. 3A is a diagram schematically showing two ECUs whose functions are integrated. ECU_A and ECU_B are connected via a CAN bus. ECU_A is, for example, an ECU of an AV apparatus, and ECU_B is, for example, a warning ECU.

ECU_Aのマイコン19Aは、カメラが撮影した画像を画像処理して、ナイトビューや白線認識用の映像としてディスプレイに出力する。このため、マイコン19Aは、一連の処理を制御するアプリXを実行する。アプリXは、例えば、映像フィルタ回路13が画像処理した画像データに、描画用プログラムを呼び出したり、描画用FlashROM12から読み出した描画データを重畳するなどして描画ASIC14に出力する。描画ASIC14が描画処理した画像データを映像出力回路15に出力すると、映像出力回路15がディスプレイに映像を表示する。また、アプリXは、描画用プログラムによる歩行者や白線の認識結果に応じて、音声合成回路16から注意換気のメッセージを、AVCLAN回路から注意換気音等を出力する。この他、マイコン19AはAVCLAN回路17を制御するためのAVCLANプログラムや、ECU_Aに特有のプラットフォーム(デバイスドライバ、OS等)を実行する。   The microcomputer 19A of the ECU_A performs image processing on the image taken by the camera and outputs it to the display as a video for night view or white line recognition. Therefore, the microcomputer 19A executes the application X that controls a series of processes. For example, the application X outputs the drawing data to the drawing ASIC 14 by calling a drawing program or superimposing drawing data read from the drawing flash ROM 12 on the image data processed by the video filter circuit 13. When the image data processed by the drawing ASIC 14 is output to the video output circuit 15, the video output circuit 15 displays the video on the display. Further, the application X outputs a caution ventilation message from the speech synthesis circuit 16 and a caution ventilation sound from the AVCLAN circuit in accordance with the recognition result of the pedestrian and the white line by the drawing program. In addition, the microcomputer 19A executes an AVCLAN program for controlling the AVCLAN circuit 17, and a platform (device driver, OS, etc.) specific to the ECU_A.

なお、CAN回路18AはCAN通信のトランシーバやCANコントローラであり、CANプロトコルに従って他のCAN回路18Bと通信する。   The CAN circuit 18A is a CAN communication transceiver or CAN controller, and communicates with another CAN circuit 18B according to the CAN protocol.

また、ECU_AのアプリXは、例えば、カメラが撮影した画像を、車両の減速度が所定値以上になった場合や、衝撃を検出した場合にEEPROM100に記憶する。すなわち、EEPROM100にはドライブレコーダの画像データが記憶される。   Further, the application X of the ECU_A stores, for example, an image captured by the camera in the EEPROM 100 when the vehicle deceleration exceeds a predetermined value or when an impact is detected. That is, the image data of the drive recorder is stored in the EEPROM 100.

また、一方、ECU_Bのマイコン19Bは、センサの検出結果に基づきブザー音を鳴らす。このため、マイコン19Bは、一連の処理を制御するアプリYを実行する。例えば、センサ通信回路22がセンサから検出したセンサ値を基準値と比較して、基準値以下の場合には、ブザー駆動プログラム(デバイスドライバ)によりブザー駆動回路21を駆動する。こうすることで、乗員に注意喚起することができる。この他、マイコン19Bはセンサ通信回路22との通信を制御するためのシリアル通信プログラムや、ECU_Bに特有のプラットフォーム(デバイスドライバ、OS等)を実行する。   On the other hand, the microcomputer 19B of the ECU_B sounds a buzzer sound based on the detection result of the sensor. For this reason, the microcomputer 19B executes the application Y that controls a series of processes. For example, the sensor value detected by the sensor communication circuit 22 from the sensor is compared with a reference value. If the sensor value is equal to or less than the reference value, the buzzer driving circuit 21 is driven by a buzzer driving program (device driver). In this way, the passenger can be alerted. In addition, the microcomputer 19B executes a serial communication program for controlling communication with the sensor communication circuit 22, and a platform (device driver, OS, etc.) specific to the ECU_B.

センサが検出するセンサ値は、電圧値や電流値である。ECU_BのアプリYは、ブザー音を鳴らす必要がある場合等、センサ値が基準値を満たさない場合に、そのセンサ値と付随するデータ(バッテリ残量、水温、位置情報等)をEEPROM100に記憶する。このデータを後の異常の解析に役立てることができる。   The sensor value detected by the sensor is a voltage value or a current value. When the sensor value does not satisfy the reference value, such as when it is necessary to sound a buzzer sound, the ECU_B application Y stores the sensor value and accompanying data (the remaining battery level, water temperature, position information, etc.) in the EEPROM 100. . This data can be used for later analysis of anomalies.

このように、車載装置の電子化が進んだため、車両に搭載されるECUは、多品種化が進んでおり、ECU毎の開発費の増大や搭載スペースの確保等が課題になりつつある。一方、マイコンのマルチコア化やマルチスレッド化が進み、1つのECUで複数の独立した処理を実行可能になってきた。   As described above, since in-vehicle devices have become more and more electronic, ECUs mounted on vehicles are becoming more diverse, and increasing development costs for each ECU and securing mounting space are becoming issues. On the other hand, multi-core and multi-threaded microcomputers have progressed, and a single ECU can execute a plurality of independent processes.

そこで、図3(b)に示すように、1つのECU(以下、統合ECU200という)に、ECU_AとECU_Bの機能を統合することが考えられている。図示するように、統合ECU200は、ECU_Aが有していた映像出力回路15、描画ASIC14、映像フィルタ回路13、描画用FlashROM12、電源IC11、音声合成回路16及びAVCLAN回路17、並びに、ECU_Bが有していた電源IC(センサ用)23、センサ通信回路22及びブザー駆動回路21を有する。また、機能が統合された結果、マイコン19だけでなく、EEPROM100及びCAN回路18は、アプリXとアプリYに共通に実装される。   Therefore, as shown in FIG. 3B, it is considered to integrate the functions of ECU_A and ECU_B into one ECU (hereinafter referred to as an integrated ECU 200). As shown in the figure, the integrated ECU 200 includes the video output circuit 15, the drawing ASIC 14, the video filter circuit 13, the drawing flash ROM 12, the power supply IC 11, the voice synthesis circuit 16 and the AVCLAN circuit 17, and the ECU_B, which the ECU_A has. The power supply IC (for sensor) 23, the sensor communication circuit 22, and the buzzer drive circuit 21 are provided. Further, as a result of the integration of functions, not only the microcomputer 19 but also the EEPROM 100 and the CAN circuit 18 are commonly mounted in the application X and the application Y.

統合ECU200は、アプリXとアプリY、及び、調停プログラムを実行する。調停プログラムは、アプリXとアプリYが共通に利用する資源へのアクセスを調停する。描画用プログラム及びAVCLANプログラムは機能統合しても同じものを利用でき、ソフトPFはECU_AのプラットフォームとECU_Bのプラットフォームの一部又は全体を、統合ECU200用に搭載したものである。IODは、データの入出力を制御する。   The integrated ECU 200 executes the application X, the application Y, and the arbitration program. The arbitration program arbitrates access to resources shared by the application X and the application Y. The drawing program and the AVCLAN program can be used even if functions are integrated, and the software PF is obtained by mounting a part or the whole of the ECU_A platform and the ECU_B platform for the integrated ECU 200. The IOD controls data input / output.

このように、複数のECUを機能統合することで、統合前のECUが共通に利用できる資源の数や面積を低減できる。また、HMT(ハードウェアマルチスレッド)という技術を利用すれば、従来、ソフトウェアにより実現していた複数プログラムの同時実行をハードウェアにより実現することができる。ハードウェアで実現することで、プログラムの切り替え時のオーバヘッドをほぼゼロにできる。また、開発済みのプログラム(アプリX、Y)を、修正することなく又は修正部を最小限にして統合ECU200に搭載できるので、統合ECU200の開発費を削減できることも期待される。なお、機能統合する対象となるECUは、図3に示したものに限定されることはなく、エンジンECUと、ブレーキECU、ハイブリッドECU等の制御系のECUを統合してもよいし、ボディECUやナビゲーション用のECUを統合してもよい。3つ以上のECUを統合してもよい。   Thus, by integrating the functions of a plurality of ECUs, the number and area of resources that can be commonly used by the ECUs before integration can be reduced. Further, if a technique called HMT (hardware multithread) is used, simultaneous execution of a plurality of programs that has been realized by software can be realized by hardware. By implementing it in hardware, the overhead when switching programs can be made almost zero. Further, since the developed program (applications X and Y) can be installed in the integrated ECU 200 without correction or with a minimum of the correction unit, it is expected that the development cost of the integrated ECU 200 can be reduced. Note that the ECUs to be functionally integrated are not limited to those shown in FIG. 3, and an engine ECU and a control ECU such as a brake ECU or a hybrid ECU may be integrated, or a body ECU Or an ECU for navigation may be integrated. Three or more ECUs may be integrated.

本実施例では、ECU_AのEEPROM100とECU_BのEEPROM100の合計容量よりも、統合ECU200のEEPROM100の容量を小さくする。こうすることで、機能統合によるEEPROM100の容量の増大やタスクタイムの増大を抑制することができる。EEPROM100は、電気的に書き換え可能なROM(不揮発メモリ)であればよく、フラッシュメモリ、FeRAM 、MRAM等、半導体の構造は問わない。

なお、統合ECU200のマイコン19は、この他、CPU、後述するRAM32、内部バス、入出力I/F等を有している。
〔EEPROM100のデータ構造〕
図4は、EEPROM100のデータ構造の一例を示す。図2にて説明したように、EEPROM100は4つの領域を有する。本実施例では、各領域の位置は固定であるとする。EEPROM100の決まったアドレス(例えば、先頭アドレスから所定範囲)には、各領域の境界アドレス(各領域の開始アドレス)が記憶されている。例えば、先頭アドレスから2Byteずつ順番に、X領域とA領域のX/A境界アドレス、A領域とB領域のA/B境界アドレス、B領域とC領域のB/C境界アドレス、が記憶されている。なお、領域を4つ以上に区分してもよい。
In this embodiment, the capacity of the EEPROM 100 of the integrated ECU 200 is made smaller than the total capacity of the EEPROM 100 of the ECU_A and the EEPROM 100 of the ECU_B. By doing so, it is possible to suppress an increase in the capacity of the EEPROM 100 and an increase in task time due to function integration. The EEPROM 100 may be any electrically rewritable ROM (nonvolatile memory), and may have any semiconductor structure such as flash memory, FeRAM, or MRAM.

In addition, the microcomputer 19 of the integrated ECU 200 includes a CPU, a RAM 32 (to be described later), an internal bus, an input / output I / F, and the like.
[Data structure of EEPROM100]
FIG. 4 shows an example of the data structure of the EEPROM 100. As described with reference to FIG. 2, the EEPROM 100 has four areas. In this embodiment, it is assumed that the position of each region is fixed. A boundary address (start address of each area) of each area is stored in a predetermined address (for example, a predetermined range from the top address) of the EEPROM 100. For example, the X / A boundary address of the X area and the A area, the A / B boundary address of the A area and the B area, and the B / C boundary address of the B area and the C area are stored in order of 2 bytes from the head address. Yes. Note that the area may be divided into four or more areas.

X領域には、初期設定用(デフォルト用)のデータ等、消去することが好ましくない重要なデータが記憶されており、アプリXやアプリYが新たにデータを書き込むことはできない。   In the X area, important data that is not preferable to be erased, such as data for initial setting (default), is stored, and the application X and the application Y cannot newly write data.

A領域には、アプリX及びアプリYが扱うデータのうち重要度が高いデータが記憶される。なお、この「扱うデータ」とは、アクセスするデータをいい、アプリX及びアプリYが生成するデータ、及び、すでにEEPROM100に記憶されており一時的に読み出されたデータの両方を含む。そして、A領域のデータは、予め定めた保存期間Aの間、上書きされないことが保証されている。図4では一例として保存期間Aを「1ヶ月」とした。   In the area A, data having high importance is stored among data handled by the application X and the application Y. The “data to be handled” refers to data to be accessed, and includes both data generated by the application X and the application Y and data that is already stored in the EEPROM 100 and temporarily read. The data in area A is guaranteed not to be overwritten during a predetermined storage period A. In FIG. 4, the storage period A is set to “1 month” as an example.

同様に、B領域には、アプリX及びアプリYが扱うデータのうち重要度が中程度のデータが記憶される。また、B領域のデータは、予め定めた保存期間Bの間、上書きされないことが保証されている。図4では一例として保存期間Bを「1週間」とした。   Similarly, data of medium importance is stored in the area B among the data handled by the application X and the application Y. Further, it is guaranteed that the data in the B area is not overwritten during a predetermined storage period B. In FIG. 4, the storage period B is set to “one week” as an example.

同様に、C領域には、アプリX及びアプリYが扱うデータのうち重要度が低いデータが記憶される。そして、C領域のデータは、C領域に格納されてから経過した時間が最も長いデータから消去される。したがって、C領域のデータは、最短で、EEPROM100のデータ更新の度に消去されることがあるが、C領域のデータに保存期間を定めないことで、EEPROM100の容量を小さくすることができる。   Similarly, in the area C, data having low importance among data handled by the application X and the application Y is stored. The data in the C area is erased from the data having the longest time elapsed since the data was stored in the C area. Therefore, the data in the C area may be deleted every time the data of the EEPROM 100 is updated, but the capacity of the EEPROM 100 can be reduced by not setting a storage period for the data in the C area.

なお、アプリXがA領域に記憶するデータは、例えば、車両の減速度が所定値以上になった時刻又は衝撃を検出した時刻の、前後の数秒の画像データ、B領域に記憶するデータはこれら時刻より相対的に離れた数秒の画像データ等である。また、アプリYがA領域に記憶するデータは、例えば、センサ値そのものであり、B領域に記憶するデータはセンサ値に付随するデータである。すなわち、共通の事象に発生した複数のデータでも、重要なデータはA領域に記憶される。   The data stored in the A area by the application X is, for example, the image data of several seconds before and after the time when the deceleration of the vehicle exceeds a predetermined value or the time when the impact is detected, and the data stored in the B area. For example, image data of several seconds that is relatively distant from the time. The data stored in the A area by the application Y is, for example, the sensor value itself, and the data stored in the B area is data accompanying the sensor value. In other words, important data is stored in the A area even in a plurality of data generated in a common event.

A領域の空き容量と保存期間Aについて説明する。保存期間Aを「1ヶ月」としても、A領域の最も古いデータの記憶時から「1ヶ月」経過する前に、A領域に空き容量がなくなる状況が生じうる。この場合、A領域の最も古いデータをB領域に移動することで、A領域に空き容量を生じさせることができる。また、A領域で最も古いデータが「1ヶ月」経過する前にB領域に移動されても、B領域でさらに「1週間」記憶されるので、合計で「1ヶ月」程度の間は記憶された状態を保つことができる。B領域についても同様である。   The free space in the A area and the storage period A will be described. Even when the storage period A is set to “1 month”, there may occur a situation in which there is no free space in the A area before “1 month” has elapsed since the oldest data in the A area was stored. In this case, by moving the oldest data in the A area to the B area, it is possible to generate free space in the A area. Even if the oldest data in area A is moved to area B before "1 month" elapses, it is further stored in area B for "1 week", so it is stored for a total of "1 month". Can be kept. The same applies to the B region.

A領域の最も古いデータが記憶時から「1ヶ月」経過していた場合は、A領域からそのデータを消去すればよく、B領域に移動しない。   If “one month” has passed since the oldest data in the A area has been stored, the data may be deleted from the A area and will not move to the B area.

なお、A領域の最も古いデータの記憶時から「1ヶ月」経過していても、例えば、B領域に空きがあることを条件に、B領域に移動してもよい。こうすることで、可能な限り、重要度の高いデータを記憶したままにすることができる。   Even if “one month” has elapsed since the oldest data in the A area was stored, the data may be moved to the B area, for example, on condition that the B area is empty. By doing so, it is possible to keep data having high importance stored as much as possible.

図5は、各領域に記憶されたデータの遷移を模式的に説明する図の一例である。なお、データを記憶するのはアプリXやYであるが、データを移動するのはアプリXやYに共通のEEPROM管理プログラム50とする。EEPROM管理プログラム50については後述する。   FIG. 5 is an example of a diagram for schematically explaining the transition of data stored in each area. The data is stored in the applications X and Y, but the data is moved in the EEPROM management program 50 common to the applications X and Y. The EEPROM management program 50 will be described later.

図5ではアプリXのデータXA、Xを例に説明するが、Y、Yについても同様である。アプリXは、データXAを記憶する際、GPS等や時計から時刻情報を取得する。時刻情報には、日付(201X年○月○日)と時刻(○時○分○秒)が含まれる。EEPROM管理プログラム50は、A領域に、日付を「記憶日時」として時刻を「記憶時刻」として、データXAと共に(例えば、データXAの次のアドレスに)記憶する。 In FIG. 5, the data X A and X B of the application X will be described as an example, but the same applies to Y A and Y B. When the application X stores the data X A , the application X acquires time information from a GPS or the like or a clock. The time information includes a date (201X year * month * day) and time (* hour * minute * second). The EEPROM management program 50 stores the date in the A area as the “storage date and time” and the time as the “storage time” together with the data X A (for example, at the next address of the data X A ).

そして、EEPROM管理プログラム50は、データXAをB領域に移動する際、記憶時刻をB領域に移動した移動日付Bに変更し、B領域に、データXAと共に記憶する。データXAがA領域に記憶されてから時間がたつと、記憶時刻の重要性は薄れるので、記憶時刻を移動日付Bに変更しても不都合は少ない。こうすることで、B領域に移動されたデータXAが占める容量を、データXAに記憶時刻を加えたままとするより低減することができる。 Then, when moving the data X A to the B area, the EEPROM management program 50 changes the storage time to the movement date B moved to the B area, and stores the data X A together with the data X A in the B area. Since the importance of the storage time decreases as time passes after the data X A is stored in the A area, there is little inconvenience even if the storage time is changed to the movement date B. By doing so, the capacity occupied by the data X A moved to the area B can be reduced as compared with the case where the storage time is added to the data X A.

同様に、EEPROM管理プログラム50は、データXAをC領域に移動する際、移動日付Bを、C領域に移動した移動日付Cに変更し、C領域に、データXAと共に記憶する。こうすることで、C領域に移動されたデータXAが占める容量を、データXAに移動日付Bを加えたままとするより低減することができる。 Similarly, when moving the data X A to the C area, the EEPROM management program 50 changes the movement date B to the movement date C moved to the C area and stores it together with the data X A in the C area. By doing so, the capacity occupied by the data X A moved to the area C can be reduced as compared to the case where the movement date B is added to the data X A.

データXについては、最初に記憶される領域がB領域なので、B領域に記憶される際、データXと共に記憶日時と記憶時刻が記憶される。そして、EEPROM管理プログラム50は、データXをC領域に移動する際、記憶時刻を、C領域に移動した移動日付Cに変更し、C領域に、データXと共に記憶する。 The data X B is the area which is initially stored since B-region, when it is stored in the B area, the storage time and the storage time is stored along with the data X B. Then, EEPROM management program 50, when moving data X B to C region, the storage time was changed to move the date C that has moved to the C region, the C region, and stores along with the data X B.

〔EEPROM管理プログラム50〕
図6は、EEPROM管理プログラム50の機能ブロック図の一例である。EEPROM管理プログラム50は、統合ECU200のCPUが実行することで実現される、領域決定手段34、残容量判定手段35、データ特定手段36、データ格納手段37及びソート手段38を有する。EEPROM管理プログラム50とマイコンが一体となって、特許請求の範囲の記憶装置を実現する。EEPROM管理プログラム50は、EEPROM100に記憶されていてもよいし、アプリX,Yに記述されていてもよいし、不図示のメモリに記憶されていてもよい。
[EEPROM management program 50]
FIG. 6 is an example of a functional block diagram of the EEPROM management program 50. The EEPROM management program 50 includes an area determining unit 34, a remaining capacity determining unit 35, a data specifying unit 36, a data storing unit 37, and a sorting unit 38, which are realized by being executed by the CPU of the integrated ECU 200. The EEPROM management program 50 and the microcomputer are integrated to realize the storage device of the claims. The EEPROM management program 50 may be stored in the EEPROM 100, may be described in the applications X and Y, or may be stored in a memory (not shown).

アプリX,Yは、アプリに特有の処理を実行中、データアクセスの早いRAM32にデータXA等を,記憶している。このため、EEPROM管理プログラム50は、所定のタイミングで、RAM32のデータをEEPROM100に記憶する。 The applications X and Y store data X A and the like in the RAM 32 with quick data access while executing processing specific to the application. Therefore, the EEPROM management program 50 stores the data in the RAM 32 in the EEPROM 100 at a predetermined timing.

まず、領域決定手段34は、データ毎に重要度を定めた重要度テーブル31を参照して、データ毎に記憶先の領域を決定する。重要度テーブル31により、データ毎に記憶先の領域も決定できる。重要度テーブル31は、EEPROM100の決まったアドレスに記憶される。なお、RAM32に記憶されたデータにXA等の表記があるわけではないので、領域決定手段34はアプリX及びアプリYからRAM32に記憶されたデータの識別情報を取得しておく。また、RAM32の特定のアドレスには特定のアプリのデータが記憶されるようにしておいてもよい。 First, the area determination unit 34 determines the storage destination area for each data with reference to the importance table 31 that defines the importance for each data. The importance level table 31 can also determine the storage destination area for each data. The importance level table 31 is stored at a predetermined address in the EEPROM 100. Since the data stored in the RAM 32 does not have a notation such as X A , the area determination unit 34 acquires the identification information of the data stored in the RAM 32 from the application X and the application Y. Further, specific application data may be stored at a specific address in the RAM 32.

図示するように、領域決定手段34は、データXA、データYをA領域に、データX、データYをB領域に、データX、データYをC領域に、それぞれ記憶すると決定する。 As shown in the figure, the area determining means 34 stores data X A and data Y A in the A area, data X B and data Y B in the B area, and data X C and data Y C in the C area. decide.

残容量判定手段35は、各領域にデータを格納する空き容量があるか否かを判定する。空き領域があれば、その領域にデータを記憶すればよい。空き容量がない場合、残容量判定手段35は、データ特定手段36にデータの特定を要求する。   The remaining capacity determining means 35 determines whether or not there is a free capacity for storing data in each area. If there is an empty area, data may be stored in that area. If there is no free space, the remaining capacity determining means 35 requests the data specifying means 36 to specify data.

データ特定手段36は、領域決定手段34が決定した領域において、消去又は移動するデータを特定する。データ特定手段36のデータの特定ルールは次のように表すことができる。   The data specifying means 36 specifies data to be erased or moved in the area determined by the area determining means 34. The data specifying rule of the data specifying means 36 can be expressed as follows.

・A(B)領域の場合
1.最も古いデータODを特定する
2.その最も古いデータODが保存期間A(B)を超えているか否かを判定する
3-1.保存期間A(B)を超えているデータODを消去の対象に決定する
3-2.保存期間A(B)を超えていないデータODを移動の対象に決定する
・C領域の場合
1.最も古いデータODを特定する
2.その最も古いデータODを消去の対象に決定する
このデータの特定ルールによれば、A領域に記憶されたデータについては、A領域、B領域及びC領域のそれぞれで空き容量がなくならない限り消去されないので、EEPROM100に保存される期間を実質的に保存期間Aよりも長くする可能性が高くなる。同様に、B領域に記憶されたデータについては、B領域及びC領域のそれぞれに空き容量がなくならない限り消去されないので、EEPROM100に保存される期間を実質的に保存期間Bよりも長くすることができる。
-In the case of A (B) area 1. Identify the oldest data OD It is determined whether or not the oldest data OD exceeds the storage period A (B) 3-1. Data OD that exceeds the storage period A (B) is determined as a deletion target 3-2. Data OD that does not exceed the storage period A (B) is determined as the object of movement. 1. Identify the oldest data OD The oldest data OD is determined to be erased. According to this data specification rule, data stored in the A area is not erased unless there is no free space in each of the A area, the B area, and the C area. Therefore, there is a high possibility that the period stored in the EEPROM 100 is substantially longer than the storage period A. Similarly, since the data stored in the B area is not erased unless there is no free space in each of the B area and the C area, the period stored in the EEPROM 100 can be made substantially longer than the storage period B. it can.

より具体的には、A領域に記憶されたデータは、およそ、期待保存期間A=「1ヶ月」〜「1ヶ月+1週間+C領域で相対的により古いデータが全て消去されるまで」保存され、B領域に記憶されたデータは、期待保存期間B=「1週間」〜「1週間+C領域で相対的により古いデータが全て消去されるまで」保存される。また、C領域に記憶されたデータは、期待保存期間C=「相対的により古いデータが全て消去されるまで」保存される。   More specifically, the data stored in the area A is approximately stored in the expected storage period A = “1 month” to “1 month + 1 week + until all older data is deleted in the C area”, The data stored in the B area is stored in the expected storage period B = “1 week” to “1 week + until all older data is deleted in the C area”. Further, the data stored in the C area is stored in the expected storage period C = “until all older data is erased relatively”.

ここで例として、A領域にデータXAを記憶する空き容量がなかった場合を説明する。データ特定手段36は、空き容量のないA領域で、各データの記憶日付及び記憶時刻と現在時刻を比較して、最も古いデータODを特定する。このデータODをB領域に移動することで、データXAをA領域に記憶することが可能になる。 Here, as an example, a case where there is no free capacity for storing data X A in the A area will be described. The data specifying means 36 compares the storage date and storage time of each data with the current time in the A area where there is no free space, and specifies the oldest data OD. By moving this data OD to the B area, the data X A can be stored in the A area.

データ特定手段36は、データXA/領域(この場合はA領域)/データODをデータ格納手段に通知する。また、データ特定手段36は、最も古いデータODを残容量判定手段35に通知する。データODは重要度が高いので、優先的に領域Bに記憶する必要があるためである。したがって、残容量判定手段35は、B領域にデータODを格納する空き容量があるか否かを判定する。以降はこれらの処理の繰り返しになり、B領域にデータODを格納する空き容量がない場合、データ特定手段36は、B領域で最も古いデータODを特定する。同様に、B領域のデータODはC領域に優先的に記憶される。C領域に空き容量がない場合、C領域の最も古いデータが消去される。 The data specifying unit 36 notifies the data storage unit of data X A / area (A area in this case) / data OD. Further, the data specifying unit 36 notifies the remaining capacity determining unit 35 of the oldest data OD. This is because the data OD is highly important and needs to be preferentially stored in the area B. Therefore, the remaining capacity determination means 35 determines whether or not there is a free capacity for storing the data OD in the B area. Thereafter, these processes are repeated, and when there is no free space for storing the data OD in the B area, the data specifying means 36 specifies the oldest data OD in the B area. Similarly, the data OD in the B area is preferentially stored in the C area. If there is no free space in the C area, the oldest data in the C area is erased.

すなわち、データ格納手段37は、データXAをA領域に記憶し、かつ、データODをB領域にそれぞれ記憶する。また、必要であれば、B領域のデータODをC領域に移動させ、C領域のデータODを消去する。こうすることで、重要度の高いデータが、重要度の高い(保存期間が長い)領域に記憶されることになる。 That is, the data storage unit 37 stores the data X A in the A area and the data OD in the B area. If necessary, the data OD in the B area is moved to the C area, and the data OD in the C area is erased. By doing so, highly important data is stored in a high importance (long storage period) area.

そして、RAM32に記憶されていた全てのデータについて、領域A〜Cへの記憶が完了すると、ソート手段38が領域A〜Cのデータをソートする。ソート順は、アプリがデータを利用しやすい順番とすればよい。また、アプリX、Y毎に異なっていてもよい。本実施例では、アプリ毎に、記憶日付及び記憶時刻の降順(古い順)にソートするものとする。データに記憶時刻が記されていなければ、記憶日付のみでソートする。(以下、記憶日付と記憶時刻を区別せずに、単に「記憶日時」という)。   When all the data stored in the RAM 32 is stored in the areas A to C, the sorting unit 38 sorts the data in the areas A to C. The sort order may be an order in which the application can easily use the data. Moreover, you may differ for every application X and Y. In this embodiment, it is assumed that the storage date and the storage time are sorted in descending order (oldest order) for each application. If the storage time is not described in the data, the data is sorted only by the storage date. (Hereinafter, the storage date and the storage time are not distinguished and are simply referred to as “storage date and time”).

図7は、ソート手段38によるソート結果を模式的に示す図の一例である。A領域のXA1〜XA3は、アプリXが記憶した重要度の高いデータXAを、記憶日付の降順に示す。B領域のXA4〜XA5は、アプリXが記憶した重要度の高いデータXAのうち、B領域に移動されたデータXAを、記憶日付の降順に示す。B領域の、X1、X2は、アプリXが記憶した重要度が中程度のデータXを、記憶日付の降順に示す。 FIG. 7 is an example of a diagram schematically showing a sorting result by the sorting means 38. X A 1 to X A of the A region 3, a high data X A importance app X is stored, shown in order of decreasing storage date. X A 4 to x A 5 and B region, of the importance of high data X A app X is stored, the moved data X A to B region, shown in order of decreasing storage date. In the area B, X B 1 and X B 2 indicate the data X B stored by the application X and having the medium importance in descending order of the storage date.

同様に、A領域の、Y1〜Y2は、アプリYが記憶した重要度の高いデータYを、記憶日時の降順に示す。B領域の、Y1〜Y3は、アプリYが記憶した重要度が中程度のデータYを、記憶日時の降順に示す。したがって、ソートすることにより、アプリX,Yは連続したアドレスにアクセスすれば各データにアクセスできることになる。 Similarly, the A region, Y A 1 to Y A 2 is a high data Y A importance app Y is stored, shown in descending order of storage time. Region B, Y B 1 to Y B 3 is a data Y B of moderate importance app Y is stored, shown in descending order of storage time. Therefore, by sorting, the applications X and Y can access each data by accessing consecutive addresses.

ソート手段38は、各アプリX、Yが、それぞれのデータにアクセスできるように、ポインタを生成する。ポインタテーブル33には、アプリ毎に、データXAの開始アドレスと終了アドレスが登録される。例えば、アプリXのデータは、A領域では、ポインタ「PSX1〜PEX1」が示すアドレス範囲に、B領域では、ポインタ「PSX2〜PEX2」と「PSX3〜PEX3」が示すアドレス範囲に、記憶されていることが登録される。したがって、例えばアプリXは、A領域のデータXA1〜XA3のみ、A領域のデータXA1〜XA3及びB領域のデータXA4とXA5、又は、アプリXの全てのデータ、のように、所望のデータだけをEEPROM100から読み出すことができる。 The sorting unit 38 generates a pointer so that the applications X and Y can access the data. The pointer table 33, for each application, start and end addresses of the data X A is registered. For example, the data of the application X has an address range indicated by the pointers “P SX1 to P EX1 ” in the A area, and an address range indicated by the pointers “P SX2 to P EX2 ” and “P SX3 to P EX3 ” in the B area. Is stored. Thus, for example, application X is, only the data X A 1 to X A 3 of the area A, the data X A 4 and X A 5 data X A 1 to X A 3 and B region of A area, or all application X Only the desired data can be read from the EEPROM 100.

すなわち、A領域には1つのアプリに対し最大1つのアドレス領域しか存在せず、B領域とC領域には、1つのアプリに対し最大2つのアドレス領域しか存在しない。よって、A領域に記憶されていたデータXA4とXA5だけを読み出すことや、最初からB領域に記憶されているデータX1とX2だけを読み出すことも容易である。 That is, there is only a maximum of one address area for one application in the A area, and there are only a maximum of two address areas for one application in the B area and the C area. Therefore, it is easy to read only the data X A 4 and X A 5 stored in the A area, or to read only the data X B 1 and X B 2 stored in the B area from the beginning.

したがって、ソートすること及びポインタテーブル33によって、記憶後に領域間でデータを移動しても、各アプリは所望のデータに自由にアクセスできることになる。なお、ポインタテーブル33は、EEPROM100の決まったアドレスに記憶される。   Therefore, by sorting and the pointer table 33, each application can freely access desired data even if data is moved between areas after storage. The pointer table 33 is stored at a predetermined address in the EEPROM 100.

〔EEPROM100への記憶手順〕
図8は、EEPROM管理プログラム50がEEPROM100にデータを記憶する手順を示すフローチャート図の一例である。図8の手順は、例えば、エンジンの停止時やメインシステム(ハイブリッド車や電気自動車の場合)の停止時にスタートする。エンジンの停止時のルーチンとして、EEPROM管理プログラム50が起動される。EEPROM管理プログラム50をアプリX,Yの一部に搭載してもよい。
[Storing procedure to EEPROM100]
FIG. 8 is an example of a flowchart showing a procedure for storing data in the EEPROM 100 by the EEPROM management program 50. The procedure of FIG. 8 starts when the engine is stopped or when the main system (in the case of a hybrid vehicle or an electric vehicle) is stopped, for example. The EEPROM management program 50 is activated as a routine for stopping the engine. The EEPROM management program 50 may be installed in a part of the applications X and Y.

なお、EEPROM100上でデータの書き変えを行うと、データの損失のおそれがあり、また、EEPROM100の書き換え回数が増加してしまうので、EEPROM管理プログラム50は、EEPROM100の全内容をRAM32にコピーしてから以降の処理を実行する。   If data is rewritten on the EEPROM 100, there is a risk of data loss, and the number of times the EEPROM 100 is rewritten increases, so the EEPROM management program 50 copies the entire contents of the EEPROM 100 to the RAM 32. Execute the subsequent processing from.

まず、領域決定手段34は、ポインタテーブル33を読み出す(S10)。ポインタテーブル33により、領域決定手段34は各アプリ毎にデータを読み出すことができる。   First, the area determination unit 34 reads the pointer table 33 (S10). By the pointer table 33, the area determination means 34 can read data for each application.

次に、領域決定手段34は、RAM32に記憶されているデータを、予め定められた順番に1つずつ読み出す(S20)。予め定められた順番は、アプリの重要度に応じたアプリ毎、かつ、そのアプリが扱うデータの重要度順である。例えば、アプリXのデータXA、アプリYのデータY、データX,データY、データX、データYの順である。 Next, the area determination means 34 reads the data stored in the RAM 32 one by one in a predetermined order (S20). The predetermined order is the order of importance of the data handled by the application for each application according to the importance of the application. For example, data X A of application X, data Y A of application Y, data X B , data Y B , data X C , and data Y C are arranged in this order.

領域決定手段34は、RAM32から読み出したデータの記憶先の領域A〜Cを、重要度テーブル31を参照して決定する(S30)。   The area determination unit 34 determines the storage areas A to C of the data read from the RAM 32 with reference to the importance level table 31 (S30).

そして、残容量判定手段35は、S30で決定した領域に空き容量があるか否かを判定する(S40)。空き容量がある場合(S40のYes)、消去や移動の処理は不要なので、処理は、ステップS80に進む。   Then, the remaining capacity determining means 35 determines whether or not there is a free capacity in the area determined in S30 (S40). If there is free space (Yes in S40), the process proceeds to step S80 because the erasing and moving processes are unnecessary.

空き容量がない場合(S40のNo)、消去や移動の処理が必要になるので、データ特定手段36が、決定された領域内で、記憶されてから最も時間が経過しているデータODを特定する(S50)。   If there is no free space (No in S40), it is necessary to delete or move the data. Therefore, the data specifying means 36 specifies the data OD that has been stored for the longest time in the determined area. (S50).

次の処理は、S30で決定した領域がA領域とB領域のいずれか、又は、C領域かに応じて異なるが、結局、データ特定手段36は、データODを消去するか移動するかを決定する(S60)。   The next process differs depending on whether the area determined in S30 is either the A area, the B area, or the C area, but eventually the data specifying means 36 determines whether to delete or move the data OD. (S60).

・S30で決定した領域がA領域とB領域のいずれかの場合
データ特定手段36はデータODがその領域に記憶されてからの経過時間が、保存期間A、Bを超えているか否かを判定する。データ特定手段36は、保存期間A、Bを超えているデータODを消去すると決定し、データ格納手段37に記憶対象のデータ/領域/データODを通知する。
When the area determined in S30 is either the A area or the B area, the data specifying unit 36 determines whether the elapsed time since the data OD is stored in the area exceeds the storage periods A and B To do. The data specifying unit 36 determines to delete the data OD that exceeds the storage periods A and B, and notifies the data storage unit 37 of the data / area / data OD to be stored.

保存期間A、Bを超えていないデータODは相対的に次に重要度の低い領域に移動すると決定し、データ格納手段37に記憶対象のデータ/領域/データODを通知する。移動の場合、データ特定手段36は、移動すると決定したデータODを残容量判定手段35に通知する
・S30で決定した領域がC領域の場合
データ特定手段36はデータODを消去すると決定し、データ格納手段37に記憶対象のデータ/領域/データODを通知する。
The data OD that has not exceeded the storage periods A and B is determined to move to the next least important area, and the data storage unit 37 is notified of the data / area / data OD to be stored. In the case of movement, the data specifying means 36 notifies the remaining capacity determining means 35 of the data OD determined to move. When the area determined in S30 is the C area, the data specifying means 36 determines to delete the data OD, and the data The storage unit 37 is notified of data / area / data OD to be stored.

データODを消去すると判定された場合、データ格納手段37は通知されたデータODを消去する(S70)。   When it is determined to delete the data OD, the data storage unit 37 deletes the notified data OD (S70).

データODを移動すると判定された場合、残容量判定手段35は、データODの移動先の領域に空き容量があるか否かを判定する(S40)。ステップS40〜70により、RAM32のデータを記憶する空き容量を生成することができる。   When it is determined that the data OD is to be moved, the remaining capacity determination unit 35 determines whether or not there is a free capacity in the movement destination area of the data OD (S40). Through steps S40 to S70, a free capacity for storing data in the RAM 32 can be generated.

次に、データ格納手段37は、RAM32のデータを、EEPROM100のデータ構造を再現したRAM32内に記憶する(S80)。これにより、1つのデータをEEPROM100に格納する用意ができた。   Next, the data storage means 37 stores the data in the RAM 32 in the RAM 32 that reproduces the data structure of the EEPROM 100 (S80). Thus, one piece of data is ready to be stored in the EEPROM100.

次に、領域決定手段34はRAM32の全データの処理が完了したか否かを判定する(S90)。全データの処理が完了していない場合(S90のNo)、EEPROM管理プログラム50は同じ処理をRAM32の全データに繰り返す。全データの処理が完了した場合(S90のYes)、ソート手段38が各領域A〜Cのデータをソートする(S100)。これにより、アプリ毎にデータを並べることができる。また、ソート手段38は、ソート結果に従い、ポインタテーブル33を更新する。そして、ソート手段38は、RAM32内のデータをEEPROM100に書き戻す(S110)。以上で、EEPROM100への記憶手順が終了する。   Next, the area determination unit 34 determines whether or not the processing of all data in the RAM 32 has been completed (S90). When the processing of all data has not been completed (No in S90), the EEPROM management program 50 repeats the same processing for all data in the RAM 32. When the processing of all data is completed (Yes in S90), the sorting unit 38 sorts the data in the areas A to C (S100). Thereby, data can be arranged for every application. In addition, the sorting unit 38 updates the pointer table 33 according to the sorting result. Then, the sorting unit 38 writes the data in the RAM 32 back to the EEPROM 100 (S110). This completes the procedure for storing data in the EEPROM 100.

以上説明したように、本実施例のECUは、重要なデータほど長く記憶されるようにすることで、EEPROM100の全容量をそれほど大きくしなくても、記憶すべきデータ量の増大に対応することができる。   As described above, the ECU of the present embodiment can cope with an increase in the amount of data to be stored without making the total capacity of the EEPROM 100 so large by storing important data for a long time. Can do.

〔変形例〕
各領域に記憶されてからの経過時間が保存期間を超えていなくても、各領域に空き容量がなくなった場合、データODを移動することなく、データODを消去してもよい。こうすることで、移動の処理が不要になり、また、ポインタテーブル33の容量も削減できる。
[Modification]
Even if the elapsed time from storage in each area does not exceed the storage period, the data OD may be erased without moving the data OD if there is no free space in each area. By doing so, the movement process becomes unnecessary, and the capacity of the pointer table 33 can be reduced.

この場合、データ特定手段36のデータの特定ルールは次のように表すことができる。   In this case, the data specifying rule of the data specifying means 36 can be expressed as follows.

・A〜C領域について
1.最も古いデータを特定する
2.その最も古いデータを消去の対象に決定する
データODは、経過時間が保存期間を超えていなくても消去される可能性が高まるが、各領域A〜Cに十分な容量を割り当てておくことで、実質的に、経過時間が保存期間を超えないようにすることができる。
・ Regarding the A to C region 1. Identify the oldest data The oldest data is determined to be erased. Data OD is more likely to be erased even if the elapsed time does not exceed the retention period, but by assigning sufficient capacity to each area A to C. In practice, the elapsed time may not exceed the storage period.

本実施例では、A領域とB領域、B領域とC領域の境界を可変とするEEPROM100について説明する。   In this embodiment, an EEPROM 100 in which the boundary between the A area and the B area and the boundary between the B area and the C area is variable will be described.

図9は、EEPROM100の記憶構造を模式的に説明する図の一例である。本実施例のEEPROM100の以下の特徴を有する。
(1)EEPROM100の領域が区分されており、各アプリはその重要度に応じてデータを領域A〜Cに格納する。
(2)ある領域に空き容量がなくなると、各アプリは、記憶時から最も時間が経過しているデータを特定し、そのデータが領域に応じた重要度を保っているか否かを判定する。
(3)そのデータが領域に応じた重要度を保っている場合、各アプリは、A領域又はB領域を拡大又は縮小する。
FIG. 9 is an example of a diagram for schematically explaining the storage structure of the EEPROM 100. The EEPROM 100 of this embodiment has the following features.
(1) The area of the EEPROM 100 is divided, and each application stores data in the areas A to C according to its importance.
(2) When there is no more free space in a certain area, each application identifies data that has passed the most time since storage, and determines whether or not the data maintains the importance corresponding to the area.
(3) When the data maintains the importance according to the area, each application enlarges or reduces the A area or the B area.

実施例1の図2にて説明したとおり、アプリXが、データXAをA領域に、データXをB領域に、データXを領域Cに、それぞれ記憶するとする。アプリYは、データYをA領域に、データYをB領域に、データYをC領域に、それぞれ記憶するとする。 As described with reference to FIG. 2 of the first embodiment, it is assumed that the application X stores the data X A in the A area, the data X B in the B area, and the data X C in the area C. It is assumed that the application Y stores the data Y A in the A area, the data Y B in the B area, and the data Y C in the C area.

そして、アプリXがデータXをB領域に記憶した後、B領域の空き容量がなくなった場合、アプリYがデータYをB領域に記憶する際、アプリYは、B領域で最も重要度が低いデータ(説明のため、データXとする)を特定し、B領域に応じた重要度を保っているか否かを判定する。具体的には、データXがB領域に記憶されてからの経過時間が、閾値を超えるか否かを判定する。 Then, after the app X stores the data X B in the B region, when the free space in the B region is lost, when the app Y stores the data Y B in the B region, the app Y has the highest importance in the B region. (for illustration, the data X B) is less data to identify, determines whether the maintaining the degree of importance according to the B region. More specifically, the data X B is the amount of time elapsed since the stored B area to determine whether more than a threshold value.

データXがB領域に応じた重要度を保ってる場合、アプリYは、データXを移動することなく、データYをB領域に記憶する。B領域には、空き容量がないので、そのままではデータYをB領域に記憶することができない。よって、EEPROM管理プログラム50は、B/Cアドレス境界を変更して、B領域を拡大する。図9では、B/Cアドレス境界が「300」から「310」に変更されている。 When the data X B maintains the importance according to the B area, the application Y stores the data Y B in the B area without moving the data X B. Since there is no free space in the B area, the data Y B cannot be stored in the B area as it is. Therefore, the EEPROM management program 50 changes the B / C address boundary and expands the B area. In FIG. 9, the B / C address boundary is changed from “300” to “310”.

こうすることで、A領域とB領域に記憶されるデータについては、保存期間A、B未満で消去されるデータをほぼゼロにすることができる。「ほぼ」としたのは、C領域の大きさが不十分だと、B領域の拡大が困難になりB領域のデータが、保存期間B未満で消去される可能性があるためである。しかし、C領域の大きさを適切に設定することで、A領域とB領域に記憶されるデータについては、保存期間A,B未満で消去されるデータをゼロにできるとしてよい。また、重要度の異なるデータが複数の領域に散在することがなくなり、また、ポインタの数も実施例1に比べて低減することができる。   By doing so, with respect to the data stored in the A area and the B area, the data to be erased in the storage periods A and B can be made almost zero. The reason for “substantially” is that if the size of the C region is insufficient, it is difficult to expand the B region, and data in the B region may be erased in less than the storage period B. However, by appropriately setting the size of the C area, the data to be erased in the storage periods A and B may be made zero for the data stored in the A area and the B area. Further, data with different importance levels are not scattered in a plurality of areas, and the number of pointers can be reduced as compared with the first embodiment.

したがって、EEPROM100の全容量をそれほど大きくしなくても、記憶すべきデータ量の増大に対応することができる。   Therefore, an increase in the amount of data to be stored can be accommodated without increasing the total capacity of the EEPROM 100.

〔EEPROM100のデータ構造〕
図9のデータ構造は、図4とほぼ同じであるが、本実施例では、X/Aアドレス境界だけが固定であり、A/Bアドレス境界とB/Cアドレス境界は可変である。この2つのアドレス境界は、上下のどちらにも移動する可能性がある。すなわち、A領域に空き容量がない状態で、さらにA領域にデータを記憶する必要がある場合は、A/Bアドレス境界の値は大きくなる(A領域が大きくなる)。A領域に十分な空き容量がある状態では、A/Bアドレス境界の値は小さくなる(A領域が小さくなる)。
[Data structure of EEPROM100]
The data structure of FIG. 9 is almost the same as that of FIG. 4, but in this embodiment, only the X / A address boundary is fixed, and the A / B address boundary and the B / C address boundary are variable. These two address boundaries may move either up or down. That is, when there is no free space in the A area and data needs to be stored in the A area, the value of the A / B address boundary becomes large (the A area becomes large). In a state where there is sufficient free space in the A area, the value of the A / B address boundary becomes small (the A area becomes small).

なお、A領域が小さくなりすぎないように、A/Bアドレス境界には下限値が設けられている。一方、A領域には重要度が高いデータが記憶されるので、A/Bアドレス境界には上限値が設けられていない。   Note that a lower limit is provided at the A / B address boundary so that the A area does not become too small. On the other hand, since data with high importance is stored in the A area, no upper limit value is provided at the A / B address boundary.

同様に、B領域に空き容量がない状態で、さらにB領域にデータを記憶する必要がある場合は、B/Cアドレス境界の値は大きくなる(B領域が大きくなる)。B領域に十分な空き容量がある状態では、B/Cアドレス境界の値は小さくなる(B領域が小さくなる)。   Similarly, when there is no free space in the B area and it is necessary to store data in the B area, the value of the B / C address boundary becomes large (the B area becomes large). In a state where there is sufficient free space in the B area, the value of the B / C address boundary becomes small (the B area becomes small).

なお、B領域が小さくなりすぎないように、B/Cアドレス境界には下限値が設けられている。また、B領域を大きくしすぎるとC領域がなくなってしまうので、B/Cアドレス境界には上限値が設けられている。   In order to prevent the B area from becoming too small, a lower limit is provided at the B / C address boundary. Also, if the B area is made too large, the C area disappears, so an upper limit value is provided at the B / C address boundary.

実施例1と同様に、領域のデータには、保存期間A(例えば「1ヶ月」)が定められており、B領域のデータには、保存期間B(例えば、「1週間」)が定められている。また、C領域のデータは、C領域に格納されてから最も時間の経過したデータから消去される。   Similar to the first embodiment, the storage period A (for example, “1 month”) is defined for the data in the area, and the storage period B (for example, “1 week”) is defined for the data in the area B. ing. Further, the data in the C area is erased from the data having the longest time elapsed after being stored in the C area.

したがって、保存期間Aを「1ヶ月」とした場合、A領域の最も古いデータODの記憶時から「1ヶ月」経過する前に、A領域に空き容量がなくなっても、保存期間Aが経過する前にA領域のデータODが消去されることがない。B領域のデータについても同様である。   Accordingly, when the storage period A is “1 month”, the storage period A elapses even if there is no free space in the A area before “1 month” has elapsed since the storage of the oldest data OD in the A area. The data OD in the A area is not erased before. The same applies to the data in area B.

図10は、各領域の遷移を模式的に説明する図の一例である。図10(a)では、既にA領域に空き容量がないが、データYを記憶する必要が生じた状況である。A領域には、保存期間Aを過ぎたデータもない。この場合、EEPROM管理プログラム50は、図10(b)に示すように、A/Bアドレス境界を大きくするように変更する。図では「200」から「210」に変更されている。こうすることで、A領域にデータYを記憶することができる。 FIG. 10 is an example of a diagram schematically illustrating the transition of each region. In FIG. 10 (a), but already there is no free space in the A region, a situation which need to store data Y A has occurred. There is no data in the A area that has passed the storage period A. In this case, the EEPROM management program 50 is changed so as to increase the A / B address boundary as shown in FIG. In the figure, “200” is changed to “210”. In this way, it is possible to store data Y A to A area.

一方、図10(b)に示すように、B領域には空き容量がある。また、例えば、B領域には保存期間Bを過ぎたデータがあるとする。保存期間Bを過ぎたデータは消去してよいデータである。このように、B領域に所定値以上の空き容量がある場合、EEPROM管理プログラム50は、図10(c)に示すように、B/Cアドレス境界を小さくするように変更する。図では「300」から「290」に変更されている。こうすることで、他の領域(この場合はC領域)に空き領域を提供でき、C領域のデータの保存期間を長くすることもできる。   On the other hand, as shown in FIG. 10B, the B area has free space. Further, for example, it is assumed that there is data that has passed the storage period B in the B area. Data that has passed the storage period B is data that may be deleted. As described above, when there is a free space of a predetermined value or more in the B area, the EEPROM management program 50 changes the B / C address boundary to be small as shown in FIG. In the figure, “300” is changed to “290”. In this way, an empty area can be provided to another area (in this case, the C area), and the data storage period of the C area can be extended.

〔EEPROM管理プログラム50〕
図11は、EEPROM管理プログラム50の機能ブロック図の一例である。図11において図6と同一部には同一の符号を付しその説明は省略する。図11のEEPROM管理プログラム50は、新たに領域移動手段39を有する。
[EEPROM management program 50]
FIG. 11 is an example of a functional block diagram of the EEPROM management program 50. In FIG. 11, the same parts as those of FIG. The EEPROM management program 50 in FIG. 11 newly has a region moving means 39.

まず、実施例1と同様に、残容量判定手段35は、領域決定手段34が決定した領域にデータを格納する空き容量があるか否かを判定する。   First, as in the first embodiment, the remaining capacity determination unit 35 determines whether or not there is a free capacity for storing data in the area determined by the area determination unit 34.

(1)空き容量がない場合
空き容量がない場合、残容量判定手段35は、データ特定要求/境界移動判定をデータ特定手段36に通知する。データ特定手段36は、領域内で消去するデータを特定するか、又は、アドレス境界の移動を要求するかを決定する。データ特定手段36の決定ルールは次のように表すことができる。
(1) When there is no free capacity When there is no free capacity, the remaining capacity determination means 35 notifies the data specification means 36 of the data specification request / boundary movement determination. The data specifying means 36 determines whether to specify data to be erased in the area or to request movement of the address boundary. The decision rule of the data specifying means 36 can be expressed as follows.

・A(B)領域の場合
1.最も古いデータODを特定する
2.その最も古いデータODが保存期間A(B)を超えているか否かを判定する
3-1.保存期間A(B)を超えているデータODを消去の対象に決定する
3-2.保存期間A(B)を超えているデータがない場合、アドレス境界の移動を要求する。
-In the case of A (B) area 1. Identify the oldest data OD It is determined whether or not the oldest data OD exceeds the storage period A (B) 3-1. Data OD that exceeds the storage period A (B) is determined as a deletion target 3-2. When there is no data exceeding the storage period A (B), the movement of the address boundary is requested.

・C領域の場合
1.最も古いデータODを特定する
2.その最も古いデータODを消去の対象に決定する
(2)空き容量がある場合
残容量判定手段35は、空き容量と閾値を比較して、アドレス境界を移動する必要があるか否かを判定する。空き容量が十分にあれば、残容量判定手段35は、境界移動手段39にアドレス境界の移動を要求する。各領域の空き容量を最適化するので、ある領域だけ空き容量がなくなりやすくなることを防止できる。また、アプリが扱うデータ量に応じて各領域のサイズを自動的に最適化できる。
・ In case of C area 1. Identify the oldest data OD The oldest data OD is determined as an erasure target. (2) When there is free capacity The remaining capacity determination means 35 compares the free capacity with a threshold value to determine whether it is necessary to move the address boundary. . If there is sufficient free capacity, the remaining capacity determining means 35 requests the boundary moving means 39 to move the address boundary. Since the free capacity of each area is optimized, it is possible to prevent the free capacity from being easily lost in a certain area. In addition, the size of each area can be automatically optimized according to the amount of data handled by the application.

そして、境界移動手段39は、アドレス境界の移動を要求されると、要求内容(拡大、縮小)と要求された境界に応じて、アドレス境界を移動するか否かを判定する。   When requested to move the address boundary, the boundary moving unit 39 determines whether to move the address boundary according to the requested content (enlargement and reduction) and the requested boundary.

・A/Bアドレス境界について
まず、拡大要求された場合、A/Bアドレス境界には上限値が設けられていないので、境界移動手段39は、予め定められたアドレスだけA/Bアドレス境界を移動する。また、縮小要求された場合、A/Bアドレス境界には下限値が設けられているので、境界移動手段39は、移動後のA/Bアドレス境界が下限値に到達するか否かを判定する。下限値に到達する場合は、下限値までA/Bアドレス境界を移動し、下限値に到達しない場合は、予め定められたアドレスだけA/Bアドレス境界を移動する。
-A / B address boundary First, when an expansion request is made, no upper limit is set for the A / B address boundary, so the boundary moving means 39 moves the A / B address boundary by a predetermined address. To do. When a reduction request is made, since the lower limit value is provided at the A / B address boundary, the boundary moving means 39 determines whether or not the A / B address boundary after the movement reaches the lower limit value. . When the lower limit value is reached, the A / B address boundary is moved to the lower limit value. When the lower limit value is not reached, the A / B address boundary is moved by a predetermined address.

・B/Cアドレス境界について
まず、拡大要求された場合、B/Cアドレス境界には上限値が設けられているので、境界移動手段39は、移動後のB/Cアドレス境界が上限値に到達するか否かを判定する。上限値に到達する場合は、上限値までB/Cアドレス境界を移動し、上限値に到達しない場合は、予め定められたアドレスだけB/Cアドレス境界を移動する。なお、上限値に到達する場合、B領域に新たなデータを記憶できないので、境界移動手段39は、データODを消去するようデータ特定手段36に要求する。
-Regarding the B / C address boundary First, when an expansion request is made, the upper limit value is provided for the B / C address boundary, so the boundary moving means 39 reaches the upper limit value after the movement. It is determined whether or not to do. When the upper limit value is reached, the B / C address boundary is moved to the upper limit value, and when the upper limit value is not reached, the B / C address boundary is moved by a predetermined address. When the upper limit value is reached, new data cannot be stored in the area B, so the boundary moving unit 39 requests the data specifying unit 36 to delete the data OD.

また、縮小要求された場合、B/Cアドレス境界には下限値が設けられているので、境界移動手段39は、移動後のB/Cアドレス境界が下限値に到達するか否かを判定する。下限値に到達する場合は、下限値までB/Cアドレス境界を移動し、下限値に到達しない場合は、予め定められたアドレスだけB/Cアドレス境界を移動する。   When a reduction request is made, since the lower limit value is provided for the B / C address boundary, the boundary moving unit 39 determines whether or not the B / C address boundary after the movement reaches the lower limit value. . When the lower limit value is reached, the B / C address boundary is moved to the lower limit value, and when the lower limit value is not reached, the B / C address boundary is moved by a predetermined address.

なお、境界移動手段39は、移動後のアドレス境界でEEPROM100のアドレス境界を更新する。   The boundary moving means 39 updates the address boundary of the EEPROM 100 with the address boundary after the movement.

データ格納手段37は、各領域の空き容量に、必要であればデータODを削除した後、又は、必要であればアドレス境界が移動された後、データを記憶する。こうすることで、重要度に応じた領域に重要度に応じたデータが記憶されることになる。   The data storage means 37 stores the data in the free capacity of each area after deleting the data OD if necessary, or after moving the address boundary if necessary. By doing so, data corresponding to the importance is stored in the area corresponding to the importance.

そして、RAM32に記憶されていた全てのデータについて、領域A〜Cへの記憶が完了すると、ソート手段38が領域A〜Cのデータをソートする。ソート順は、実施例1と同様である。ソート手段38は、領域毎かつアプリ毎に、記憶日時の降順にデータをソートするものとする。   When all the data stored in the RAM 32 is stored in the areas A to C, the sorting unit 38 sorts the data in the areas A to C. The sort order is the same as in the first embodiment. The sorting means 38 sorts data in descending order of storage date and time for each area and for each application.

図12は、ソート手段38によるソート結果を模式的に示す図の一例である。A領域のXA1〜XA5は、アプリXが記憶した重要度の高いデータXAを、記憶日付の降順に示す。A領域の、Y1、Y2は、アプリYが記憶した重要度が高いデータYを、記憶日付の降順に示す。また、B領域のX1、X2は、アプリXが記憶した中程度の重要度のデータXを、記憶日付の降順に示す。また、B領域のY1〜3は、アプリYが記憶した中程度の重要度のデータYを、記憶日付の降順に示す。 FIG. 12 is an example of a diagram schematically showing a sorting result by the sorting unit 38. X A 1 to X A of the A region 5, a high data X A importance app X is stored, shown in order of decreasing storage date. In the A area, Y A 1 and Y A 2 indicate data Y A stored by the app Y in descending order of storage date. Further, X B 1 and X B 2 in the B area indicate the medium importance data X B stored by the application X in descending order of the storage date. Further, Y B 1 to 3 in the B area indicate the medium importance data Y B stored by the app Y in descending order of the storage date.

このように、1つの領域には同じ重要度のデータしか記憶されないので、各領域に各アプリに対応した1つのポインタがあればよく、実施例1に比べてポインタの数を低減できる。   As described above, since only data of the same importance level is stored in one area, it is only necessary to have one pointer corresponding to each application in each area, and the number of pointers can be reduced as compared with the first embodiment.

ソート手段38は、各アプリX、Yが、それぞれのデータにアクセスできるように、ポインタを生成する。例えば、アプリXのデータは、A領域では、ポインタ「PSX1〜PEX1」が示すアドレス範囲に、B領域では、ポインタ「PSX2〜PEX2」が示すアドレス範囲に、記憶されていることが登録される。 The sorting unit 38 generates a pointer so that the applications X and Y can access the data. For example, the application X data is stored in the address range indicated by the pointers “P SX1 to P EX1 ” in the A area, and in the address range indicated by the pointers “P SX2 to P EX2 ” in the B area. be registered.

したがって、各アプリは、重要度が高いA領域のデータXA1〜XA5のみ、B領域のデータX1〜X2のみ、又は、アプリXの全てのデータ、のように、所望のデータだけをEEPROM100から読み出すことができる。 Thus, each application is only the data X A 1 to X A 5 of high importance A region, only the data X B 1 to X B 2 and B regions, or all the data of the application X, as in the desired Only the data of can be read from EEPROM100.

したがって、ソートすることによって、各アプリは所望のデータに自由にアクセスできることになる。なお、ポインタテーブル33は、EEPROM100の決まったアドレスに記憶される。   Therefore, by sorting, each application can freely access desired data. The pointer table 33 is stored at a predetermined address in the EEPROM 100.

〔EEPROM100への記憶手順〕
図13は、EEPROM管理プログラム50がEEPROM100にデータを記憶する手順を示すフローチャート図の一例である。図13において図8と同一部の処理には同じステップ番号を付した。
[Storing procedure to EEPROM100]
FIG. 13 is an example of a flowchart showing a procedure in which the EEPROM management program 50 stores data in the EEPROM 100. In FIG. 13, the same steps as those in FIG.

まず、領域決定手段34は、ポインタテーブル33を読み出す(S10)。次に、領域決定手段34は、RAM32に記憶されているデータを、予め定められた順番に1つずつ読み出す(S20)。   First, the area determination unit 34 reads the pointer table 33 (S10). Next, the area determination means 34 reads the data stored in the RAM 32 one by one in a predetermined order (S20).

領域決定手段34は、RAM32から読み出したデータの記憶先の領域A〜Cを、重要度テーブル31を参照して決定する(S30)。   The area determination unit 34 determines the storage areas A to C of the data read from the RAM 32 with reference to the importance level table 31 (S30).

そして、残容量判定手段35は、S30で決定した領域に空き容量があるか否かを判定する(S40)。空き容量がある場合(S40のYes)、消去や移動の処理は不要なので、処理は、ステップS80に進む。   Then, the remaining capacity determining means 35 determines whether or not there is a free capacity in the area determined in S30 (S40). If there is free space (Yes in S40), the process proceeds to step S80 because the erasing and moving processes are unnecessary.

空き容量がない場合(S40のNo)、消去可能か否かを判定するため、データ特定手段36が、決定された領域内で、記憶されてから最も時間が経過しているデータODを特定する(S50)。   If there is no free space (No in S40), in order to determine whether or not erasure is possible, the data specifying means 36 specifies the data OD that has been most time lapsed since being stored in the determined area. (S50).

データ特定手段36は、保存期間と、データODが記憶されてからの経過時間を比較し、データODを消去するか移動するかを判定する(S60)。データODがその領域に記憶されてからの経過時間が、保存期間を超えている場合、データ特定手段36はデータODを消去すると決定する。データ格納手段37はデータODを消去することができる(S70)。   The data specifying unit 36 compares the storage period with the elapsed time since the data OD is stored, and determines whether to delete or move the data OD (S60). When the elapsed time since the data OD is stored in the area exceeds the storage period, the data specifying unit 36 determines to delete the data OD. The data storage unit 37 can erase the data OD (S70).

データ特定手段36は、データODが保存期間を超えていない場合、アドレス境界の移動を境界移動手段39に要求する。なお、ステップS60のアドレス境界の移動要求は、境界の拡大の要求である。   When the data OD does not exceed the storage period, the data specifying unit 36 requests the boundary moving unit 39 to move the address boundary. Note that the address boundary movement request in step S60 is a boundary expansion request.

アドレス境界の移動要求に基づき、境界移動手段39は、移動要求のあった境界がA/Bアドレス境界か、B/Cアドレス境界かを判定する(S72)。A/Bアドレス境界の場合、A/Bアドレス境界の上限値に制限がないので、境界移動手段39は、仮のA/Bアドレス境界を決定する(S74)。「仮の」としたのは、実際にアドレス境界を移動するのは、RAM32の全データに対する処理が終わった後でよいからである。   Based on the address boundary movement request, the boundary movement means 39 determines whether the boundary for which the movement request has been made is an A / B address boundary or a B / C address boundary (S72). In the case of an A / B address boundary, the upper limit value of the A / B address boundary is not limited, so the boundary moving unit 39 determines a temporary A / B address boundary (S74). The reason for “provisional” is that the address boundary is actually moved after the processing on all the data in the RAM 32 is completed.

B/Cアドレス境界の場合、B/Cアドレス境界の上限値があるので、境界移動手段39は、上限値を限度に仮のB/Cアドレス境界を決定する(S76)。S74、76では、例えばデータ1つ分(例えば2バイト)、アドレス境界を移動すればよい。   In the case of the B / C address boundary, since there is an upper limit value of the B / C address boundary, the boundary moving unit 39 determines a temporary B / C address boundary with the upper limit value as a limit (S76). In S74 and 76, the address boundary may be moved by, for example, one data (for example, 2 bytes).

次に、データ格納手段37は、RAM32のデータを、EEPROM100のデータ構造を再現したRAM32内に記憶する(S80)。これにより、1つのデータをEEPROM100に格納する用意ができた。領域決定手段34はRAM32の全データの処理が完了したか否かを判定する(S90)。   Next, the data storage means 37 stores the data in the RAM 32 in the RAM 32 that reproduces the data structure of the EEPROM 100 (S80). Thus, one piece of data is ready to be stored in the EEPROM100. The area determination unit 34 determines whether or not the processing of all the data in the RAM 32 has been completed (S90).

全データの処理が完了していない場合(S90のNo)、EEPROM管理プログラム50は同じ処理をRAM32の全データに繰り返す。   When the processing of all data has not been completed (No in S90), the EEPROM management program 50 repeats the same processing for all data in the RAM 32.

全データの処理が完了した場合(S90のYes)、残容量判定手段35は、仮のA/B境界、仮のB/C境界に基づき、各領域の空き容量と閾値を比較して、アドレス境界を拡大方向に移動する必要があるか否かを判定する。そして、拡大方向に移動する必要がある場合、境界移動手段39は、仮のA/Bアドレス境界又は仮のB/Cアドレス境界を移動する(S92)。こうすることで、A/Bアドレス境界とB/Cアドレス境界を決定できた。   When the processing of all the data is completed (Yes in S90), the remaining capacity determination unit 35 compares the free capacity of each area with the threshold value based on the temporary A / B boundary and the temporary B / C boundary to determine the address It is determined whether it is necessary to move the boundary in the enlargement direction. When it is necessary to move in the enlargement direction, the boundary moving unit 39 moves the temporary A / B address boundary or the temporary B / C address boundary (S92). By doing so, the A / B address boundary and the B / C address boundary could be determined.

次に、ソート手段38が各領域A〜Cのデータをソートする(S100)。すなわち、新たに決まった、領域A〜Cの先頭アドレスを起点に、各アプリのデータをアプリ毎にソートする。これにより、アプリ毎にデータを並べることができる。また、ソート手段38は、ソート結果に従い、ポインタテーブル33を更新する。そして、ソート手段38は、RAM32内のデータをEEPROM100に書き戻す(S110)。以上で、EEPROM100への記憶手順が終了する。   Next, the sorting means 38 sorts the data of the areas A to C (S100). That is, the data of each application is sorted for each application starting from the newly determined start address of the areas A to C. Thereby, data can be arranged for every application. In addition, the sorting unit 38 updates the pointer table 33 according to the sorting result. Then, the sorting unit 38 writes the data in the RAM 32 back to the EEPROM 100 (S110). This completes the procedure for storing data in the EEPROM 100.

以上説明したように、本実施例のECUは、A領域とB領域を拡大できるので、保存期間未満で消去されるデータをほぼゼロにすることができる。また、重要度の異なるデータが複数の領域に散在することがなくなり、データの読み込みも容易になる。したがって、EEPROM100の全容量をそれほど大きくしなくても、記憶すべきデータ量の増大に対応することができる。   As described above, the ECU of the present embodiment can enlarge the A area and the B area, so that the data to be erased within the storage period can be made almost zero. Also, data with different importance levels are not scattered in a plurality of areas, and data can be easily read. Therefore, an increase in the amount of data to be stored can be accommodated without increasing the total capacity of the EEPROM 100.

31 重要度テーブル
32 RAM
33 ポインタテーブル
34 領域決定手段
35 残容量判定手段
36 データ特定手段
37 データ格納手段
38 ソート手段
39 領域移動手段
100 EEPROM
200 統合ECU
31 Importance table 32 RAM
33 Pointer table 34 Area determining means 35 Remaining capacity determining means 36 Data specifying means 37 Data storing means 38 Sorting means 39 Area moving means 100 EEPROM
200 Integrated ECU

Claims (12)

複数の領域に区分された不揮発メモリにデータを記憶する記憶装置であって、
プログラムがアクセスする記憶対象データと前記領域の対応を、前記記憶対象データの記憶期間に応じて定めた対応情報と、
前記対応情報に基づき、前記記憶対象データの記憶先の前記領域を決定する領域決定手段と、
前記領域決定手段が決定した前記領域に前記記憶対象データを格納するデータ格納手段と、
を有することを特徴とする記憶装置。
A storage device for storing data in a nonvolatile memory divided into a plurality of areas,
Correspondence information that defines the correspondence between the storage target data accessed by the program and the area according to the storage period of the storage target data;
Area determining means for determining the area of the storage destination of the storage target data based on the correspondence information;
Data storage means for storing the storage target data in the area determined by the area determination means;
A storage device comprising:
前記領域における前記記憶対象データの記憶場所を、前記領域毎に記述したデータ記憶場所情報を有し、
前記プログラムは、前記データ記憶場所情報に基づき前記記憶対象データを前記不揮発メモリから読み出す、
ことを特徴とする請求項1記載の記憶装置。
Data storage location information describing the storage location of the storage target data in the region for each region,
The program reads the storage target data from the nonvolatile memory based on the data storage location information.
The storage device according to claim 1.
前記領域決定手段が決定した前記領域に、空き容量があるか否かを判定する空き容量判定手段と、
前記空き容量がないと判定された場合、前記領域決定手段が決定した前記領域に、該領域に認められた前記記憶期間よりも長い期間記憶されているデータを特定するデータ特定手段と、を有し、
前記データ格納手段は、前記データ特定手段が特定したデータの代わりに前記記憶対象データを、前記領域決定手段が決定した前記領域に記憶する、
ことを特徴とする請求項1又は2記載の記憶装置。
Free space determination means for determining whether or not there is free space in the area determined by the area determination means;
If it is determined that there is no free space, the area determining means has data specifying means for specifying data stored for a period longer than the storage period allowed for the area. And
The data storage means stores the storage target data in the area determined by the area determining means instead of the data specified by the data specifying means.
The storage device according to claim 1, wherein the storage device is a storage device.
前記空き容量がないと判定された場合、
前記データ格納手段は、前記データ特定手段が特定したデータを、前記領域決定手段が決定した前記領域よりも前記記憶期間が短い前記領域に移動し、移動により生じた空き容量に前記記憶対象データを記憶する、
ことを特徴とする請求項13記載の記憶装置。
If it is determined that there is no free space,
The data storage means moves the data specified by the data specification means to the area having a shorter storage period than the area determined by the area determination means, and stores the storage target data in the free space generated by the movement. Remember,
The storage device according to claim 13.
前記データ特定手段が、前記領域決定手段が決定した前記領域に認められた前記記憶期間よりも長い期間記憶されているデータを特定できない場合、
前記領域決定手段が決定した前記領域を拡大する領域変更手段を有し、
前記データ格納手段は、前記領域の拡大により生じた空き容量に前記記憶対象データを記憶する、
を有することを特徴とする請求項3記載の記憶装置。
When the data specifying means cannot specify data stored for a longer period than the storage period allowed for the area determined by the area determining means,
An area changing means for enlarging the area determined by the area determining means;
The data storage means stores the storage target data in a free space generated by the expansion of the area;
The storage device according to claim 3, further comprising:
前記領域変更手段は、前記領域の空き容量に応じて該領域を縮小する、
ことを特徴とする請求項5記載の記憶装置。
The area changing means reduces the area according to the free space of the area;
The storage device according to claim 5.
前記領域の最大のサイズには制限がなく、最小のサイズには制限がある
ことを特徴とする請求項6記載の記憶装置。
The storage device according to claim 6, wherein the maximum size of the area is not limited and the minimum size is limited.
前記領域に記憶された前記記憶対象データ及び前記記憶対象データが記憶されるよりも前から前記領域に記憶されていたデータを、前記領域毎にソートするソート手段、
を有することを特徴とする請求項3〜7いずれか1項記載の記憶装置。
Sort means for sorting the storage target data stored in the area and the data stored in the area from before the storage target data is stored, for each area,
The storage device according to claim 3, further comprising:
前記対応情報は、独立した複数の前記プログラム毎に、前記記憶対象データと前記領域の対応を、前記記憶対象データの記憶期間に応じて定め、
前記データ記憶場所情報には、複数の前記プログラム毎に、前記領域における前記記憶対象データの記憶場所が記述されている、
ことを特徴とする請求項2記載の記憶装置。
The correspondence information determines the correspondence between the storage target data and the area for each of the plurality of independent programs according to the storage period of the storage target data,
In the data storage location information, the storage location of the storage target data in the area is described for each of the plurality of programs.
The storage device according to claim 2.
前記プログラムは、複数の前記領域から選択した1つの前記領域のみから、前記記憶対象データを読み出す、
ことを特徴とする請求項2記載の記憶装置。
The program reads the storage target data from only one area selected from the plurality of areas.
The storage device according to claim 2.
請求項1〜10いずれか1項記載の記憶装置と、
前記プログラムを実行するマイコンと、
センサ通信回路と、
外部機器との入力回路又は出力回路と、
データ通信回路と、
を有する電子制御ユニット。
A storage device according to any one of claims 1 to 10,
A microcomputer for executing the program;
A sensor communication circuit;
An input circuit or an output circuit with an external device;
A data communication circuit;
Having an electronic control unit.
複数の領域に区分された不揮発メモリにデータを記憶する記憶方法であって、
プログラムがアクセスする記憶対象データと前記領域の対応を、前記記憶対象データの記憶期間に応じて定めた対応情報に基づき、領域決定手段が、前記記憶対象データの記憶先の前記領域を決定するステップと、
データ格納手段が、前記領域決定手段が決定した前記領域に前記記憶対象データを格納するステップと、
を有することを特徴とする記憶方法。
A storage method for storing data in a nonvolatile memory divided into a plurality of areas,
A step of determining the storage destination area of the storage target data by the area determination means, based on correspondence information determined in accordance with a storage period of the storage target data, the correspondence between the storage target data accessed by the program and the area; When,
Data storage means storing the storage object data in the area determined by the area determination means;
A storage method characterized by comprising:
JP2010064217A 2010-03-19 2010-03-19 Storage device, electronic control unit and storage method Pending JP2011198049A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2010064217A JP2011198049A (en) 2010-03-19 2010-03-19 Storage device, electronic control unit and storage method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010064217A JP2011198049A (en) 2010-03-19 2010-03-19 Storage device, electronic control unit and storage method

Publications (1)

Publication Number Publication Date
JP2011198049A true JP2011198049A (en) 2011-10-06

Family

ID=44876161

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010064217A Pending JP2011198049A (en) 2010-03-19 2010-03-19 Storage device, electronic control unit and storage method

Country Status (1)

Country Link
JP (1) JP2011198049A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014056408A (en) * 2012-09-12 2014-03-27 Toshiba Corp Memory system, computer system, and memory management method
JP2014129074A (en) * 2012-12-28 2014-07-10 Fujitsu Ten Ltd Vehicle information storage processing device and vehicle information storage processing method
JP2015222590A (en) * 2015-07-24 2015-12-10 株式会社東芝 Memory system
JP2019148907A (en) * 2018-02-26 2019-09-05 大日本印刷株式会社 Electronic information storage medium, ic card, and information processing method by electronic information storage medium and os
JP7384554B2 (en) 2018-08-30 2023-11-21 トヨタ自動車株式会社 Brake ECU, system, control method and vehicle
JP7542310B2 (en) 2016-12-15 2024-08-30 コンティ テミック マイクロエレクトロニック ゲゼルシャフト ミット ベシュレンクテル ハフツング Vehicle control device, brake control device, and vehicle control method

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014056408A (en) * 2012-09-12 2014-03-27 Toshiba Corp Memory system, computer system, and memory management method
JP2014129074A (en) * 2012-12-28 2014-07-10 Fujitsu Ten Ltd Vehicle information storage processing device and vehicle information storage processing method
JP2015222590A (en) * 2015-07-24 2015-12-10 株式会社東芝 Memory system
JP7542310B2 (en) 2016-12-15 2024-08-30 コンティ テミック マイクロエレクトロニック ゲゼルシャフト ミット ベシュレンクテル ハフツング Vehicle control device, brake control device, and vehicle control method
JP2019148907A (en) * 2018-02-26 2019-09-05 大日本印刷株式会社 Electronic information storage medium, ic card, and information processing method by electronic information storage medium and os
JP7043886B2 (en) 2018-02-26 2022-03-30 大日本印刷株式会社 Information processing method and OS using electronic information storage medium, IC card, electronic information storage medium
JP7384554B2 (en) 2018-08-30 2023-11-21 トヨタ自動車株式会社 Brake ECU, system, control method and vehicle

Similar Documents

Publication Publication Date Title
CN113535081B (en) Device maintenance of data storage devices
JP2011198049A (en) Storage device, electronic control unit and storage method
JP4548601B2 (en) Automotive control unit
CN100530153C (en) Apparatus and method for processing operations of nonvolatile memory in order of priority
JP2006302255A (en) Data storage device having heterogeneous non-volatile memory and driving method thereof
EP0834812A1 (en) A method for accessing flash memory and an automotive electronic control system
JP4743055B2 (en) Map display control device and program for map display control device
CN105009096B (en) Data storage device, the storage method of data and control device for vehicle
JP2005276097A (en) Interruption request program and microcomputer
JP4654750B2 (en) Automotive control system
JP4748609B2 (en) Image processing system
JP2013161242A (en) Electronic controller
US20160124682A1 (en) Data storage system
JP4271651B2 (en) Navigation system
JP6832448B2 (en) Program update method and device
WO2003102961A1 (en) Electronic control apparatus
US9170929B2 (en) Memory controller
KR101758331B1 (en) Apparatus and method for file recoding based on non-volatile memory
KR20150137661A (en) Method and apparatus for fragmentation prevention of non-volatile memory for blackbox device
JP2009223435A (en) Data storage method and device, and program
US20230304825A1 (en) Map data update apparatus and map data update method
JP4501159B2 (en) Automotive control unit
JPH06162786A (en) Information processor using flash memory
JP2008513758A (en) A system and a computer installed in an automobile that allows the capturing of data to be paused when the computer stops
EP4513320A1 (en) Information processing equipment