JP2011022934A - Electronic control unit and method for detecting failure - Google Patents

Electronic control unit and method for detecting failure Download PDF

Info

Publication number
JP2011022934A
JP2011022934A JP2009169373A JP2009169373A JP2011022934A JP 2011022934 A JP2011022934 A JP 2011022934A JP 2009169373 A JP2009169373 A JP 2009169373A JP 2009169373 A JP2009169373 A JP 2009169373A JP 2011022934 A JP2011022934 A JP 2011022934A
Authority
JP
Japan
Prior art keywords
vcpu
virtual cpu
virtual
cpu
ecu
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
JP2009169373A
Other languages
Japanese (ja)
Inventor
Tetsuaki Wakabayashi
哲明 若林
Kotaro Sato
浩太郎 佐藤
Soichiro Arai
総一郎 荒井
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
Toyota Motor Corp
Renesas Electronics Corp
Original Assignee
Denso Corp
Toyota Motor Corp
Renesas Electronics 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, Toyota Motor Corp, Renesas Electronics Corp filed Critical Denso Corp
Priority to JP2009169373A priority Critical patent/JP2011022934A/en
Publication of JP2011022934A publication Critical patent/JP2011022934A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide an electronic control unit which can mount a monitoring microcomputer without increase cost and in-vehicle space and reducing a communication time between a microcomputer and the monitoring microcomputer, and a method for detecting an failure. <P>SOLUTION: The electronic control unit 100 for providing an in-vehicle device with an operation result includes: a CPU 11 that actually exists; virtual CPU constructing means 12 and 14 for constructing virtual CPUs from the CPU 11 that actually exists; and a first virtual CPU(A)1 and a second virtual CPU(A)2 which are virtually constructed, wherein the second virtual CPU(A)2 monitors the first virtual CPU(A)1 for providing an operation result. <P>COPYRIGHT: (C)2011,JPO&INPIT

Description

本発明は、車両に搭載される車載装置に演算結果を提供する電子制御ユニット等に関し、特に、電子制御ユニットの異常を検出する電子制御ユニット及び異常検出方法に関する。   The present invention relates to an electronic control unit that provides a calculation result to an in-vehicle device mounted on a vehicle, and more particularly to an electronic control unit and an abnormality detection method for detecting an abnormality of the electronic control unit.

車両にはマイコンを実体とする種々の電子制御ユニットが搭載されているが、マイコン上で動作するアプリケーションはソフトウェアであるため、リソース不足、無限ループ、ノイズ等、特殊な状況の発生等により、マイコンが正常に動作することが困難になる場合がある。そこで、マイコンが異常検出プログラムを実行してマイコンが正常に動作していないことを検出する技術が考えられている(例えば、特許文献1参照。)。特許文献1には、オペレーティングシステムから取得したアプリケーションの動作情報(プロセスの動作状況、状態継続時間、コンテキストスイッチ回数)からアプリケーションの異常を検出する異常検出方法が開示されている。しかしながら、このような異常検出プログラムを用いた方法は、レジスタ操作等の具体的なタスクが実行されているか否かの確認が困難である。また、マイコンがアプリケーションと別に異常検出プログラムを実行するので、マイコンの負荷が大きいという問題がある。   The vehicle has various electronic control units that are based on microcomputers. However, because the applications that run on the microcomputer are software, the microcomputers can run out of special situations such as resource shortages, infinite loops, and noise. May be difficult to operate normally. Therefore, a technique is considered in which the microcomputer executes an abnormality detection program to detect that the microcomputer is not operating normally (see, for example, Patent Document 1). Patent Document 1 discloses an abnormality detection method for detecting an application abnormality from application operation information (process operation status, state duration, context switch count) acquired from an operating system. However, in the method using such an abnormality detection program, it is difficult to confirm whether or not a specific task such as register operation is being executed. In addition, since the microcomputer executes the abnormality detection program separately from the application, there is a problem that the load on the microcomputer is large.

また、マイコンを監視するための監視用の監視マイコンを設けることで、マイコンが正常に動作していないことを検出する技術が利用されている。
図1は、従来のマイコン監視システムの一例を示す図である。電子制御ユニット上にマイコンに接続された監視マイコンが配置されている。この監視マイコンはいわゆるウォッチドッグタイマと同様の態様でマイコンを監視する。マイコンは、定期的に監視マイコンのレジスタにフラグを立て、監視マイコンはフラグが立ってからの経過時間を計測する。監視マイコンは、経過時間が閾値を超えるとマイコンが正常に動作していないことを検出して、例えばマイコンをリセットする。
In addition, a technique for detecting that the microcomputer is not operating normally by providing a monitoring microcomputer for monitoring the microcomputer is used.
FIG. 1 is a diagram illustrating an example of a conventional microcomputer monitoring system. A monitoring microcomputer connected to the microcomputer is arranged on the electronic control unit. This monitoring microcomputer monitors the microcomputer in the same manner as a so-called watchdog timer. The microcomputer periodically sets a flag in the register of the monitoring microcomputer, and the monitoring microcomputer measures an elapsed time after the flag is set. When the elapsed time exceeds the threshold, the monitoring microcomputer detects that the microcomputer is not operating normally, and resets the microcomputer, for example.

特開2006−277115号公報JP 2006-277115 A

しかしながら、図1のように監視マイコンを設けると、適切なタイミングでマイコンをリセットすることが困難な場合があった。これは、マイコンと監視マイコンとが比較的低速なシリアル通信等を用いて通信していたため、監視マイコンがリセットしようとする際にある程度の時間がかかってしまっていたためである。   However, when a monitoring microcomputer is provided as shown in FIG. 1, it may be difficult to reset the microcomputer at an appropriate timing. This is because the microcomputer and the monitoring microcomputer communicate with each other using relatively low-speed serial communication or the like, and it takes a certain amount of time when the monitoring microcomputer tries to reset.

また、監視マイコンをマイコンとは別に搭載することは、コストや車載スペースの増大をもたらし、さらに監視マイコン用に搭載するソフトウェア開発に工数が発生するという問題があった。これは、マイコンと監視マイコンは設計が異なるため、マイコンとは別に監視マイコンのための開発環境を整備する必要があるためである。   In addition, mounting the monitoring microcomputer separately from the microcomputer causes an increase in cost and in-vehicle space, and there is a problem that man-hours are required for developing software to be mounted for the monitoring microcomputer. This is because the microcomputer and the monitoring microcomputer have different designs, and it is necessary to prepare a development environment for the monitoring microcomputer separately from the microcomputer.

本発明は、上記課題に鑑み、コストや車載スペースの増大をもたらすことなく監視マイコンを搭載可能にし、また、マイコンと監視マイコン間の通信時間を低減可能な電子制御ユニット及び異常検出方法を提供することを目的とする。   In view of the above problems, the present invention provides an electronic control unit and an abnormality detection method capable of mounting a monitoring microcomputer without causing an increase in cost and in-vehicle space and reducing communication time between the microcomputer and the monitoring microcomputer. For the purpose.

上記課題に鑑み、本発明は、車載装置に演算結果を提供する電子制御ユニットにおいて、実在するCPUと、実在するCPUから仮想的なCPUを構築する仮想CPU構築手段と、仮想的に構築された、第1の仮想CPU及び第2の仮想CPUと、を有し、演算結果を提供する第1の仮想CPUを、第2の仮想CPUが監視する、ことを特徴とする。   In view of the above problems, the present invention is virtually constructed in an electronic control unit that provides a calculation result to an in-vehicle device, a virtual CPU, and a virtual CPU construction means for constructing a virtual CPU from the real CPU. The first virtual CPU has a first virtual CPU and a second virtual CPU, and the second virtual CPU monitors the first virtual CPU that provides the calculation result.

コストや車載スペースの増大をもたらすことなく監視マイコンを搭載可能にし、また、マイコンと監視マイコン間の通信時間を低減可能な電子制御ユニット及び異常検出方法を提供することができる。   It is possible to provide an electronic control unit and an abnormality detection method capable of mounting a monitoring microcomputer without causing an increase in cost and in-vehicle space and reducing communication time between the microcomputer and the monitoring microcomputer.

従来のマイコン監視システムの一例を示す図である。It is a figure which shows an example of the conventional microcomputer monitoring system. 電子制御ユニットの構造を概念的に説明する図の一例である。It is an example of the figure which illustrates notionally the structure of an electronic control unit. ECUの概略構成図の一例である(実施例1)。It is an example of the schematic block diagram of ECU (Example 1). ECUが異常を検出する手順を示すフローチャート図の一例である(実施例1)。It is an example of the flowchart figure which shows the procedure in which ECU detects abnormality (Example 1). 異常検出システムの概略構成図の一例である(実施例2)。It is an example of the schematic block diagram of an abnormality detection system (Example 2). ECUの機能ブロック図の一例である。It is an example of the functional block diagram of ECU. 一方のECUが他方のECUの異常を検出する手順を示すフローチャート図の一例である。It is an example of the flowchart figure which shows the procedure in which one ECU detects the abnormality of the other ECU. 3つの仮想CPUを有するECUの概略構成図の一例である(実施例3)。It is an example of the schematic block diagram of ECU which has three virtual CPUs (Example 3). ECUが論理積をロジックにして異常を検出する手順を示すフローチャート図の一例である(実施例3)。FIG. 10 is an example of a flowchart illustrating a procedure for detecting abnormality by an ECU using logical product as logic (Example 3); ECUが論理和をロジックにして異常を検出する手順を示すフローチャート図の一例である(実施例4)。FIG. 10 is an example of a flowchart illustrating a procedure for detecting an abnormality using an logical OR as a logic (Embodiment 4); 多数決により異常を検出するECUの概略構成図の一例である(実施例4)。(Example 4) which is an example of the schematic block diagram of ECU which detects abnormality by majority vote. WDTユニットにより異常を検出するECUを示す図の一例である(実施例5)。(Example 5) which is an example of the figure which shows ECU which detects abnormality by a WDT unit. 、WDTユニットによりVCPU(A)1の異常を検出する手順を示すフローチャート図の一例を示す(実施例5)。An example of a flowchart showing a procedure for detecting an abnormality of the VCPU (A) 1 by the WDT unit is shown (Example 5). VCPU(A)1を監視する仮想CPUを周期的に切り替えるECUの概略構成図の一例である(実施例6)。(Example 6) which is an example of the schematic block diagram of ECU which switches the virtual CPU which monitors VCPU (A) 1 periodically. ECUが監視する仮想CPUを周期的に切り替える手順を示すフローチャート図の一例である(実施例6)。(Example 6) which is an example of the flowchart figure which shows the procedure which switches virtual CPU which ECU monitors periodically. ECUが監視する仮想CPUの役割を周期的に切り替える手順を示すフローチャート図の一例である(実施例6)。(Example 6) which is an example of the flowchart figure which shows the procedure which switches the role of virtual CPU which ECU monitors periodically. VCPU(A)1を監視する仮想CPUを非周期的に切り替えるECU100の概略構成図の一例である(実施例7)。(Example 7) which is an example of the schematic block diagram of ECU100 which switches the virtual CPU which monitors VCPU (A) 1 aperiodically. ECUが監視する仮想CPUを非周期的に切り替える手順を示すフローチャート図の一例である(実施例7)。(Example 7) which is an example of the flowchart figure which shows the procedure which switches virtual CPU which ECU monitors aperiodically. ECUが監視する仮想CPUの役割を非周期的に切り替える手順を示すフローチャート図の一例である(実施例7)。(Example 7) which is an example of the flowchart figure which shows the procedure which switches the role of virtual CPU which ECU monitors periodically. 多数決により異常を検出するECUの概略構成図の一例である(実施例8)。FIG. 10 is an example of a schematic configuration diagram of an ECU that detects an abnormality by majority vote (Embodiment 8). 3以上の仮想CPUの監視結果の多数決により異常を検出するECUの概略構成図の一例である(実施例8)。FIG. 10 is an example of a schematic configuration diagram of an ECU that detects an abnormality by majority decision of monitoring results of three or more virtual CPUs (Embodiment 8). 異常検出システムの概略構成図の一例である(実施例9)。(Example 9) which is an example of the schematic block diagram of an abnormality detection system. 異常検出システムの概略構成図の一例である(実施例10)。(Example 10) which is an example of the schematic block diagram of an abnormality detection system. 監視用の仮想CPUを更に監視する仮想CPUを搭載したECUの概略構成図の一例である(実施例11)。(Example 11) which is an example of the schematic block diagram of ECU equipped with the virtual CPU which further monitors the monitoring virtual CPU. ECUが異常を検出する手順を示すフローチャート図の一例を示す(実施例11)。(Example 11) which shows an example of the flowchart figure which shows the procedure in which ECU detects abnormality. 実在する監視マイコンによりVCPU(A)1及びVCPU(A)2の異常を検出するECU100の概略構成図の一例である(実施例12)。(Example 12) which is an example of the schematic block diagram of ECU100 which detects abnormality of VCPU (A) 1 and VCPU (A) 2 by the actual monitoring microcomputer.

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

図2は、本実施形態の電子制御ユニットの構造を概念的に説明する図の一例である。電子制御ユニット(以下、ECU(Electronic Control Unit)という)は、下層から順にハードウェアリソース11、OS(Operating System)15、アプリケーション16という階層構造になっている。   FIG. 2 is an example of a diagram conceptually illustrating the structure of the electronic control unit of the present embodiment. An electronic control unit (hereinafter referred to as an ECU (Electronic Control Unit)) has a hierarchical structure of a hardware resource 11, an OS (Operating System) 15, and an application 16 in order from the lower layer.

