JP2017191529A - Program rewriting system and program rewriting method - Google Patents

Program rewriting system and program rewriting method Download PDF

Info

Publication number
JP2017191529A
JP2017191529A JP2016081650A JP2016081650A JP2017191529A JP 2017191529 A JP2017191529 A JP 2017191529A JP 2016081650 A JP2016081650 A JP 2016081650A JP 2016081650 A JP2016081650 A JP 2016081650A JP 2017191529 A JP2017191529 A JP 2017191529A
Authority
JP
Japan
Prior art keywords
program
type node
rewriting
divided
node
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.)
Granted
Application number
JP2016081650A
Other languages
Japanese (ja)
Other versions
JP6165292B1 (en
Inventor
松井 俊憲
Toshinori Matsui
俊憲 松井
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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric 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 Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP2016081650A priority Critical patent/JP6165292B1/en
Application granted granted Critical
Publication of JP6165292B1 publication Critical patent/JP6165292B1/en
Publication of JP2017191529A publication Critical patent/JP2017191529A/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

PROBLEM TO BE SOLVED: To provide a program rewriting system capable of easily restoring, when the program of a controller is rewritten and a problem occurs in the rewritten program, the program before rewriting.SOLUTION: In rewriting the program of a motor controller 101, the program is divided and the divided programs are transmitted to another controller for storage by a divided program transmission unit 116 of the motor controller 101; and after that, the program is rewritten by a rewriting program transmitted from a tester 103; and when an abnormality of the operation by a new program thus obtained is detected by a state detection unit 115, the divided programs are transmitted from the other controller and the original program is written back.SELECTED DRAWING: Figure 1

Description

この発明は、ネットワークに接続された制御装置のプログラムを書き換えるプログラム書き換えシステムおよびプログラム書き換え方法に関するものである。   The present invention relates to a program rewriting system and a program rewriting method for rewriting a program of a control device connected to a network.

従来、自動車のネットワークに接続された制御装置のプログラム書き換えシステムおよび方法として、例えば特許文献1に記載されたものが知られている。
この特許文献1におけるプログラム書き換えシステムでは、通信用バスラインを介して、プログラムのデータを書き換え対象であるエンジン制御装置と、メモリ書換機が通信バス接続用コネクタによって信号的に接続されている。
エンジン制御装置は、センサからの信号を処理する入力処理回路と、このセンサ信号等からエンジン最適制御量を演算するCPU(Central Processing Unit)と、このCPUでの演算結果を制御信号として受けてエンジンに取付けられた燃料噴射装置や点火装置などのアクチュエータを駆動する出力回路と、外部機器であるメモリ書換機とのデータ通信用の通信回路とを備えている。
2. Description of the Related Art Conventionally, as a program rewriting system and method for a control device connected to an automobile network, for example, one described in Patent Document 1 is known.
In the program rewriting system disclosed in Patent Document 1, an engine control device whose program data is to be rewritten and a memory rewrite device are connected in signal via a communication bus connection connector via a communication bus line.
The engine control device includes an input processing circuit that processes a signal from the sensor, a CPU (Central Processing Unit) that calculates an engine optimum control amount from the sensor signal and the like, and an operation result in the CPU as a control signal. And an output circuit for driving an actuator such as a fuel injection device or an ignition device attached to the memory, and a communication circuit for data communication with a memory rewrite machine as an external device.

CPUには制御プログラムに従い動作するマイクロ・プロセッサ・ユニット(以下、MPU)と、このMPUを動作させるに必要なプログラムおよびデータを格納するROM(Read Only Memory)と、MPUの演算結果を格納するRAM(Random Access Memory)と、入力処理回路および通信回路からの信号を受けるとともに、出力回路に制御信号を出力するI/O(Input/Output)とが備えられている。
また、通信バス接続用コネクタにより接続されたモード判定用制御信号ラインは、リセット直後におけるCPUの実行モードをメモリ書換機側から設定するものである。
The CPU includes a microprocessor unit (hereinafter referred to as MPU) that operates in accordance with a control program, a ROM (Read Only Memory) that stores programs and data necessary for operating the MPU, and a RAM that stores calculation results of the MPU. (Random Access Memory) and I / O (Input / Output) for receiving signals from the input processing circuit and the communication circuit and outputting a control signal to the output circuit.
Further, the mode determination control signal line connected by the communication bus connection connector sets the execution mode of the CPU immediately after the reset from the memory rewrite device side.

この特許文献1のプログラム書き換え方法は、内蔵プログラム起動中に外部から送信される書き換え命令があった場合に、自動車の駆動がなされていないことを様々な条件から判断し、駆動されていないことが判明すると、内蔵プログラムまたは内蔵データの一部または全部を、外部から送信される新たなプログラムまたはデータに書き換えるものである。   In the program rewriting method of Patent Document 1, when there is a rewriting command transmitted from the outside while the built-in program is activated, it is determined that the automobile is not driven from various conditions, and is not driven. If it becomes clear, a part or all of the built-in program or built-in data is rewritten with a new program or data transmitted from the outside.

特許第3109413号公報(第5〜7頁、第1図)Japanese Patent No. 3109413 (pages 5-7, Fig. 1)

しかしながら、この特許文献1に記載されたプログラムの書き換えシステムでは、プログラムを書き換えて、メモリ書換機をコネクタから切り離した後に、書き換えたプログラムのバグや、書き換えたプログラムにセキュリティ的な脆弱性が判明したときは、再度メモリ書換機を接続し直し、同じ書き換え手順を実施してプログラムを書き換えるまで、問題の有ったプログラムを使い続けることとなり、自動車の安全性が確保できないという問題があった。   However, in the program rewriting system described in Patent Document 1, after rewriting the program and disconnecting the memory rewrite device from the connector, a bug in the rewritten program and a security vulnerability in the rewritten program were found. In some cases, until the memory rewriting machine is connected again and the same rewriting procedure is performed to rewrite the program, the problematic program continues to be used, and the safety of the vehicle cannot be ensured.

この発明は、上記のような課題を解決するためになされたものであり、制御装置のプログラムを書き換え、この書き換えたプログラムに問題があった場合に、簡単に書き換え前のプロラムに戻すことができるプログラム書き換えシステムおよびプログラム書き換え方法を得ることを目的とする。   The present invention has been made in order to solve the above-described problems. When the program of the control device is rewritten and there is a problem with the rewritten program, the program can be easily returned to the program before rewriting. An object is to obtain a program rewriting system and a program rewriting method.

この発明に係わるプログラム書き換えシステムにおいては、第1種ノードおよび複数の第2種ノードが通信可能にネットワークに接続され、ネットワークに随時接続される第3種ノードから送信される書き換えプログラムによって第1種ノードのプログラムを書き換えるプログラム書き換えシステムであって、第1種ノードは、プログラムを保存する第1の記録領域と、この第1の記録領域に保存されているプログラムを複数に分割し、各分割プログラムを各別に第2種ノードに送信する分割プログラム送信部と、第3種ノードから受信した書き換えプログラムによって、第1の記録領域のプログラムを書き換えるプログラム書き換え部とを有し、第2種ノードは、第1種ノードから受信した分割プログラムを保存する第2の記録領域と、この第2の記録領域に保存された分割プログラムを第1種ノードに送信する送信部とを有し、第3種ノードは、書き換えプログラムを保存する第3の記録領域と、第1種ノードへの書き換えを指示する書き換え指示部と、書き換えプログラムを第1種ノードに送信する書き換えプログラム送信部とを有し、第1種ノードのプログラム書き換え部は、第3種ノードから書き換え指示を受信した場合に、分割プログラムを第2種ノードに送信したのち、第3種ノードから受信した書き換えプログラムによってプログラムを書き換えるものである。   In the program rewriting system according to the present invention, the first type node and the plurality of second type nodes are communicably connected to the network, and the first type is transmitted by the rewriting program transmitted from the third type node connected to the network as needed. A program rewriting system for rewriting a node program, wherein a first type node divides a first recording area for storing a program and a program stored in the first recording area into a plurality of divided programs. Respectively, and a program rewriting unit for rewriting the program in the first recording area by the rewriting program received from the third type node. A second recording area for storing the divided program received from the first type node; A transmission unit for transmitting the divided program stored in the second recording area to the first type node, and the third type node includes a third recording area for storing the rewrite program, and a first type node. A rewriting instruction unit for instructing rewriting and a rewriting program transmission unit for transmitting a rewriting program to the first type node, and the program rewriting unit of the first type node receives the rewriting instruction from the third type node After the split program is transmitted to the second type node, the program is rewritten by the rewrite program received from the third type node.

この発明によれば、第1種ノードおよび複数の第2種ノードが通信可能にネットワークに接続され、ネットワークに随時接続される第3種ノードから送信される書き換えプログラムによって第1種ノードのプログラムを書き換えるプログラム書き換えシステムであって、第1種ノードは、プログラムを保存する第1の記録領域と、この第1の記録領域に保存されているプログラムを複数に分割し、各分割プログラムを各別に第2種ノードに送信する分割プログラム送信部と、第3種ノードから受信した書き換えプログラムによって、第1の記録領域のプログラムを書き換えるプログラム書き換え部とを有し、第2種ノードは、第1種ノードから受信した分割プログラムを保存する第2の記録領域と、この第2の記録領域に保存された分割プログラムを第1種ノードに送信する送信部とを有し、第3種ノードは、書き換えプログラムを保存する第3の記録領域と、第1種ノードへの書き換えを指示する書き換え指示部と、書き換えプログラムを第1種ノードに送信する書き換えプログラム送信部とを有し、第1種ノードのプログラム書き換え部は、第3種ノードから書き換え指示を受信した場合に、分割プログラムを第2種ノードに送信したのち、第3種ノードから受信した書き換えプログラムによってプログラムを書き換えるので、書き換えたのちのプログラムに問題があった場合に、第2種ノードから簡単に書き換え前のプロラムに戻すことができる。   According to the present invention, the first type node and the plurality of second type nodes are communicably connected to the network, and the program of the first type node is executed by the rewrite program transmitted from the third type node connected to the network as needed. In the program rewriting system for rewriting, the first type node divides a first recording area for storing a program and a program stored in the first recording area into a plurality of parts, and each divided program is divided into a plurality of parts. A divided program transmission unit that transmits to the two-type node, and a program rewriting unit that rewrites the program in the first recording area by the rewriting program received from the third-type node, and the second-type node is the first-type node A second recording area for storing the division program received from the second recording area, and a division program stored in the second recording area. A transmission unit for transmitting the ram to the first type node, the third type node having a third recording area for storing the rewriting program, a rewriting instruction unit for instructing rewriting to the first type node, and a rewriting A rewriting program transmitting unit that transmits the program to the first type node, and the program rewriting unit of the first type node transmits the divided program to the second type node when receiving a rewriting instruction from the third type node. After that, since the program is rewritten by the rewriting program received from the third type node, if there is a problem with the program after the rewriting, it is possible to easily return to the program before rewriting from the second type node.

この発明の実施の形態1によるプログラム書き換えシステムが適用される車両制御システムの構成を示すブロック図である。It is a block diagram which shows the structure of the vehicle control system to which the program rewriting system by Embodiment 1 of this invention is applied. この発明の実施の形態1によるプログラム書き換えシステムにおける第1〜第3種ノードの記録装置の領域構成を示すメモリマップ図である。It is a memory map figure which shows the area | region structure of the recording device of the 1st-3rd type node in the program rewriting system by Embodiment 1 of this invention. この発明の実施の形態1によるプログラム書き換えシステムの第1種ノードにおけるプログラム書き換え時の処理の流れを示すフローチャートである。It is a flowchart which shows the flow of a process at the time of the program rewriting in the 1st type node of the program rewriting system by Embodiment 1 of this invention. この発明の実施の形態1によるプログラム書き換えシステムの第1種ノードにおけるプログラム書き戻し時の処理の流れを示すフローチャートである。It is a flowchart which shows the flow of a process at the time of the program write-back in the 1st type node of the program rewriting system by Embodiment 1 of this invention. この発明の実施の形態1によるプログラム書き換えシステムの第2種ノードにおける処理の流れを示すフローチャートである。It is a flowchart which shows the flow of a process in the 2nd type node of the program rewriting system by Embodiment 1 of this invention. この発明の実施の形態1によるプログラム書き換えシステムの第3種ノードにおける処理の流れを示すフローチャートである。It is a flowchart which shows the flow of a process in the 3rd type node of the program rewriting system by Embodiment 1 of this invention. この発明の実施の形態2によるプログラム書き換えシステムが適用される車両制御システムの構成を示すブロック図である。It is a block diagram which shows the structure of the vehicle control system to which the program rewriting system by Embodiment 2 of this invention is applied. この発明の実施の形態2によるプログラム書き換えシステムにおける第1〜第3種ノードの記録装置の領域構成を示すメモリマップ図である。It is a memory map figure which shows the area | region structure of the recording device of the 1st-3rd type node in the program rewriting system by Embodiment 2 of this invention. この発明の実施の形態2によるプログラム書き換えシステムの第1種ノードにおけるプログラム書き換え時の処理の流れを示すフローチャートである。It is a flowchart which shows the flow of a process at the time of the program rewriting in the 1st type node of the program rewriting system by Embodiment 2 of this invention. この発明の実施の形態2によるプログラム書き換えシステムの第1種ノードにおけるプログラム書き戻し時の処理の流れを示すフローチャートである。It is a flowchart which shows the flow of a process at the time of the program write-back in the 1st type node of the program rewriting system by Embodiment 2 of this invention. この発明の実施の形態2によるプログラム書き換えシステムの第2種ノードにおける処理の流れを示すフローチャートである。It is a flowchart which shows the flow of a process in the 2nd type node of the program rewriting system by Embodiment 2 of this invention. この発明の実施の形態2によるプログラム書き換えシステムの第3種ノードにおける処理の流れを示すフローチャートである。It is a flowchart which shows the flow of a process in the 3rd type node of the program rewriting system by Embodiment 2 of this invention.

実施の形態1.
以下に、実施の形態1によるプログラム書き換えシステムについて、図に基づいて説明する。
図1は、この発明の実施の形態1によるプログラム書き換えシステムが適用される車両制御システムの構成を示すブロック図である。
図1において、実施の形態1のプログラム書き換えシステムは、第1種ノードであるモータ制御装置101と、第2種ノードであるEPS(Electric Power Steering=電動パワーステアリング)制御装置102aおよびバッテリ制御装置102bと、第3種ノードであるテスタ103とを有する。
これらのノードは、車両のCAN(Controller Area Network)ネットワーク106を介して、互いに通信可能に接続されている。
なお、第2種ノードとして、EPS制御装置102aとバッテリ制御装置102bとを示したが、これに限らずに、さらに別のノードを含み得ることは言うまでもない。
Embodiment 1 FIG.
Below, the program rewriting system by Embodiment 1 is demonstrated based on figures.
FIG. 1 is a block diagram showing a configuration of a vehicle control system to which a program rewriting system according to Embodiment 1 of the present invention is applied.
In FIG. 1, the program rewriting system of Embodiment 1 includes a motor control device 101 that is a first type node, an EPS (Electric Power Steering) control device 102a and a battery control device 102b that are second type nodes. And a tester 103 which is a third type node.
These nodes are communicably connected to each other via a vehicle CAN (Controller Area Network) network 106.
In addition, although the EPS control apparatus 102a and the battery control apparatus 102b were shown as a 2nd type node, it cannot be overemphasized that another node may be included not only in this.

第1種ノードとしてのモータ制御装置101は、駆動用モータ110を制御し、同様にEPS制御装置102aは、EPS120aを、バッテリ制御装置102bは、バッテリ120bを、それぞれ制御するように接続されている。
なお、図1に示すテスタ103以外の制御装置は、常時、CANネットワーク106に接続されているが、テスタ103は、CANネットワーク106に常時接続されているものではなく、プログラムの書き換えや各ノードの故障診断時等、必要に応じて、随時、接続される。
各制御装置およびテスタの構成については後述する。
なお、各制御装置およびテスタは、図1に示す以外の構成物も備えているが、実施の形態1に直接関係しないものについては図示を省略している。
The motor control device 101 as the first type node controls the drive motor 110, and similarly, the EPS control device 102a is connected to control the EPS 120a, and the battery control device 102b is connected to control the battery 120b. .
1 is always connected to the CAN network 106. However, the tester 103 is not always connected to the CAN network 106. Connected as needed, such as during failure diagnosis.
The configuration of each control device and tester will be described later.
Each control device and tester includes components other than those shown in FIG. 1, but those not directly related to the first embodiment are not shown.

図2は、この発明の実施の形態1によるプログラム書き換えシステムにおける第1種ノード〜第3種ノードの記録装置の領域構成を示すメモリマップ図である。
図2(a)は、モータ制御装置101の記録装置113の領域構成を示し、図2(b)はEPS制御装置102aの記録装置123aの領域構成を示し、図2(c)はバッテリ制御装置102bの記録装置123bの領域構成を示し、図2(d)はテスタ103の記録装置133の領域構成を示している。
FIG. 2 is a memory map diagram showing the area configuration of the recording devices of type 1 to type 3 nodes in the program rewriting system according to Embodiment 1 of the present invention.
2A shows the area configuration of the recording apparatus 113 of the motor control apparatus 101, FIG. 2B shows the area configuration of the recording apparatus 123a of the EPS control apparatus 102a, and FIG. 2C shows the battery control apparatus. FIG. 2D shows an area configuration of the recording device 133 of the tester 103. FIG.

図2(a)において、記録装置113は、モータ制御プログラムを全体的もしくは部分的に書き換えるためのプログラム書き換え用プログラムを保存するプログラム書き換え用プログラム記録領域221と、モータ制御プログラムを保存する第1の記録領域であるモータ制御プログラム記録領域222と、駆動用モータ110の制御に関わるデータ等を保存するモータ制御プログラム用記録領域(データ用)223を備えている。   In FIG. 2A, the recording device 113 stores a program rewriting program recording area 221 for storing a program rewriting program for rewriting the motor control program in whole or in part, and a first for storing the motor control program. A motor control program recording area 222, which is a recording area, and a motor control program recording area (data) 223 for storing data related to the control of the driving motor 110 are provided.

図2(b)において、記録装置123aは、EPS120aの制御内容を決定するEPS制御プログラムを保存するEPS制御プログラム記録領域231aと、EPS120aの制御に関わるデータ等を保存するEPS制御プログラム用記録領域(データ用)232aと、後述する分割プログラムを一時的に保存する第2の記録領域である分割モータ制御プログラム記録領域233aとを備えている。
なお、分割モータ制御プログラム記録領域233aには、記録装置123aの空き領域等を割り当てることができる。
In FIG. 2B, the recording device 123a includes an EPS control program recording area 231a for storing an EPS control program for determining the control content of the EPS 120a, and an EPS control program recording area (for storing data related to the control of the EPS 120a). (For data) 232a and a divided motor control program recording area 233a which is a second recording area for temporarily storing a divided program to be described later.
Note that an empty area of the recording device 123a can be allocated to the divided motor control program recording area 233a.

図2(c)において、記録装置123bは、バッテリ120bの制御内容を決定するバッテリ制御プログラムを保存するバッテリ制御プログラム記録領域231bと、バッテリ120bの制御に関わるデータ等が記録されるバッテリ制御プログラム用記録領域(データ用)232bと、後述する分割プログラムを一時的に保存する第2の記録領域である分割モータ制御プログラム記録領域233bを備えている。
なお、分割モータ制御プログラム記録領域233bには、記録装置123bの空き領域等を割り当てることができる。
In FIG. 2C, the recording device 123b is for a battery control program recording area 231b for storing a battery control program for determining the control content of the battery 120b, and for a battery control program for recording data relating to the control of the battery 120b. A recording area (for data) 232b and a divided motor control program recording area 233b, which is a second recording area for temporarily storing a divided program to be described later, are provided.
Note that an empty area of the recording device 123b can be allocated to the divided motor control program recording area 233b.

図2(d)において、記録装置133は、書き換えプログラムを保存する第3の記録領域であるモータ制御プログラム記録領域241を備えている。   In FIG. 2D, the recording device 133 includes a motor control program recording area 241 that is a third recording area for storing a rewrite program.

次に、図1の各制御装置およびテスタの構成と機能について説明する。
まず、モータ制御装置101の構成と機能について説明する。
マイコン111は、駆動用モータ110の制御に関わる制御量や各種処理値を演算する。CANネットワーク用データ送受信部であるデータ送受信部112は、CANネットワーク106を介して、接続された他の制御装置(EPS制御装置102a、バッテリ制御装置102b、テスタ103を含む)とデータを送受信する。
記録装置113は、書き換え対象であるモータ制御プログラムを保存する第1の記録領域であるモータ制御プログラム記録領域222を有している。このモータ制御プログラムは、モータ制御装置101の動作(制御内容)を決定し、演算を行うものである。
Next, the configuration and function of each control device and tester in FIG. 1 will be described.
First, the configuration and function of the motor control device 101 will be described.
The microcomputer 111 calculates a control amount and various processing values related to the control of the driving motor 110. The data transmission / reception unit 112, which is a data transmission / reception unit for the CAN network, transmits / receives data to / from other connected control devices (including the EPS control device 102a, the battery control device 102b, and the tester 103) via the CAN network 106.
The recording device 113 has a motor control program recording area 222 that is a first recording area for storing a motor control program to be rewritten. This motor control program determines the operation (control content) of the motor control device 101 and performs calculation.

モータ制御装置101のプログラム書き換え部114は、記録装置113のモータ制御プログラム記録領域222に保存されたモータ制御プログラムを全体的もしくは部分的に書き換える。その際には、記録装置113のプログラム書き換え用プログラム記録領域221に記録されたプログラム書き換え用プログラムを用いる。   The program rewriting unit 114 of the motor control device 101 rewrites the motor control program stored in the motor control program recording area 222 of the recording device 113 in whole or in part. At that time, the program rewriting program recorded in the program rewriting program recording area 221 of the recording device 113 is used.

状態検出部115は、第1種ノード自身がモータ制御プログラムを書き換え可能な状態であるか否か、或いはモータ制御プログラムが全て書き換えられているか否か、自身に異常がないか否か等の状態を検出し、他の制御装置に通知する。
状態検出部115により自身に異常があり、かつ、書き換え可能であることが検出された場合は、CANネットワーク106を介して、EPS制御装置102aおよびバッテリ制御装置102bに通知し、この通知を受けたEPS制御装置102aおよびバッテリ制御装置102bは、自身が保存する分割モータ制御プログラム(以下、分割プログラムと略す。)を、CANネットワーク106を介してモータ制御装置101に送信する。
そして、モータ制御装置101は、EPS制御装置102aまたはバッテリ制御装置102bから分割プログラムを受信する度に、モータ制御プログラム記録領域222に保存されたモータ制御プログラムの該当部分をプログラム書き換え部114により書き換える。
ここで、自身の異常とは、意図しない制御や処理を実施したり、セキュリティ上の脆弱性が検出されたりすることが挙げられるが、これに限るものではない。
The state detection unit 115 indicates whether the first type node itself is in a state in which the motor control program can be rewritten, whether the motor control program has been completely rewritten, whether there is no abnormality in itself, etc. Is detected and notified to other control devices.
When the state detection unit 115 detects an abnormality in itself and that it can be rewritten, it notifies the EPS control device 102a and the battery control device 102b via the CAN network 106, and receives this notification. The EPS control device 102a and the battery control device 102b transmit a divided motor control program (hereinafter, abbreviated as a divided program) stored by the EPS control device 102a and the battery control device 102b to the motor control device 101 via the CAN network 106.
Then, every time the motor control device 101 receives the division program from the EPS control device 102a or the battery control device 102b, the program rewriting unit 114 rewrites the corresponding part of the motor control program stored in the motor control program recording area 222.
Here, the abnormality of itself may include performing unintended control or processing, or detecting a security vulnerability, but is not limited thereto.

モータ制御装置101の分割プログラム送信部116は、テスタ103から書き換え指示を通知された後、モータ制御プログラム記録領域222に保存されている(現状時点の)モータ制御プログラムを分割して、分割プログラムを作成し、EPS制御装置102aと、バッテリ制御装置102bへそれぞれ送信する。   After receiving the rewrite instruction from the tester 103, the division program transmission unit 116 of the motor control device 101 divides the motor control program (currently) stored in the motor control program recording area 222 to obtain the division program. It is created and transmitted to the EPS control device 102a and the battery control device 102b, respectively.

次に、第2種ノードとしてのEPS制御装置102aの構成と機能について説明する。
マイコン121aは、EPS120aの制御量や各種処理値を演算する。データ送受信部122aは、CANネットワーク106を介して、接続された他の制御装置(モータ制御装置101、バッテリ制御装置102b、テスタ103を含む)とデータの送受信を行う。記録装置123aは、モータ制御プログラムの一部分である分割モータ制御プログラムを保存する第2の記録領域である分割モータ制御プログラム記録領域233aを有している。
Next, the configuration and function of the EPS control apparatus 102a as the second type node will be described.
The microcomputer 121a calculates the control amount and various processing values of the EPS 120a. The data transmitter / receiver 122a transmits / receives data to / from other connected control devices (including the motor control device 101, the battery control device 102b, and the tester 103) via the CAN network 106. The recording device 123a has a divided motor control program recording area 233a which is a second recording area for storing a divided motor control program which is a part of the motor control program.

分割プログラム送信部124a(送信部)は、モータ制御装置101への分割プログラムの送信可否を判断する。分割プログラム送信部124aにより、モータ制御装置101への分割プログラムの送信が可能であると判断された場合には、自ノードが第2の記録領域に保存する分割プログラムを、CANネットワーク106を介してモータ制御装置101に送信する。   The division program transmission unit 124a (transmission unit) determines whether or not the division program can be transmitted to the motor control device 101. When the divided program transmission unit 124a determines that the divided program can be transmitted to the motor control device 101, the divided program stored in the second recording area by the own node is transmitted via the CAN network 106. It transmits to the motor control apparatus 101.

次に、第2種ノードとしてのバッテリ制御装置102bの構成と機能について簡単に説明する。
マイコン121bは、バッテリ120bの制御量や各種処理値を演算する。データ送受信部122bは、CANネットワーク106を介して、接続された他の制御装置(モータ制御装置101、EPS制御装置102a、テスタ103を含む)とデータを送受信する。
記録装置123bは、モータ制御プログラムを分割した一部分である分割プログラムを保存する第2の記録領域である分割モータ制御プログラム記録領域233bを有している。
Next, the configuration and function of the battery control apparatus 102b as the second type node will be briefly described.
The microcomputer 121b calculates the control amount and various processing values of the battery 120b. The data transmission / reception unit 122b transmits / receives data to / from other connected control devices (including the motor control device 101, the EPS control device 102a, and the tester 103) via the CAN network 106.
The recording device 123b has a divided motor control program recording area 233b, which is a second recording area for storing a divided program that is a part of dividing the motor control program.

分割プログラム送信部124b(送信部)は、モータ制御装置101への分割プログラムの送信可否を判断する。分割プログラム送信部124bにより、モータ制御装置101への分割プログラムの送信が可能であると判断された場合には、自ノードが第2の記録領域に保存する分割プログラムを、CANネットワーク106を介してモータ制御装置101に送信する。   The division program transmission unit 124 b (transmission unit) determines whether or not the division program can be transmitted to the motor control device 101. If the divided program transmission unit 124b determines that the divided program can be transmitted to the motor control device 101, the divided program stored in the second recording area by the own node is transmitted via the CAN network 106. It transmits to the motor control apparatus 101.

次に、第3種ノードとしてのテスタ103の構成と機能について簡単に説明する。
このテスタ103は、モータ制御プログラムの書き換え対象とするプログラム(以下、書き換えプログラムと略す。)を送信するものである。
マイコン131は、テスタ103の動作に関わる各種処理を実施する。データ送受信部132は、CANネットワーク106を介して、接続された他の制御装置(モータ制御装置101、EPS制御装置102a、バッテリ制御装置102bを含む)とデータを送受信する。
記録装置133は、図2(d)に示すように、書き換えプログラムを保存する第3の記録領域であるモータ制御プログラム記録領域241を備えている。
Next, the configuration and function of the tester 103 as the third type node will be briefly described.
The tester 103 transmits a program to be rewritten to the motor control program (hereinafter abbreviated as a rewriting program).
The microcomputer 131 performs various processes related to the operation of the tester 103. The data transmission / reception unit 132 transmits / receives data to / from other connected control devices (including the motor control device 101, the EPS control device 102a, and the battery control device 102b) via the CAN network 106.
As shown in FIG. 2D, the recording device 133 includes a motor control program recording area 241 that is a third recording area for storing the rewriting program.

書き換え指示部134は、モータ制御装置101に対して、プログラムの書き換えを指示する。書き換えプログラム送信部135は、モータ制御装置101から書き換え可能の通知を受けたのちに、モータ制御プログラム記録領域241に記録している書き換えプログラムをモータ制御装置101に送信する。
テスタ103は、常時、CANネットワーク106に接続されるものではなく、制御装置へのプログラムの書き換えや、診断を実施するときに接続するものである。
The rewrite instruction unit 134 instructs the motor control device 101 to rewrite the program. The rewriting program transmission unit 135 transmits the rewriting program recorded in the motor control program recording area 241 to the motor control device 101 after receiving a rewriteable notification from the motor control device 101.
The tester 103 is not always connected to the CAN network 106 but is connected when rewriting a program to the control device or performing diagnosis.

次に、動作について説明する。
ここでは、実施の形態1によるプログラム書き換えシステムの各ノードにおける処理の流れについて、図3〜図6のフローチャートを用いて説明する。
第1種ノードであるモータ制御装置101では、駆動用モータ110の制御に関わる通常の処理と、モータ制御プログラムの書き換えに関する処理が実施される。プログラム書き換えに関する処理の流れを図3に示し、テスタ103から書き換え実施の通知(書き換え指示)があった場合に実施される。
第1種ノードであるモータ制御装置101の書き換え前のプロラムに書戻す処理の流れは、図4に示している。
Next, the operation will be described.
Here, the flow of processing in each node of the program rewriting system according to the first embodiment will be described with reference to the flowcharts of FIGS.
In the motor control device 101 that is the first type node, normal processing related to control of the driving motor 110 and processing related to rewriting of the motor control program are performed. FIG. 3 shows a flow of processing relating to program rewriting, which is performed when a rewrite execution notification (rewrite instruction) is received from the tester 103.
The flow of the process of writing back to the program before rewriting of the motor control apparatus 101 which is the first type node is shown in FIG.

まず、図3により、第1種ノードのプログラム書き換え時の処理について説明する。
ステップS301において、状態検出部115は、テスタ103から書き換え指示が通知されているか否かを判断する。通知されている場合(YES)は、ステップS302へ進み、通知されていない場合(NO)は、通知されるまで待機する。
First, the processing at the time of program rewriting of the first type node will be described with reference to FIG.
In step S <b> 301, the state detection unit 115 determines whether a rewrite instruction is notified from the tester 103. If notified (YES), the process proceeds to step S302. If not notified (NO), the process waits until notified.

続いて、ステップS302において、状態検出部115は、通常の処理が実施されているか否かを判断し、通常の処理が実施されていなければ、書き換え可能(YES)であるため、ステップS303へ進み、通常の処理が実施されている場合には、終了まで待機する。   Subsequently, in step S302, the state detection unit 115 determines whether or not normal processing is performed. If normal processing is not performed, the state detection unit 115 is rewritable (YES), and thus proceeds to step S303. When normal processing is being performed, the process waits until the end.

ステップS303(第2のステップ)において、分割プログラム送信部116は、記録装置113に保存されたモータ制御プログラム記録領域222にあるモータ制御プログラムを分割して、分割プログラムを作成する。そして、データ送受信部112により、分割プログラムを第2種ノードであるバッテリ制御装置102bとEPS制御装置102aへ送信する。
ここで、実施の形態1では、第2種ノードを2つ備えているため、書き換えプログラムを2つに分割して、分割プログラムAと分割プログラムBを作成し、分割プログラムAをEPS制御装置102aに、分割プログラムBをバッテリ制御装置102bに送信するものとする。
すなわち、書き換えプログラムは、分割プログラムAと分割プログラムの2つに分割される。
In step S303 (second step), the division program transmission unit 116 divides the motor control program in the motor control program recording area 222 stored in the recording device 113 to create a division program. Then, the data transmission / reception unit 112 transmits the divided program to the battery control device 102b and the EPS control device 102a which are the second type nodes.
Here, since the first type node is provided in the first embodiment, the rewriting program is divided into two to create the divided program A and the divided program B, and the divided program A is transferred to the EPS control apparatus 102a. In addition, the divided program B is transmitted to the battery control device 102b.
That is, the rewriting program is divided into two programs, a divided program A and a divided program.

ステップS304において、モータ制御プログラムすべてを送信したかどうかを判断する。すべてを送信している場合(YES)は、ステップS305へ進み、送信していない場合は(NO)は、ステップS303に進み、再度、送信処理を実施する。   In step S304, it is determined whether all the motor control programs have been transmitted. If everything has been transmitted (YES), the process proceeds to step S305. If not (NO), the process proceeds to step S303, and the transmission process is performed again.

ステップS305において、状態検出部115は、モータ制御プログラムのすべてを送信したため、テスタ103に対して、書き換え可能を通知する。   In step S305, since the state detection unit 115 has transmitted all of the motor control program, the state detection unit 115 notifies the tester 103 that rewriting is possible.

ステップS306において、テスタ103からの書き換えプログラムの受信を待つ。書き換えプログラムを受信した場合(YES)は、ステップS307に進む。   In step S306, reception of a rewrite program from the tester 103 is awaited. When the rewrite program is received (YES), the process proceeds to step S307.

ステップS307(第4のステップ)において、プログラム書き換え部114は、プログラム書き換え用プログラムを用いて、受信した書き換えプログラムに該当するモータ制御プログラムの部分を書き換え、ステップS308へ進む。   In step S307 (fourth step), the program rewriting unit 114 rewrites the portion of the motor control program corresponding to the received rewriting program using the program rewriting program, and proceeds to step S308.

ステップS308において、状態検出部115は、すべての書き換えプログラムを受信し、該当するモータ制御プログラムの部分を書き換えたか否かを判断する。すべての書き換えプログラムを受信していない場合は(NO)、ステップS306へ進み、受信している場合は(YES)処理を終了する。   In step S308, the state detection unit 115 receives all the rewrite programs and determines whether or not the corresponding motor control program portion has been rewritten. If all rewrite programs have not been received (NO), the process proceeds to step S306, and if received (YES), the process is terminated.

次に、図4を用いて、書き換え後の動作として、書き換えプログラムに書き換えたのち、書き換え前のプログラムに書戻す処理について説明する。
このとき、テスタ103は、CANネットワーク106から取り外されているものとする。
ステップS311(第5のステップ)において、状態検出部115は、自身の処理に異常がないか否かを判断する。異常を検出した場合は(YES)、ステップS312へ進む。
Next, with reference to FIG. 4, description will be given of the processing after rewriting to the rewriting program and then writing back to the program before rewriting as the operation after rewriting.
At this time, the tester 103 is assumed to be removed from the CAN network 106.
In step S311 (fifth step), the state detection unit 115 determines whether or not there is an abnormality in its processing. If an abnormality is detected (YES), the process proceeds to step S312.

ステップS312において、状態検出部115は、通常の処理が実施されているか否かを判断し、通常の処理が実施されていなければ、書き換え可能(YES)であるため、ステップS313へ進み、通常の処理が実施されている場合には、終了するまで待機する。   In step S312, the state detection unit 115 determines whether or not normal processing is performed. If normal processing is not performed, the state detection unit 115 is rewritable (YES), and thus proceeds to step S313. If the process is being performed, the process waits until the process is completed.

ステップS313において、状態検出部115は、第2種ノードであるバッテリ制御装置102bとEPS制御装置102aに対して、記録している分割プログラムの送信指示を通知する。   In step S313, the state detection unit 115 notifies the battery control device 102b and the EPS control device 102a, which are the second type nodes, of a transmission instruction for the recorded divided program.

ステップS314において、バッテリ制御装置102bとEPS制御装置102aからの分割プログラムの受信を待つ。分割プログラムを受信した場合(YES)は、ステップS315に進む。   In step S314, it waits for reception of the division program from the battery control device 102b and the EPS control device 102a. When the division program is received (YES), the process proceeds to step S315.

ステップS315(第7のステップ)において、プログラム書き換え部114は、プログラム書き換え用プログラムを用いて、受信した分割プログラムに該当するモータ制御プログラムの部分を書き換え、ステップS316へ進む。   In step S315 (seventh step), the program rewriting unit 114 rewrites the portion of the motor control program corresponding to the received divided program using the program rewriting program, and proceeds to step S316.

ステップS316において、すべての分割プログラムを受信し、該当するモータ制御プログラムの部分を書き換えたか否かを判断する。すべての分割プログラムを受信していない場合は(NO)、ステップS314へ進み、受信している場合は(YES)処理を終了する。   In step S316, all the divided programs are received, and it is determined whether or not the corresponding motor control program portion has been rewritten. If all the divided programs have not been received (NO), the process proceeds to step S314, and if they have been received (YES), the process ends.

次に、第2種ノードであるEPS制御装置102aおよびバッテリ制御装置102bにおけるプログラム書き換えに関する処理の流れについて、図5を用いて説明する。
EPS制御装置102a(またはバッテリ制御装置102b)では、EPS120a(またはバッテリ120b)の制御に関わる通常の処理と、モータ制御装置101のプログラム書き換えに関する処理が実施される。
なお、EPS制御装置102aとバッテリ制御装置102bにおけるプログラム書き換えに関する処理は、同じであるので、ここではEPS制御装置102aを例に挙げて説明する。
Next, the flow of processing related to program rewriting in the EPS control device 102a and the battery control device 102b, which are the second type nodes, will be described with reference to FIG.
In the EPS control device 102a (or the battery control device 102b), normal processing related to the control of the EPS 120a (or the battery 120b) and processing related to program rewriting of the motor control device 101 are performed.
Note that the processes related to program rewriting in the EPS control apparatus 102a and the battery control apparatus 102b are the same, and therefore, the EPS control apparatus 102a will be described as an example here.

EPS制御装置102aは、テスタ103から書き換え実施指示が通知された後、ステップS401において、モータ制御装置101からの分割プログラムの受信を待つ。データ送受信部122aにより分割プログラムを受信した場合(YES)は、ステップS402へ進み、受信した分割プログラムを記録装置123aの分割モータ制御プログラム記録領域233aに保存し、ステップS403へ進む。   The EPS control apparatus 102a waits for reception of the division program from the motor control apparatus 101 in step S401 after the rewriting execution instruction is notified from the tester 103. When the division program is received by the data transmission / reception unit 122a (YES), the process proceeds to step S402, the received division program is stored in the division motor control program recording area 233a of the recording device 123a, and the process proceeds to step S403.

ステップS403において、EPS制御装置102aは、モータ制御装置101からの分割プログラムの送信指示の通知を待つ。送信指示が通知された場合(YES)は、ステップS405へ進み、送信指示が通知されていない場合(NO)は、ステップS404へ進む。   In step S403, the EPS control apparatus 102a waits for notification of a split program transmission instruction from the motor control apparatus 101. When the transmission instruction is notified (YES), the process proceeds to step S405, and when the transmission instruction is not notified (NO), the process proceeds to step S404.

ステップS404において、分割プログラムの受信を確認する。データ送受信部122aにより分割プログラムを受信した場合(YES)は、ステップS402へ進む。受信していない場合(NO)は、ステップS403へ進み、分割プログラムの送信指示を待つ。   In step S404, reception of the divided program is confirmed. When the division program is received by the data transmitting / receiving unit 122a (YES), the process proceeds to step S402. If not received (NO), the process proceeds to step S403 and waits for a split program transmission instruction.

ステップS405(第6のステップ)において、分割モータ制御プログラム記録領域233aに保存した分割プログラムをモータ制御装置101へ送信し、ステップS406へ進む。   In step S405 (sixth step), the divided program stored in the divided motor control program recording area 233a is transmitted to the motor control device 101, and the process proceeds to step S406.

ステップS406において、保存した分割プログラムをすべて送信したかどうかを確認する。すべて送信している場合(YES)は処理を完了し、送信していない場合(NO)は、ステップS405へ進み、送信処理を実施する。   In step S406, it is confirmed whether or not all the saved divided programs have been transmitted. If all have been transmitted (YES), the process is completed. If not (NO), the process proceeds to step S405, and the transmission process is performed.

次に、第3種ノードであるテスタ103におけるプログラム書き換えに関する処理の流れについて、図6を用いて説明する。
テスタ103では、関連ノードへのプログラム書き換え実施の通知と、書き換えプログラムの送信処理を実施する。
Next, the flow of processing related to program rewriting in the tester 103 which is the third type node will be described with reference to FIG.
The tester 103 performs notification of program rewriting to the related nodes and transmission processing of the rewriting program.

まず、ステップS411(第1のステップ)において、書き換え指示部134は、モータ制御装置101、EPS制御装置102a、バッテリ制御装置102bに対して、モータ制御装置101の書き換えを実施することを通知する。   First, in step S411 (first step), the rewrite instruction unit 134 notifies the motor control device 101, the EPS control device 102a, and the battery control device 102b that the motor control device 101 will be rewritten.

次に、ステップS412において、書き換え指示部134は、モータ制御装置101から書き換え可能が通知されたかどうかを判断する。通知されている場合(YES)は、書き換え可能と判断し、ステップS413へ進む。通知されていない場合(NO)は、通知されるまで待機する。   Next, in step S <b> 412, the rewriting instruction unit 134 determines whether or not rewriting is notified from the motor control device 101. If notified (YES), it is determined that rewriting is possible, and the process proceeds to step S413. When not notified (NO), it waits until notified.

次いで、ステップS413(第3のステップ)において、記録装置133のモータ制御プログラム記録領域241にあらかじめ記録されている書き換えプログラムをモータ制御装置101へ送信し、処理を終了する。   Next, in step S413 (third step), the rewriting program recorded in advance in the motor control program recording area 241 of the recording device 133 is transmitted to the motor control device 101, and the process is terminated.

なお、本実施の形態1において、モータ制御装置101に分割プログラムを暗号化する暗号化部と復号化する復号化部を備え、暗号化部により暗号化した分割プログラムをEPS制御装置102aとバッテリ制御装置102bに送信し、EPS制御装置102aとバッテリ制御装置102bでは、暗号化された分割プログラムを保存し、モータ制御装置101で、EPS制御装置102aまたはバッテリ制御装置102bから暗号化された分割プログラムを受信した際に、復号化部により分割プログラムを復号化するようにしても良い。   In the first embodiment, the motor control device 101 includes an encryption unit that encrypts a divided program and a decryption unit that decrypts the divided program, and the divided program encrypted by the encryption unit is transferred to the EPS control device 102a and the battery control. The EPS controller 102a and the battery controller 102b store the encrypted split program, and the motor controller 101 stores the encrypted split program from the EPS controller 102a or the battery controller 102b. When received, the division program may be decoded by the decoding unit.

上記のような暗号化部と復号化部を備えることにより、CANネットワーク106で第三者に解読される危険性、またはEPS制御装置102aおよびバッテリ制御装置102bに保存時に、第三者に解読される危険性を低減させることができ、プログラム書き換えを安全に実施することが可能となる。   By providing the encryption unit and the decryption unit as described above, there is a risk of being decrypted by the third party on the CAN network 106, or when being stored in the EPS control device 102a and the battery control device 102b, The program can be rewritten safely.

以上説明したように、実施の形態1によるプログラム書き換えシステムでは、テスタ103からモータ制御装置101へプログラム書き換え実施を通知したときに、モータ制御装置101では、まず、これまでの制御に用いていたモータ制御プログラムから分割プログラムを作成し、EPS制御装置102aおよびバッテリ制御装置102bそれぞれに送信する。
送信完了後に、モータ制御装置101は、テスタ103から受信する書き換えプログラムでモータ制御プログラムを書き換える。
その後、テスタ103がCANネットワーク106から分離され、モータ制御装置101は、書き換えたモータ制御プログラムで制御する。
そして、モータ制御装置101は、制御中に動作異常やセキュリティ上の脆弱性が検出された場合には、EPS制御装置102aとバッテリ制御装置102bに通知し、通知を受けたEPS制御装置102aとバッテリ制御装置102bは、自身が保存する分割プログラムをそれぞれモータ制御装置101に送信し、モータ制御装置101は、分割プログラムを受信する度に、受信した分割プログラムで該当するモータ制御プログラムを書き換える。
As described above, in the program rewriting system according to the first embodiment, when the tester 103 notifies the motor control device 101 of execution of program rewriting, the motor control device 101 first uses the motor used for the control so far. A divided program is created from the control program and transmitted to the EPS control device 102a and the battery control device 102b.
After the transmission is completed, the motor control device 101 rewrites the motor control program with the rewrite program received from the tester 103.
Thereafter, the tester 103 is separated from the CAN network 106, and the motor control device 101 performs control with the rewritten motor control program.
When an abnormal operation or a security vulnerability is detected during the control, the motor control device 101 notifies the EPS control device 102a and the battery control device 102b, and the received EPS control device 102a and the battery are notified. The control device 102b transmits the divided programs stored by itself to the motor control device 101, and the motor control device 101 rewrites the corresponding motor control program with the received divided program every time the divided program is received.

実施の形態1によれば、モータ制御装置101のモータ制御プログラムを書き換えて、テスタ103をCANネットワーク106から分離したのちに、モータ制御装置101の動作に異常が有ったり、セキュリティ上の脆弱性が検出されたりした場合には、従来のようにテスタ103をCANネットワーク106につなぎ直して再度、書き換えプログラムを送信することなく、効率の良く書き換え前の制御プログラムに戻すことができ、問題のある制御プログラムを使い続けず、自動車の安全性を確保することができる。   According to the first embodiment, after rewriting the motor control program of the motor control device 101 and separating the tester 103 from the CAN network 106, there is an abnormality in the operation of the motor control device 101, or security vulnerability. Is detected, it is possible to efficiently return to the control program before rewriting without reconnecting the tester 103 to the CAN network 106 and transmitting the rewriting program again as in the past. The safety of the vehicle can be ensured without using the control program.

また、モータ制御プログラムから分割プログラムを作成し、複数の第2種ノード(実施の形態1ではEPS制御装置102aおよびバッテリ制御装置102bの2つ)に保存するため、1つの第2種ノードに全ての書き換えプログラムを保存できるほどの大きな記録容量を設ける必要がなく、1つのノードがコスト高になることを防ぐことができ、全体としてのコストが抑えられる。   In addition, since a divided program is created from the motor control program and stored in a plurality of second type nodes (in the first embodiment, two of the EPS control device 102a and the battery control device 102b), all are stored in one second type node. It is not necessary to provide a recording capacity large enough to store the rewriting program, and the cost of one node can be prevented from increasing, and the overall cost can be suppressed.

実施の形態2.
図7は、この発明の実施の形態2によるプログラム書き換えシステムが適用される車両制御システムの構成を示すブロック図である。
図7において、実施の形態2によるプログラム書き換えシステムは、第1種ノードであるモータ制御装置101と、第2種ノードであるEPS制御装置102aおよびバッテリ制御装置102bと、第3種ノードであるテスタ103とを有する。
これらのノードは、車両のCANネットワーク106を介して、互いに通信可能に接続されている。
なお、第2種ノードとしては、EPS制御装置102aとバッテリ制御装置102bとが示されているが、これに限らずに、さらに別のノードを含み得ることは言うまでもない。
Embodiment 2. FIG.
FIG. 7 is a block diagram showing a configuration of a vehicle control system to which a program rewriting system according to Embodiment 2 of the present invention is applied.
7, the program rewriting system according to the second embodiment includes a motor control device 101 that is a first type node, an EPS control device 102a and a battery control device 102b that are second type nodes, and a tester that is a third type node. 103.
These nodes are communicably connected to each other via the vehicle's CAN network 106.
In addition, although the EPS control apparatus 102a and the battery control apparatus 102b are shown as a 2nd type node, it cannot be overemphasized that another node may be included not only in this.

第1種ノードとしてのモータ制御装置101は駆動用モータ110を制御し、同様にEPS制御装置102aはEPS120aを、バッテリ制御装置102bはバッテリ120bを、それぞれ制御するように接続されている。
なお、図7に示すテスタ103以外の制御装置は、常時、CANネットワーク106に接続されているが、テスタ103は、CANネットワーク106に常時、接続されるのではなく、プログラムの書き換え、各ノードの故障診断時など、必要に応じて随時、接続される。
各制御装置およびテスタの構成については後述する。
なお、図7において、各制御装置およびテスタは、図7に示す以外の構成物も備えているが、本実施の形態2に直接関係しないものについては図示を省略している。
The motor control device 101 as the first type node controls the driving motor 110, and similarly, the EPS control device 102a is connected to control the EPS 120a, and the battery control device 102b is connected to control the battery 120b.
Although the control devices other than the tester 103 shown in FIG. 7 are always connected to the CAN network 106, the tester 103 is not always connected to the CAN network 106. Connected as needed, such as during failure diagnosis.
The configuration of each control device and tester will be described later.
In FIG. 7, each control device and tester includes components other than those shown in FIG. 7, but those not directly related to the second embodiment are not shown.

図8は、この発明の実施の形態2によるプログラム書き換えシステムにおける第1〜第3種ノードの記録装置の領域構成を示すメモリマップ図である。
図8(a)は、モータ制御装置101の記録装置113の領域構成を示し、図8(b)は、EPS制御装置102aの記録装置123aの領域構成を示し、図8(c)は、バッテリ制御装置102bの記録装置123bの領域構成を示し、図8(d)は、テスタ103の記録装置133の領域構成を示している。
FIG. 8 is a memory map diagram showing the area configuration of the recording devices of the first to third type nodes in the program rewriting system according to the second embodiment of the present invention.
8A shows the area configuration of the recording device 113 of the motor control apparatus 101, FIG. 8B shows the area configuration of the recording apparatus 123a of the EPS control apparatus 102a, and FIG. 8C shows the battery configuration. FIG. 8D shows the area configuration of the recording apparatus 133 of the tester 103. FIG. 8D shows the area configuration of the recording apparatus 123b of the control apparatus 102b.

図8(a)において、記録装置113は、モータ制御プログラムを全体的もしくは部分的に書き換えるためのプログラム書き換え用プログラムを保存するプログラム書き換え用プログラム記録領域221と、モータ制御プログラムを保存する第1の記録領域であるモータ制御プログラム記録領域222と、駆動用モータ110の制御に関わるデータ等を保存するモータ制御プログラム用記録領域(データ用)223と、モータ制御プログラムを部分的に検証するためのプログラム検証用プログラムを保存するプログラム検証用プログラム記録領域634とを備えている。   In FIG. 8A, the recording device 113 stores a program rewriting program recording area 221 for storing a program rewriting program for rewriting the motor control program in whole or in part, and a first for storing the motor control program. A motor control program recording area 222, which is a recording area, a motor control program recording area (data) 223 for storing data related to the control of the driving motor 110, and a program for partially verifying the motor control program And a program verification program recording area 634 for storing the verification program.

図8(b)において、記録装置123aは、EPS120aの制御内容を決定するEPS制御プログラムを保存するEPS制御プログラム記録領域231aと、EPS120aの制御に関わるデータ等を保存するEPS制御プログラム用記録領域(データ用)232aと、後述する分割プログラムを一時的に保存する第2の記録領域およびチェックコードを一時的に保存する第4の記録領域である分割モータ制御プログラム記録領域533aとを備えている。
なお、分割モータ制御プログラム記録領域533aには、記録装置123aの空き領域等を割り当てることができる。
In FIG. 8B, the recording device 123a includes an EPS control program recording area 231a for storing an EPS control program for determining the control content of the EPS 120a, and an EPS control program recording area (for storing data related to the control of the EPS 120a). (For data) 232a, a second recording area for temporarily storing a divided program to be described later, and a divided motor control program recording area 533a which is a fourth recording area for temporarily storing a check code.
Note that an empty area of the recording device 123a can be allocated to the divided motor control program recording area 533a.

図8(c)において、記録装置123bは、バッテリ120bの制御内容を決定するバッテリ制御プログラムを保存するバッテリ制御プログラム記録領域231bと、バッテリ120bの制御に関わるデータ等が記録されるバッテリ制御プログラム用記録領域(データ用)232bと、後述する分割プログラムを一時的に保存する第2の記録領域およびチェックコードを一時的に保存する第4の記録領域である分割モータ制御プログラム記録領域533bを備えている。
なお、分割モータ制御プログラム記録領域533bには、記録装置123bの空き領域等を割り当てることができる。
In FIG. 8C, the recording device 123b is for a battery control program recording area 231b for storing a battery control program for determining the control content of the battery 120b, and for a battery control program in which data related to the control of the battery 120b is recorded. A recording area (for data) 232b, a second recording area for temporarily storing a divided program to be described later, and a divided motor control program recording area 533b that is a fourth recording area for temporarily storing a check code are provided. Yes.
Note that an empty area of the recording device 123b can be allocated to the divided motor control program recording area 533b.

図8(d)において、記録装置133は、書き換えプログラムを保存する第3の記録領域であるモータ制御プログラム記録領域241を備えている。   In FIG. 8D, the recording device 133 includes a motor control program recording area 241 that is a third recording area for storing the rewrite program.

次に、図7の各制御装置およびテスタの構成と機能について説明する。
まず、モータ制御装置101の構成と機能について簡単に説明する。
マイコン111は、駆動用モータ110の制御に関わる制御量や各種処理値を演算する。CANネットワーク用データ送受信部であるデータ送受信部112は、CANネットワーク106を介して、接続された他の制御装置(EPS制御装置102a、バッテリ制御装置102b、テスタ103を含む)とデータを送受信する。
記録装置113は、書き換え対象であるモータ制御プログラムを保存する第1の記録領域を有している。このモータ制御プログラムは、モータ制御装置101の動作(制御内容)を決定し、演算を行うものである。
Next, the configuration and function of each control device and tester in FIG. 7 will be described.
First, the configuration and function of the motor control device 101 will be briefly described.
The microcomputer 111 calculates a control amount and various processing values related to the control of the driving motor 110. The data transmission / reception unit 112, which is a data transmission / reception unit for the CAN network, transmits / receives data to / from other connected control devices (including the EPS control device 102a, the battery control device 102b, and the tester 103) via the CAN network 106.
The recording device 113 has a first recording area for storing a motor control program to be rewritten. This motor control program determines the operation (control content) of the motor control device 101 and performs calculation.

モータ制御装置101のプログラム書き換え部114は、記録装置113のモータ制御プログラム記録領域222に保存されたモータ制御プログラムを全体的もしくは部分的に書き換える。その際には、記録装置113のプログラム書き換え用プログラム記録領域221に記録されたプログラム書き換え用プログラムを用いる。   The program rewriting unit 114 of the motor control device 101 rewrites the motor control program stored in the motor control program recording area 222 of the recording device 113 in whole or in part. At that time, the program rewriting program recorded in the program rewriting program recording area 221 of the recording device 113 is used.

分割プログラムおよびチェックコード送信部512(チェックコード生成部を含む)は、記録装置113に保存されたモータ制御プログラム記録領域222にあるモータ制御プログラムを分割して、分割プログラムおよび分割したプログラムが変更されていないことを証明するチェックコードを作成する。
第2の状態検出部513は、第1種ノード自身が通常の処理が実施されているか否かにより、自身がモータ制御プログラムを書き換え可能な状態であるか否か、或いはモータ制御プログラムが全て書き換えられているか否かの状態を検出し、他の制御装置に通知する。
第2の状態検出部513により、書き換え可能であることが検出された場合は、CANネットワーク106を介してEPS制御装置102aおよびバッテリ制御装置102bに通知する。
そして、この通知を受けたEPS制御装置102aおよびバッテリ制御装置102bは、自身が保存する分割プログラムおよび保存する分割プログラムが変更されていないことを証明するチェックコードを、CANネットワーク106を介して、モータ制御装置101に送信する。
The division program and check code transmission unit 512 (including the check code generation unit) divides the motor control program in the motor control program recording area 222 stored in the recording device 113, and the division program and the divided program are changed. Create a check code to prove that you have not.
The second state detection unit 513 determines whether or not the first type node itself is in a state where the motor control program can be rewritten, or whether the motor control program is completely rewritten, depending on whether or not normal processing is being performed by the first type node itself. The state of whether or not it has been detected is detected and notified to another control device.
When the second state detection unit 513 detects that rewriting is possible, it notifies the EPS control device 102a and the battery control device 102b via the CAN network 106.
Then, the EPS control device 102a and the battery control device 102b that have received this notification send a check code for proving that the divided program to be saved and the saved divided program have not been changed via the CAN network 106 to the motor. Transmit to the control device 101.

モータ制御装置101のプログラム検証部511は、記録装置113のプログラム検証用プログラム記録領域634に記録されたプログラム検証用プログラムを用いて、CANネットワーク106上または他のノードで保存中に分割プログラムが壊れていないか否か(例えば、ノイズによるビット反転等)を、受信したチェックコードを用いて検証する。   The program verification unit 511 of the motor control device 101 uses the program verification program recorded in the program verification program recording area 634 of the recording device 113 to break the divided program during storage on the CAN network 106 or another node. It is verified by using the received check code whether it is not (eg, bit inversion due to noise).

モータ制御装置101は、EPS制御装置102aまたはバッテリ制御装置102bから分割プログラムを受信する度に、モータ制御プログラム記録領域222に保存されたモータ制御プログラムの該当する分割プログラムを、プログラム書き換え部114により書き換える。
また、チェックコードを受信する度に、プログラム検証部511により、対応する分割プログラムによって書き換えられた内容を検証する。
Whenever the motor control device 101 receives a division program from the EPS control device 102a or the battery control device 102b, the program rewriting unit 114 rewrites the corresponding division program of the motor control program stored in the motor control program recording area 222. .
Each time a check code is received, the program verification unit 511 verifies the content rewritten by the corresponding divided program.

次に、第2種ノードとしてのEPS制御装置102aの構成と機能について簡単に説明する。
マイコン121aは、EPS120aの制御量や各種処理値を演算する。データ送受信部122aは、CANネットワーク106を介して、接続された他の制御装置(モータ制御装置101、バッテリ制御装置102b、テスタ103を含む)とデータの送受信を行う。
記録装置123aは、モータ制御プログラムの書き換えプログラムの一部分である分割プログラム、および他の第2種ノードが保存する分割プログラムが変更されていないことを証明するチェックコードを保存する第2の記録領域・第4の記録領域として、分割モータ制御プログラム記録領域533aを有している。
Next, the configuration and function of the EPS control apparatus 102a as the second type node will be briefly described.
The microcomputer 121a calculates the control amount and various processing values of the EPS 120a. The data transmitter / receiver 122a transmits / receives data to / from other connected control devices (including the motor control device 101, the battery control device 102b, and the tester 103) via the CAN network 106.
The recording device 123a has a second recording area for storing a split program that is a part of the rewrite program of the motor control program and a check code that proves that the split program stored by another type 2 node has not been changed. As a fourth recording area, a divided motor control program recording area 533a is provided.

分割プログラムおよびチェックコード送信部521aは、モータ制御装置101への分割プログラムおよびチェックコードの送信可否を判断する。
分割プログラム送信部124aにより、モータ制御装置101への分割プログラムおよびチェックコードの送信が可能であると判断された場合には、自身が保存する分割プログラムおよびチェックコードを、CANネットワーク106を介してモータ制御装置101に送信する。
The division program and check code transmission unit 521a determines whether the division program and the check code can be transmitted to the motor control apparatus 101.
If the divided program transmission unit 124a determines that the divided program and the check code can be transmitted to the motor control device 101, the divided program and the check code stored by itself are transmitted to the motor via the CAN network 106. Transmit to the control device 101.

第1種ノード状態検出部522aは、モータ制御装置101に異常がないか否かの状態を検出する。異常を検出した場合は、CANネットワーク106を介してモータ制御装置101とバッテリ制御装置102bに書き戻し指示を通知する。
第1種ノード状態検出部522aにより異常を検出している、または、他の第2種ノードから書き戻し指示が通知されている場合、かつ、モータ制御装置101の第2の状態検出部513より、書き換え可能であることが通知された場合は、自身が保存する分割プログラムおよびチェックコードを、CANネットワーク106を介して、モータ制御装置101に送信する。
ここで、モータ制御装置101の異常には、意図しない制御または処理が実施されたり、セキュリティ上の脆弱性があったりすることが挙げられるが、これに限るものではない。
The first type node state detection unit 522a detects a state of whether or not there is an abnormality in the motor control device 101. When an abnormality is detected, a write-back instruction is notified to the motor control device 101 and the battery control device 102b via the CAN network 106.
When abnormality is detected by the first type node state detection unit 522a, or when a write back instruction is notified from another second type node, and from the second state detection unit 513 of the motor control device 101 If it is notified that rewriting is possible, the divided program and check code stored by itself are transmitted to the motor control device 101 via the CAN network 106.
Here, examples of the abnormality of the motor control device 101 include that unintended control or processing is performed or there is a security vulnerability, but is not limited thereto.

次に、第2種ノードとしてのバッテリ制御装置102bの構成と機能について、簡単に説明する。
マイコン121bは、バッテリ120bの制御量や各種処理値を演算する。データ送受信部122bは、CANネットワーク106を介して、接続された他の制御装置(モータ制御装置101、EPS制御装置102a、テスタ103を含む)とデータを送受信する。
記録装置123bは、モータ制御プログラムを分割した一部分である分割プログラムおよび他の制御装置が保存する分割プログラムが変更されていないことを証明するチェックコードを保存する第2の記録領域・第4の記録領域として、分割モータ制御プログラム記録領域533bを有している。
Next, the configuration and function of the battery control apparatus 102b as the second type node will be briefly described.
The microcomputer 121b calculates the control amount and various processing values of the battery 120b. The data transmission / reception unit 122b transmits / receives data to / from other connected control devices (including the motor control device 101, the EPS control device 102a, and the tester 103) via the CAN network 106.
The recording device 123b is a second recording area / fourth recording for storing a division program that is a part of dividing the motor control program and a check code that proves that the division program stored by another control device has not been changed. As an area, a divided motor control program recording area 533b is provided.

分割プログラムおよびチェックコード送信部521bは、モータ制御装置101への分割プログラムおよびチェックコードの送信可否を判断する。
分割プログラムおよびチェックコード送信部521bにより、モータ制御装置101への分割プログラムおよびチェックコードの送信が可能であると判断された場合には、自ノードが保存する分割プログラムおよびチェックコードを、CANネットワーク106を介してモータ制御装置101に送信する。
The division program and check code transmission unit 521b determines whether the division program and the check code can be transmitted to the motor control device 101.
If the divided program and check code transmission unit 521b determines that the divided program and check code can be transmitted to the motor control device 101, the divided program and check code stored in the own node are stored in the CAN network 106. Is transmitted to the motor control device 101.

第1種ノード状態検出部522bは、モータ制御装置101に異常がないか否かの状態を検出する。異常を検出した場合は、CANネットワーク106を介して、モータ制御装置101とEPS制御装置102aに書き戻し指示を通知する。
第1種ノード状態検出部522bにより異常を検出している、または、他の第2種ノードから書き戻し指示が通知されている場合、かつ、モータ制御装置101の第2の状態検出部513より書き換え可能であることが通知された場合は、自身が保存する分割プログラムおよびチェックコードを、CANネットワーク106を介してモータ制御装置101に送信する。
ここで、モータ制御装置101の異常とは、意図しない制御または処理が実施されたり、セキュリティ上の脆弱性があったりすることが挙げられるが、これに限るものではない。
The first type node state detection unit 522b detects a state of whether or not the motor control device 101 is normal. When an abnormality is detected, a write-back instruction is notified to the motor control device 101 and the EPS control device 102a via the CAN network 106.
When abnormality is detected by the first type node state detection unit 522b, or when a write back instruction is notified from another second type node, and from the second state detection unit 513 of the motor control device 101 When it is notified that rewriting is possible, the divided program and the check code stored by itself are transmitted to the motor control apparatus 101 via the CAN network 106.
Here, the abnormality of the motor control device 101 may include that unintended control or processing is performed or there is a security vulnerability, but is not limited thereto.

次に、第3種ノードとしてのテスタ103の構成と機能について簡単に説明する。このテスタ103は、書き換えプログラムを送信するものである。
マイコン131は、テスタ103の動作に関わる各種処理を実施する。データ送受信部132は、CANネットワーク106を介して、接続された他の制御装置(モータ制御装置101、EPS制御装置102a、バッテリ制御装置102bを含む)とデータを送受信する。
記録装置133は、図8(d)に示すように、書き換えプログラムを保存する第3の記録領域であるモータ制御プログラム記録領域241を備えている。
Next, the configuration and function of the tester 103 as the third type node will be briefly described. The tester 103 transmits a rewriting program.
The microcomputer 131 performs various processes related to the operation of the tester 103. The data transmission / reception unit 132 transmits / receives data to / from other connected control devices (including the motor control device 101, the EPS control device 102a, and the battery control device 102b) via the CAN network 106.
As shown in FIG. 8D, the recording device 133 includes a motor control program recording area 241 that is a third recording area for storing the rewriting program.

書き換え指示部134は、モータ制御装置101に対して、プログラムの書き換えを指示する。書き換えプログラム送信部135は、モータ制御装置101から書き換え可能の通知を受けたのちに、モータ制御プログラム記録領域241に記録している書き換えプログラムをモータ制御装置101に送信する。
テスタ103は、常時、CANネットワーク106に接続されるものではなく、制御装置へのプログラムの書き換えや、診断を実施するときに接続されるものである。
The rewrite instruction unit 134 instructs the motor control device 101 to rewrite the program. The rewriting program transmission unit 135 transmits the rewriting program recorded in the motor control program recording area 241 to the motor control device 101 after receiving a rewriteable notification from the motor control device 101.
The tester 103 is not always connected to the CAN network 106, but is connected when rewriting a program to the control device or performing diagnosis.

次に、動作について説明する。
ここでは、実施の形態2によるプログラム書き換えシステムの各ノードにおける処理の流れについて、図9〜図12のフローチャートを用いて説明する。
第1種ノードであるモータ制御装置101では、駆動用モータ110の制御に関わる通常の処理と、モータ制御プログラムの書き換えに関する処理が実施される。プログラム書き換えに関する処理は、図9に示し、テスタ103から書き換え実施の通知(書き換え指示)があった場合に実施される。
第1種ノードであるモータ制御装置101における書き換え前のプロラムに書戻す処理は、図10に示している。
Next, the operation will be described.
Here, the flow of processing in each node of the program rewriting system according to the second embodiment will be described with reference to the flowcharts of FIGS.
In the motor control device 101 that is the first type node, normal processing related to control of the driving motor 110 and processing related to rewriting of the motor control program are performed. The processing related to program rewriting is shown in FIG. 9 and is performed when a rewrite execution notification (rewrite instruction) is received from the tester 103.
The process of writing back to the program before rewriting in the motor control apparatus 101 which is the first type node is shown in FIG.

まず、図9により、第1種ノードのプログラム書き換え時の処理について説明する。
ステップS701において、第2の状態検出部513は、テスタ103から書き換え指示が通知されているか否かを判断する。通知されている場合(YES)は、ステップS702へ進み、通知されていない場合(NO)は、通知されるまで待機する。
First, the processing at the time of rewriting the program of the first type node will be described with reference to FIG.
In step S <b> 701, the second state detection unit 513 determines whether a rewrite instruction is notified from the tester 103. If notified (YES), the process proceeds to step S702. If not notified (NO), the process waits until notified.

続いて、ステップS702において、第2の状態検出部513は、通常の処理が実施されているか否かを判断し、通常の処理が実施されていなければ、書き換え可能(YES)であるため、ステップS703へ進み、通常の処理が実施されている場合には、終了まで待機する。   Subsequently, in step S702, the second state detection unit 513 determines whether or not normal processing is performed. If normal processing is not performed, the second state detection unit 513 is rewritable (YES). The process proceeds to S703, and when normal processing is being performed, the process waits until the end.

ステップS703において、分割プログラムおよびチェックコード送信部512は、記録装置113に保存されたモータ制御プログラム記録領域222にあるモータ制御プログラムを分割して、分割プログラムおよび分割したプログラムが変更されていないことを証明するチェックコードを作成する。
そして、データ送受信部112により、分割プログラムおよびチェックコードを第2種ノードであるバッテリ制御装置102bとEPS制御装置102aへ送信する。
ここで、実施の形態2では、第2種ノードを2つ備えているため、書き換えプログラムを2つに分割し、分割プログラムAと分割プログラムBを作成するとともに、分割プログラムAと分割プログラムBのそれぞれに対応するチェックコードAとチェックコードBを作成し、分割プログラムAとチェックコードBをEPS制御装置102aに、分割プログラムBとチェックコードAをバッテリ制御装置102bへといったように、分割プログラムとチェックコードを異なる制御装置に送信するものとする。
In step S703, the divided program and check code transmission unit 512 divides the motor control program in the motor control program recording area 222 stored in the recording device 113, and confirms that the divided program and the divided program are not changed. Create a check code to prove.
Then, the data transmission / reception unit 112 transmits the divided program and the check code to the battery control device 102b and the EPS control device 102a that are the second type nodes.
Here, since the second type node is provided in the second embodiment, the rewriting program is divided into two, and the divided program A and the divided program B are created. Check code A and check code B corresponding to each are created, and divided program A and check code B are sent to EPS control device 102a, divided program B and check code A are sent to battery control device 102b, and so on. The code shall be sent to a different control device.

ステップS704において、モータ制御プログラムから作成した分割プログラムおよびチェックコードのすべてを送信したかどうかを判断する。すべてを送信している場合(YES)は、ステップS705へ進み、送信していない場合は(NO)は、ステップS703に進み、再度、送信処理を実施する。   In step S704, it is determined whether all of the division program and check code created from the motor control program have been transmitted. If everything has been transmitted (YES), the process proceeds to step S705. If not (NO), the process proceeds to step S703, and the transmission process is performed again.

ステップS705において、第2の状態検出部513は、モータ制御プログラムすべてを送信したため、テスタ103に対して書き換え可能を通知する。   In step S705, the second state detection unit 513 notifies the tester 103 that rewriting is possible because all the motor control programs have been transmitted.

ステップS706において、テスタ103からの書き換えプログラムの受信を待つ。書き換えプログラムを受信した場合(YES)は、ステップS707に進む。   In step S706, reception of a rewrite program from the tester 103 is awaited. If the rewriting program is received (YES), the process proceeds to step S707.

ステップS707において、プログラム書き換え部114は、プログラム書き換え用プログラムを用いて、受信した書き換えプログラムに該当するモータ制御プログラムの部分を書き換え、ステップS708へ進む。   In step S707, the program rewriting unit 114 rewrites the portion of the motor control program corresponding to the received rewriting program using the program rewriting program, and proceeds to step S708.

ステップS708において、第2の状態検出部513は、すべての書き換えプログラムを受信し、該当するモータ制御プログラムの部分を書き換えたか否かを判断する。受信してない場合は(NO)、ステップS706へ進み、受信している場合は(YES)処理を終了する。   In step S708, the second state detection unit 513 receives all the rewrite programs and determines whether or not the corresponding motor control program portion has been rewritten. If not received (NO), the process proceeds to step S706, and if received (YES), the process is terminated.

次に、図10を用いて、モータ制御装置101において、書き換えプログラムに書き換えたのち、書き換え前のプロラムに書戻す処理について説明する。
この時、テスタ103は、CANネットワーク106から取り外されているものとする。
ステップS711において、第2の状態検出部513は、第2種ノード(ここでは、EPS制御装置102aまたはバッテリ制御装置102b)から書き戻し指示を通知されているか否かを判断する。通知されている場合(YES)は、ステップS712へ進み、通知されていない場合(NO)は、受信するまで待機する。
Next, with reference to FIG. 10, a description will be given of processing in the motor control device 101 for rewriting to a rewriting program and then writing back to the program before rewriting.
At this time, it is assumed that the tester 103 has been removed from the CAN network 106.
In step S711, the second state detection unit 513 determines whether or not a write-back instruction is notified from the second type node (here, the EPS control device 102a or the battery control device 102b). If notified (YES), the process proceeds to step S712. If not notified (NO), the process waits until reception.

ステップS712において、第2の状態検出部513は、通常の処理が実施されているか否かを判断し、通常の処理が実施されていなければ、書き換え可能(YES)であるため、ステップS713へ進み、通常の処理が実施されている場合は、終了まで待機する。   In step S712, the second state detection unit 513 determines whether or not normal processing is performed. If normal processing is not performed, the second state detection unit 513 is rewritable (YES), and thus proceeds to step S713. If normal processing is being performed, the process waits until the end.

ステップS713において、第2の状態検出部513は、第2種ノードであるバッテリ制御装置102bとEPS制御装置102aに対して、記録している分割プログラムおよびチェックコードの送信指示を通知する。   In step S713, the second state detection unit 513 notifies the battery control device 102b and the EPS control device 102a, which are the second type nodes, the transmission instructions of the recorded divided program and check code.

ステップS714において、バッテリ制御装置102bとEPS制御装置102aからの分割プログラムおよびチェックコードの受信を待つ。分割プログラムまたはチェックコードを受信した場合(YES)は、ステップS715に進む。   In step S714, reception of the division program and check code from the battery control device 102b and the EPS control device 102a is awaited. When the division program or the check code is received (YES), the process proceeds to step S715.

ステップS715において、受信した内容を確認する。分割プログラムであれば、ステップS716へ進み、チェックコードであれば、ステップS717へ進む。
ステップS716において、プログラム書き換え部114は、プログラム書き換え用プログラムを用いて、受信した分割プログラムに該当するモータ制御プログラムの部分を書き換え、ステップS719へ進む。
In step S715, the received content is confirmed. If it is a divided program, the process proceeds to step S716, and if it is a check code, the process proceeds to step S717.
In step S716, the program rewriting unit 114 rewrites the portion of the motor control program corresponding to the received divided program using the program rewriting program, and proceeds to step S719.

ステップS717において、プログラム検証部511は、プログラム検証用プログラムを用い、受信したチェックコードに該当するモータ制御プログラムの部分を検証する。
ステップS718において、検証結果に対する問題の有無を判断し、問題がない場合(YES)は、ステップS719へ進み、問題がある場合(NO)は、書き戻し処理を終了する。
In step S717, the program verification unit 511 verifies the portion of the motor control program corresponding to the received check code using the program verification program.
In step S718, it is determined whether there is a problem with the verification result. If there is no problem (YES), the process proceeds to step S719. If there is a problem (NO), the write-back process is terminated.

ステップS719において、すべての分割プログラムを受信し、該当するモータ制御プログラムの部分を書き換えたか否かを判断する。すべてを受信していない場合は(NO)、ステップS714へ進み、受信している場合は(YES)、処理を終了する。   In step S719, it is determined whether all divided programs have been received and the corresponding motor control program portion has been rewritten. If not all have been received (NO), the process proceeds to step S714. If all have been received (YES), the process ends.

次に、第2種ノードであるEPS制御装置102aおよびバッテリ制御装置102bにおけるプログラム書き換えに関する処理の流れについて、図11を用いて説明する。
EPS制御装置102a(またはバッテリ制御装置102b)では、EPS120a(またはバッテリ120b)の制御に関わる通常の処理と、モータ制御装置101のプログラム書き換えに関する処理が実施される。
なお、EPS制御装置102aとバッテリ制御装置102bにおけるプログラム書き換えに関する処理は、同じであるので、ここでは、EPS制御装置102aを例に挙げて説明する。
Next, the flow of processing related to program rewriting in the EPS control device 102a and the battery control device 102b, which are type 2 nodes, will be described with reference to FIG.
In the EPS control device 102a (or the battery control device 102b), normal processing related to the control of the EPS 120a (or the battery 120b) and processing related to program rewriting of the motor control device 101 are performed.
In addition, since the process regarding the program rewriting in the EPS control apparatus 102a and the battery control apparatus 102b is the same, here, the EPS control apparatus 102a will be described as an example.

EPS制御装置102aは、テスタ103から書き換え実施指示が通知された後、ステップS801において、分割プログラムまたはチェックコードの受信を待つ。データ送受信部122aにより、分割プログラムまたはチェックコードを受信した場合(YES)は、ステップS802へ進み、受信した分割プログラムまたはチェックコードを記録装置123aの分割モータ制御プログラム記録領域533aに保存し、ステップS803へ進む。   After receiving the rewrite execution instruction from the tester 103, the EPS control apparatus 102a waits for reception of the divided program or check code in step S801. If the data transmission / reception unit 122a receives the divided program or check code (YES), the process proceeds to step S802, where the received divided program or check code is stored in the divided motor control program recording area 533a of the recording device 123a, and step S803 is performed. Proceed to

ステップS803(第5のステップ)において、EPS制御装置102aの第1種ノード状態検出部522aは、モータ制御装置101に異常がないか否かを判断する。モータ制御装置101の異常を検出した場合(YES)は、ステップS806へ進み、異常を検出していない場合(NO)は、ステップS804へ進む。   In step S803 (fifth step), the first type node state detection unit 522a of the EPS control apparatus 102a determines whether or not the motor control apparatus 101 is normal. If an abnormality is detected in the motor control device 101 (YES), the process proceeds to step S806, and if no abnormality is detected (NO), the process proceeds to step S804.

ステップS804において、EPS制御装置102aは、他の第2種ノード(ここでは、バッテリ制御装置102b)からモータ制御装置101へ書き戻し指示が通知されているか否かを判断する。通知されている場合(YES)は、ステップS807へ進み、通知されていない場合(NO)は、ステップS805へ進む。   In step S804, the EPS control apparatus 102a determines whether or not a write-back instruction is notified from the other second type node (here, the battery control apparatus 102b) to the motor control apparatus 101. If notified (YES), the process proceeds to step S807. If not notified (NO), the process proceeds to step S805.

ステップS805において、データ送受信部122aにより、分割プログラムまたはチェックコードを受信しているかどうかを確認する。受信している場合(YES)は、ステップS802へ進み、受信していない場合(NO)は、ステップS803へ進む。   In step S805, the data transmission / reception unit 122a confirms whether a division program or a check code is received. If received (YES), the process proceeds to step S802. If not received (NO), the process proceeds to step S803.

ステップS806において、EPS制御装置102aは、他の第2種ノード(ここでは、バッテリ制御装置102b)とモータ制御装置101へ書き戻し指示を通知し、ステップS807へ進む。   In step S806, the EPS control apparatus 102a notifies the other second type node (here, the battery control apparatus 102b) and the motor control apparatus 101 of a write-back instruction, and proceeds to step S807.

ステップS807において、EPS制御装置102aは、モータ制御装置101からの分割プログラムおよびチェックコードの送信指示を待つ。送信指示が通知されている場合(YES)は、ステップS808へ進み、送信指示が通知されていない場合(NO)は、通知されるまで待機する。   In step S807, the EPS control apparatus 102a waits for a split program and check code transmission instruction from the motor control apparatus 101. When the transmission instruction is notified (YES), the process proceeds to step S808. When the transmission instruction is not notified (NO), the process waits until the notification is received.

ステップS808において、分割モータ制御プログラム記録領域533aに保存された分割プログラムおよびチェックコードをモータ制御装置101へ送信し、ステップS809へ進む。   In step S808, the divided program and check code stored in the divided motor control program recording area 533a are transmitted to the motor control apparatus 101, and the process proceeds to step S809.

ステップS809において、保存した分割プログラムおよびチェックコードをすべて送信したかどうかを確認する。
すべて送信している場合(YES)は、処理を完了し、送信していない場合(NO)は、ステップS808へ進み、送信処理を実施する。
In step S809, it is confirmed whether all of the saved divided programs and check codes have been transmitted.
If all are transmitted (YES), the process is completed, and if not transmitted (NO), the process proceeds to step S808, and the transmission process is performed.

次に、第3種ノードであるテスタ103におけるプログラム書き換えに関する処理の流れについて、図12を用いて説明する。
テスタ103では、関連ノードへのプログラム書き換え実施の通知と、書き換えプログラムの送信処理を実施する。
まず、ステップS811において、書き換え指示部134は、モータ制御装置101、EPS制御装置102a、バッテリ制御装置102bに対して、モータ制御装置101の書き換えを実施することを通知する。
Next, a flow of processing related to program rewriting in the tester 103 which is the third type node will be described with reference to FIG.
The tester 103 performs notification of program rewriting to the related nodes and transmission processing of the rewriting program.
First, in step S811, the rewrite instruction unit 134 notifies the motor control device 101, the EPS control device 102a, and the battery control device 102b that the motor control device 101 is to be rewritten.

次に、ステップS812において、書き換え指示部134は、モータ制御装置101から書き換え可能が通知されたかどうかを判断する。通知されている場合(YES)は、書き換え可能と判断し、ステップS813へ進む。通知されていない場合(NO)は、通知されるまで待機する。   Next, in step S812, the rewrite instruction unit 134 determines whether or not the motor control apparatus 101 has notified that rewrite is possible. If notified (YES), it is determined that rewriting is possible, and the process proceeds to step S813. When not notified (NO), it waits until notified.

ステップS813においては、記録装置133のモータ制御プログラム記録領域241にあらかじめ記録されている書き換えプログラムをモータ制御装置101へ送信し、処理を終了する。   In step S813, the rewrite program recorded in advance in the motor control program recording area 241 of the recording device 133 is transmitted to the motor control device 101, and the process ends.

なお、本実施の形態2において、モータ制御装置101に、分割プログラムおよびチェックコードを暗号化する暗号化部と復号化する復号化部を備え、暗号化部により暗号化した分割プログラムおよびチェックコードをEPS制御装置102aとバッテリ制御装置102bに送信し、EPS制御装置102aとバッテリ制御装置102bでは、暗号化された分割プログラムおよびチェックコードを保存し、モータ制御装置101で、EPS制御装置102aまたはバッテリ制御装置102bから暗号化された分割プログラムおよびチェックコードを受信した際に、復号化部により分割プログラムを復号化するようにしても良い。   In the second embodiment, the motor control device 101 includes an encryption unit that encrypts the divided program and the check code, and a decryption unit that decrypts the divided program and the check code, and the divided program and the check code encrypted by the encryption unit. The EPS control apparatus 102a and the battery control apparatus 102b transmit the encrypted divided program and the check code, and the motor control apparatus 101 executes the EPS control apparatus 102a or the battery control. When the encrypted divided program and check code are received from the apparatus 102b, the divided program may be decrypted by the decryption unit.

上記のような暗号化部と復号化部を備えることにより、CANネットワーク106で第三者に解読される危険性、またはEPS制御装置102aおよびバッテリ制御装置102bでの保存時に第三者に解読される危険性を低減させることができ、プログラム書き換えを安全に実施することが可能となる。   By providing the encryption unit and the decryption unit as described above, there is a risk of being decrypted by a third party on the CAN network 106, or it is decrypted by a third party at the time of storage in the EPS control device 102a and the battery control device 102b. The program can be rewritten safely.

以上のような処理の流れを持つ、実施の形態2によるプログラム書き換えシステムでは、テスタ103からモータ制御装置101へプログラム書き換え実施を通知したときに、モータ制御装置101では、まず、これまでの制御に用いていたモータ制御プログラムから、分割プログラムを作成するとともに、分割したプログラムが変更されていないことを証明するチェックコードを作成し、EPS制御装置102aおよびバッテリ制御装置102bにそれぞれ送信する。
送信完了後に、モータ制御装置101は、テスタ103から送信される書き換えプログラムで、モータ制御プログラムを書き換える。
その後、テスタ103がCANネットワーク106から分離され、モータ制御装置101は、書き換えたモータ制御プログラムで制御する。
そして、EPS制御装置102aまたはバッテリ制御装置102bが、書き換えたモータ制御プログラムによるモータ制御装置101の動作異常やセキュリティ上の脆弱性が検出された場合には、他の第2種ノードとモータ制御装置101に通知する。
In the program rewriting system according to the second embodiment having the above processing flow, when the tester 103 notifies the motor control device 101 of execution of the program rewrite, the motor control device 101 first performs the control so far. A divided program is created from the motor control program used, and a check code for proving that the divided program has not been changed is created and transmitted to the EPS control device 102a and the battery control device 102b, respectively.
After the transmission is completed, the motor control device 101 rewrites the motor control program with the rewrite program transmitted from the tester 103.
Thereafter, the tester 103 is separated from the CAN network 106, and the motor control device 101 performs control with the rewritten motor control program.
When the EPS control apparatus 102a or the battery control apparatus 102b detects an operation abnormality or security vulnerability of the motor control apparatus 101 by the rewritten motor control program, the other second type node and the motor control apparatus are detected. 101 is notified.

これにより、EPS制御装置102aとバッテリ制御装置102bは、自身が保存する分割プログラムおよびチェックコードをそれぞれモータ制御装置101に送信し、モータ制御装置101は、分割プログラムを受信する度に、受信した分割プログラムに該当するモータ制御プログラムの部分を書き換え、チェックコードを受信する度に、該当するモータ制御プログラムの部分を検証するものである。   Thereby, the EPS control apparatus 102a and the battery control apparatus 102b transmit the division program and the check code stored therein to the motor control apparatus 101, and the motor control apparatus 101 receives the division The motor control program portion corresponding to the program is rewritten, and each time the check code is received, the corresponding motor control program portion is verified.

実施の形態2のプログラム書き換えシステムによれば、モータ制御装置101のモータ制御プログラムを書き換えて、テスタ103をCANネットワーク106から分離したのちに、モータ制御装置101の動作に異常が有ったり、セキュリティ上の脆弱性が検出されたりした場合にも、テスタ103をCANネットワーク106につなぎ直して再度、書き換えプログラムを送信する必要がなく、効率の良く書き換え前の制御プログラムに戻し、かつ検証することができ、モータ制御装置101は、問題のある制御プログラムを使い続けず、自動車の安全性を確保することができる。   According to the program rewriting system of the second embodiment, after the motor control program of the motor control device 101 is rewritten and the tester 103 is separated from the CAN network 106, there is an abnormality in the operation of the motor control device 101 or security. Even when the above vulnerability is detected, there is no need to re-connect the tester 103 to the CAN network 106 and send the rewriting program again, and it is possible to efficiently return to the control program before rewriting and verify it. In addition, the motor control apparatus 101 can ensure the safety of the automobile without continuing to use the problematic control program.

また、モータ制御プログラムから分割プログラムを作成し、複数の第2種ノード(本実施の形態2では、EPS制御装置102aおよびバッテリ制御装置102bの2つ)に保存するため、1つの第2種ノードに全ての書き換えプログラムを保存できるほどの大きな記録容量を設ける必要がなく、1つのノードがコスト高になることを防ぐことができ、全体としてのコストが抑えられる。   In addition, since a divided program is created from the motor control program and stored in a plurality of second type nodes (in the second embodiment, two of the EPS control device 102a and the battery control device 102b), one second type node It is not necessary to provide a recording capacity large enough to store all the rewriting programs, and the cost of one node can be prevented from increasing, and the overall cost can be suppressed.

なお、上述の実施の形態1と実施の形態2では、2つの第2種ノードを備えた車両制御システムを例に挙げて説明したが、第2種ノードの数はこれに限定されるものではない。
第2種ノードの数を増やすことにより、各分割プログラムの容量を低減することができ、各第2種ノードに必要となる記録容量を抑えることができる。
In the first embodiment and the second embodiment described above, the vehicle control system including two second type nodes has been described as an example. However, the number of second type nodes is not limited to this. Absent.
By increasing the number of type 2 nodes, the capacity of each divided program can be reduced, and the recording capacity required for each type 2 node can be suppressed.

また、各ノードが接続されるネットワークとしてCANネットワーク106を例に挙げて説明したが、ネットワークの種類はこれに限るものではない。
また、テスタは、CANネットワーク106を介さずに、直接、モータ制御装置101に接続する場合でも同様の効果が得られる。
Further, although the CAN network 106 has been described as an example of a network to which each node is connected, the type of network is not limited to this.
Further, the same effect can be obtained when the tester is directly connected to the motor control device 101 without using the CAN network 106.

また、上述の実施の形態1と実施の形態2では、第1種ノードのプログラム書き換えが成功することを前提として説明したが、検証結果により問題があり、書き換えが失敗した場合や、何らかの理由で書き換えが失敗した場合に備えて、第1種ノードにタイムアウト時間等を設定しておき、所定時間が経過しても書き換えプログラムまたは、分割プログラムを受信できない場合や、書き換えが終了しない場合には、書き換え処理を強制的に終了させるようにしても良い。   In the first and second embodiments described above, the description has been made on the assumption that the program rewriting of the first type node is successful. However, there is a problem due to the verification result, and the rewriting fails or for some reason. In preparation for the case where rewriting fails, a timeout time or the like is set in the first type node, and when the rewriting program or the divided program cannot be received even after a predetermined time has passed, or when rewriting does not end, The rewriting process may be forcibly terminated.

ただし、書き換え処理を途中で終了させる場合には、関連ノードに故障状況を示す一意のコードを記録しておく等の対応策を併せて用意しておく必要がある。   However, when the rewriting process is terminated halfway, it is necessary to prepare a countermeasure such as recording a unique code indicating a failure state in the related node.

また、上述の実施の形態2では、分割プログラムに対応するチェックコードが届くことを前提として説明したが、チェックコードか届かない時は、CANネットワーク106もしくは、該当する第2種ノードに異常があると判断することができ、早期に書き換えを中止することができる。   In the second embodiment described above, the description has been made on the assumption that the check code corresponding to the divided program arrives. However, when the check code does not reach, there is an abnormality in the CAN network 106 or the corresponding second type node. Therefore, rewriting can be stopped at an early stage.

また、上述の実施の形態2では、チェックコードにより、分割したプログラムが変更されていないことを証明できることを前提に説明したが、チェックコードとして、変更時に訂正できるチェックコード(例えば、Error−Correcting Code)を用いれば、問題発生時に分割プログラムを修復させることもできる。   In the above-described second embodiment, the description has been made on the assumption that the divided program can be proved by the check code. However, as the check code, a check code that can be corrected at the time of change (for example, an error-correcting code). ) Can be used to repair the split program when a problem occurs.

なお、この発明は、その発明の範囲内において、各実施の形態を自由に組み合わせたり、各実施の形態を適宜、変形、省略することが可能である。   It should be noted that within the scope of the present invention, the embodiments can be freely combined, or the embodiments can be appropriately modified or omitted.

この発明は、ネットワークに接続された複数の制御装置を含むシステム(例えば車両制御システム)におけるプログラムの書き換えに利用することができる。   The present invention can be used for rewriting a program in a system (for example, a vehicle control system) including a plurality of control devices connected to a network.

101 モータ制御装置(第1種ノード)、102a EPS制御装置(第2種ノード)、
102b バッテリ制御装置(第2種ノード)、103 テスタ(第3種ノード)、
106 CANネットワーク、110 駆動用モータ、
111、121a、121b、131 マイコン、
112、122a、122b、132 データ送受信部、
113、123a、123b、133 記録装置、
114 プログラム書き換え部、115 状態検出部、116 分割プログラム送信部、
120a EPS、120b バッテリ、
124a、124b 分割プログラム送信部、134 書き換え指示部、
135 書き換えプログラム送信部、511 プログラム検証部、
512 分割プログラムおよびチェックコード送信部、513 第2の状態検出部、
521a、521b 分割プログラムおよびチェックコード送信部、
522a、522b 第1種ノード状態検出部
101 motor control device (first type node), 102a EPS control device (second type node),
102b Battery control device (type 2 node), 103 tester (type 3 node),
106 CAN network, 110 drive motor,
111, 121a, 121b, 131 microcomputer,
112, 122a, 122b, 132 data transmission / reception unit,
113, 123a, 123b, 133 recording device,
114 program rewriting unit, 115 status detection unit, 116 divided program transmission unit,
120a EPS, 120b battery,
124a, 124b division program transmission unit, 134 rewrite instruction unit,
135 rewrite program transmission unit, 511 program verification unit,
512 division program and check code transmission unit, 513 second state detection unit,
521a, 521b division program and check code transmission unit,
522a, 522b type 1 node state detection unit