ハードウェアリソース11は、例えば、CPU、I/O、RAM、ROM、ASIC((Application Specific Integrated Circuit)、スイッチ素子、CAN通信ユニット(COM1)等である。CPUはマルチコア型でもシングルコア型でもよい。   The hardware resource 11 is, for example, a CPU, I / O, RAM, ROM, ASIC (Application Specific Integrated Circuit), switch element, CAN communication unit (COM1), etc. The CPU may be a multi-core type or a single-core type. .

本実施形態では、ハードウェアリソースが仮想CPUモニタ12を有する。仮想CPUモニタ12は、複数のOS15に対して仮想的なハードウェアリソース11を提供することで、ハードウェアリソース11の競合が生じないようOS15からの使用要求を調停する。OS15は仮想的なハードウェアリソース11を物理的なハードウェアであると認識して動作する。   In this embodiment, the hardware resource has the virtual CPU monitor 12. The virtual CPU monitor 12 provides virtual hardware resources 11 to a plurality of OSs 15 to arbitrate use requests from the OSs 15 so that the hardware resources 11 do not compete with each other. The OS 15 operates by recognizing the virtual hardware resource 11 as physical hardware.

このような仮想CPUの実装方法としては、ハードウェア・マルチスレッド型の実行環境が知られている。ハードウェア・マルチスレッドとは、命令バッファ、レジスタファイルをそれぞれ複数備え、これらとALU(Arithmetic Logic Unit)等との接続を切り変えて命令を実行する構造をいう。したがって、「仮想」CPUと称されても、物理的に存在する回路により演算結果を提供する。   As such a virtual CPU mounting method, a hardware multithread type execution environment is known. The hardware multithread means a structure in which a plurality of instruction buffers and register files are provided, and instructions are executed by switching the connection between these and an ALU (Arithmetic Logic Unit). Therefore, even if referred to as a “virtual” CPU, the operation result is provided by a physically existing circuit.

一般的なOS15は、ハードウェアリソース(特にCPU)11に自分のコードを最も高い特権モードで実行するよう要求し、また、アプリケーション16は低い特権モードでコードを実行するよう要求する。仮想CPUモニタ12は、ハードウェアリソース11上で、OS15が普段実行される最も高い特権モードよりも更に高い特権モードで実行される。仮想CPUモニタ12がこのような特殊な特権モードで実行されると、仮想CPUモニタ12はOS15に、OS15を最も高い特権モードで実行していることを示す情報を送る。これにより、OS15にとってはOS15が最も高い特権モードで実行されているように見える。   The general OS 15 requests the hardware resource (especially the CPU) 11 to execute its code in the highest privilege mode, and the application 16 requests to execute the code in the low privilege mode. The virtual CPU monitor 12 is executed on the hardware resource 11 in a privilege mode that is higher than the highest privilege mode in which the OS 15 is normally executed. When the virtual CPU monitor 12 is executed in such a special privilege mode, the virtual CPU monitor 12 sends information indicating that the OS 15 is executed in the highest privilege mode to the OS 15. Thus, it appears to the OS 15 that the OS 15 is being executed in the highest privilege mode.

こうすることで、OS15が実行要求した、ハードウェアリソース11を直接制御するような特権命令を仮想CPUモニタ12が受け取り、OS間の競合を回避できるようになる。したがって、OS15にはハードウェアリソース11を独占しているように見え、各OS15にはそれぞれ仮想的なCPU(以下、仮想CPU13という)が存在していることと同等になる。仮想CPU13を、以下の実施例ではVCPU(Virtual CPU)と表記した。   By doing so, the virtual CPU monitor 12 receives a privileged instruction for directly controlling the hardware resource 11 requested to be executed by the OS 15, so that a conflict between the OSs can be avoided. Therefore, the OS 15 seems to monopolize the hardware resource 11, which is equivalent to the fact that each OS 15 has a virtual CPU (hereinafter referred to as a virtual CPU 13). The virtual CPU 13 is expressed as VCPU (Virtual CPU) in the following embodiments.

このように複数の仮想CPU13はハードウェアリソース11を共有できるので、複数のOS15を同時に実行することができる。図では2つしかOS15がないが、図2と同様の構造で3以上のOS15を実行することができる。   As described above, since the plurality of virtual CPUs 13 can share the hardware resource 11, a plurality of OSs 15 can be executed simultaneously. Although there are only two OSs 15 in the figure, three or more OSs 15 can be executed with the same structure as in FIG.

また、仮想CPUモニタ12は、OS15を適宜切り替えてハードウェアリソース11で実行している。これは、ハードウェアリソース11に制約がある場合(例えば、CPUが1つしかないような場合)、ある瞬間に動作しているOS15は1つのみとなるためである。   The virtual CPU monitor 12 is executed by the hardware resource 11 by switching the OS 15 as appropriate. This is because when the hardware resource 11 is limited (for example, when there is only one CPU), only one OS 15 is operating at a certain moment.

仮想CPUモニタ12は、例えば、時間毎又はOS15からの要求により一方のOS(A)1から他方のOS(A)2に、実行するOS15を切り替える場合、切り替える直前のCPUのすべてのレジスタ値(プログラムカウンタ、命令ンレジスタ、汎用レジスタ等)を待避する(使用するレジスタファイルを切り替える)。保存するデータ構造が、仮想CPU制御構造14であり、ここにはOS15実行時のレジスタ値、仮想CPUモニタ12実行時のレジスタ値、の記憶エリアがある。OS15を切り替える際、仮想CPUモニタ12は、一方のOS(A)1のレジスタ値を仮想CPU制御構造14へ退避し、他方のOS(A)2の仮想CPU制御構造14の内容のレジスタへの復帰する、一連の処理を実行する。   For example, when the OS 15 to be executed is switched from one OS (A) 1 to the other OS (A) 2 every time or in response to a request from the OS 15, the virtual CPU monitor 12 displays all register values ( Save the program counter, instruction register, general-purpose register, etc. (switch the register file to be used). The data structure to be stored is the virtual CPU control structure 14, which has storage areas for register values when the OS 15 is executed and register values when the virtual CPU monitor 12 is executed. When switching the OS 15, the virtual CPU monitor 12 saves the register value of one OS (A) 1 to the virtual CPU control structure 14 and transfers the contents of the virtual CPU control structure 14 of the other OS (A) 2 to the register. Perform a series of processing to return.

このレジスタの退避・復帰の処理はハード的に行われるので、1〜数クロックで終了する。したがって、従来、例えばOS15がコンテキストの切り替えを行うような場合と比べて極めて短時間で一方の仮想CPU(A)1から他方の仮想CPU(A)2へ切り替えが終了する。このため、外部からは複数の(仮想)CPU又はOS15が同時に動作しているように見える。   Since this register saving / restoring process is performed in hardware, it is completed in one to several clocks. Therefore, conventionally, for example, switching from one virtual CPU (A) 1 to the other virtual CPU (A) 2 is completed in a very short time compared to the case where the OS 15 performs context switching. For this reason, a plurality of (virtual) CPUs or OSs 15 appear to operate simultaneously from the outside.

OS15は例えば、OSEK(Open system together with interfaces for automotive electronics)、μITRON、LINUX等、汎用的なOSでもよいし、独自に設計されたOSでもよい。また、OS15上では各種のアプリケーション16が稼働する。本実施形態では、アプリケーション16が正常に動作していないことを検出するため、少なくとも1つのアプリケーション16は監視プログラム(A)2になる。監視されるアプリケーション(A)1は例えば、エンジン制御、ブレーキ制御、トランスミッション制御、走行用モータ制御、ナビゲーション用のプログラムである。以下では両者を区別して、実処理を行うプログラムを単にアプリケーション(A)1といい、正常に動作していないことを検出するプログラムを監視プログラム(A)2という。また、正常に動作していないことを検出することを、単に「異常を検出する」という。   The OS 15 may be a general-purpose OS such as OSEK (Open system together with interfaces for automotive electronics), μITRON, LINUX, or may be an OS designed uniquely. Various applications 16 run on the OS 15. In this embodiment, in order to detect that the application 16 is not operating normally, at least one application 16 becomes the monitoring program (A) 2. The monitored application (A) 1 is, for example, a program for engine control, brake control, transmission control, travel motor control, and navigation. In the following description, the program for performing the actual processing is simply referred to as application (A) 1, and the program for detecting that it is not operating normally is referred to as monitoring program (A) 2. Further, detecting that the device is not operating normally is simply referred to as “detecting an abnormality”.

図3(a)は、ECU100の概略構成図の一例を示す。ECU100は、基板上に実装されたマイコンを実体とし、マイコンはCPU(A)及びCOM1を有する。CPU(A)及びCOM1はハードウェアリソース11を実体とする。RAM、I/O等のハードウェアリソース11は省略した。COM1は、CAN(Controller Area Network)、FlexRay又はLIN(Local Interconnect Network)等の車載LAN17に接続され、他のECU100と通信する通信ユニットである。   FIG. 3A shows an example of a schematic configuration diagram of the ECU 100. The ECU 100 has a microcomputer mounted on a substrate as an entity, and the microcomputer includes a CPU (A) and a COM1. The CPU (A) and COM1 have the hardware resource 11 as an entity. The hardware resources 11 such as RAM and I / O are omitted. The COM 1 is a communication unit that is connected to the in-vehicle LAN 17 such as CAN (Controller Area Network), FlexRay, or LIN (Local Interconnect Network) and communicates with other ECUs 100.

CPU(A)上に記載されたVCPU(A)1とVCPU(A)2が仮想CPU13である。すなわち、VCPU(A)1とVCPU(A)2は、例えばOS15、アプリケーション(A)1又は監視プログラム(A)2から存在するように見える仮想的なCPUである。図3(a)では、VCPU(A)1上でアプリケーション(A)1が、VCPU(A)2上で監視プログラム(A)2が実行されるものとする。   VCPU (A) 1 and VCPU (A) 2 described on the CPU (A) are virtual CPUs 13. That is, VCPU (A) 1 and VCPU (A) 2 are virtual CPUs that appear to exist from, for example, the OS 15, the application (A) 1, or the monitoring program (A) 2. In FIG. 3A, it is assumed that the application (A) 1 is executed on the VCPU (A) 1 and the monitoring program (A) 2 is executed on the VCPU (A) 2.

監視プログラム(A)2は、VCPU(A)1上で実行されているアプリケーション(A)1が、リソース不足や無限ループ、デッドロック等の何らかの要因で、正常な動作をしていない場合に、VCPU(A)1にリセット要求を出力する。リセット要求は、例えばVCPU(A)1のハードウェアリセット端子をアクティブにすることをいう。すなわち、ハード的にVCPU(A)1のみをリセットできる。正常に動作しているか否かは、VCPU(A)1が一定周期でVCPU(A)2のレジスタ(VCPU(A)2_checkreg21)にアクセスしている否かにより、VCPU(A)2が判定する。VCPU(A)1が一定周期でVCPU(A)2_checkreg21にアクセスしていない場合、VCPU(A)2はVCPU(A)1をリセットする。   The monitoring program (A) 2 is used when the application (A) 1 running on the VCPU (A) 1 is not operating normally due to some reason such as resource shortage, infinite loop, deadlock, etc. A reset request is output to VCPU (A) 1. The reset request refers to, for example, activating the hardware reset terminal of the VCPU (A) 1. That is, only the VCPU (A) 1 can be reset in hardware. Whether the VCPU (A) 1 is operating normally is determined by the VCPU (A) 2 depending on whether the VCPU (A) 1 is accessing the VCPU (A) 2 register (VCPU (A) 2_checkreg21) at regular intervals. . When VCPU (A) 1 is not accessing VCPU (A) 2_checkreg21 at a constant cycle, VCPU (A) 2 resets VCPU (A) 1.

図3(b)は、ECU100の機能ブロック図の一例を示す。図3(b)の機能ブロック図は、VCPU(A)1がアプリケーション(A)1を、VCPU(A)2が監視プログラム(A)2をそれぞれ実行することで実現される。   FIG. 3B shows an example of a functional block diagram of the ECU 100. The functional block diagram of FIG. 3B is realized by the VCPU (A) 1 executing the application (A) 1 and the VCPU (A) 2 executing the monitoring program (A) 2.

実処理部61Aはアプリケーション(A)1の本来の処理を実行するブロックである。書き込み部62Aは、VCPU(A)2のVCPU(A)2_checkreg21に所定値「FFh」(h:16進数)を書き込む。書き込みは一定周期内に行われなければ異常が検出されてしまうので、書き込み部62Aは、一定周期毎に繰り返し、実処理部61Aから呼び出されて実行される。呼び出された書き込み部62Aは、VCPU(A)2_checkreg21に所定値「FFh」を書き込むと、実処理部61Aに処理を戻す。したがって、実処理部61Aが正常に動作していれば、書き込み部62AがVCPU(A)2_checkreg21に所定値「FFh」を書き込むことができる。一方、実処理部61Aが正常に動作していない場合、書き込み部62Aが呼び出されないので、一定周期内にVCPU(A)2_checkreg21に所定値「FFh」を書き込むことができない。   The actual processing unit 61A is a block for executing the original processing of the application (A) 1. The writing unit 62A writes the predetermined value “FFh” (h: hexadecimal) in the VCPU (A) 2_checkreg21 of the VCPU (A) 2. If the writing is not performed within a certain period, an abnormality is detected. Therefore, the writing unit 62A is repeatedly called at a certain period and executed by being called from the actual processing unit 61A. The called writing unit 62A writes the predetermined value “FFh” in the VCPU (A) 2_checkreg 21 and returns the process to the actual processing unit 61A. Therefore, if the actual processing unit 61A is operating normally, the writing unit 62A can write the predetermined value “FFh” in the VCPU (A) 2_checkreg21. On the other hand, when the actual processing unit 61A is not operating normally, the writing unit 62A is not called, so that the predetermined value “FFh” cannot be written to the VCPU (A) 2_checkreg21 within a certain period.

レジスタ値検出部64Aは、書き込み部62AがVCPU(A)2_checkreg21に所定値「FFh」を書き込んだ直後にVCPU(A)2_checkreg21の値を検出して、「FFh」が書き込まれているか否かを判定する。書き込み部62Aが書き込んだ直後に、レジスタ値検出部64AがVCPU(A)2_checkreg21の値を検出するため、レジスタ値検出部64Aは書き込み部62Aと同期をとる。そして、レジスタ値検出部64Aは書き込みのタイミングから少しだけ遅らせて、書き込みと同じ一定周期でVCPU(A)2_checkreg21の値を検出する。   The register value detection unit 64A detects the value of VCPU (A) 2_checkreg21 immediately after the writing unit 62A writes the predetermined value “FFh” in the VCPU (A) 2_checkreg21, and determines whether “FFh” is written. judge. Immediately after the writing by the writing unit 62A, the register value detecting unit 64A detects the value of VCPU (A) 2_checkreg21, so that the register value detecting unit 64A is synchronized with the writing unit 62A. Then, the register value detection unit 64A detects the value of the VCPU (A) 2_checkreg21 at the same constant cycle as the write with a slight delay from the write timing.

VCPU(A)2_checkreg21に「FFh」が書き込まれている場合、レジスタ値検出部64Aはレジスタ値初期化部66AにVCPU(A)2_checkreg21の初期化を要求する。レジスタ値初期化部66AはVCPU(A)2_checkreg21に「00h」を書き込む。   When “FFh” is written in the VCPU (A) 2_checkreg21, the register value detection unit 64A requests the register value initialization unit 66A to initialize the VCPU (A) 2_checkreg21. The register value initialization unit 66A writes “00h” in the VCPU (A) 2_checkreg21.

また、レジスタ値検出部64AがVCPU(A)2_checkreg21に「00h」が書き込まれていることを検出した場合、レジスタ値検出部64Aはリセット部65AにVCPU(A)1のリセットを要求する。リセット部65AはVCPU(A)1にリセットをかける。リセットをかける方法は、上記のようにハードウェア的にリセットしてもよいし、ソフトウェアによるリセット(ソフトウェアリセットレジスタに値を書き込むことでVCPU(A)1のみリセットする)を用いてもよい。   When the register value detection unit 64A detects that “00h” is written in the VCPU (A) 2_checkreg 21, the register value detection unit 64A requests the reset unit 65A to reset the VCPU (A) 1. The reset unit 65A resets the VCPU (A) 1. As a method of applying the reset, the reset may be performed by hardware as described above, or a reset by software (only VCPU (A) 1 is reset by writing a value in the software reset register) may be used.

図4は、本実施例のECU100が異常を検出する手順を示すフローチャート図の一例である。図4の手順は、例えばイグニッションがオンになるか又は電気自動車やハイブリッド車の場合はメインシステムがオンになると一定周期毎に繰り返しスタートされる。スタートのタイミングは以下の実施例に共通である。   FIG. 4 is an example of a flowchart illustrating a procedure in which the ECU 100 according to the present embodiment detects an abnormality. The procedure of FIG. 4 is repeatedly started at regular intervals when, for example, the ignition is turned on or the main system is turned on in the case of an electric vehicle or a hybrid vehicle. The start timing is common to the following embodiments.

まず、VCPU(A)1の書き込み部62Aは、一定周期毎にVCPU(A)2のVCPU(A)2_checkreg21に「FFh」を書き込む(S10)。   First, the writing unit 62A of the VCPU (A) 1 writes “FFh” to the VCPU (A) 2_checkreg 21 of the VCPU (A) 2 at regular intervals (S10).

VCPU(A)2のレジスタ値検出部64Aは、VCPU(A)2_checkreg21に「FFh」が書き込まれているか否かを判定する(S20)。   The register value detection unit 64A of the VCPU (A) 2 determines whether “FFh” is written in the VCPU (A) 2_checkreg 21 (S20).

VCPU(A)2_checkreg21に「FFh」が書き込まれている場合(S20のYes)、一定周期毎にVCPU(A)1がVCPU(A)2_checkreg21にアクセスしていることになるので、VCPU(A)2のレジスタ値初期化部66AはVCPU(A)2_checkreg21に「00h」を書き込む(S30)。その後、VCPU(A)2は一定周期の間、待機している(S40)。   When “FFh” is written in VCPU (A) 2_checkreg21 (Yes in S20), VCPU (A) 1 is accessing VCPU (A) 2_checkreg21 at regular intervals, so VCPU (A) The register value initialization unit 66A of 2 writes “00h” in the VCPU (A) 2_checkreg 21 (S30). Thereafter, the VCPU (A) 2 stands by for a certain period (S40).

VCPU(A)2_checkreg21に「FFh」が書き込まれていない場合(S20のN0)、一定周期毎にVCPU(A)1がVCPU(A)2_checkreg21にアクセスしていないことになるので、VCPU(A)2のリセット部65AがVCPU(A)1をリセットする(S50)。これにより、VCPU(A)1が再起動する。以降は、図4の処理を繰り返す(S60)。なお、一定周期が経過しても再起動中は、VCPU(A)2はVCPU(A)1をリセットしない。こうすることで、リセットが繰り返されることを防止する。   When “FFh” is not written in VCPU (A) 2_checkreg21 (N0 in S20), VCPU (A) 1 does not access VCPU (A) 2_checkreg21 at regular intervals, so VCPU (A) The second reset unit 65A resets the VCPU (A) 1 (S50). As a result, the VCPU (A) 1 is restarted. Thereafter, the process of FIG. 4 is repeated (S60). Note that VCPU (A) 2 does not reset VCPU (A) 1 during restart even after a fixed period has elapsed. This prevents repeated resets.

以上説明したように、本実施例のECU100は、物理的な監視マイコンを用いることなく、アプリケーション(A)1が正常に実行されているか否かを監視することができる。VCPU(A)1とVCPU(A)2は同じハードウェアリソース11を実体とするので、機能上は複数のCPUであっても、車載スペースの増大をもたらすことがない。また、監視側のみ仮想CPU13を用いてもよいが、VCPU(A)1とVCPU(A)2とは同じハードウェアリソース11を実体とするので、監視される側と監視する側のCPUをいずれも仮想CPU13とすることで、監視される側の物理的なCPUを搭載する必要が無く車載スペースをより効率的に利用できる。   As described above, the ECU 100 according to the present embodiment can monitor whether or not the application (A) 1 is normally executed without using a physical monitoring microcomputer. Since VCPU (A) 1 and VCPU (A) 2 have the same hardware resource 11, even if they are a plurality of CPUs in terms of function, there is no increase in in-vehicle space. The virtual CPU 13 may be used only on the monitoring side. However, since the VCPU (A) 1 and VCPU (A) 2 have the same hardware resource 11, the monitoring side and the monitoring CPU are both selected. By using the virtual CPU 13 as well, it is not necessary to mount a physical CPU to be monitored, and the in-vehicle space can be used more efficiently.

また、VCPU(A)1とVCPU(A)2は同じハードウェアリソース11を共有するので、VCPU(A)2とVCPU(A)1の通信速度は高速になる。したがって、異常が検出されてから短い時間で、VCPU(A)2がVCPU(A)1をリセットすることができる。   In addition, since VCPU (A) 1 and VCPU (A) 2 share the same hardware resource 11, the communication speed between VCPU (A) 2 and VCPU (A) 1 becomes high. Therefore, the VCPU (A) 2 can reset the VCPU (A) 1 in a short time after the abnormality is detected.

図5は、本実施例の異常検出システム200の概略構成図の一例を示す。図5において図3(a)と同一部には同一の符号を付しその説明は省略する。図5では、ECU100AとECU100BがLAN1を介して接続されている。このうち、ECU100Aの構成は図3(a)と同様である。   FIG. 5 shows an example of a schematic configuration diagram of the abnormality detection system 200 of the present embodiment. In FIG. 5, the same parts as those in FIG. In FIG. 5, ECU 100A and ECU 100B are connected via LAN1. Among these, the configuration of the ECU 100A is the same as that in FIG.

ECU100Bは、基板上に実装されたマイコン2を実体とし、マイコン2はCPU(B)及びCOM2を有する。CPU(B)上にあるVCPU(B)1とVCPU(B)2が仮想CPU13である。したがって、VCPU(B)1とVCPU(B)2は、例えばOS15、アプリケーション(A)1又は監視プログラム(A)2から存在するように見える仮想的なCPUである。図5(a)と図5(b)では、VCPU(B)1上でアプリケーション(A)1が、VCPU(B)2上で監視プログラム(A)2が実行されるものとする。   The ECU 100B has the microcomputer 2 mounted on the board as a substance, and the microcomputer 2 has a CPU (B) and a COM2. VCPU (B) 1 and VCPU (B) 2 on CPU (B) are virtual CPUs 13. Therefore, VCPU (B) 1 and VCPU (B) 2 are virtual CPUs that appear to exist from, for example, the OS 15, the application (A) 1, or the monitoring program (A) 2. 5A and 5B, it is assumed that the application (A) 1 is executed on the VCPU (B) 1 and the monitoring program (A) 2 is executed on the VCPU (B) 2.

かかる構成において、本実施例では、ECU100BがECU100Aの異常を検出し、ECU100AがECU100Bの異常を検出する。
図6は、ECU100の機能ブロック図の一例を示す。なお、図6において図3(b)と同一部には同一の符号を付しその説明は省略する。
In this configuration, in this embodiment, the ECU 100B detects an abnormality in the ECU 100A, and the ECU 100A detects an abnormality in the ECU 100B.
FIG. 6 shows an example of a functional block diagram of the ECU 100. In FIG. 6, the same parts as those in FIG. 3B are denoted by the same reference numerals, and the description thereof is omitted.

VCPU(A)1の書き込み部62Aは、VCPU(B)2のVCPU(B)2_checkreg22に所定値「FFh」を書き込む。書き込み部62Aの実装は実施例1と同じであるが、書き込み部62AはLAN1経由で書き込むので、書き込み部62Aは書き込むための情報を格納したフレームをCOM1からECU100に送信する。実処理部61Aが正常に動作していれば、書き込み部62AがVCPU(B)2_checkreg22に所定値「FFh」を一定周期毎に書き込むことができる。実処理部61Aが正常に動作していない場合、書き込み部62Aは一定周期内にVCPU(B)2_checkreg22に所定値「FFh」を書き込むことができない。   The writing unit 62A of the VCPU (A) 1 writes the predetermined value “FFh” into the VCPU (B) 2_checkreg 22 of the VCPU (B) 2. The implementation of the writing unit 62A is the same as that of the first embodiment, but the writing unit 62A writes via the LAN 1, so the writing unit 62A transmits a frame storing information for writing from the COM 1 to the ECU 100. If the actual processing unit 61A is operating normally, the writing unit 62A can write the predetermined value “FFh” in the VCPU (B) 2_checkreg 22 at regular intervals. When the actual processing unit 61A is not operating normally, the writing unit 62A cannot write the predetermined value “FFh” into the VCPU (B) 2_checkreg22 within a certain period.

VCPU(B)2のレジスタ値検出部64Bは、書き込み部62AがVCPU(B)2_checkreg22に所定値「FFh」を書き込んだ直後にVCPU(B)2_checkreg22の値を検出して、「FFh」が書き込まれているか否かを判定する。レジスタ値検出部64Bは、書き込みの直後にVCPU(B)2_checkreg22の値を検出するため、書き込み部62Aとの間で書き込みのタイミングを定めている。そして、レジスタ値検出部64Bは、LAN1を介した通信の時間に起因した遅延時間を想定し、定めたタイミングから少し遅れて一定周期でVCPU(B)2_checkreg22の値を検出する。   The register value detection unit 64B of the VCPU (B) 2 detects the value of the VCPU (B) 2_checkreg22 immediately after the writing unit 62A writes the predetermined value “FFh” to the VCPU (B) 2_checkreg22, and writes “FFh”. It is determined whether or not. The register value detection unit 64B determines the write timing with the write unit 62A in order to detect the value of VCPU (B) 2_checkreg22 immediately after the write. Then, the register value detection unit 64B assumes a delay time due to the communication time via the LAN 1, and detects the value of the VCPU (B) 2_checkreg22 at a constant cycle with a slight delay from the determined timing.

VCPU(B)2_checkreg22に「FFh」が書き込まれている場合、レジスタ値検出部64Bはレジスタ値初期化部66BにVCPU(B)2_checkreg22の初期化を要求する。レジスタ値初期化部66BはVCPU(B)2_checkreg22に「00h」を書き込む。   When “FFh” is written in VCPU (B) 2_checkreg22, the register value detection unit 64B requests the register value initialization unit 66B to initialize the VCPU (B) 2_checkreg22. The register value initialization unit 66B writes “00h” in the VCPU (B) 2_checkreg22.

レジスタ値検出部64BがVCPU(B)2_checkreg22に「00h」が書き込まれていることを検出した場合、レジスタ値検出部64Bはリセット部65BにVCPU(A)1のリセットを要求する。リセット部65BはVCPU(A)1にリセットをかける。リセットをかける方法は、ハードウェア的なリセットでもよいが、LAN1を経由しているので、ソフトウェアによるリセットを用いることが好適となる。   When the register value detection unit 64B detects that “00h” is written in the VCPU (B) 2_checkreg 22, the register value detection unit 64B requests the reset unit 65B to reset the VCPU (A) 1. The reset unit 65B resets the VCPU (A) 1. The reset method may be a hardware reset, but since it is via the LAN 1, it is preferable to use a software reset.

また、VCPU(B)1の書き込み部62Bは一定周期毎に、VCPU(A)2のVCPU(A)2_checkreg21に所定値「FFh」を書き込む。実処理部61Bが正常に動作していれば、書き込み部62BがVCPU(A)2_checkreg21に所定値「FFh」を書き込むことができる。実処理部61Bが正常に動作していない場合、書き込み部62Bは一定周期内にVCPU(A)2_checkreg21に所定値「FFh」を書き込むことができない。   Further, the writing unit 62B of the VCPU (B) 1 writes a predetermined value “FFh” into the VCPU (A) 2_checkreg 21 of the VCPU (A) 2 at regular intervals. If the actual processing unit 61B is operating normally, the writing unit 62B can write the predetermined value “FFh” in the VCPU (A) 2_checkreg21. When the actual processing unit 61B is not operating normally, the writing unit 62B cannot write the predetermined value “FFh” to the VCPU (A) 2_checkreg21 within a certain period.

レジスタ値検出部64Aは、書き込み部62BがVCPU(A)2_checkreg21に所定値「FFh」を書き込んだ直後にVCPU(A)2_checkreg21の値を検出して、「FFh」が書き込まれているか否かを判定する。「書き込みの直後」のタイミングを決定する方法は、VCPU(B)2のレジスタ値検出部64Bと同じである。   The register value detection unit 64A detects the value of the VCPU (A) 2_checkreg21 immediately after the writing unit 62B writes the predetermined value “FFh” in the VCPU (A) 2_checkreg21 to determine whether “FFh” is written. judge. The method of determining the timing of “immediately after writing” is the same as that of the register value detection unit 64B of the VCPU (B) 2.

VCPU(A)2_checkreg21に「FFh」が書き込まれている場合、レジスタ値検出部64Aはレジスタ値初期化部66AにVCPU(A)2_checkreg21の初期化を要求する。レジスタ値初期化部66AはVCPU(A)2_checkreg21に「00h」を書き込む。レジスタ値検出部64AがVCPU(A)2_checkreg21に「00h」が書き込まれていることを検出した場合、レジスタ値検出部64Aはリセット部65AにVCPU(B)1のリセットを要求する。リセット部65AはVCPU(B)1にリセットをかける。リセットをかける方法は、ハードウェア的なリセットでもよいが、LAN1を経由しているので、ソフトウェアによるリセットを用いることが好適となる。   When “FFh” is written in the VCPU (A) 2_checkreg21, the register value detection unit 64A requests the register value initialization unit 66A to initialize the VCPU (A) 2_checkreg21. The register value initialization unit 66A writes “00h” in the VCPU (A) 2_checkreg21. When the register value detection unit 64A detects that “00h” is written in the VCPU (A) 2_checkreg 21, the register value detection unit 64A requests the reset unit 65A to reset the VCPU (B) 1. The reset unit 65A resets VCPU (B) 1. The reset method may be a hardware reset, but since it is via the LAN 1, it is preferable to use a software reset.

このように、アプリケーション(A)1や監視プログラム(A)2が増大しても、仮想CPU13の場所や数が変わるだけで、アプリケーション(A)1や監視プログラム(A)2の構成は同じにすることができる。   Thus, even if the application (A) 1 and the monitoring program (A) 2 increase, the configuration of the application (A) 1 and the monitoring program (A) 2 is the same only by changing the location and number of the virtual CPU 13. can do.

図7(a)はECU100BがECU100Aの異常を検出する手順を示すフローチャート図の一例である。まず、VCPU(A)1の書き込み部62AはVCPU(B)2のVCPU(B)2_checkreg22に一定周期毎に「FFh」を書き込む(S10)。VCPU(B)2のレジスタ値検出部64Bは一定周期毎にVCPU(B)2_checkreg22の値を検出して、「FFh」が書き込まれているか否かを判定する(S20)。   FIG. 7A is an example of a flowchart illustrating a procedure in which the ECU 100B detects an abnormality in the ECU 100A. First, the writing unit 62A of the VCPU (A) 1 writes “FFh” to the VCPU (B) 2_checkreg22 of the VCPU (B) 2 at regular intervals (S10). The register value detection unit 64B of VCPU (B) 2 detects the value of VCPU (B) 2_checkreg22 at regular intervals, and determines whether “FFh” is written (S20).

VCPU(B)2_checkreg22に「FFh」が書き込まれている場合(S20のYes)、VCPU(B)2のレジスタ値初期化部66BはVCPU(B)2_checkreg22に「00h」を書き込む(S30)。その後、VCPU(B)2は一定周期の間、待機している(S40)。その後、VCPU(B)2は元の状態に戻る(リターン)。   When “FFh” is written in VCPU (B) 2_checkreg22 (Yes in S20), the register value initialization unit 66B of VCPU (B) 2 writes “00h” in VCPU (B) 2_checkreg22 (S30). Thereafter, the VCPU (B) 2 is on standby for a certain period (S40). Thereafter, VCPU (B) 2 returns to the original state (return).

VCPU(B)2_checkreg22に「FFh」が書き込まれていない場合(S20のNo)、VCPU(B)2のリセット部65BはVCPU(A)1にリセットをかける(S50)。VCPU(A)1が再起動するので、VCPU(A)1は元の状態に戻る(リターン)。以降は、図7(a)の処理を繰り返す(S60)。   When “FFh” is not written in VCPU (B) 2_checkreg22 (No in S20), the reset unit 65B of VCPU (B) 2 resets VCPU (A) 1 (S50). Since VCPU (A) 1 restarts, VCPU (A) 1 returns to its original state (return). Thereafter, the process of FIG. 7A is repeated (S60).

図7(b)はECU100AがECU10Bの異常を検出する際の手順を示すフローチャート図の一例である。同様に、VCPU(B)1の書き込み部62BはVCPU(A)2のVCPU(A)2_checkreg21に一定周期毎に「FFh」を書き込む(S10)。VCPU(A)2のレジスタ値検出部64Aは一定周期毎にVCPU(A)2_checkreg21の値を検出して、「FFh」が書き込まれているか否かを判定する(S20)。   FIG. 7B is an example of a flowchart illustrating a procedure when the ECU 100A detects an abnormality in the ECU 10B. Similarly, the writing unit 62B of the VCPU (B) 1 writes “FFh” to the VCPU (A) 2_checkreg 21 of the VCPU (A) 2 at regular intervals (S10). The register value detector 64A of the VCPU (A) 2 detects the value of the VCPU (A) 2_checkreg21 at regular intervals, and determines whether “FFh” is written (S20).

VCPU(A)2_checkreg21に「FFh」が書き込まれている場合(S20のYes)、VCPU(A)2のレジスタ値初期化部66AはVCPU(A)2_checkreg21に「00h」を書き込む(S30)。その後、VCPU(A)2は一定周期の間、待機している(S40)。その後、VCPU(A)2は元の状態に戻る(リターン)。   When “FFh” is written in the VCPU (A) 2_checkreg 21 (Yes in S20), the register value initialization unit 66A of the VCPU (A) 2 writes “00h” in the VCPU (A) 2_checkreg 21 (S30). Thereafter, the VCPU (A) 2 stands by for a certain period (S40). Thereafter, the VCPU (A) 2 returns to the original state (return).

VCPU(A)2_checkreg21に「FFh」が書き込まれていない場合(S20のNo)、VCPU(A)2のリセット部65AはVCPU(B)1にリセットをかける(S50)。VCPU(B)1が再起動するので、VCPU(B)1は元の状態に戻る(リターン)。以降は、図7(b)の処理を繰り返す(S60)。   When “FFh” is not written in the VCPU (A) 2_checkreg 21 (No in S20), the reset unit 65A of the VCPU (A) 2 resets the VCPU (B) 1 (S50). Since VCPU (B) 1 restarts, VCPU (B) 1 returns to its original state (return). Thereafter, the process of FIG. 7B is repeated (S60).

本実施例によれば、実施例1の効果に加え、LAN1を介して接続された2つのECU100AとECU100A間で異常を検出することができる。ノイズにより一方のECU100Aに異常が生じ、アプリケーション(A)1だけでなく監視プログラム(A)2にも異常が生じても、他方のECU100Bの監視プログラム(A)2によりアプリケーション(A)1の異常を検出できるので、信頼性を向上できる。   According to the present embodiment, in addition to the effects of the first embodiment, an abnormality can be detected between the two ECUs 100A and 100A connected via the LAN1. Even if an abnormality occurs in one ECU 100A due to noise and an abnormality occurs not only in the application (A) 1, but also in the monitoring program (A) 2, the abnormality in the application (A) 1 is caused by the monitoring program (A) 2 of the other ECU 100B. Therefore, reliability can be improved.

本実施例では、2つの仮想CPU13により1つの仮想CPU13の異常を検出するECU100について説明する。   In the present embodiment, an ECU 100 that detects an abnormality of one virtual CPU 13 by two virtual CPUs 13 will be described.

図8(a)、図8(b)は、3つの仮想CPU13を有するECU100の概略構成図の一例を示す。図8では、VCPU(A)1がアプリケーション(A)1を実行し、VCPU(A)2とVCPU(A)3とがそれぞれ監視プログラム(A)2を実行する。そして、ECU100は以下のいずれかのロジックで、異常を検出する。
(1)論理積
(2)論理和
FIG. 8A and FIG. 8B show an example of a schematic configuration diagram of the ECU 100 having three virtual CPUs 13. In FIG. 8, VCPU (A) 1 executes application (A) 1, and VCPU (A) 2 and VCPU (A) 3 execute monitoring program (A) 2. Then, the ECU 100 detects an abnormality with one of the following logics.
(1) Logical product (2) Logical sum

〔論理積〕
図8(a)は論理積により異常を検出するECU100を示す図である。VCPU(A)2はAND回路23と接続されており、VCPU(A)3もAND回路23と接続されている。そして、AND回路23とVCPU(A)1が接続されている。
〔Logical AND〕
FIG. 8A is a diagram showing the ECU 100 that detects an abnormality by logical product. VCPU (A) 2 is connected to the AND circuit 23, and VCPU (A) 3 is also connected to the AND circuit 23. The AND circuit 23 and VCPU (A) 1 are connected.

まず、VCPU(A)1はVCPU(A)2のVCPU(A)2_checkreg21に一定周期毎に「FFh」を書き込む。また、VCPU(A)1はVCPU(A)3のVCPU(A)3_checkreg24に一定周期毎に「FFh」を書き込む。   First, the VCPU (A) 1 writes “FFh” in the VCPU (A) 2_checkreg 21 of the VCPU (A) 2 at regular intervals. Further, the VCPU (A) 1 writes “FFh” in the VCPU (A) 3_checkreg 24 of the VCPU (A) 3 at regular intervals.

VCPU(A)2は一定周期毎にVCPU(A)2_checkreg21の値を検出して、「FFh」が書き込まれているか否かを判定する。「FFh」が書き込まれていない場合、VCPU(A)2はリセット要求(A)2をAND回路23に入力する。同様に、VCPU(A)3は一定周期毎にVCPU(A)3_checkreg24の値を検出して、「FFh」が書き込まれているか否かを判定する。「FFh」が書き込まれていない場合、VCPU(A)3はリセット要求(A)3をAND回路23に入力する。   VCPU (A) 2 detects the value of VCPU (A) 2_checkreg21 at regular intervals, and determines whether “FFh” is written. When “FFh” is not written, the VCPU (A) 2 inputs a reset request (A) 2 to the AND circuit 23. Similarly, VCPU (A) 3 detects the value of VCPU (A) 3_checkreg 24 at regular intervals to determine whether “FFh” is written. When “FFh” is not written, the VCPU (A) 3 inputs a reset request (A) 3 to the AND circuit 23.

AND回路23は、リセット要求(A)2とリセット要求(A)3の両方が入力されるとリセット要求をVCPU(A)1に出力する。したがって、図8(a)のECU100Aは、論理積を異常の検出ロジックにすることができる。   The AND circuit 23 outputs a reset request to the VCPU (A) 1 when both the reset request (A) 2 and the reset request (A) 3 are input. Therefore, the ECU 100A in FIG. 8A can make the logical product the abnormality detection logic.

AND回路23はハードウェアリソース11に含まれている。また、AND回路23を、VCPU(A)2又はVCPU(A)3がソフトウェア的に実装してもよい。この場合、VCPU(A)2又はVCPU(A)3の監視プログラム(A)2が例えば2つのフラグを監視して、両方ともオンになるとリセット要求をVCPU(A)1に出力する。   The AND circuit 23 is included in the hardware resource 11. Further, the AND circuit 23 may be implemented in software by the VCPU (A) 2 or VCPU (A) 3. In this case, the monitoring program (A) 2 of the VCPU (A) 2 or VCPU (A) 3 monitors two flags, for example, and outputs a reset request to the VCPU (A) 1 when both are turned on.

図9は、ECU100Aが論理積をロジックにして異常を検出する手順を示すフローチャート図の一例である。   FIG. 9 is an example of a flowchart illustrating a procedure in which the ECU 100A detects an abnormality using a logical product as a logic.

まず、VCPU(A)1がVCPU(A)2のVCPU(A)2_checkreg21に一定周期毎に「FFh」を書き込む(S10A)。VCPU(A)1がVCPU(A)2のVCPU(A)2_checkreg21に「FFh」を書き込んだ直後、VCPU(A)2がVCPU(A)2_checkreg21に「FFh」が書き込まれているか否か判定する(S20A)。   First, the VCPU (A) 1 writes “FFh” to the VCPU (A) 2_checkreg 21 of the VCPU (A) 2 at regular intervals (S10A). Immediately after VCPU (A) 1 writes “FFh” to VCPU (A) 2_checkreg 21 of VCPU (A) 2, it is determined whether or not “FFh” is written to VCPU (A) 2_checkreg21. (S20A).

「FFh」がVCPU(A)2_checkreg21に書き込まれている場合(S20AのYes)、VCPU(A)2がVCPU(A)2_checkreg21に「00h」を書き込む(S30A)。「FFh」がVCPU(A)2_checkreg21に書き込まれていない場合(S20AのNo)、VCPU(A)2がリセット要求(A)2をAND回路23に出力する(S40A)。   When “FFh” is written in the VCPU (A) 2_checkreg 21 (Yes in S20A), the VCPU (A) 2 writes “00h” in the VCPU (A) 2_checkreg21 (S30A). When “FFh” is not written in the VCPU (A) 2_checkreg 21 (No in S20A), the VCPU (A) 2 outputs a reset request (A) 2 to the AND circuit 23 (S40A).

また、VCPU(A)1はVCPU(A)3のVCPU(A)3_checkreg24に一定周期毎に「FFh」を書き込む(S10B)。VCPU(A)1がVCPU(A)2_checkre21 とVCPU(A)3_checkreg24に「FFh」を書き込むタイミングは、好ましくは同時であるが、少なくとも一定周期以上ずれないように調整されている。VCPU(A)2はVCPU(A)2_checkreg21の値が「FFh」でなければ一定周期毎にリセット要求(A)2を、VCPU(A)3はVCPU(A)3_checkreg24の値が「FFh」でなければ一定周期毎にリセット要求(A)3を、出力するので、論理積をロジックに採用しても一定周期内に異常を検出できる。   Further, the VCPU (A) 1 writes “FFh” to the VCPU (A) 3_checkreg 24 of the VCPU (A) 3 at regular intervals (S10B). The timing at which VCPU (A) 1 writes “FFh” in VCPU (A) 2_checkre 21 and VCPU (A) 3_checkreg 24 is preferably the same, but is adjusted so as not to deviate at least a certain period. If the value of VCPU (A) 2_checkreg21 is not “FFh”, VCPU (A) 2 issues a reset request (A) 2 at regular intervals, and VCPU (A) 3 indicates that the value of VCPU (A) 3_checkreg24 is “FFh” If there is not, the reset request (A) 3 is output every fixed period, so that the abnormality can be detected within the fixed period even if the logical product is adopted in the logic.

VCPU(A)1がVCPU(A)3のVCPU(A)3_checkreg24に「FFh」を書き込んだ直後、VCPU(A)3がVCPU(A)3_checkreg24に「FFh」が書き込まれているか否か判定する(S20B)。   Immediately after VCPU (A) 1 writes “FFh” to VCPU (A) 3_checkreg 24 of VCPU (A) 3, VCPU (A) 3 determines whether “FFh” is written to VCPU (A) 3_checkreg24 (S20B).

「FFh」がVCPU(A)3_checkreg24に書き込まれている場合(S20BのYes)、VCPU(A)3がVCPU(A)3_checkreg24に「00h」を書き込む(S30B)。「FFh」がVCPU(A)3_checkreg24に書き込まれていない場合(S20BのNo)、VCPU(A)3がリセット要求(A)3をAND回路23に出力する(S40B)。   When “FFh” is written in the VCPU (A) 3_checkreg 24 (Yes in S20B), the VCPU (A) 3 writes “00h” in the VCPU (A) 3_checkreg 24 (S30B). When “FFh” is not written in the VCPU (A) 3_checkreg 24 (No in S20B), the VCPU (A) 3 outputs a reset request (A) 3 to the AND circuit 23 (S40B).

これらの結果、AND回路23がオンになると(S50のYes)、AND回路はVCPU(A)1にリセット要求を出力するので、VCPU(A)1は再起動する(S60)。AND回路23がオンにならなければ(S50のNo)、VCPU(A)1にリセット要求が出力されない。この場合、VCPU(A)1,VCPU(A)2及びVCPU(A)3は一定周期の間、待機している(S70)。VCPU(A)1が再起動することで(S60)、VCPU(A)1は元の状態に戻る(リターン)。また、一定周期の間、待機した後(S70)、VCPU(A)1,VCPU(A)2及びVCPU(A)3は元の状態に戻る(リターン)。   As a result, when the AND circuit 23 is turned on (Yes in S50), the AND circuit outputs a reset request to the VCPU (A) 1, and the VCPU (A) 1 is restarted (S60). If the AND circuit 23 is not turned on (No in S50), no reset request is output to the VCPU (A) 1. In this case, VCPU (A) 1, VCPU (A) 2, and VCPU (A) 3 are on standby for a certain period (S70). When VCPU (A) 1 is restarted (S60), VCPU (A) 1 returns to the original state (return). Further, after waiting for a certain period (S70), VCPU (A) 1, VCPU (A) 2, and VCPU (A) 3 return to their original states (return).

このように、論理積を異常検出のロジックに採用することで、異常が生じている可能性が高い場合にのみVCPU(A)1をリセットすることができる。例えば、急な再起動が好ましくない制御を実行するECU100Aをリセットするロジックに好適となる。すなわち、明らかに異常がある場合のみECU100Aを再起動するので、ECU100の可用性を向上できる。   In this way, by using the logical product as the abnormality detection logic, it is possible to reset the VCPU (A) 1 only when there is a high possibility that an abnormality has occurred. For example, it is suitable for logic that resets the ECU 100A that executes control in which sudden restart is not preferable. That is, since the ECU 100A is restarted only when there is an obvious abnormality, the availability of the ECU 100 can be improved.

〔論理和〕
図8(b)は論理和により異常を検出するECU100を示す図である。なお、図8(b)において図8(a)と同一部には同一の符号を付しその説明は省略する。VCPU(A)2はOR回路25と接続されており、VCPU(A)3もOR回路25と接続されている。そして、OR回路25とVCPU(A)1が接続されている。
[Logical sum]
FIG. 8B is a diagram showing the ECU 100 that detects an abnormality by a logical sum. In FIG. 8B, the same parts as those in FIG. VCPU (A) 2 is connected to the OR circuit 25, and VCPU (A) 3 is also connected to the OR circuit 25. The OR circuit 25 and VCPU (A) 1 are connected.

まず、VCPU(A)1はVCPU(A)2のVCPU(A)2_checkreg21に一定周期毎に「FFh」を書き込む。また、VCPU(A)1はVCPU(A)3のVCPU(A)3_checkreg24に一定周期毎に「FFh」を書き込む。   First, the VCPU (A) 1 writes “FFh” in the VCPU (A) 2_checkreg 21 of the VCPU (A) 2 at regular intervals. Further, the VCPU (A) 1 writes “FFh” in the VCPU (A) 3_checkreg 24 of the VCPU (A) 3 at regular intervals.

OR回路25は、リセット要求(A)2とリセット要求(A)3のいずれか又は両方が入力されるとリセット要求をVCPU(A)1に出力する。したがって、図8(b)のECU100Aは、論理和を異常の検出ロジックにすることができる。   The OR circuit 25 outputs a reset request to the VCPU (A) 1 when either or both of the reset request (A) 2 and the reset request (A) 3 are input. Therefore, the ECU 100A in FIG. 8B can set the logical sum to the abnormality detection logic.

なお、OR回路25は、ハードウェアリソース11に含まれている。また、OR回路25を、VCPU(A)2又はVCPU(A)3がソフトウェア的に実装してもよい。この場合、VCPU(A)2又はVCPU(A)3の監視プログラム(A)2が例えば2つのフラグを監視して、いずれか又は両方がオンになるとリセット要求をVCPU(A)1に出力する。   The OR circuit 25 is included in the hardware resource 11. In addition, the OR circuit 25 may be implemented in software by the VCPU (A) 2 or VCPU (A) 3. In this case, the monitoring program (A) 2 of the VCPU (A) 2 or VCPU (A) 3 monitors, for example, two flags and outputs a reset request to the VCPU (A) 1 when one or both of them are turned on. .

図10は、ECU100が論理和をロジックにして異常を検出する手順を示すフローチャート図の一例である。なお、図10において図9と同じステップの説明は省略する。ステップS10A、S10B〜S40A、S40Bまでの処理は図10と同じである。   FIG. 10 is an example of a flowchart illustrating a procedure in which the ECU 100 detects an abnormality using a logical sum as logic. In FIG. 10, the description of the same steps as in FIG. 9 is omitted. The processes from step S10A, S10B to S40A, S40B are the same as those in FIG.

S40までの処理の結果、OR回路25がオンになると(S50のYes)、VCPU(A)1にリセット要求が出力され、VCPU(A)1が再起動する(S60)。なお、VCPU(A)1が再起動している間は、VCPU(A)2がリセット要求(A)2を出力することはなく、VCPU(A)3がリセット要求(A)3を出力することはない。   If the OR circuit 25 is turned on as a result of the processing up to S40 (Yes in S50), a reset request is output to the VCPU (A) 1, and the VCPU (A) 1 is restarted (S60). While VCPU (A) 1 is restarting, VCPU (A) 2 does not output reset request (A) 2, but VCPU (A) 3 outputs reset request (A) 3 There is nothing.

OR回路25がオンにならなければ(S50のNo)、VCPU(A)1にリセット要求が出力されない。この場合、VCPU(A)1,VCPU(A)2及びVCPU(A)3は一定周期の間、待機している(S70)。VCPU(A)1が再起動することで(S60)、VCPU(A)1は元の状態に戻る(リターン)。また、一定周期の間、待機した後(S70)、VCPU(A)1,VCPU(A)2及びVCPU(A)3は元の状態に戻る(リターン)。   If the OR circuit 25 is not turned on (No in S50), no reset request is output to the VCPU (A) 1. In this case, VCPU (A) 1, VCPU (A) 2, and VCPU (A) 3 are on standby for a certain period (S70). When VCPU (A) 1 is restarted (S60), VCPU (A) 1 returns to the original state (return). Further, after waiting for a certain period (S70), VCPU (A) 1, VCPU (A) 2, and VCPU (A) 3 return to their original states (return).

このように、論理和を異常検出のロジックに採用することで、例えば、急に再起動してもよい制御を実行するECU100のVCPU(A)1を早期にリセットできる。すなわち、異常の可能性がある場合にはECU100を再起動するので、ECU100の信頼性を向上できる。   Thus, by adopting the logical sum as the abnormality detection logic, for example, the VCPU (A) 1 of the ECU 100 that executes control that may be suddenly restarted can be reset early. That is, when there is a possibility of abnormality, the ECU 100 is restarted, so that the reliability of the ECU 100 can be improved.

実施例3では、2つのVCPU(A)2とVCPU(A)3の出力の論理積又は論理和で異常を検出したが、3以上の仮想CPU(VCPU(A)2、VCPU(A)3、…、VCPU(A)n)13の出力に、論理積又は論理和のロジックを適用して、VCPU(A)1の異常を検出し、以上が検出された場合にはVCPU(A)1をリセットしてもよい。この場合は、AND回路23又はOR回路25と各仮想CPU13を接続するだけでよい。   In the third embodiment, an abnormality is detected by the logical product or logical sum of the outputs of the two VCPU (A) 2 and VCPU (A) 3, but three or more virtual CPUs (VCPU (A) 2, VCPU (A) 3 ,..., VCPU (A) n) 13 is applied with logical product or logical sum logic to detect VCPU (A) 1 abnormality, and VCPU (A) 1 if any of the above is detected. May be reset. In this case, it is only necessary to connect the AND circuit 23 or the OR circuit 25 to each virtual CPU 13.

また、ECU100は、VCPU(A)2〜VCPU(A)nのように多数の仮想CPU13がVCPU(A)1を関している場合、VCPU(A)2〜VCPU(A)nの出力の多数決から、異常を検出することができる。   Further, the ECU 100 determines the majority of outputs of VCPU (A) 2 to VCPU (A) n when a large number of virtual CPUs 13 are related to VCPU (A) 1 as in VCPU (A) 2 to VCPU (A) n. Therefore, an abnormality can be detected.

図11は、多数決により異常を検出するECU100を示す図の一例である。なお、図11において図8(a)と同一部には同一の符号を付しその説明は省略する。VCPU(A)2、VCPU(A)3、…、VCPU(A)nは多数決回路27と接続されている。   FIG. 11 is an example of a diagram illustrating the ECU 100 that detects an abnormality by majority vote. In FIG. 11, the same parts as those in FIG. VCPU (A) 2, VCPU (A) 3,..., VCPU (A) n are connected to the majority circuit 27.

多数決回路27は、一定周期内に入力されたリセット要求(A)2、リセット要求A(3)、…リセット要求(A)nの数(以下、リセット要求数という)をカウントする。リセット要求数が所定値(例えば、VCPU(A)2等の数の半分)以上の場合、多数決回路27は、リセット要求をVCPU(A)1に出力する。所定値は多数決回路27に予め記憶されている。多数決回路27は、一定周期内に入力されるリセット要求数をカウントして所定値との比較結果を出力し、所定値未満の場合は、カウントしたリセット要求数をクリアする処理を繰り返す。こうすることで、多数決回路27は、一定周期毎に、多数決によりVCPU(A)1をリセットするか否かを決定できる。なお、多数決回路27も、ハードウェアリソース11に含まれている。多数決回路27をソフトウェア的に実装してもよい。   The majority circuit 27 counts the number of reset requests (A) 2, reset requests A (3),... Reset requests (A) n (hereinafter referred to as the number of reset requests) input within a certain period. When the number of reset requests is equal to or greater than a predetermined value (for example, half of the number of VCPU (A) 2 etc.), the majority circuit 27 outputs a reset request to VCPU (A) 1. The predetermined value is stored in the majority circuit 27 in advance. The majority circuit 27 counts the number of reset requests input within a certain period and outputs a comparison result with a predetermined value. If the result is less than the predetermined value, the process of clearing the counted number of reset requests is repeated. By doing so, the majority circuit 27 can determine whether to reset the VCPU (A) 1 by majority vote at regular intervals. Note that the majority circuit 27 is also included in the hardware resource 11. The majority circuit 27 may be implemented by software.

なお、フローチャート図は図9又は図10において、ステップS50の処理が「多数決が成立した?」となるだけなので省略した。   Note that the flowchart is omitted in FIG. 9 or FIG. 10 because the process of step S50 is only “Has the majority vote been established?”.

本実施例のECU100によれば、n個のVCPU(A)の出力による多数決により異常を検出するので、異常があるか否かを正確に判定することができる。また、所定値を変えることで、VCPU(A)1をリセットしやすくして信頼性を向上したり、リセットしにくくして可用性を向上させるなどを調整できる。   According to the ECU 100 of the present embodiment, the abnormality is detected by the majority vote based on the outputs of the n VCPUs (A), so it is possible to accurately determine whether there is an abnormality. In addition, by changing the predetermined value, it is possible to adjust the VCPU (A) 1 so that it is easy to reset and improve the reliability, or it is difficult to reset and the availability is improved.

これまで説明した異常の検出方法はウォッチドッグタイマ(WDT)と親和性がある。そこで、本実施例ではWDTユニット18がVCPU(A)1をリセットするように構成することで、WDTを実現するECU100について説明する。   The abnormality detection method described so far has an affinity with the watchdog timer (WDT). Therefore, in this embodiment, the ECU 100 that realizes WDT by configuring the WDT unit 18 to reset the VCPU (A) 1 will be described.

図12は、WDTユニット18により異常を検出するECU100を示す図の一例である。図12のWDTユニット18は、WDT_reg28とリセット要求をVCPU(A)1に出力するリセット回路(不図示)を有する。WDTユニット18にはこれまでの実施例で説明した一定周期に対応するタイマ値が記憶されている。WDTユニット18は、時間の計測を常に継続しているが、WDT_reg28に「FFh」が書き込まれると、計測した時間をいったんゼロにして時間の計測を再開する。WDT_reg28に「FFh」が書き込まれる前に、計測した時間がタイマ値を超えると、WDTユニット18はVCPU(A)1にリセット信号を出力する。   FIG. 12 is an example of a diagram illustrating the ECU 100 that detects an abnormality by the WDT unit 18. The WDT unit 18 of FIG. 12 includes a reset circuit (not shown) that outputs a WDT_reg 28 and a reset request to the VCPU (A) 1. The WDT unit 18 stores a timer value corresponding to the fixed period described in the previous embodiments. The WDT unit 18 continues to measure time, but when “FFh” is written in the WDT_reg 28, the measured time is once set to zero and the time measurement is resumed. If the measured time exceeds the timer value before “FFh” is written to WDT_reg 28, WDT unit 18 outputs a reset signal to VCPU (A) 1.

図12では、VCPU(A)2にWDTユニット18を配置した。WDTユニット18はICなど独立したハードウェアなので、実体はハードウェアリソース11に含まれる。また、一般的なECU100では、WDTユニット18はマイコン内になく、複数のICを統合した統合ICに実装されていることが多い。   In FIG. 12, the WDT unit 18 is arranged in the VCPU (A) 2. Since the WDT unit 18 is independent hardware such as an IC, the entity is included in the hardware resource 11. In general ECU 100, WDT unit 18 is often not mounted in a microcomputer, but is mounted on an integrated IC in which a plurality of ICs are integrated.

図13は、WDTユニット18によりVCPU(A)1の異常を検出する手順を示すフローチャート図の一例を示す。   FIG. 13 shows an example of a flowchart showing a procedure for detecting an abnormality of the VCPU (A) 1 by the WDT unit 18.

VCPU(A)1は、一定周期毎にWDTユニット18のWDT_reg28に「FFh」を書き込む(S10)。WDTユニット18は、に「FFh」が書き込まれているか否かを判定する(S20)。   The VCPU (A) 1 writes “FFh” in the WDT_reg 28 of the WDT unit 18 at regular intervals (S10). The WDT unit 18 determines whether “FFh” is written in (S20).

WDT_reg28に「FFh」が書き込まれている場合(S20のYes)、WDTユニット18はそれまで計測した時間をゼロに戻す(S30)。   When “FFh” is written in the WDT_reg 28 (Yes in S20), the WDT unit 18 returns the time measured so far to zero (S30).

ついで、WDTユニット18は計測時間がタイマ値(一定周期)以上か否かを判定する(S40)。計測時間がタイマ値以上の場合(S40のYes)、WDTユニット18がVCPU(A)1をリセットする(S50)。これにより、VCPU(A)1が再起動する(S60)。VCPU(A)1が再起動することで(S60)、VCPU(A)1は元の状態に戻る(リターン)。   Next, the WDT unit 18 determines whether or not the measurement time is equal to or greater than a timer value (constant period) (S40). If the measurement time is equal to or greater than the timer value (Yes in S40), the WDT unit 18 resets the VCPU (A) 1 (S50). As a result, the VCPU (A) 1 is restarted (S60). When VCPU (A) 1 is restarted (S60), VCPU (A) 1 returns to the original state (return).

計測時間がタイマ値以上でない場合(S40のNo)、VCPU(B)2はステップS20からの処理を繰り返す(リターン)。   If the measurement time is not equal to or greater than the timer value (No in S40), VCPU (B) 2 repeats the processing from step S20 (return).

本実施例によれば、広く利用されているWDTユニット18を仮想CPU13により実現することができる。   According to the present embodiment, the widely used WDT unit 18 can be realized by the virtual CPU 13.

本実施例では、周期的にVCPU(A)1を監視する仮想CPU13を切り替えるECU100について説明する。一般に、同じCPUに同じ処理を固定することは特定の回路に負荷が集中するため監視上好ましくないとされている。そこで、監視する仮想CPU13を切り替えることで、負荷が集中することを防止する。   In the present embodiment, an ECU 100 that switches the virtual CPU 13 that periodically monitors the VCPU (A) 1 will be described. Generally, fixing the same processing to the same CPU is not preferable for monitoring because a load is concentrated on a specific circuit. Therefore, the load is prevented from being concentrated by switching the virtual CPU 13 to be monitored.

図14(a)は、VCPU(A)1を監視する仮想CPU13を切り替えるECU100の概略構成図の一例を示す。なお、図14(a)において図8(b)と同一部には同一の符号を付しその説明は省略する。ECU100は、監視用にVCPU(A)2とVCPU(A)3を有しているが、どちらか一方のみがアクティブで、他方が非アクティブになっている。アクティブとは、その仮想CPU13が、VCPU(A)2_checkreg21の監視、「00h」の書き込み、リセット要求の出力、の一連の処理を実行していることをいう。   FIG. 14A shows an example of a schematic configuration diagram of the ECU 100 that switches the virtual CPU 13 that monitors the VCPU (A) 1. In FIG. 14 (a), the same parts as those in FIG. 8 (b) are denoted by the same reference numerals and description thereof is omitted. The ECU 100 has a VCPU (A) 2 and a VCPU (A) 3 for monitoring, but only one of them is active and the other is inactive. Active means that the virtual CPU 13 is executing a series of processes of monitoring the VCPU (A) 2_checkreg 21, writing “00h”, and outputting a reset request.

VCPU(A)2とVCPU(A)3を切り替えるにはいくつか方法があるが、例えばタイマ割込みを利用する。タイマは、切り替え時間毎に、タイマ割り込みをVCPU(A)1、VCPU(A)2及びVCPU(A)3それぞれに発生させる。VCPU(A)2がアクティブだった場合、タイマ割込みを検出したVCPU(A)1は「FFh」の書き込み先をVCPU(A)2からVCPU(A)3に切り替える。また、タイマ割込みを検出したVCPU(A)2は監視プログラム(A)2の実行を中断する。また、タイマ割込みを検出したVCPU(A)3は監視プログラム(A)2の実行を開始する。すなわち、VCPU(A)2の監視プログラム(A)2とVCPU(A)3の監視プログラム(A)2を、例えばタスクスケジューリングにおける待機状態と実行状態に遷移させることで、VCPU(A)2とVCPU(A)3の一方のみをアクティブにすることができる。このような切り替えは、一般には仮想CPUモニタ12のスケジューラの機能を利用することで実現できる。   There are several methods for switching between VCPU (A) 2 and VCPU (A) 3. For example, a timer interrupt is used. The timer generates timer interrupts to VCPU (A) 1, VCPU (A) 2, and VCPU (A) 3 for each switching time. When VCPU (A) 2 is active, VCPU (A) 1 that detected the timer interrupt switches the write destination of “FFh” from VCPU (A) 2 to VCPU (A) 3. The VCPU (A) 2 that has detected the timer interrupt interrupts the execution of the monitoring program (A) 2. Further, the VCPU (A) 3 that has detected the timer interrupt starts execution of the monitoring program (A) 2. That is, by switching the monitoring program (A) 2 of the VCPU (A) 2 and the monitoring program (A) 2 of the VCPU (A) 3 to, for example, a standby state and an execution state in task scheduling, the VCPU (A) 2 Only one of VCPU (A) 3 can be active. Such switching can generally be realized by using the scheduler function of the virtual CPU monitor 12.

図15は、ECU100が監視する仮想CPU13を切り替える手順を示すフローチャート図の一例を示す。タイマ割込みが発生するまで、VCPU(A)1はアプリケーション(A)1を、VCPU(A)2は監視プログラム(A)2を実行している。   FIG. 15 shows an example of a flowchart showing a procedure for switching the virtual CPU 13 monitored by the ECU 100. Until the timer interrupt occurs, VCPU (A) 1 executes application (A) 1, and VCPU (A) 2 executes monitoring program (A) 2.

タイマがタイマ割込みを発生させると(S10)、VCPU(A)1は「FFh」の書き込み先をVCPU(A)2からVCPU(A)3に切り替える(S20)。その後、VCPU(A)1はこの処理を繰り返し、「FFh」の書き込み先をVCPU(A)3からVCPU(A)2に切り替える(リターン→S20)。   When the timer generates a timer interrupt (S10), VCPU (A) 1 switches the write destination of “FFh” from VCPU (A) 2 to VCPU (A) 3 (S20). Thereafter, the VCPU (A) 1 repeats this process, and switches the write destination of “FFh” from the VCPU (A) 3 to the VCPU (A) 2 (return → S20).

また、タイマがタイマ割込みを発生させると(S10)、VCPU(A)2は監視プログラム(A)2の実行を中断する(S30)。その後、VCPU(A)2は監視プログラム(A)2の実行を再開する(リターン→S30)。   When the timer generates a timer interrupt (S10), the VCPU (A) 2 interrupts the execution of the monitoring program (A) 2 (S30). Thereafter, the VCPU (A) 2 resumes the execution of the monitoring program (A) 2 (Return → S30).

また、VCPU(A)3は監視プログラム(A)2の実行を再開する(S40)。その後、VCPU(A)3は監視プログラム(A)2の実行を再開する(リターン→S40)。   Further, the VCPU (A) 3 resumes the execution of the monitoring program (A) 2 (S40). Thereafter, the VCPU (A) 3 resumes the execution of the monitoring program (A) 2 (Return → S40).

こうすることで、周期的にVCPU(A)1を監視する仮想CPUを切り替え、負荷を分散させることができる。   By doing so, it is possible to switch the virtual CPU that periodically monitors the VCPU (A) 1 and distribute the load.

図14(b)は、ECU100の概略構成図の一例を示す。図14(b)のECU100は、VCPU(A)2とVCPU(A)3の役割を入れ替えながら、VCPU(A)1を監視している。   FIG. 14B shows an example of a schematic configuration diagram of the ECU 100. The ECU 100 in FIG. 14B monitors VCPU (A) 1 while switching the roles of VCPU (A) 2 and VCPU (A) 3.

例えば、図14(b)の左図では、VCPU(A)1はVCPU(A)2のVCPU(A)2_checkreg21及びVCPU(A)3のVCPU(A)3_checkreg24に「FFh」を書き込む。VCPU(A)2は、VCPU(A)2_checkreg21の値を読み出し「FFh」が書き込まれているか否かを判定する。そして、VCPU(A)3も、VCPU(A)3_checkreg24の値を読み出し「FFh」が書き込まれているか否かを判定する。   For example, in the left diagram of FIG. 14B, VCPU (A) 1 writes “FFh” in VCPU (A) 2_checkreg 21 of VCPU (A) 2 and VCPU (A) 3_checkreg 24 of VCPU (A) 3. The VCPU (A) 2 reads the value of the VCPU (A) 2_checkreg21 and determines whether “FFh” is written. The VCPU (A) 3 also reads the value of the VCPU (A) 3_checkreg 24 and determines whether “FFh” is written.

実施例1と同様に、VCPU(A)2_checkreg21に「FFh」が書き込まれていない場合、VCPU(A)2はVCPU(A)1をリセットする。これに対し、VCPU(A)3は、VCPU(A)3_checkreg24に「FFh」が書き込まれていない場合、VCPU(A)2にイベントの発生に伴う処理を要求する(以下、単にイベント要求という)。このイベント要求は、VCPU(A)1のリセットを要求するものである。このため、イベント要求を受信したVCPU(A)2はVCPU(A)1をリセットする。すなわち、VCPU(A)2とVCPU(A)3が多重にVCPU(A)1を監視していることになる。   As in the first embodiment, when “FFh” is not written in the VCPU (A) 2_checkreg 21, the VCPU (A) 2 resets the VCPU (A) 1. On the other hand, when “FFh” is not written in the VCPU (A) 3_checkreg 24, the VCPU (A) 3 requests the VCPU (A) 2 to perform processing associated with the occurrence of an event (hereinafter simply referred to as an event request). . This event request is a request for resetting the VCPU (A) 1. Therefore, the VCPU (A) 2 that has received the event request resets the VCPU (A) 1. That is, VCPU (A) 2 and VCPU (A) 3 are monitoring VCPU (A) 1 in multiple.

図14(b)のECU100はこの役割分担を時間毎に切り替る。図14(b)の右図は役割を切り替えた後のECU100の一例を示している。すなわち、VCPU(A)1はVCPU(A)2のVCPU(A)2_checkreg21及びVCPU(A)3のVCPU(A)3_checkreg24にそれぞれ「FFh」を書き込む。VCPU(A)3は、VCPU(A)3_checkreg24の値を読み出し「FFh」が書き込まれているか否かを判定する。そして、VCPU(A)3_checkreg24に「FFh」が書き込まれていない場合、VCPU(A)3はVCPU(A)1をリセットする。また、VCPU(A)2は、VCPU(A)2_checkreg21の値を読み出し「FFh」が書き込まれているか否かを判定する。そして、VCPU(A)2_checkreg21に「FFh」が書き込まれていない場合、VCPU(A)2はVCPU(A)3にイベントを要求する。イベント要求を受信したVCPU(A)3はVCPU(A)1をリセットする。なお、イベント要求は例えば割り込みの一種である。   The ECU 100 in FIG. 14 (b) switches the division of roles every time. The right figure of FIG.14 (b) has shown an example of ECU100 after switching the role. That is, the VCPU (A) 1 writes “FFh” in the VCPU (A) 2_checkreg 21 of the VCPU (A) 2 and the VCPU (A) 3_checkreg 24 of the VCPU (A) 3. The VCPU (A) 3 reads the value of the VCPU (A) 3_checkreg 24 and determines whether “FFh” is written. When “FFh” is not written in the VCPU (A) 3_checkreg 24, the VCPU (A) 3 resets the VCPU (A) 1. Also, the VCPU (A) 2 reads the value of the VCPU (A) 2_checkreg21 and determines whether “FFh” is written. If “FFh” is not written in the VCPU (A) 2_checkreg 21, the VCPU (A) 2 requests an event from the VCPU (A) 3. Receiving the event request, VCPU (A) 3 resets VCPU (A) 1. The event request is a kind of interrupt, for example.

このような役割の切り替えも、例えばタイマ割り込みを利用することで実現できる。タイマ割込みを検出したVCPU(A)1の処理に変化はない。これに対し、タイマ割込みを検出したVCPU(A)2はVCPU(A)2_checkreg21に「FFh」が書き込まれていない場合の処理を、VCPU(A)1をリセットする処理から、イベント要求をVCPU(A)3に出力する処理に切り替える。   Such switching of roles can also be realized by using a timer interrupt, for example. There is no change in the processing of VCPU (A) 1 that detected the timer interrupt. On the other hand, the VCPU (A) 2 that has detected the timer interrupt performs the process when “FFh” is not written in the VCPU (A) 2_checkreg 21 from the process of resetting the VCPU (A) 1 to the VCPU (A) 2 A) Switch to the process that outputs to 3.

また、タイマ割込みを検出したVCPU(A)3は、VCPU(A)3_checkreg24に「FFh」が書き込まれていない場合の処理を、VCPU(A)2にイベント要求を出力する処理から、VCPU(A)1をリセットする処理に切り替える。このような役割の切り替えは、例えばスケジューラが、タイマ割込みによりVCPU(A)2とVCPU(A)3が実行する監視プログラム(A)2の処理(タスク)を切り替えることで実現できる。   The VCPU (A) 3 that has detected the timer interrupt performs processing when “FFh” is not written in the VCPU (A) 3_checkreg 24, and from processing that outputs an event request to the VCPU (A) 2, VCPU (A) 3 ) Switch to the process of resetting 1. Such switching of roles can be realized, for example, when the scheduler switches processing (tasks) of the monitoring program (A) 2 executed by the VCPU (A) 2 and VCPU (A) 3 by timer interruption.