この発明に係わるプログラム書き換えシステムにおいては、第1種ノードおよび複数の第2種ノードが通信可能にネットワークに接続され、ネットワークに随時接続される第3種ノードから送信される書き換えプログラムによって第1種ノードのプログラムを書き換えるプログラム書き換えシステムであって、第1種ノードは、プログラムを保存する第1の記録領域と、この第1の記録領域に保存されているプログラムを複数に分割し、各分割プログラムを各別に第2種ノードに送信する分割プログラム送信部と、第3種ノードから受信した書き換えプログラムによって、第1の記録領域のプログラムを書き換えるプログラム書き換え部とを有し、第2種ノードは、第1種ノードから受信した分割プログラムを保存する第2の記録領域と、この第2の記録領域に保存された分割プログラムを第1種ノードに送信する送信部と、第1種ノードの状態を検出する第1種ノード状態検出部とを有し、第3種ノードは、書き換えプログラムを保存する第3の記録領域と、第1種ノードへの書き換えを指示する書き換え指示部と、書き換えプログラムを第1種ノードに送信する書き換えプログラム送信部とを有し、第1種ノードのプログラム書き換え部は、第3種ノードから書き換え指示を受信した場合に、分割プログラムを第2種ノードに送信したのち、第3種ノードから受信した書き換えプログラムによってプログラムを書き換え、第2種ノードは、プログラム書き換え部によってプログラムが書き換えられたのちに、第1種ノード状態検出部によって第1種ノードの異常が検出された場合に、第1種ノードおよび他の第2種ノードに通知するとともに、自ノードが保存する分割プログラムを第1種ノードに送信し、通知を受けた他の第2種ノードは、自ノードが保存する分割プログラムを第1種ノードに送信し、第1種ノードは、各第2種ノードより受信した分割プログラムにより、第1の記録領域のプログラムの該当部分を書き換えるものである。 In the program rewriting system according to the present invention, the first type node and the plurality of second type nodes are communicably connected to the network, and the first type is transmitted by the rewriting program transmitted from the third type node connected to the network as needed. A program rewriting system for rewriting a node program, wherein a first type node divides a first recording area for storing a program and a program stored in the first recording area into a plurality of divided programs. Respectively, and a program rewriting unit for rewriting the program in the first recording area by the rewriting program received from the third type node. A second recording area for storing the divided program received from the first type node; Has a transmission unit for transmitting the stored divided program in the second recording area to the one node, the first type node state detecting unit for detecting the state of the first type node, the third type node, A first recording node having a third recording area for storing the rewriting program, a rewriting instruction unit for instructing rewriting to the first type node, and a rewriting program transmitting unit for transmitting the rewriting program to the first type node; the program rewriting unit, when receiving a rewrite instruction from the three nodes, after transmitting the divided programs into the second type node, rewrites the program by rewriting program received from the third type node, the second type node After the program is rewritten by the program rewriting unit, the first type node status detection unit detects an abnormality of the first type node. In addition to notifying the first type node and other second type nodes, the divided program stored by the own node is transmitted to the first type node, and the other second type node receiving the notification is stored by the own node. The divided program to be transmitted is transmitted to the first type node, and the first type node rewrites the corresponding part of the program in the first recording area by the divided program received from each second type node .

この発明によれば、第1種ノードおよび複数の第2種ノードが通信可能にネットワークに接続され、ネットワークに随時接続される第3種ノードから送信される書き換えプログラムによって第1種ノードのプログラムを書き換えるプログラム書き換えシステムであって、第1種ノードは、プログラムを保存する第1の記録領域と、この第1の記録領域に保存されているプログラムを複数に分割し、各分割プログラムを各別に第2種ノードに送信する分割プログラム送信部と、第3種ノードから受信した書き換えプログラムによって、第1の記録領域のプログラムを書き換えるプログラム書き換え部とを有し、第2種ノードは、第1種ノードから受信した分割プログラムを保存する第2の記録領域と、この第2の記録領域に保存された分割プログラムを第1種ノードに送信する送信部と、第1種ノードの状態を検出する第1種ノード状態検出部とを有し、第3種ノードは、書き換えプログラムを保存する第3の記録領域と、第1種ノードへの書き換えを指示する書き換え指示部と、書き換えプログラムを第1種ノードに送信する書き換えプログラム送信部とを有し、第1種ノードのプログラム書き換え部は、第3種ノードから書き換え指示を受信した場合に、分割プログラムを第2種ノードに送信したのち、第3種ノードから受信した書き換えプログラムによってプログラムを書き換え、第2種ノードは、プログラム書き換え部によってプログラムが書き換えられたのちに、第1種ノード状態検出部によって第1種ノードの異常が検出された場合に、第1種ノードおよび他の第2種ノードに通知するとともに、自ノードが保存する分割プログラムを第1種ノードに送信し、通知を受けた他の第2種ノードは、自ノードが保存する分割プログラムを第1種ノードに送信し、第1種ノードは、各第2種ノードより受信した分割プログラムにより、第1の記録領域のプログラムの該当部分を書き換えるので、書き換えたのちのプログラムに問題があった場合に、第2種ノードから簡単に書き換え前のプロラムに戻すことができる。 According to the present invention, the first type node and the plurality of second type nodes are communicably connected to the network, and the program of the first type node is executed by the rewrite program transmitted from the third type node connected to the network as needed. In the program rewriting system for rewriting, the first type node divides a first recording area for storing a program and a program stored in the first recording area into a plurality of parts, and each divided program is divided into a plurality of parts. A divided program transmission unit that transmits to the two-type node, and a program rewriting unit that rewrites the program in the first recording area by the rewriting program received from the third-type node, and the second-type node is the first-type node A second recording area for storing the division program received from the second recording area, and a division program stored in the second recording area. Has a transmission unit for transmitting the ram to the first type node, the first type node state detecting unit for detecting the state of the first type node, the third type node, a third recording area for storing the rewriting program A rewriting instruction unit that instructs rewriting to the first type node, and a rewriting program transmitting unit that transmits the rewriting program to the first type node. The program rewriting unit of the first type node is a third type node. When the rewrite instruction is received from the node, after the split program is transmitted to the second type node, the program is rewritten by the rewrite program received from the third type node , and the program is rewritten by the program rewriting unit in the second type node Later, when an abnormality of the first type node is detected by the first type node state detection unit, the first type node and other second type nodes are detected. And the split program stored by the own node is transmitted to the first type node, and the other second type node having received the notification transmits the split program stored by the own node to the first type node, Since the first type node rewrites the corresponding part of the program in the first recording area by the divided program received from each second type node , if there is a problem with the program after the rewriting, You can easily return to the program before rewriting.