図16は、ECU100が監視する仮想CPU13の役割を周期的に切り替える手順を示すフローチャート図の一例を示す。なお、図16において図15と同一ステップの説明は省略する。   FIG. 16 shows an example of a flowchart showing a procedure for periodically switching the role of the virtual CPU 13 monitored by the ECU 100. In FIG. 16, the description of the same steps as those in FIG. 15 is omitted.

タイマがタイマ割込みを発生させると(S10)、VCPU(A)2はVCPU(A)2_checkreg21に「FFh」が書き込まれていない場合の処理を、VCPU(A)1をリセットする処理から、イベント要求をVCPU(A)3に出力する処理に切り替える(S30)。その後、VCPU(A)1はタイマからの割り込みをVCPU(A)3とVCPU(A)2に通知する(リターン)。VCPU(A)2は、VCPU(A)1から通知の度に、イベント要求をVCPU(A)3に出力する処理からVCPU(A)1をリセットする処理に切り替える(リターン→S30)。   When the timer generates a timer interrupt (S10), VCPU (A) 2 performs the process when “FFh” is not written in VCPU (A) 2_checkreg21, from the process of resetting VCPU (A) 1, to the event request. Is switched to the process of outputting to the VCPU (A) 3 (S30). Thereafter, VCPU (A) 1 notifies the interruption from the timer to VCPU (A) 3 and VCPU (A) 2 (return). The VCPU (A) 2 switches from the process of outputting the event request to the VCPU (A) 3 to the process of resetting the VCPU (A) 1 each time notification is made from the VCPU (A) 1 (Return → S30).

また、VCPU(A)3は、VCPU(A)3_checkreg24に「FFh」が書き込まれていない場合の処理を、VCPU(A)2にイベント要求を出力する処理から、VCPU(A)1をリセットする処理に切り替える(S40)。VCPU(A)2は、VCPU(A)1から通知の度に、VCPU(A)1をリセットする処理からVCPU(A)2にイベント要求を出力する処理に切り替える(リターン→S40)。
こうすることで、周期的に、多重的な監視の手順を切り替え、負荷を分散させることができる。
Further, the VCPU (A) 3 resets the VCPU (A) 1 from the process in which “FFh” is not written in the VCPU (A) 3 _checkreg 24 and from the process of outputting the event request to the VCPU (A) 2. Switch to processing (S40). The VCPU (A) 2 switches from the process of resetting the VCPU (A) 1 to the process of outputting an event request to the VCPU (A) 2 each time a notification is sent from the VCPU (A) 1 (Return → S40).
By doing so, it is possible to periodically switch multiple monitoring procedures and distribute the load.

本実施例のECU100によれば、VCPU(A)1を監視する仮想CPU13又は役割を周期的に切り替えることで、負荷を分散させることができる。また、VCPU(A)1を多重に監視していることになるので信頼性が向上する。   According to the ECU 100 of the present embodiment, the load can be distributed by periodically switching the virtual CPU 13 or the role that monitors the VCPU (A) 1. Further, since the VCPU (A) 1 is monitored in multiple, reliability is improved.