次に、図4を用いて、書き換え後の動作として、書き換えプログラムに書き換えたのち、書き換え前のプログラムに書戻す処理について説明する。
このとき、テスタ103は、CANネットワーク106から取り外されているものとする。
ステップS311において、状態検出部115は、自身の処理に異常がないか否かを判断する。異常を検出した場合は(YES)、ステップS312へ進む。
Next, with reference to FIG. 4, description will be given of the processing after rewriting to the rewriting program and then writing back to the program before rewriting as the operation after rewriting.
At this time, the tester 103 is assumed to be removed from the CAN network 106.
Oite to Step S31 1, the state detection unit 115 determines whether a problem arises in its processing. If an abnormality is detected (YES), the process proceeds to step S312.

Claims (7)

第1種ノードおよび複数の第2種ノードが通信可能にネットワークに接続され、上記ネットワークに随時接続される第3種ノードから送信される書き換えプログラムによって上記第1種ノードのプログラムを書き換えるプログラム書き換えシステムであって、
上記第1種ノードは、
上記プログラムを保存する第1の記録領域と、
この第1の記録領域に保存されているプログラムを複数に分割し、各分割プログラムを各別に上記第2種ノードに送信する分割プログラム送信部と、
上記第3種ノードから受信した上記書き換えプログラムによって、上記第1の記録領域の上記プログラムを書き換えるプログラム書き換え部とを有し、
上記第2種ノードは、
上記第1種ノードから受信した上記分割プログラムを保存する第2の記録領域と、
この第2の記録領域に保存された上記分割プログラムを上記第1種ノードに送信する送信部とを有し、
上記第3種ノードは、
上記書き換えプログラムを保存する第3の記録領域と、
上記第1種ノードへの書き換えを指示する書き換え指示部と、
上記書き換えプログラムを上記第1種ノードに送信する書き換えプログラム送信部とを有し、
上記第1種ノードのプログラム書き換え部は、上記第3種ノードから書き換え指示を受信した場合に、上記分割プログラムを上記第2種ノードに送信したのち、上記第3種ノードから受信した上記書き換えプログラムによって上記プログラムを書き換えることを特徴とするプログラム書き換えシステム。
A program rewriting system in which a first type node and a plurality of second type nodes are communicably connected to a network, and the program of the first type node is rewritten by a rewriting program transmitted from a third type node connected to the network as needed Because
The first type node is
A first recording area for storing the program;
A divided program transmission unit that divides the program stored in the first recording area into a plurality of parts, and transmits each divided program to the second type node separately;
A program rewriting unit for rewriting the program in the first recording area by the rewriting program received from the third type node;
The second type node is
A second recording area for storing the divided program received from the first type node;
A transmission unit for transmitting the divided program stored in the second recording area to the first type node;
The above type 3 node is
A third recording area for storing the rewriting program;
A rewriting instruction unit for instructing rewriting to the first type node;
A rewriting program transmitting unit for transmitting the rewriting program to the first type node;
The program rewrite unit of the first type node receives the rewrite instruction from the third type node, transmits the divided program to the second type node, and then receives the rewrite program received from the third type node. A program rewriting system, wherein the program is rewritten by
上記第1種ノードは、自身の状態を検出する状態検出部を有し、
上記プログラム書き換え部によって上記プログラムを書き換えたのちに、上記状態検出部により異常が検出された場合に上記第2種ノードに通知し、
上記第2種ノードは、上記通知を受けて、自ノードが保存する分割プログラムを上記第1種ノードに送信し、
上記第1種ノードは、上記第2種ノードより受信した上記分割プログラムにより、上記第1の記録領域のプログラムの該当部分を書き換えることを特徴とする請求項1に記載のプログラム書き換えシステム。
The first type node has a state detection unit that detects its own state,
After rewriting the program by the program rewriting unit, when an abnormality is detected by the state detection unit, the second type node is notified,
Upon receiving the notification, the second type node transmits the divided program stored by the own node to the first type node,
2. The program rewriting system according to claim 1, wherein the first type node rewrites a corresponding part of the program in the first recording area by the divided program received from the second type node.
上記第2種ノードは、上記第1種ノードの状態を検出する第1種ノード状態検出部を有し、
上記プログラム書き換え部によって上記プログラムを書き換えたのちに、上記第1種ノードの異常が検出された場合に上記第1種ノードおよび他の第2種ノードに通知するとともに、自ノードが保存する分割プログラムを上記第1種ノードに送信し、
上記通知を受けた他の第2種ノードは、自ノードが保存する分割プログラムを上記第1種ノードに送信し、
上記第1種ノードは、各第2種ノードより受信した上記分割プログラムにより、上記第1の記録領域のプログラムの該当部分を書き換えることを特徴とする請求項1に記載のプログラム書き換えシステム。
The second type node has a first type node state detection unit for detecting the state of the first type node,
After rewriting the program by the program rewriting unit, when an abnormality of the first type node is detected, the divided program is stored in the first type node and other second type nodes and stored by the own node To the first type node,
Upon receiving the notification, the other type 2 node transmits the divided program stored by itself to the type 1 node,
2. The program rewriting system according to claim 1, wherein the first type node rewrites a corresponding portion of the program in the first recording area by the divided program received from each second type node.
上記第1種ノードは、上記分割プログラムを暗号化する暗号化部と、
上記第2種ノードから受信した上記分割プログラムを復号化する復号化部とを有し、
上記分割プログラムを暗号化してから上記第2種ノードに送信し、第2種ノードから受信した上記分割プログラムを複合化してから、上記第1の記録領域の上記プログラムの該当部分を書き換えることを特徴とする請求項2または請求項3に記載のプログラム書き換えシステム。
The first type node includes an encryption unit that encrypts the divided program;
A decoding unit for decoding the divided program received from the second type node,
The divided program is encrypted, transmitted to the second type node, the divided program received from the second type node is decrypted, and the corresponding part of the program in the first recording area is rewritten. The program rewriting system according to claim 2 or 3.
上記第1種ノードは、上記分割プログラムの生成時に上記分割プログラムを検証するためのチェックコードを生成するチェックコード生成部を有し、
このチェックコード生成部により生成されたチェックコードを上記第2種ノードに送信し、
上記第2種ノードは、上記第1種ノードから受信したチェックコードを保存する第4の記録領域を有し、
上記分割プログラムの第1種ノードへの送信時に、上記第4の記録領域に保存されているチェックコードを第1種ノードに送信し、
上記第1種ノードは、上記第2種ノードから受信した上記分割プログラムおよび上記チェックコードから、上記分割プログラムが変更されていないことを検証した後、この分割プログラムにより、上記第1の記録領域の上記プログラムの該当部分を書き換えることを特徴とする請求項2から請求項4のいずれか一項に記載のプログラム書き換えシステム。
The first type node has a check code generation unit that generates a check code for verifying the divided program when the divided program is generated,
The check code generated by the check code generation unit is transmitted to the second type node,
The second type node has a fourth recording area for storing the check code received from the first type node,
When transmitting the divided program to the first type node, the check code stored in the fourth recording area is transmitted to the first type node,
The first type node verifies that the divided program has not been changed from the divided program and the check code received from the second type node, and then uses the divided program to store the first recording area. The program rewriting system according to any one of claims 2 to 4, wherein a corresponding portion of the program is rewritten.
第3種ノードが、ネットワークを介して第1種ノードに、上記第1種ノードのプログラムの書き換え指示を送信する第1のステップ、
上記書き換え指示の受信に応じて、上記第1種ノードが上記プログラムを分割し、各分割プログラムを各別に複数の第2種ノードに上記ネットワークを介して送信する第2のステップ、
上記第3種ノードが、上記プログラムを書き換えるための書き換えプログラムを上記第1種ノードに送信する第3のステップ、
および上記第1種ノードが、上記プログラムを、上記第3のステップで送信された書き換えプログラムによって書き換える第4のステップを含むことを特徴とするプログラム書き換え方法。
A first step in which the third type node transmits a program rewrite instruction of the first type node to the first type node via the network;
A second step in which the first type node divides the program in response to receiving the rewrite instruction, and transmits each divided program to a plurality of second type nodes via the network;
A third step in which the third type node transmits a rewriting program for rewriting the program to the first type node;
A program rewriting method comprising: a fourth step in which the first type node rewrites the program by the rewriting program transmitted in the third step.
上記第4のステップで上記プログラムを書き換えたのちに、上記第1種ノードまたは上記第2種ノードが、上記第1種ノードの動作の異常を検出する第5のステップ、
この第5のステップにより異常が検出された場合に、上記各第2種ノードがそれぞれ保存している上記分割プログラムを上記第1種ノードに送信する第6のステップ、
および上記第1種ノードが、上記第6のステップにより送信された分割プログラムにより、上記第4のステップで書き換えたプログラムの該当部分を、書き換える第7のステップを含むことを特徴とする請求項6に記載のプログラム書き換え方法。
A fifth step in which, after rewriting the program in the fourth step, the first type node or the second type node detects an abnormal operation of the first type node;
A sixth step of transmitting the divided program stored in each of the second type nodes to the first type node when an abnormality is detected in the fifth step;
And the first type node includes a seventh step of rewriting a corresponding part of the program rewritten in the fourth step by the divided program transmitted in the sixth step. The program rewrite method described in 1.
JP2016081650A 2016-04-15 2016-04-15 Program rewriting system and program rewriting method Active JP6165292B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2016081650A JP6165292B1 (en) 2016-04-15 2016-04-15 Program rewriting system and program rewriting method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2016081650A JP6165292B1 (en) 2016-04-15 2016-04-15 Program rewriting system and program rewriting method