本実施例では、実施例6と同様の切り替えを、非周期的に実行するECU100について説明する。   In the present embodiment, an ECU 100 that performs the same switching as in the sixth embodiment aperiodically will be described.

図17(a)は、VCPU(A)1を監視する仮想CPUを非周期的に切り替えるECU100の概略構成図の一例を示す。なお、図17(a)において図14(a)と同一部には同一の符号を付しその説明は省略する。構成上の違いはないが、図17(a)では、アクティブな仮想CPU13を切り替えるトリガが図16(a)と異なる。すなわち、実施例6では周期的に(例えばタイマ割り込みで)アクティブな仮想CPU13を切り替えたが、本実施例では何らかのイベントにより、アクティブな仮想CPU13を切り替える。   FIG. 17A shows an example of a schematic configuration diagram of the ECU 100 that switches the virtual CPU that monitors the VCPU (A) 1 aperiodically. In FIG. 17A, the same parts as those in FIG. 14A are denoted by the same reference numerals, and the description thereof is omitted. Although there is no difference in configuration, in FIG. 17A, a trigger for switching the active virtual CPU 13 is different from that in FIG. That is, in the sixth embodiment, the active virtual CPU 13 is switched periodically (for example, by timer interruption), but in this embodiment, the active virtual CPU 13 is switched by some event.

イベントには種々あるが、例えば、ハードウェア割り込み、例外の発生、フックの検出(ソフトウェアが指定した特定の事象が検出されること)等である。   There are various events, for example, hardware interrupt, occurrence of exception, detection of hook (a specific event specified by software is detected), and the like.

このようなイベントを検出した、仮想CPU13、OS15、又は、アプリケーション16は、VCPU(A)1、VCPU(A)2及びVCPU(A)3にそれぞれに割り込みを発生させる。イベントが発生した後の処理は実施例6と同様である。   The virtual CPU 13, OS 15, or application 16 that has detected such an event causes VCPU (A) 1, VCPU (A) 2, and VCPU (A) 3 to generate interrupts. Processing after the event has occurred is the same as that in the sixth embodiment.

図18は、ECU100が監視する仮想CPU13を非周期的に切り替える手順を示すフローチャート図の一例を示す。イベントが発生するまで、VCPU(A)1はアプリケーション(A)1を、VCPU(A)2及びVCPU(A)3は監視プログラム(A)2を実行している。   FIG. 18 shows an example of a flowchart showing a procedure for aperiodically switching the virtual CPU 13 monitored by the ECU 100. Until the event occurs, the VCPU (A) 1 executes the application (A) 1, and the VCPU (A) 2 and the VCPU (A) 3 execute the monitoring program (A) 2.

ハードウェアリソース11、アプリケーション(A)1又はOS15はイベントの発生を検出し、VCPU(A)1、VCPU(A)2及びVCPU(A)3にそれぞれ割り込みを発生させる(S10)。これにより、VCPU(A)1は「FFh」の書き込み先をVCPU(A)2からVCPU(A)3に切り替える(S20)。その後、VCPU(A)1はこの処理を繰り返し、「FFh」の書き込み先をVCPU(A)3からVCPU(A)2に切り替える(リターン→S20)。   The hardware resource 11, the application (A) 1 or the OS 15 detects the occurrence of an event, and generates an interrupt for each of the VCPU (A) 1, VCPU (A) 2 and VCPU (A) 3 (S10). As a result, the VCPU (A) 1 switches the write destination of “FFh” from VCPU (A) 2 to VCPU (A) 3 (S20). Thereafter, the VCPU (A) 1 repeats this process, and switches the write destination of “FFh” from VCPU (A) 3 to VCPU (A) 2 (Return → S20).

また、VCPU(A)2は監視プログラム(A)2の実行を中断する(S30)。その後、VCPU(A)2は監視プログラム(A)2の実行を再開する(リターン→S30)。   The VCPU (A) 2 interrupts the execution of the monitoring program (A) 2 (S30). Thereafter, the VCPU (A) 2 resumes the execution of the monitoring program (A) 2 (Return → S30).

また、VCPU(A)3は監視プログラム(A)2の実行を再開する(S40)。その後、VCPU(A)3は監視プログラム(A)2の実行を再開する(リターン→S40)。こうすることで、非周期的にVCPU(A)1を監視する仮想CPUを切り替え、負荷を分散させることができる。   Further, the VCPU (A) 3 resumes the execution of the monitoring program (A) 2 (S40). Thereafter, the VCPU (A) 3 resumes the execution of the monitoring program (A) 2 (Return → S40). By doing this, it is possible to switch the virtual CPU that monitors the VCPU (A) 1 aperiodically and distribute the load.

図17(b)は、監視する仮想CPUの役割を非周期的に切り替えるECU100の概略構成図の一例を示す。なお、図17(b)において図14(b)と同一部には同一の符号を付しその説明は省略する。図17(b)のECU100は、図17(a)のECU100と同様にイベントの発生により、VCPU(A)2とVCPU(A)3の役割を切り替える。イベント発生後の処理は実施例6と同様である。   FIG. 17B shows an example of a schematic configuration diagram of the ECU 100 that switches the role of the virtual CPU to be monitored aperiodically. In FIG. 17 (b), the same parts as those in FIG. 14 (b) are denoted by the same reference numerals, and the description thereof is omitted. The ECU 100 in FIG. 17B switches the roles of the VCPU (A) 2 and VCPU (A) 3 by the occurrence of an event in the same manner as the ECU 100 in FIG. Processing after the occurrence of an event is the same as in the sixth embodiment.

図19は、ECU100が監視する仮想CPU13の役割を非周期的に切り替える手順を示すフローチャート図の一例を示す。   FIG. 19 shows an example of a flowchart showing a procedure for aperiodically switching the role of the virtual CPU 13 monitored by the ECU 100.

ハードウェアリソース11、アプリケーション(A)1又はOS15はイベントの発生を検出し、VCPU(A)1、VCPU(A)2及びVCPU(A)3にそれぞれ割り込みを発生させる(S10)。   The hardware resource 11, the application (A) 1 or the OS 15 detects the occurrence of an event, and generates an interrupt for each of the VCPU (A) 1, VCPU (A) 2 and VCPU (A) 3 (S10).

VCPU(A)2はVCPU(A)2_checkreg21に「FFh」が書き込まれていない場合の処理を、VCPU(A)1をリセットする処理から、イベント要求をVCPU(A)3に出力する処理に切り替える(S30)。その後、VCPU(A)1はタイマからの割り込みをVCPU(A)3とVCPU(A)2に通知する(リターン)。VCPU(A)2は、VCPU(A)1から通知の度に、イベント要求をVCPU(A)3に出力する処理からVCPU(A)1をリセットする処理に切り替える(リターン→S30)。   VCPU (A) 2 switches the process when “FFh” is not written in VCPU (A) 2_checkreg21 from the process of resetting VCPU (A) 1 to the process of outputting an event request to VCPU (A) 3 (S30). Thereafter, VCPU (A) 1 notifies the interruption from the timer to VCPU (A) 3 and VCPU (A) 2 (return). The VCPU (A) 2 switches from the process of outputting the event request to the VCPU (A) 3 to the process of resetting the VCPU (A) 1 each time notification is made from the VCPU (A) 1 (Return → S30).

また、VCPU(A)3は、VCPU(A)3_checkreg24に「FFh」が書き込まれていない場合の処理を、VCPU(A)2にイベント要求を出力する処理から、VCPU(A)1をリセットする処理に切り替える(S40)。VCPU(A)2は、VCPU(A)1から通知の度に、VCPU(A)1をリセットする処理からVCPU(A)2にイベント要求を出力する処理に切り替える(リターン→S40)。   Further, the VCPU (A) 3 resets the VCPU (A) 1 from the process in which “FFh” is not written in the VCPU (A) 3_checkreg24, and from the process of outputting the event request to the VCPU (A) 2. Switch to processing (S40). The VCPU (A) 2 switches from the process of resetting the VCPU (A) 1 to the process of outputting an event request to the VCPU (A) 2 each time a notification is sent from the VCPU (A) 1 (Return → S40).

こうすることで、非周期的に、多重的な監視の手順を切り替え、負荷を分散させることができる。   By doing so, it is possible to switch the multiple monitoring procedures aperiodically and distribute the load.

本実施例のECU100によれば、イベントの発生毎にVCPU(A)1を監視する仮想CPU13又は役割を切り替えることで、負荷を分散させることができる。また、VCPU(A)1を多重に監視していることになるので信頼性が向上する。なお、実施例6と本実施例を組み合わせ、周期的かつ非周期的にVCPU(A)1を監視する仮想CPU13を切り替えてもよいし、又は、多重的な監視の手順を切り替えてもよい。   According to the ECU 100 of this embodiment, the load can be distributed by switching the virtual CPU 13 that monitors the VCPU (A) 1 or the role every time an event occurs. Further, since the VCPU (A) 1 is monitored in multiple, reliability is improved. Note that the virtual CPU 13 that monitors the VCPU (A) 1 may be switched periodically or aperiodically, or multiple monitoring procedures may be switched by combining the sixth embodiment and the present embodiment.

実施例6又は7のように、仮想CPU13を切り替える構成を、3以上の仮想CPU13に対し適用することもできる。   As in the sixth or seventh embodiment, the configuration for switching the virtual CPUs 13 can be applied to three or more virtual CPUs 13.

図20(a)は、多数決により異常を検出するECU100の概略構成図の一例である。なお、図20(a)において図11と同一部には同一の符号を付しその説明は省略する。図示するVCPU(A)2、VCPU(A)3、…、VCPU(A)nのうち、必ず1以上の仮想CPU13がアクティブであるが、必ず1以上の仮想CPU13はアクティブでない。例えば、図ではVCPU(A)n以外をアクティブな仮想CPU13とした。   FIG. 20A is an example of a schematic configuration diagram of the ECU 100 that detects an abnormality by majority vote. In FIG. 20 (a), the same parts as those in FIG. Of the VCPU (A) 2, VCPU (A) 3,..., VCPU (A) n shown in the figure, one or more virtual CPUs 13 are always active, but one or more virtual CPUs 13 are not always active. For example, in the figure, an active virtual CPU 13 other than VCPU (A) n is used.

そして、このECU100は、周期的又は非周期的にアクティブな仮想CPU13を繰り替える。例えば、切り替え時間が経過すると、図20(b)に示すように、ECU100はVCPU(A)nをアクティブにして、VCPU(A)2を非アクティブにする。こうすることで、負荷を分散しながら、常に一定数の仮想CPU13によりVCPU(A)1を監視することができる。   The ECU 100 repeats the virtual CPU 13 that is active periodically or aperiodically. For example, when the switching time elapses, as shown in FIG. 20B, the ECU 100 activates VCPU (A) n and deactivates VCPU (A) 2. In this way, the VCPU (A) 1 can be monitored by a fixed number of virtual CPUs 13 while the load is distributed.

なお、周期的又は非周期的にアクティブとなるか非アクティブとなるかは、例えば次のように各仮想CPU13が決定する。タイマ割込みやイベントの発生による割り込みの回数を各仮想CPU13がカウントしておき、各仮想CPU13は、回数に応じてアクティブとなるか非アクティブを決定する。例えば、回数を仮想CPU13の数nで割って、その余りが0ならVCPU(A)1が、1ならVCPU(A)2が、…という規則に仮想CPU13が従うことで、仮想CPU13はアクティブとなるか非アクティブとなるかを決定できる。   Whether each of the virtual CPUs 13 becomes active or inactive periodically or not is determined by each virtual CPU 13 as follows, for example. Each virtual CPU 13 counts the number of interrupts due to the occurrence of a timer interrupt or event, and each virtual CPU 13 determines whether to be active or inactive according to the number of times. For example, when the number is divided by the number n of virtual CPUs 13 and the remainder is 0, VCPU (A) 1 is 1; You can decide whether to become active or inactive.

また、図20(a)の多数決定回路27を用いずに、多数決でVCPU(A)1をリセットするか否かを決定することもできる。   Further, it is possible to determine whether or not to reset the VCPU (A) 1 by majority decision without using the majority decision circuit 27 of FIG.

図21(a)は、3以上の仮想CPU13の監視結果の多数決により異常を検出するECU100の概略構成図の一例である。図21(a)のECU100では、VCPU(A)1が、一定周期毎にVCPU(A)2、VCPU(A)3、…、VCPU(A)nにそれぞれ「FFh」を書き込む。VCPU(A)2はVCPU(A)2_checkreg21に「FFh」が書き込まれているか否かを判定し、書き込まれていなければイベント要求を記憶する。一方、VCPU(A)3はVCPU(A)3_checkreg24に「FFh」が書き込まれているか否かを判定し、書き込まれていなければイベント要求をVCPU(A)2に出力する。VCPU(A)nはVCPU(A)n_checkreg26に「FFh」が書き込まれているか否かを判定し、書き込まれていなければイベント要求をVCPU(A)2に出力する。   FIG. 21A is an example of a schematic configuration diagram of the ECU 100 that detects an abnormality by majority decision of the monitoring results of three or more virtual CPUs 13. In the ECU 100 of FIG. 21A, the VCPU (A) 1 writes “FFh” to the VCPU (A) 2, VCPU (A) 3,..., VCPU (A) n at regular intervals. The VCPU (A) 2 determines whether “FFh” is written in the VCPU (A) 2_checkreg 21, and stores the event request if not written. On the other hand, the VCPU (A) 3 determines whether “FFh” is written in the VCPU (A) 3_checkreg 24, and if not, outputs an event request to the VCPU (A) 2. The VCPU (A) n determines whether “FFh” is written in the VCPU (A) n_checkreg 26, and outputs an event request to the VCPU (A) 2 if not written.

そして、VCPU(A)2は、一定周期内に入力されたリセット要求数をカウントする。リセット要求数が所定値以上の場合、VCPU(A)2は、リセット要求をVCPU(A)1に出力する。すなわち、VCPU(A)2はマスタVCPUとして多数決の判定処理を実行する。このように、多重的に各仮想CPU13がVCPU(A)1を監視して、多数決によりマスタVCPUとなるVCPU(A)2が、リセットするか否かを決定できる。マスタVCPUとなった仮想CPU13の処理は監視プログラム(A)2に記述されている。   Then, the VCPU (A) 2 counts the number of reset requests input within a certain period. If the number of reset requests is greater than or equal to a predetermined value, the VCPU (A) 2 outputs a reset request to the VCPU (A) 1. That is, the VCPU (A) 2 executes majority decision processing as the master VCPU. In this manner, each virtual CPU 13 multiplexly monitors the VCPU (A) 1, and the majority CPU can determine whether the VCPU (A) 2 serving as the master VCPU is to be reset. The processing of the virtual CPU 13 which has become the master VCPU is described in the monitoring program (A) 2.

そして、ECU100は、マスタVCPUのVCPU(A)2を別の仮想CPU13に切り替えることができる。切り替え方は図20にて説明したECU100の切り替え方法と同様に、予め決定しておくことができる。各仮想CPU13は、タイマ割込みやイベントの発生による割り込みの回数を仮想CPU13の数nで割った、その余りに基づき、マスターとなるかならないかを決定する。   Then, the ECU 100 can switch the VCPU (A) 2 of the master VCPU to another virtual CPU 13. The switching method can be determined in advance as in the switching method of the ECU 100 described in FIG. Each virtual CPU 13 determines whether or not to become a master based on the remainder obtained by dividing the number of interrupts due to the occurrence of timer interrupts or events by the number n of virtual CPUs 13.

図21(b)は、マスタVCPUをVCPU(A)2からVCPU(A)3に切り替えたECU100の一例を示す図である。図示するように、マスタVCPUがVCPU(A)2からVCPU(A)3に変わっている。こうすることで、特定の仮想CPU13が多数決したり、VCPU(A)1をリセットするという同じ処理負荷が集中することを、分散させることができる。また、各CPU13が多重的にVCPU(A)1を監視するので、ECU100の信頼性を向上させることができる。   FIG. 21B is a diagram showing an example of the ECU 100 in which the master VCPU is switched from VCPU (A) 2 to VCPU (A) 3. As shown in the figure, the master VCPU is changed from VCPU (A) 2 to VCPU (A) 3. By doing this, it is possible to disperse the fact that the same processing load is concentrated in which a large number of specific virtual CPUs 13 are determined or the VCPU (A) 1 is reset. Further, since each CPU 13 monitors the VCPU (A) 1 in a multiplexed manner, the reliability of the ECU 100 can be improved.

以上のように、本実施例のECU100は、実施例6又は実施例7の効果に加え、さらにECU100の信頼性を向上できる。   As described above, the ECU 100 of the present embodiment can further improve the reliability of the ECU 100 in addition to the effects of the sixth embodiment or the seventh embodiment.

実施例2では、LAN1に接続されたECU100AがECU100Bを、ECU100BがECU100Aを、それぞれ監視する異常検出システム200を説明した。   In the second embodiment, the abnormality detection system 200 in which the ECU 100A connected to the LAN 1 monitors the ECU 100B and the ECU 100B monitors the ECU 100A has been described.

本実施例では、更に、階層的に形成されたLAN1とLAN2を介して、ECU100AがECU100Bを、ECU100BがECU100Aを、それぞれ監視する異常検出システム200について説明する。   In this embodiment, an abnormality detection system 200 will be described in which the ECU 100A monitors the ECU 100B and the ECU 100B monitors the ECU 100A via the hierarchically formed LAN1 and LAN2.

図22は、本実施例の異常検出システム200の概略構成図の一例を示す。図22において図5と同一部には同一の符号を付しその説明は省略する。図22では、ECU100AはLAN1に、ECU100BはLAN2に、それぞれ接続されている。そして、LAN1とLAN2は、G/W(GateWay)装置19を介して接続されている。   FIG. 22 shows an example of a schematic configuration diagram of the abnormality detection system 200 of the present embodiment. In FIG. 22, the same parts as those in FIG. In FIG. 22, the ECU 100A is connected to the LAN 1 and the ECU 100B is connected to the LAN 2. LAN 1 and LAN 2 are connected via a G / W (Gateway) device 19.

G/W装置19は、LAN1とLAN2のプロトコルが異なる場合に、一方のLAN1(LAN2)のプロトコルに従ったフォーマットの通信データを他方のLAN2(LAN1)のプロトコルに従ったフォーマットの通信データに変換する。車載LAN17には、例えば、CAN、FlexRay、LIN等の種々のものがあるが、これらはフォーマットに互換性があるとは限らない。G/W装置19は、異なるプロトコルのLAN1のECU100AがLAN2のECU100Bを監視すること(又はその逆)を可能にする。   When the LAN1 and LAN2 protocols are different, the G / W device 19 converts communication data formatted according to the protocol of one LAN1 (LAN2) into communication data formatted according to the protocol of the other LAN2 (LAN1) To do. There are various in-vehicle LANs 17 such as CAN, FlexRay, and LIN, for example, but these are not always compatible in format. The G / W device 19 enables the ECU 100A of the LAN 1 with a different protocol to monitor the ECU 100B of the LAN 2 (or vice versa).

また、同じプロトコルであっても、両者で通信速度がことなる場合がある。この場合にもG/W装置19は速度の違いを吸収して、LAN1のECU100AがLAN2のECU100Bを監視すること(又はその逆)を可能にする。具体的には、G/W装置19にバッファを設け、LAN1から送信された通信データをいったん記憶してから他方のLAN2に送信することで、通信速度の違いを吸収する。   Even in the same protocol, the communication speed may differ between the two. Also in this case, the G / W device 19 absorbs the difference in speed and enables the LAN 1 ECU 100A to monitor the LAN 2 ECU 100B (or vice versa). Specifically, a buffer is provided in the G / W device 19 to temporarily store communication data transmitted from the LAN 1 and then transmit it to the other LAN 2 to absorb the difference in communication speed.

なお、図22のようにLAN1とLAN2を階層的に接続する場合だけでなく、G/W装置19を中心にECU100A、100Bを複数接続したスター型、複数のECU100A、100Bを同じLANに接続したスター型においても、ECU100AがECU100Bを監視すること(又はその逆)ができる。LAN1が複数のケーブルで多重化されていてもよい。   In addition to the case where LAN1 and LAN2 are connected hierarchically as shown in FIG. 22, a star type in which a plurality of ECUs 100A and 100B are connected around the G / W device 19 and a plurality of ECUs 100A and 100B are connected to the same LAN. Even in the star type, the ECU 100A can monitor the ECU 100B (or vice versa). The LAN 1 may be multiplexed with a plurality of cables.

また、特殊な例としてFlexRayでは、通信データを送信した時刻情報が通信データに含まれる。これにより、例えばECU100AがECU100BのVCPU(B)2_checkreg22に「FFh」を書き込む際に、時刻情報を一緒に書き込むことができる。したがって、この時刻情報を参照すれば、最後にECU100AがVCPU(B)2_checkreg22に「FFh」を書き込んでから経過した時間を、ECU100Bが検出することができる。ECU100Bが「FFh」だけでなく時刻情報を参照してVCPU(A)1をリセットすれこととすれば、より的確なタイミングでVCPU(A)1をリセットすることができる。ECU100Aの信頼性や可用性を向上させることができる。   As a special example, in FlexRay, the time information at which the communication data is transmitted is included in the communication data. Thereby, for example, when the ECU 100A writes “FFh” in the VCPU (B) 2_checkreg 22 of the ECU 100B, the time information can be written together. Therefore, by referring to this time information, ECU 100B can detect the time that has elapsed since ECU 100A last written “FFh” in VCPU (B) 2_checkreg22. If the ECU 100B resets the VCPU (A) 1 with reference to time information as well as “FFh”, the VCPU (A) 1 can be reset at a more accurate timing. The reliability and availability of the ECU 100A can be improved.