Publications (2)

Publication Number Publication Date
JP6165292B1 JP6165292B1 (en) 2017-07-19
JP2017191529A true JP2017191529A (en) 2017-10-19

Family

ID=59351367

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2016081650A Active JP6165292B1 (en) 2016-04-15 2016-04-15 Program rewriting system and program rewriting method

Country Status (1)

Country Link
JP (1) JP6165292B1 (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005339049A (en) * 2004-05-25 2005-12-08 Toshiba Corp Paper sheet processing system
JP2013246718A (en) * 2012-05-28 2013-12-09 Auto Network Gijutsu Kenkyusho:Kk Control system and program updating method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005339049A (en) * 2004-05-25 2005-12-08 Toshiba Corp Paper sheet processing system
JP2013246718A (en) * 2012-05-28 2013-12-09 Auto Network Gijutsu Kenkyusho:Kk Control system and program updating method

Also Published As

Publication number Publication date
JP6165292B1 (en) 2017-07-19

Similar Documents

Publication Publication Date Title
JP6675271B2 (en) Gateway device, in-vehicle network system, and firmware update method
JP6741559B2 (en) Evaluation device, evaluation system, and evaluation method
US11803366B2 (en) Firmware updating system and method
JP7280412B2 (en) GATEWAY DEVICE, IN-VEHICLE NETWORK SYSTEM AND FIRMWARE UPDATE METHOD
CN104426669B (en) Method for the protected transmission of data
TW201929441A (en) System and method for online functional testing for error-correcting code function
US20230409491A1 (en) Memory device with cryptographic kill switch
CN111786820B (en) Firmware updating method and device and network equipment
CN210310316U (en) Autonomous driving controller for vehicle autonomous driving system
EP3565176A1 (en) Data transfer system and transfer method
CN105279441A (en) Methods and architecture for encrypting and decrypting data
CN111095200A (en) Method, device and equipment for safely upgrading embedded program and storage medium
JP2016134671A (en) Data generation device, communication device, communication system, mobile, data generation method and program
JP6165292B1 (en) Program rewriting system and program rewriting method
CN112242903B (en) Hybrid device and method for performing secure boot procedure for hybrid device
EP3979113B1 (en) Secure startup method, target controller, auxiliary controller, control system, vehicle-mounted device, and computer-readable storage medium
CN113204365A (en) Charging pile upgrading method and intelligent charging pile
KR102236282B1 (en) Method and system for authenticating communication data of vehicle
JP6103565B1 (en) Program rewriting system and program rewriting method
CN113542265A (en) Local network security management, device, computer equipment and storage medium
US10359753B2 (en) Program rewriting system and program rewriting method
KR102649908B1 (en) Vehicle communication system, communication method, and storage medium storing communication program
US20240036878A1 (en) Method for booting an electronic control unit
EP4220461A1 (en) Accelerated secure boot for embedded controllers
CN115729123A (en) Control method and device for Electronic Control Unit (ECU)

Legal Events

Date Code Title Description
TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20170523

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20170620

R151 Written notification of patent or utility model registration

Ref document number: 6165292

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250