本実施例のECU100によれば、階層的に構築されたネットワークを介して、ECU100AがECU100Bの異常を、ECU100BがECU100Aの異常を、それぞれ検出できる。   According to the ECU 100 of the present embodiment, the ECU 100A can detect an abnormality of the ECU 100B and the ECU 100B can detect an abnormality of the ECU 100A via a hierarchically constructed network.

実施例9のように種々のプロトコルや通信速度のLAN1、2が混在した車載LAN17を介して、一方のECU100Aが他方のECU100Bを監視できることで、特に車両では仮想CPU13を用いた異常の検出の有効性が向上する。   As in the ninth embodiment, one ECU 100A can monitor the other ECU 100B via the in-vehicle LAN 17 in which LANs 1 and 2 of various protocols and communication speeds are mixed, so that the abnormality detection using the virtual CPU 13 is effective particularly in the vehicle. Improves.

図23は、本実施例の異常検出システム200の概略構成図の一例を示す。車両ではLAN1とLAN2に故障耐性要求レベルの異なるECU100A、100Bが接続されることが多い。例えば、パワートレーン系のECU100は同じ1つのLAN1に接続され、ブレーキ系のECU100は同じ1つのLAN1に接続され、ボディ系のECU100は同じ1つのLAN2に接続され、マルチメディア系のECU100は同じ1つのLAN2に接続される。そして、各LAN1,2はG/W装置19を介して接続されている。   FIG. 23 shows an example of a schematic configuration diagram of the abnormality detection system 200 of the present embodiment. In vehicles, ECUs 100A and 100B having different failure tolerance requirement levels are often connected to LAN1 and LAN2. For example, the power train ECU 100 is connected to the same LAN 1, the brake ECU 100 is connected to the same LAN 1, the body ECU 100 is connected to the same LAN 2, and the multimedia ECU 100 is the same 1 Connected to two LANs 2. The LANs 1 and 2 are connected via the G / W device 19.

マルチメディア系のECU100は、例え故障しても走行に影響を与えることは少ないが、パワートレーン系のECU100が故障すると最悪の場合、走行できなくおそれがある。ECU100は要求される、故障に対する耐性の高さに応じて設計されている。すなわち、マルチメディア系のECU100は故障耐性要求レベルが低く、パワートレーン系のECU100は故障耐性要求レベルが高い。   The multimedia-type ECU 100 is less likely to affect driving even if it fails, but if the power-train-type ECU 100 fails, it may not be able to run in the worst case. The ECU 100 is designed according to the required high tolerance for failure. That is, the multimedia-type ECU 100 has a low failure tolerance requirement level, and the power train-type ECU 100 has a high failure tolerance requirement level.

従来の物理的なCPUを有する監視マイコンでは、柔軟に構成を変えることができなかったので、ECUの異常を検出する場合、監視マイコンはLAN毎に配置する必要があった。   In the conventional monitoring microcomputer having a physical CPU, the configuration could not be flexibly changed. Therefore, when detecting an abnormality in the ECU, the monitoring microcomputer had to be arranged for each LAN.

しかしながら、本実施例の仮想CPU13を有するECU100はどのLAN1,2に配置されても、複数の仮想CPU13が異常を検出する基準(例えば、論理積、論理和、多数決、一定周期等)を適宜設定することができる。また、上記のように、ECU100は、種々のプロトコルや通信速度のLANが混在した車載LAN17を介して通信することができる。   However, even if the ECU 100 having the virtual CPU 13 of this embodiment is arranged in any LAN 1, 2, a reference (for example, logical product, logical sum, majority decision, fixed period, etc.) by which the plurality of virtual CPUs 13 detect abnormality is appropriately set. can do. Further, as described above, the ECU 100 can communicate via the in-vehicle LAN 17 in which LANs having various protocols and communication speeds are mixed.

このため、1つの監視用のECU100が異なる故障耐性要求レベルのECU100の異常を検出できる。また、本実施例の異常検出システム200は、故障耐性要求レベルの異なるECU100A、100Bを種々の車載LAN17を介して監視することができるので、故障耐性要求レベルの異なるECU100A、100Bを同じLAN内で監視する必要がない。この結果、異常を検出するECU100を配置するLAN1又はLAN2を柔軟に決定することができる。   For this reason, one monitoring ECU 100 can detect an abnormality of the ECU 100 at a different failure tolerance requirement level. In addition, since the abnormality detection system 200 according to the present embodiment can monitor the ECUs 100A and 100B having different failure tolerance request levels via various in-vehicle LANs 17, the ECUs 100A and 100B having different failure tolerance requirement levels can be monitored within the same LAN. There is no need to monitor. As a result, it is possible to flexibly determine the LAN 1 or LAN 2 in which the ECU 100 that detects abnormality is arranged.

本実施例では、監視用の仮想CPU13を更に監視する仮想CPU13を搭載したECU100について説明する。   In this embodiment, an ECU 100 equipped with a virtual CPU 13 that further monitors the monitoring virtual CPU 13 will be described.

図24は、監視用の仮想CPU13を更に監視する仮想CPU13を搭載したECU100の概略構成図の一例を示す。VCPU(A)2がVCPU(A)1を監視しているのはこれまでの実施例と同じである。これに対し、VCPU(A)3はVCPU(A)2及びVCPU(A)1を監視している。   FIG. 24 shows an example of a schematic configuration diagram of the ECU 100 equipped with the virtual CPU 13 that further monitors the monitoring virtual CPU 13. The VCPU (A) 2 is monitoring the VCPU (A) 1 as in the previous embodiments. On the other hand, the VCPU (A) 3 monitors the VCPU (A) 2 and the VCPU (A) 1.

VCPU(A)1は、一定周期毎に、VCPU(B)2のVCPU(B)2_checkreg22に所定値「FFh」を書き込む。実施例1等と同様に、VCPU(A)2はVCPU(B)2_checkreg22に「FFh」が記載されているか否かを監視する。   The VCPU (A) 1 writes a predetermined value “FFh” in the VCPU (B) 2_checkreg 22 of the VCPU (B) 2 at regular intervals. Similarly to the first embodiment, the VCPU (A) 2 monitors whether “FFh” is described in the VCPU (B) 2_checkreg22.

また、VCPU(A)1は、一定周期毎にVCPU(A)3のVCPU(A)3_checkreg24に所定値「F0h」を書き込む。VCPU(A)2は、一定周期毎に、VCPU(A)3のVCPU(A)3_checkreg24に所定値「Fh」を書き込む(「0Fh」でなく「Fh」)。すなわち、VCPU(A)3_checkreg24の下位1バイトのみを全て「1」にする。このような書き込みの結果、VCPU(A)3_checkreg24は次のような状態を取る。
・VCPU(A)1とVCPU(A)2が共に正常に動作している場合
VCPU(A)3_checkreg=「FFh」
・VCPU(A)1だけが正常に動作している場合
VCPU(A)3_checkreg=「F0h」
・VCPU(A)2だけが正常に動作している場合
VCPU(A)3_checkreg=「0Fh」
VCPU(A)3は、VCPU(A)3_checkreg24に所定値「FFh」「F0h」「0Fh」のいずれが書き込まれているか否かを判定し、「FFh」が書き込まれている場合は、VCPU(A)3_checkreg24に所定値「00h」を書き込む。
そして、VCPU(A)3は以下のようにリセット要求をリセット判定回路30に出力する。
(1)VCPU(A)3_checkreg24が「0Fh」だった場合
VCPU(A)1に異常が生じているおそれがあるので、VCPU(A)3はVCPU(A)1に対するリセット要求(3→1)をリセット判定回路30に出力する。したがって、VCPU(A)3はVCPU(A)2とは別にVCPU(A)1の故障を検出することができる。
(2)VCPU(A)3_checkreg24が「F0h」だった場合
VCPU(A)2に異常が生じているおそれがあるので、VCPU(A)3はVCPU(A)2に対するリセット要求(3→2)をリセット判定回路30に出力する。すなわち、VCPU(A)2の異常を検出して、VCPU(A)2に異常が生じても検出することができる。
(3)VCPU(B)2_checkreg22が「00h」だった場合
VCPU(A)1に異常が生じているおそれがあるので、VCPU(B)2はVCPU(A)1に対するリセット要求(2→1)をリセット判定回路30に出力する。
Further, the VCPU (A) 1 writes a predetermined value “F0h” in the VCPU (A) 3_checkreg 24 of the VCPU (A) 3 at regular intervals. The VCPU (A) 2 writes a predetermined value “Fh” into the VCPU (A) 3_checkreg 24 of the VCPU (A) 3 at regular intervals (“Fh” instead of “0Fh”). That is, only the lower 1 byte of the VCPU (A) 3_checkreg 24 is set to “1”. As a result of such writing, the VCPU (A) 3_checkreg 24 takes the following state.
・ When both VCPU (A) 1 and VCPU (A) 2 are operating normally
VCPU (A) 3_checkreg = "FFh"
・ When only VCPU (A) 1 is operating normally
VCPU (A) 3_checkreg = "F0h"
・ When only VCPU (A) 2 is operating normally
VCPU (A) 3_checkreg = "0Fh"
The VCPU (A) 3 determines whether any of the predetermined values “FFh”, “F0h”, and “0Fh” is written in the VCPU (A) 3_checkreg 24. If “FFh” is written, the VCPU (A) 3_checkreg24 A) A predetermined value “00h” is written in 3_checkreg24.
The VCPU (A) 3 then outputs a reset request to the reset determination circuit 30 as follows.
(1) When VCPU (A) 3_checkreg24 is “0Fh”
Since VCPU (A) 1 may be abnormal, VCPU (A) 3 outputs a reset request (3 → 1) to VCPU (A) 1 to reset determination circuit 30. Therefore, VCPU (A) 3 can detect a failure of VCPU (A) 1 separately from VCPU (A) 2.
(2) When VCPU (A) 3_checkreg24 is “F0h”
Since VCPU (A) 2 may be abnormal, VCPU (A) 3 outputs a reset request (3 → 2) to VCPU (A) 2 to reset determination circuit 30. That is, it is possible to detect an abnormality in the VCPU (A) 2 by detecting an abnormality in the VCPU (A) 2.
(3) When VCPU (B) 2_checkreg22 is “00h”
Since VCPU (A) 1 may be abnormal, VCPU (B) 2 outputs a reset request (2 → 1) to VCPU (A) 1 to reset determination circuit 30.

すなわち、VCPU(A)3は、VCPU(A)1とVCPU(A)2のいずれの異常も検出することができる。リセット判定回路30は、これらのリセット要求からリセットすべきVCPU(A)1及びVCPU(A)2を決定する。なお、リセット要求(3→1)とリセット要求(3→2)をVCPU(A)1が区別できれば、リセット要求(3→1)とリセット要求(3→2)のいずれを受信したかでリセット対象を変えるなどが可能となる。しかし、本実施例では、リセット要求(3→1)とリセット要求(3→2)を単にVCPU(A)3からのリセット要求として扱う。   That is, the VCPU (A) 3 can detect any abnormality of the VCPU (A) 1 and VCPU (A) 2. The reset determination circuit 30 determines VCPU (A) 1 and VCPU (A) 2 to be reset from these reset requests. If the VCPU (A) 1 can distinguish between the reset request (3 → 1) and the reset request (3 → 2), it is reset depending on whether the reset request (3 → 1) or the reset request (3 → 2) is received. It is possible to change the target. However, in this embodiment, the reset request (3 → 1) and the reset request (3 → 2) are simply handled as a reset request from the VCPU (A) 3.

・リセット要求(3→1)又はリセット要求(3→2)を受信した場合、リセット判定回路30はVCPU(B)1及びVCPU(B)2をリセットする。
・リセット要求(2→1)を受信した場合、リセット判定回路30はVCPU(A)1及びVCPU(B)2をリセットする。
・リセット要求(3→1)とリセット要求(2→1)、又は、リセット要求(3→2)とリセット要求(2→1)を一定周期内に受信した場合、リセット判定回路30はVCPU(A)3をリセットする。なお、VCPU(A)3をリセットするのは、リセットの優先順位をVCPU(A)3>VCPU(A)2としているためである。
When the reset request (3 → 1) or the reset request (3 → 2) is received, the reset determination circuit 30 resets VCPU (B) 1 and VCPU (B) 2.
When receiving a reset request (2 → 1), the reset determination circuit 30 resets VCPU (A) 1 and VCPU (B) 2.
When the reset request (3 → 1) and the reset request (2 → 1), or the reset request (3 → 2) and the reset request (2 → 1) are received within a certain period, the reset determination circuit 30 receives the VCPU ( A) Reset 3 The reason why the VCPU (A) 3 is reset is that the priority of reset is VCPU (A) 3> VCPU (A) 2.

このようにリセット要求(2→1)、(3→1)、(3→2)のいずれかがリセット判定回路30に入力されると、仮想的に構築されたVCPU(A)1、VCPU(B)2及びVCPU(A)3を維持したまま、ECU全体をリセットすることができる。また、リセット判定回路30は、リセット要求(2→1)、(3→1)、(3→2)を調停して、VCPU(A)1、VCPU(B)2又はVCPU(A)3からリセットする対象を決定できる。   As described above, when any one of the reset requests (2 → 1), (3 → 1), and (3 → 2) is input to the reset determination circuit 30, the VCPU (A) 1, VCPU ( The entire ECU can be reset while maintaining B) 2 and VCPU (A) 3. The reset determination circuit 30 arbitrates reset requests (2 → 1), (3 → 1), and (3 → 2), and from VCPU (A) 1, VCPU (B) 2, or VCPU (A) 3 You can decide what to reset.

図25は、ECU100が異常を検出する手順を示すフローチャート図の一例を示す。
VCPU(A)2は、一定周期毎に、VCPU(B)2_checkreg22に所定値「FFh」を書き込む(S10)。また、VCPU(A)2は、一定周期毎にVCPU(A)3_checkreg24に所定値「F0h」を書き込む(S20)。
FIG. 25 shows an example of a flowchart showing a procedure in which the ECU 100 detects an abnormality.
The VCPU (A) 2 writes a predetermined value “FFh” in the VCPU (B) 2_checkreg 22 at regular intervals (S10). Further, the VCPU (A) 2 writes a predetermined value “F0h” in the VCPU (A) 3_checkreg 24 at regular intervals (S20).

また、VCPU(A)2は、一定周期毎に、VCPU(A)3_checkreg24に所定値「Fh」を書き込む(S30)。そして、VCPU(A)2は、VCPU(B)2_checkreg22に「FFh」が書き込まれているか否かを判定する(S40)。VCPU(B)2_checkreg22に「FFh」が書き込まれていない場合(S40のNo)、VCPU(A)2はリセット要求(2→1)をリセット回路に送信する(S50)。VCPU(B)2_checkreg22に「FFh」が書き込まれている場合(S40のYes)、VCPU(A)2はVCPU(B)2_checkreg22に「00h」を書き込む(S60)。   Further, the VCPU (A) 2 writes a predetermined value “Fh” in the VCPU (A) 3_checkreg 24 at regular intervals (S30). Then, the VCPU (A) 2 determines whether “FFh” is written in the VCPU (B) 2_checkreg 22 (S40). When “FFh” is not written in the VCPU (B) 2_checkreg 22 (No in S40), the VCPU (A) 2 transmits a reset request (2 → 1) to the reset circuit (S50). When “FFh” is written in the VCPU (B) 2_checkreg 22 (Yes in S40), the VCPU (A) 2 writes “00h” in the VCPU (B) 2_checkreg 22 (S60).

また、VCPU(A)3は、VCPU(B)3_checkregに「FFh」が書き込まれているか否か判定する(S70)。VCPU(B)3_checkregに「FFh」が書き込まれている場合(S70のYes)、VCPU(A)3はVCPU(B)3_checkregに「00h」を書き込む(S80)。   The VCPU (A) 3 determines whether “FFh” is written in the VCPU (B) 3_checkreg (S70). When “FFh” is written in VCPU (B) 3_checkreg (Yes in S70), VCPU (A) 3 writes “00h” in VCPU (B) 3_checkreg (S80).

また、VCPU(B)3_checkregに「FFh」でなく「0Fh」が書き込まれている場合、VCPU(A)3はリセット要求(3→1)をリセット判定回路30に送信する(S90)。また、VCPU(B)3_checkregに「FFh」でなく「F0h」が書き込まれている場合、VCPU(A)3はリセット要求(3→2)をリセット判定回路30に送信する(S100)。   If “0Fh” is written in VCPU (B) 3_checkreg instead of “FFh”, the VCPU (A) 3 transmits a reset request (3 → 1) to the reset determination circuit 30 (S90). If “F0h” is written in VCPU (B) 3_checkreg instead of “FFh”, VCPU (A) 3 transmits a reset request (3 → 2) to the reset determination circuit 30 (S100).

そして、リセット判定回路30は、リセット要求に応じてリセットする仮想CPU13を決定する(S110)。   Then, the reset determination circuit 30 determines the virtual CPU 13 to be reset in response to the reset request (S110).

本実施例のECU100によれば、VCPU(A)1の異常をVCPU(A)2とVCPU(A)3で検出でき、さらにVCPU(A)2の異常をVCPU(A)3で検出できるので、VCPU(A)1の異常を多重に異常を検出できECU100の信頼性を向上させることができる。   According to the ECU 100 of this embodiment, the abnormality of VCPU (A) 1 can be detected by VCPU (A) 2 and VCPU (A) 3, and further the abnormality of VCPU (A) 2 can be detected by VCPU (A) 3. Therefore, the abnormality of the VCPU (A) 1 can be detected in a multiplexed manner, and the reliability of the ECU 100 can be improved.

実施例11では、仮想CPU13であるVCPU(A)3により、VCPU(A)1及びVCPU(A)2の異常を検出したが、本実施例では、実在する監視マイコン40によりVCPU(A)1及びVCPU(A)2の異常を検出するECU100について説明する。   In the eleventh embodiment, the VCPU (A) 3 which is the virtual CPU 13 detects an abnormality in the VCPU (A) 1 and VCPU (A) 2. However, in this embodiment, the VCPU (A) 1 is detected by the actual monitoring microcomputer 40. The ECU 100 that detects an abnormality of the VCPU (A) 2 will be described.

図26は、実在する監視マイコン40によりVCPU(A)1及びVCPU(A)2の異常を検出するECU100の概略構成図の一例を示す。図26において図24と同一部には同一の符号を付しその説明は省略する。図26では、VCPU(A)3の代わりに物理的に実在する監視マイコン40を有する。   FIG. 26 shows an example of a schematic configuration diagram of the ECU 100 that detects abnormality of the VCPU (A) 1 and VCPU (A) 2 by the actual monitoring microcomputer 40. In FIG. 26, the same parts as those in FIG. In FIG. 26, a monitoring microcomputer 40 that physically exists instead of the VCPU (A) 3 is provided.

VCPU(A)2がVCPU(A)1を監視している。監視マイコン40はVCPU(A)2及びVCPU(A)1を監視している。   VCPU (A) 2 is monitoring VCPU (A) 1. The monitoring microcomputer 40 monitors VCPU (A) 2 and VCPU (A) 1.

VCPU(A)1は、一定周期毎に、VCPU(B)2のVCPU(B)2_checkreg22に所定値「FFh」を書き込む。実施例1等と同様に、VCPU(A)2はVCPU(B)2_checkreg22に「FFh」が記載されているか否かを監視する。   The VCPU (A) 1 writes a predetermined value “FFh” in the VCPU (B) 2_checkreg 22 of the VCPU (B) 2 at regular intervals. Similarly to the first embodiment, the VCPU (A) 2 monitors whether “FFh” is described in the VCPU (B) 2_checkreg22.

また、VCPU(A)1は、一定周期毎に監視マイコン40のCPU(B)_checkreg41に所定値「F0h」を書き込む。VCPU(A)2は、一定周期毎に、監視マイコン40のCPU(B)_checkreg41に所定値「Fh」を書き込む(「0Fh」でなく「Fh」)。また、監視マイコン40はCPU(B)_checkreg41に所定値「FFh」が書き込まれているか否かを判定し、書き込まれている場合は、CPU(B)_checkreg41に所定値「00h」を書き込む。   Further, the VCPU (A) 1 writes a predetermined value “F0h” in the CPU (B) _checkreg 41 of the monitoring microcomputer 40 at regular intervals. The VCPU (A) 2 writes a predetermined value “Fh” into the CPU (B) _checkreg 41 of the monitoring microcomputer 40 at regular intervals (“Fh” instead of “0Fh”). Further, the monitoring microcomputer 40 determines whether or not the predetermined value “FFh” is written in the CPU (B) _checkreg 41, and if it is written, the predetermined value “00h” is written in the CPU (B) _checkreg 41.

したがって、監視マイコン40は実施例11のVCPU(A)3と同様に、VCPU(A)2及びVCPU(A)1の異常を検出することができる。   Accordingly, the monitoring microcomputer 40 can detect an abnormality in the VCPU (A) 2 and VCPU (A) 1 in the same manner as the VCPU (A) 3 in the eleventh embodiment.

本実施例のECU100によれば、実施例11の効果に加え、VCPU(A)3を監視マイコン40で構成することで、マイコン自体に何らかの不具合が生じ仮想CPU13に異常が生じた際でも、VCPU(A)1の異常を確実に検出することができる。   According to the ECU 100 of the present embodiment, in addition to the effects of the eleventh embodiment, by configuring the VCPU (A) 3 with the monitoring microcomputer 40, even if some trouble occurs in the microcomputer itself and an abnormality occurs in the virtual CPU 13, the VCPU (A) The abnormality 1 can be reliably detected.

以上説明したように、本実施形態のECU100は、コストや車載スペースの増大をもたらすことなくECU100の異常を検出することができる。異常が検出されてから短い時間で、VCPU(A)2がVCPU(A)1をリセットすることができる。VCPU(A)1を監視する仮想CPU13を切り替えることで、処理負荷を分散できる。ECU100Aが車載LAN17を経由してECU100Bの異常を検出することができるので、ECU100A又はECU100Bの配置を柔軟に設計できる。また、監視用に複数の仮想CPU13を構築することで、VCPU(A)1を多重に監視することができる。また、監視用の仮想CPU13を監視する仮想CPU13を配置できるので、信頼性を向上させることができる。   As described above, the ECU 100 according to the present embodiment can detect an abnormality in the ECU 100 without causing an increase in cost or in-vehicle space. The VCPU (A) 2 can reset the VCPU (A) 1 in a short time after the abnormality is detected. By switching the virtual CPU 13 that monitors the VCPU (A) 1, the processing load can be distributed. Since ECU 100A can detect abnormality of ECU 100B via in-vehicle LAN 17, the arrangement of ECU 100A or ECU 100B can be designed flexibly. Further, by constructing a plurality of virtual CPUs 13 for monitoring, it is possible to monitor VCPU (A) 1 in a multiple manner. In addition, since the virtual CPU 13 that monitors the monitoring virtual CPU 13 can be arranged, the reliability can be improved.

11 ハードウェアリソース
13 仮想CPU
15 OS
16(A)1 アプリケーション
16(A)2 監視プログラム
17 車載LAN
18 WDTユニット
19 G/W装置
23 AND回路
25 OR回路
27 多数決回路
30 リセット判定回路
40 監視マイコン
100 ECU(電子制御ユニット)
200 異常検出システム
11 Hardware resources 13 Virtual CPU
15 OS
16 (A) 1 Application 16 (A) 2 Monitoring program 17 In-vehicle LAN
18 WDT unit 19 G / W device 23 AND circuit 25 OR circuit 27 Majority circuit 30 Reset determination circuit 40 Monitoring microcomputer 100 ECU (electronic control unit)
200 Anomaly detection system

Claims (13)

車載装置に演算結果を提供する電子制御ユニットにおいて、
実在するCPUと、
実在するCPUから仮想的なCPUを構築する仮想CPU構築手段と、
仮想的に構築された、第1の仮想CPU及び第2の仮想CPUと、を有し、
前記演算結果を提供する前記第1の仮想CPUを、前記第2の仮想CPUが監視する、
ことを特徴とする電子制御ユニット。
In the electronic control unit that provides the calculation results to the in-vehicle device,
A real CPU,
A virtual CPU construction means for constructing a virtual CPU from an existing CPU;
A first virtual CPU and a second virtual CPU constructed virtually;
The second virtual CPU monitors the first virtual CPU that provides the calculation result.
An electronic control unit characterized by that.
前記第2の仮想CPUは、車載ネットワークを介して前記第1の仮想CPUを監視する、
ことを特徴とする請求項1記載の電子制御ユニット。
The second virtual CPU monitors the first virtual CPU via an in-vehicle network.
The electronic control unit according to claim 1.
前記第2の仮想CPUは、ゲートウェイを介して接続された第1の車載ネットワークと第2の車載ネットワークを介して、前記第1の仮想CPUを監視する、
ことを特徴とする請求項1記載の電子制御ユニット。
The second virtual CPU monitors the first virtual CPU via a first in-vehicle network and a second in-vehicle network connected via a gateway;
The electronic control unit according to claim 1.
前記第1の仮想CPUは、前記第2の仮想CPUのレジスタに周期的に所定値を書き込む書き込み手段を有し、
前記第2の仮想CPUは、前記レジスタに前記所定値が記憶されているか否かを判定する判定手段と、
前記レジスタに前記所定値が記憶されていない場合に前記第1の仮想CPUをリセットするリセット手段と、を有する、
ことを特徴とする請求項1〜3いずれか1項記載の電子制御ユニット。
The first virtual CPU has writing means for periodically writing a predetermined value to a register of the second virtual CPU,
The second virtual CPU is configured to determine whether or not the predetermined value is stored in the register;
Resetting means for resetting the first virtual CPU when the predetermined value is not stored in the register;
The electronic control unit according to any one of claims 1 to 3, wherein
構築された複数の前記第2の仮想CPUと、
複数の前記第2の仮想CPUが出力した監視結果が入力される論理演算手段と、を有し、
前記論理演算手段による論理演算の結果に応じて前記第1の仮想CPUをリセットする、
ことを特徴とする請求項1〜4いずれか1項記載の電子制御ユニット。
A plurality of the second virtual CPUs constructed;
Logical operation means for receiving monitoring results output from the plurality of second virtual CPUs,
Resetting the first virtual CPU according to a result of a logical operation by the logical operation means;
The electronic control unit according to claim 1, wherein:
前記第2の仮想CPUは、ウォッチドッグタイマである、
ことを特徴とする請求項1〜5いずれか1項記載の電子制御ユニット。
The second virtual CPU is a watchdog timer;
The electronic control unit according to any one of claims 1 to 5, wherein
2つの前記第2の仮想CPU1及び前記第2の仮想CPU2が構築された場合、
前記第1の仮想CPUを監視する前記第2の仮想CPUを、前記第2の仮想CPU1から前記第2の仮想CPU2に切り替える、
ことを特徴とする請求項1〜6いずれか1項記載の電子制御ユニット。
When the two second virtual CPUs 1 and the second virtual CPU 2 are constructed,
Switching the second virtual CPU that monitors the first virtual CPU from the second virtual CPU 1 to the second virtual CPU 2;
The electronic control unit according to claim 1, wherein the electronic control unit is an electronic control unit.
タイマ割り込み又は所定のイベントの発生に伴う割り込みが発生する毎に、
前記第2の仮想CPU1は前記第1の仮想CPUの監視を中断し、前記第2の仮想CPU2は前記第1の仮想CPUの監視を再開する、
ことを特徴とする請求項7記載の電子制御ユニット。
Every time a timer interrupt or an interrupt accompanying the occurrence of a predetermined event occurs,
The second virtual CPU 1 interrupts monitoring of the first virtual CPU, and the second virtual CPU 2 resumes monitoring of the first virtual CPU;
The electronic control unit according to claim 7.
構築された2つの前記第2の仮想CPUのうち、一方は前記第1の仮想CPUの監視結果を他方の前記第2の仮想CPUに出力し、
他方の前記第2の仮想CPUは、前記第1の仮想CPUの監視結果又は一方の前記第2の仮想CPUによる監視結果に基づき、前記第1の仮想CPUを監視する場合、
タイマ割り込み又は所定のイベントの発生に伴う割り込みが発生する毎に、
一方の前記第2の仮想CPUと他方の前記第2の仮想CPUの役割を切り替える、
ことを特徴とする請求項7項記載の電子制御ユニット。
Of the two second virtual CPUs constructed, one outputs the monitoring result of the first virtual CPU to the other second virtual CPU,
When the other second virtual CPU monitors the first virtual CPU based on the monitoring result of the first virtual CPU or the monitoring result by the one second virtual CPU,
Every time a timer interrupt or an interrupt accompanying the occurrence of a predetermined event occurs,
Switching roles of one second virtual CPU and the other second virtual CPU;
The electronic control unit according to claim 7.
前記論理演算手段は、
複数の前記第2の仮想CPUが出力した否定的又は肯定的な監視結果の数と、所定値とを比較した比較結果に応じて前記第1の仮想CPUをリセットする、
ことを特徴とする請求項5項記載の電子制御ユニット。
The logical operation means is
Resetting the first virtual CPU according to a comparison result obtained by comparing a predetermined value with the number of negative or positive monitoring results output by the plurality of second virtual CPUs;
The electronic control unit according to claim 5.
前記第1の仮想CPU及び前記第2の仮想CPUを監視する第3の仮想CPUと、
前記第2の仮想CPUの監視結果と前記第3の仮想CPUの監視結果が入力される監視判定手段と、を有し、
前記監視判定手段は、前記第2の仮想CPUの監視結果と前記第3の仮想CPUの監視結果のいずれか一方が入力されると、前記第1の仮想CPUをリセットする、
ことを特徴とする請求項1記載の電子制御ユニット。
A third virtual CPU that monitors the first virtual CPU and the second virtual CPU;
Monitoring determination means for inputting the monitoring result of the second virtual CPU and the monitoring result of the third virtual CPU;
The monitoring determination unit resets the first virtual CPU when one of the monitoring result of the second virtual CPU and the monitoring result of the third virtual CPU is input.
The electronic control unit according to claim 1.
前記第3の仮想CPUは、
仮想的に構築されたCPUでなく、実在するCPUである、
ことを特徴とする請求項11記載の電子制御ユニット。
The third virtual CPU is
It is not a virtually constructed CPU but a real CPU.
The electronic control unit according to claim 11.
車載装置に演算結果を提供する電子制御ユニットの異常検出方法において、
仮想CPU構築手段が、実在するCPUから仮想的な第1の仮想CPU及び第2の仮想CPUを構築するステップと、
前記演算結果を提供する前記第1の仮想CPUを、前記第2の仮想CPUが監視するステップと、
を有することを特徴とする異常検出方法。
In the abnormality detection method of the electronic control unit that provides the calculation result to the in-vehicle device,
A step in which the virtual CPU construction means constructs a virtual first virtual CPU and a second virtual CPU from the existing CPU;
The second virtual CPU monitoring the first virtual CPU providing the calculation result;
The abnormality detection method characterized by having.
JP2009169373A 2009-07-17 2009-07-17 Electronic control unit and method for detecting failure Pending JP2011022934A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009169373A JP2011022934A (en) 2009-07-17 2009-07-17 Electronic control unit and method for detecting failure

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009169373A JP2011022934A (en) 2009-07-17 2009-07-17 Electronic control unit and method for detecting failure

Publications (1)

Publication Number Publication Date
JP2011022934A true JP2011022934A (en) 2011-02-03

Family

ID=43632933

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009169373A Pending JP2011022934A (en) 2009-07-17 2009-07-17 Electronic control unit and method for detecting failure

Country Status (1)

Country Link
JP (1) JP2011022934A (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012247850A (en) * 2011-05-25 2012-12-13 Denso Corp Microcomputer
JP2013025570A (en) * 2011-07-21 2013-02-04 Denso Corp Electronic control unit
JP2013257695A (en) * 2012-06-12 2013-12-26 Renesas Electronics Corp Computer system
JP2014203181A (en) * 2013-04-03 2014-10-27 三菱電機株式会社 Fault diagnosis device and program
JP2015525915A (en) * 2012-06-26 2015-09-07 ノルディック セミコンダクタ アーエスアーNordic Semiconductor ASA Microprocessor control
US9753808B2 (en) 2012-12-06 2017-09-05 Denso Corporation Data processing device having resetting feature without interfering with user interface unit
US9958846B2 (en) 2013-03-08 2018-05-01 Denso Corporation Data processing device
JP2019016340A (en) * 2017-07-03 2019-01-31 北京▲東▼土科技股▲分▼有限公司 Multi-operating system operation method and device based on industrial internet operating system
JP2020190986A (en) * 2019-05-23 2020-11-26 株式会社デンソー Device for vehicle
US11884283B2 (en) 2019-05-31 2024-01-30 Denso Corporation Vehicle device

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012247850A (en) * 2011-05-25 2012-12-13 Denso Corp Microcomputer
JP2013025570A (en) * 2011-07-21 2013-02-04 Denso Corp Electronic control unit
US10379931B2 (en) 2012-06-12 2019-08-13 Renesas Electronics Corporation Computer system
JP2013257695A (en) * 2012-06-12 2013-12-26 Renesas Electronics Corp Computer system
US9612909B2 (en) 2012-06-12 2017-04-04 Renesas Electronics Corporation Computer system
JP2015525915A (en) * 2012-06-26 2015-09-07 ノルディック セミコンダクタ アーエスアーNordic Semiconductor ASA Microprocessor control
US10191793B2 (en) 2012-06-26 2019-01-29 Nordic Semiconductor Asa Microprocessor device with reset timer
US9753808B2 (en) 2012-12-06 2017-09-05 Denso Corporation Data processing device having resetting feature without interfering with user interface unit
US9958846B2 (en) 2013-03-08 2018-05-01 Denso Corporation Data processing device
JP2014203181A (en) * 2013-04-03 2014-10-27 三菱電機株式会社 Fault diagnosis device and program
JP2019016340A (en) * 2017-07-03 2019-01-31 北京▲東▼土科技股▲分▼有限公司 Multi-operating system operation method and device based on industrial internet operating system
JP2020190986A (en) * 2019-05-23 2020-11-26 株式会社デンソー Device for vehicle
JP7449650B2 (en) 2019-05-23 2024-03-14 株式会社デンソー Vehicle equipment
US11884283B2 (en) 2019-05-31 2024-01-30 Denso Corporation Vehicle device

Similar Documents

Publication Publication Date Title
JP2011022934A (en) Electronic control unit and method for detecting failure
US9430266B2 (en) Activating a subphysical driver on failure of hypervisor for operating an I/O device shared by hypervisor and guest OS and virtual computer system
US11283864B2 (en) Cluster system with fail-safe fallback mechanism
JP2010285001A (en) Electronic control system and functional agency method
US9690719B2 (en) Mechanism for managing access to at least one shared integrated peripheral of a processing unit and a method of operating thereof
EP2518627B1 (en) Partial fault processing method in computer system
WO2020239060A1 (en) Error recovery method and apparatus
JP2010218277A (en) Failure diagnostic system, electronic control unit, failure diagnostic method
US8943360B2 (en) DMI redundancy in multiple processor computer systems
EP2816480A1 (en) Processor system
JP2012128788A (en) Vehicle control device and data communication method
JP4377463B2 (en) Method and apparatus for monitoring computer apparatus comprising at least two processors
JP2008262419A (en) Information processor, operating system selection method and program
WO2017188109A1 (en) Vehicle control device and vehicle system
US10379931B2 (en) Computer system
JP5712783B2 (en) Electronic control unit, in-vehicle network, data transmission method
EP4115283A1 (en) Power management on a vehicle
JP2011002993A (en) Watchdog timer monitoring device, and watchdog timer monitoring method
JP3690666B2 (en) Multi-computer system
JP5887952B2 (en) In-vehicle terminal and application execution environment program
US8312126B2 (en) Managing at least one computer node
Sukumaran Nair et al. TaskMUSTER: a comprehensive analysis of task parameters for mixed criticality automotive systems
CN115248724A (en) Real-time scheduling for heterogeneous multi-core systems
WO2021176053A1 (en) Power management on a vehicle
US20040078649A1 (en) Computer system