JP2018109900A - In-vehicle electronic control apparatus and log storing method - Google Patents

In-vehicle electronic control apparatus and log storing method Download PDF

Info

Publication number
JP2018109900A
JP2018109900A JP2017000648A JP2017000648A JP2018109900A JP 2018109900 A JP2018109900 A JP 2018109900A JP 2017000648 A JP2017000648 A JP 2017000648A JP 2017000648 A JP2017000648 A JP 2017000648A JP 2018109900 A JP2018109900 A JP 2018109900A
Authority
JP
Japan
Prior art keywords
event
order
log
occurrence
electronic control
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
JP2017000648A
Other languages
Japanese (ja)
Other versions
JP6735683B2 (en
Inventor
ハイロ ロペス
Lopez Jairo
ハイロ ロペス
拓 下沢
Taku Shimosawa
拓 下沢
朋仁 蛯名
Tomohito Ebina
朋仁 蛯名
一 芹沢
Hajime Serizawa
一 芹沢
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.)
Hitachi Astemo Ltd
Original Assignee
Hitachi Automotive Systems Ltd
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 Hitachi Automotive Systems Ltd filed Critical Hitachi Automotive Systems Ltd
Priority to JP2017000648A priority Critical patent/JP6735683B2/en
Publication of JP2018109900A publication Critical patent/JP2018109900A/en
Application granted granted Critical
Publication of JP6735683B2 publication Critical patent/JP6735683B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide an in-vehicle electronic control apparatus and a log storing method capable of reducing a storage area required for recording an event.SOLUTION: An in-vehicle electronic control apparatus 100 has a log area 122 in which a log of an event that has occurred is recorded, a storage unit 112 for storing pattern information 112A including a normal order which is an occurrence order of normal events and a character string corresponding to the normal order, and a compression unit for compressing the log by recording the character string in place of the normal order in the log area.SELECTED DRAWING: Figure 2

Description

本発明は、車載電子制御装置、およびログ格納方法に関する。   The present invention relates to an on-vehicle electronic control device and a log storage method.

近年の車両には多数の電子機器が搭載される。車両に発生する不具合の原因を究明するためには、それら電子機器の動作の記録であるログを解析することが肝要である。特許文献1には、車両運転中の操作状況及び車両状況の一方または双方を含む運転状況情報を取得する運転状況情報取得部と、車両主電源のONからOFFまでの期間において取得される前記運転状況情報の少なくとも一部のデータからなる車両運転ログを順次生成するログ生成部と、前記運転状況情報を用いて、前記ログ生成部で順次生成された車両運転ログが同一走行に属するものであるかどうかを判定するログ同一性判定部と、前記ログ同一性判定部による判定結果に基づいて前記車両運転ログを連結するログ加工部と、同一走行単位で仕分けられた前記車両運転ログを格納するログ格納部と、を備える車両運転ログ処理システムが開示されている。   Many electronic devices are mounted on recent vehicles. In order to investigate the cause of a problem occurring in a vehicle, it is important to analyze a log that is a record of the operation of these electronic devices. Patent Document 1 discloses a driving status information acquisition unit that acquires driving status information including one or both of an operating status and a vehicle status during driving of the vehicle, and the driving acquired during a period from ON to OFF of the vehicle main power source. A log generation unit that sequentially generates a vehicle driving log including at least a part of the situation information, and a vehicle driving log that is sequentially generated by the log generation unit using the driving status information belongs to the same travel. A log identity determination unit for determining whether or not, a log processing unit for connecting the vehicle operation logs based on a determination result by the log identity determination unit, and the vehicle operation log sorted in the same travel unit A vehicle operation log processing system including a log storage unit is disclosed.

特開2010−152687号公報JP 2010-152687 A

特許文献1に記載されている発明では、イベントの記録に要する記憶領域を削減することができない。   In the invention described in Patent Document 1, the storage area required for event recording cannot be reduced.

本発明の第1の態様による車載電子制御装置は、発生したイベントのログが記録されるログ領域と、正常時の前記イベントの発生順序である正常順序、および前記正常順序に対応する文字列を含むパターン情報が格納される記憶部と、前記正常順序に代えて前記文字列を前記ログ領域に記録することで前記ログを圧縮する圧縮部とを備える。
本発明の第2の態様によるログ格納方法は、発生したイベントのログが記録されるログ領域と、正常時の前記イベントの発生順序である正常順序および前記正常順序に対応する文字列を含むパターン情報が格納される記憶部と、を備える車載電子制御装置において実行されるログ格納方法であって、前記車載電子制御装置が前記正常順序に代えて前記文字列を前記ログ領域に記録することでログを圧縮する。
The on-vehicle electronic control device according to the first aspect of the present invention includes a log area in which a log of an event that has occurred is recorded, a normal order that is the occurrence order of the event at normal time, and a character string corresponding to the normal order. A storage unit storing pattern information to be included, and a compression unit that compresses the log by recording the character string in the log area instead of the normal order.
The log storage method according to the second aspect of the present invention includes a pattern including a log area in which a log of an event that has occurred is recorded, a normal order that is the order of occurrence of the event at normal time, and a character string corresponding to the normal order A storage unit for storing information, and a log storage method executed in an in-vehicle electronic control device, wherein the in-vehicle electronic control device records the character string in the log area instead of the normal order. Compress the log.

本発明によれば、イベントの記録に要する記憶領域を削減することができる。   According to the present invention, the storage area required for event recording can be reduced.

ECUのハードウエア構成を示す図The figure which shows the hardware constitutions of ECU 第1の実施の形態におけるECUの機能構成を示す図The figure which shows the function structure of ECU in 1st Embodiment. イベント情報の一例を示す図The figure which shows an example of event information 第1の実施の形態におけるパターン情報の一例を示す図The figure which shows an example of the pattern information in 1st Embodiment 一時バッファの一例を示す図Diagram showing an example of a temporary buffer ログ領域の一例を示す図Figure showing an example of the log area 第1の実施の形態におけるパターン認識部の動作例を示す図The figure which shows the operation example of the pattern recognition part in 1st Embodiment 第1の実施の形態におけるECUの動作を示すフローチャートThe flowchart which shows operation | movement of ECU in 1st Embodiment. 第1の実施の形態におけるECUの動作を示すフローチャートThe flowchart which shows operation | movement of ECU in 1st Embodiment. 変形例1におけるパターン情報の一例を示す図The figure which shows an example of the pattern information in the modification 1 変形例2においてツリー形式で記録される正常順序の一例を示す図The figure which shows an example of the normal order recorded in a tree format in the modification 2 第2の実施の形態におけるECUの機能構成を示す図The figure which shows the function structure of ECU in 2nd Embodiment. 第3の実施の形態におけるECUの機能構成を示す図The figure which shows the function structure of ECU in 3rd Embodiment. 時刻差バッファの一例を示す図The figure which shows an example of a time difference buffer 第3の実施の形態におけるECUの動作を示すフローチャートThe flowchart which shows operation | movement of ECU in 3rd Embodiment. 第3の実施の形態におけるECUの動作を示すフローチャートThe flowchart which shows operation | movement of ECU in 3rd Embodiment. 第3の実施の形態における動作例を示す図The figure which shows the operation example in 3rd Embodiment

―第1の実施の形態―
以下、図1〜図9を参照して、車載電子制御装置であるECUの第1の実施の形態を説明する。本発明に係るECUは、車両に搭載される。以下では1台のECUについて説明するが、車両に搭載されるECUの数はこれに限定されない。
-First embodiment-
Hereinafter, a first embodiment of an ECU that is an in-vehicle electronic control device will be described with reference to FIGS. The ECU according to the present invention is mounted on a vehicle. Hereinafter, one ECU will be described, but the number of ECUs mounted on the vehicle is not limited to this.

(ECUのハードウエア構成)
図1は、第1の実施の形態にかかるECU100のハードウエア構成を示す図である。ECU100は、CPU11と、ROM12と、RAM13と、不揮発性メモリ14とを備える。CPU11は、ROM12および不揮発性メモリ14に格納されるプログラムをRAM13に展開して実行する。ROM12には変更が不要なプログラム、およびプログラムが使用する定数、たとえばタイムアウトを規定する情報などが格納される。RAM13は揮発性メモリであり、プログラムの展開やプログラムが使用する一時的な情報の格納に使用される。不揮発性メモリ14は電源供給が断たれても情報の記憶が継続される記憶領域であり、プログラムの動作ログや更新される可能性があるプログラム、たとえばオペレーティングシステム(OS)などが格納される。
(ECU hardware configuration)
FIG. 1 is a diagram illustrating a hardware configuration of the ECU 100 according to the first embodiment. The ECU 100 includes a CPU 11, a ROM 12, a RAM 13, and a nonvolatile memory 14. The CPU 11 develops a program stored in the ROM 12 and the nonvolatile memory 14 in the RAM 13 and executes it. The ROM 12 stores a program that does not need to be changed and constants used by the program, for example, information that defines a timeout. The RAM 13 is a volatile memory and is used for program development and temporary information storage used by the program. The nonvolatile memory 14 is a storage area in which information is stored even when power supply is cut off, and stores an operation log of the program and a program that may be updated, such as an operating system (OS).

(ECUの機能構成)
図2は、ECU100の機能構成を示す図である。ECU100は、時刻レジスタ111と、パターン認識部112と、イベント情報113と、一時バッファ121と、ログ領域122と、スナップショット領域123とを備える。
(Functional configuration of ECU)
FIG. 2 is a diagram illustrating a functional configuration of the ECU 100. The ECU 100 includes a time register 111, a pattern recognition unit 112, event information 113, a temporary buffer 121, a log area 122, and a snapshot area 123.

時刻レジスタ111は、CPU11に内蔵される特定のレジスタである。時刻レジスタ111には現在時刻を示す情報、たとえば「2016年1月2日3時45分6.7890123456秒」が格納される。時刻レジスタ111に格納される値は、CPU11に内蔵される発振子の動作に基づき更新されており、CPU11が実行するプログラムは時刻レジスタ111を参照することで現在時刻を取得できる。   The time register 111 is a specific register built in the CPU 11. The time register 111 stores information indicating the current time, for example, “January 2, 2016 3: 45: 6.7890123456 seconds”. The value stored in the time register 111 is updated based on the operation of the oscillator built in the CPU 11, and the program executed by the CPU 11 can acquire the current time by referring to the time register 111.

パターン認識部112は、イベントの発生の順番を認識して予め定められたパターンと一致するか否かを判断し、予め定められたパターンと一致すると判断すると該当するパターンに対応する識別子(以下、「パターン識別子」と呼ぶ)を提供する。この予め定められたパターンおよび各パターンに対応する識別子は、パターン情報112AとしてROM12または不揮発性メモリ14に保存される。パターン情報112Aには、パターンに含まれる各イベントについて、直前のイベント発生から当該イベントが発生するまでの想定される時間間隔も保存される。パターン情報112Aの一例は後述する。本実施の形態では、パターン情報112Aに保存されるイベントのパターンは全て、想定される正常なイベントの順序(以下、「正常順序」と呼ぶ)である。さらにパターン認識部112は、不図示の報知部を備え、異常を検出すると報知部を用いて異常の発生を報知する。この報知部は、ECU100に接続される他の機器と通信を行い異常を報知してもよいし、RAM13や不揮発性メモリ14に異常の発生を記録することにより異常を報知してもよい。   The pattern recognizing unit 112 recognizes the order of occurrence of events and determines whether or not the pattern matches a predetermined pattern. If the pattern recognition unit 112 determines that the pattern matches the predetermined pattern, an identifier corresponding to the corresponding pattern (hereinafter, “ Called "Pattern Identifier"). The predetermined pattern and the identifier corresponding to each pattern are stored in the ROM 12 or the nonvolatile memory 14 as the pattern information 112A. In the pattern information 112A, for each event included in the pattern, an assumed time interval from the occurrence of the previous event to the occurrence of the event is also stored. An example of the pattern information 112A will be described later. In the present embodiment, all the event patterns stored in the pattern information 112A are assumed to be the normal event order (hereinafter referred to as “normal order”). Furthermore, the pattern recognition unit 112 includes a not-illustrated notification unit, and when an abnormality is detected, the pattern recognition unit 112 notifies the occurrence of the abnormality using the notification unit. The notification unit may communicate with other devices connected to the ECU 100 to notify the abnormality, or may notify the abnormality by recording the occurrence of the abnormality in the RAM 13 or the nonvolatile memory 14.

イベント情報113には、複数のイベントについて、イベントの識別子であるイベントIDとそのイベントの識別情報とが関連付けて保存される。イベント情報113は、不揮発性メモリ14に確保される記憶領域である。イベント情報113の一例は後述する。   In the event information 113, for a plurality of events, an event ID that is an identifier of the event and identification information of the event are stored in association with each other. The event information 113 is a storage area secured in the nonvolatile memory 14. An example of the event information 113 will be described later.

一時バッファ121は、イベントの識別情報とイベントの発生時刻が一時的に記録される領域である。ただしイベントの識別情報に代えてイベントIDが記録されてもよい。一時バッファ121はRAM13に確保された領域である。詳しくは後述するが、一時バッファ121に記録されるイベントはパターン情報112Aに記載されたいずれかのパターンと一致する可能性があるイベントである。一時バッファ121に記録されたイベントの情報は、そのまま、または置換されてログ領域122に記録される。そしてイベントの情報がログ領域122に記録されると、一時バッファ121に記録されていたそのイベントの情報は消去される。一時バッファ121の一例は後述する。   The temporary buffer 121 is an area in which event identification information and event occurrence time are temporarily recorded. However, an event ID may be recorded instead of the event identification information. The temporary buffer 121 is an area secured in the RAM 13. As will be described in detail later, the event recorded in the temporary buffer 121 is an event that may match any of the patterns described in the pattern information 112A. The event information recorded in the temporary buffer 121 is recorded in the log area 122 as it is or after being replaced. When event information is recorded in the log area 122, the event information recorded in the temporary buffer 121 is deleted. An example of the temporary buffer 121 will be described later.

ログ領域122は、イベントの識別情報とイベントの発生時刻が記録される領域である。ただしイベントの識別情報に代えてイベントIDやパターン識別子が記録されてもよい。ログ領域122は不揮発性メモリ14に確保された領域である。ログ領域122に記録されたイベントの情報は、不図示のインタフェースを介してECU100の外部に読みだされる。ログ領域122の一例は後述する。   The log area 122 is an area in which event identification information and event occurrence time are recorded. However, an event ID or a pattern identifier may be recorded instead of the event identification information. The log area 122 is an area secured in the nonvolatile memory 14. The event information recorded in the log area 122 is read outside the ECU 100 via an interface (not shown). An example of the log area 122 will be described later.

スナップショット領域123は、ECU100の異常が検知された際のECU100の動作状態が記録される領域である。記録されるECU100の動作状態には、ログ領域122に記録される情報が含まれる。   The snapshot area 123 is an area where the operation state of the ECU 100 when an abnormality of the ECU 100 is detected is recorded. The recorded operation state of the ECU 100 includes information recorded in the log area 122.

(イベント情報)
図3は、イベント情報113の一例を示す図である。イベント情報113はたとえば複数のレコードから構成され、各レコードはイベントの識別子であるイベントIDが格納されるフィールドとイベント識別情報が格納されるフィールドとを有する。イベント情報113のレコード数、すなわちイベント情報113に記録されるイベントの数に制限はない。イベントIDはたとえば1文字のアルファベットであり、本実施の形態では6つのイベントに、A,B,C,X,Y,Zを割り当てる。イベント識別情報は、イベントを識別する様々な情報である。換言すると本実施の形態における「イベント」とは、イベント情報113を用いて識別される事象である。
(event information)
FIG. 3 is a diagram illustrating an example of the event information 113. The event information 113 is composed of, for example, a plurality of records, and each record has a field in which an event ID that is an event identifier is stored and a field in which event identification information is stored. There is no limit to the number of records in the event information 113, that is, the number of events recorded in the event information 113. The event ID is, for example, a one-letter alphabet. In the present embodiment, A, B, C, X, Y, and Z are assigned to six events. The event identification information is various information for identifying an event. In other words, the “event” in the present embodiment is an event identified using the event information 113.

イベント識別情報の構成は限定されないが、たとえばイベントの種別を表すイベントプロパティとパラメータ値を表すイベントパラメータの組み合わせでもよい。イベントプロパティはたとえば、CANフレームの受信、プログラム中の変数の特定値への一致などである。イベントパラメータはたとえば、イベントプロパティがCANフレームの受信である場合に、CANIDの値とデータフィールドに格納される値の組み合わせである。なお以下の説明では、イベントIDがAのイベントを、イベントAなどとも呼ぶ。CPU11は、CPU11の内部の情報、およびRAM13や不揮発性メモリ14に格納された情報にアクセスできるので、イベントの発生時にイベント識別情報を取得できる。   The configuration of the event identification information is not limited, but may be a combination of an event property representing an event type and an event parameter representing a parameter value, for example. The event property is, for example, reception of a CAN frame, matching to a specific value of a variable in the program, or the like. The event parameter is, for example, a combination of a CANID value and a value stored in the data field when the event property is reception of a CAN frame. In the following description, an event whose event ID is A is also referred to as event A or the like. Since the CPU 11 can access information inside the CPU 11 and information stored in the RAM 13 and the nonvolatile memory 14, the event identification information can be acquired when an event occurs.

(パターン情報)
図4は、パターン情報112Aの一例を示す図である。パターン情報112Aはたとえば複数のレコードから構成され、各レコードはあらかじめ定められたイベントの発生順番およびイベントの発生する時間間隔である置換前情報が格納されるフィールドと、イベントのパターンに対応する識別子である置換後情報が格納されるフィールドとを有する。パターン情報112Aのレコード数および各レコードにおけるパターンを構成するイベント数に制限はない。
(Pattern information)
FIG. 4 is a diagram illustrating an example of the pattern information 112A. The pattern information 112A is composed of, for example, a plurality of records. Each record is a field in which pre-replacement information, which is a predetermined order of event occurrence and an event occurrence time interval, is stored, and an identifier corresponding to the event pattern. And a field for storing certain post-replacement information. There are no restrictions on the number of records in the pattern information 112A and the number of events constituting the pattern in each record.

図4に示すように、置換前情報のフィールドには、発生する順番に第1イベント〜第4イベント、および各イベントについて想定される発生の時間間隔が含まれる。パターン情報112Aでは、イベントを識別する情報としてイベント識別情報を用いてもよいが、ここではイベントIDを用いる。たとえば1つ目の例では、想定されるイベントの発生順番は、A,X,Y,Bであり、2つ目の例では、A,X,Cである。そして図4では「想定間隔」のフィールドに各イベントについて想定される発生の時間間隔が記録される。このフィールドに記載される時間の単位は、たとえばナノ秒やマイクロ秒である。   As illustrated in FIG. 4, the pre-replacement information field includes the first event to the fourth event in the order of occurrence, and the occurrence time interval assumed for each event. In the pattern information 112A, event identification information may be used as information for identifying an event, but an event ID is used here. For example, in the first example, the expected event occurrence order is A, X, Y, B, and in the second example, A, X, C. In FIG. 4, the time interval of occurrence assumed for each event is recorded in the field of “assumed interval”. The unit of time described in this field is, for example, nanoseconds or microseconds.

たとえば1つ目の例において、第1イベントのAと第2イベントのXの間に記載された「500」は、イベントAが発生してからイベントXが発生するまでの想定される時間間隔が「500」であることを示している。同様に、イベントXが発生してからイベントYが発生するまでの想定される時間間隔は「2000」であり、イベントYが発生してからイベントBが発生するまでの想定される時間間隔は「300」であることが示されている。置換後情報のフィールドには、同一レコードの置換前情報に合致するイベントのパターンに合致するパターン識別子として、1つ目の例ではPが、2つ目の例ではQが記載される。置換処理の詳細は後述する。   For example, in the first example, “500” described between A of the first event and X of the second event is an estimated time interval from the occurrence of event A to the occurrence of event X. “500”. Similarly, the assumed time interval from the occurrence of event X to the occurrence of event Y is “2000”, and the assumed time interval from the occurrence of event Y to the occurrence of event B is “2000”. 300 ". In the post-replacement information field, P is described in the first example and Q is described in the second example as a pattern identifier that matches the pattern of the event that matches the pre-replacement information of the same record. Details of the replacement process will be described later.

(一時バッファ)
図5は、一時バッファ121一例を示す図である。一時バッファ121はたとえば複数のレコードから構成され、各レコードにはイベントの識別情報、およびイベントが発生した時刻を示すタイムスタンプが格納される。
(Temporary buffer)
FIG. 5 is a diagram illustrating an example of the temporary buffer 121. The temporary buffer 121 is composed of, for example, a plurality of records, and each record stores event identification information and a time stamp indicating the time when the event occurred.

(ログ領域)
図6は、ログ領域122の一例を示す図である。ログ領域122はたとえば複数のレコードから構成され、各レコードにはイベントの識別情報、およびイベントが発生した時刻を示すタイムスタンプが格納される。ただしイベント識別情報の代わりにイベントIDが格納されてもよいし、パターン情報112Aに含まれるパターン識別子が格納されてもよい。
(Log area)
FIG. 6 is a diagram illustrating an example of the log area 122. The log area 122 is composed of, for example, a plurality of records, and each record stores event identification information and a time stamp indicating the time when the event occurred. However, an event ID may be stored instead of the event identification information, or a pattern identifier included in the pattern information 112A may be stored.

(パターン認識部の動作)
パターン認識部112の動作、および動作例を説明する。パターン認識部112は、一時バッファ121に格納されたイベントの順番が、パターン情報112Aに格納されたいずれかのイベントのパターンと一致すると、以下の置換処理を行う。すなわち、それらのイベントIDを対応するパターン識別子に置き換えるとともに、パターンの最後のイベントが発生した時刻を、そのパターン識別子のイベントが発生した時刻とする。またパターン認識部112は、一時バッファ121に格納されたイベントの順番が、パターン情報112Aに格納されたいずれのイベントのパターンとも一致しないが、いずれかのイベントのパターンと途中まで一致する場合には、置換を行わずに報知部を用いて異常の発生を報知する。さらにパターン認識部112は、一時バッファ121に格納されたイベントの順番がパターン情報112Aに格納されたいずれのイベントのパターンともまったく一致しない場合、すなわち一時バッファ121に格納された先頭のイベントがパターン情報112Aに格納されたいずれのパターンの先頭のイベントとも一致しない場合は、置換および報知のいずれも行わない。
(Operation of pattern recognition unit)
An operation and an operation example of the pattern recognition unit 112 will be described. When the order of events stored in the temporary buffer 121 matches one of the event patterns stored in the pattern information 112A, the pattern recognition unit 112 performs the following replacement process. That is, the event ID is replaced with the corresponding pattern identifier, and the time when the last event of the pattern occurs is set as the time when the event of the pattern identifier occurs. Also, the pattern recognition unit 112 does not match the event order stored in the temporary buffer 121 with any event pattern stored in the pattern information 112A, but matches any event pattern halfway. The occurrence of abnormality is notified using the notification unit without performing replacement. Furthermore, the pattern recognition unit 112 determines that the event sequence stored in the temporary buffer 121 does not match the pattern of any event stored in the pattern information 112A at all, that is, the first event stored in the temporary buffer 121 is the pattern information. If it does not match the first event of any pattern stored in 112A, neither replacement nor notification is performed.

図7は、ケース1〜ケース3の3つのケースにおけるパターン認識部112の動作例を示す図である。図7は、各ケースについて、イベント発生状況と全イベント発生後のログ領域122に格納される情報を示している。イベント発生状況の欄には、イベントの発生した順番でイベントIDが記載され、そのイベントの発生が観測された時刻も併記される。なお、いずれのケースも最初のイベントが発生する際には、一時バッファ121には何も記録されていないこととする。また、いずれのケースも最初のイベントが観測された時刻をゼロとする。   FIG. 7 is a diagram illustrating an operation example of the pattern recognition unit 112 in three cases of case 1 to case 3. FIG. 7 shows the event occurrence status and information stored in the log area 122 after the occurrence of all events for each case. In the event occurrence status column, event IDs are described in the order in which the events occurred, and the time when the occurrence of the event was observed is also written. In any case, it is assumed that nothing is recorded in the temporary buffer 121 when the first event occurs. In both cases, the time when the first event is observed is set to zero.

ケース1では、発生したイベントの順番をイベントIDで表すと、「A,X,Y,B,C」である。先頭から4つのイベントがパターン情報112Aにおける1つ目のパターンに合致するので、これら4つのイベントの代わりにパターン識別子Pがログ領域122に記録される。そしてタイムスタンプはこのパターンの最後のイベントであるイベントBが観測された時刻である「2690」が記録される。5つ目のイベントCは、パターン情報112Aのいずれのパターンとも合致しないので、イベントIDおよび観測時刻がそのまま記録される。   In case 1, the order of events that have occurred is represented by event IDs “A, X, Y, B, C”. Since the four events from the top match the first pattern in the pattern information 112A, the pattern identifier P is recorded in the log area 122 instead of these four events. The time stamp records “2690”, which is the time when event B, which is the last event of this pattern, was observed. Since the fifth event C does not match any pattern in the pattern information 112A, the event ID and the observation time are recorded as they are.

ケース2では、発生したイベントの順番をイベントIDで表すと、「A,X,Z」である。このイベントのパターンは、パターン情報112Aのいずれのパターンとも合致しないが、1つ目のパターンと途中までは一致する。具体的には、発生した先頭の2つのイベント「A,X」は、パターン情報112Aの1つ目のパターンである「A,X,Y,B」の先頭の2つと一致する。そのため、全体が一致しないので置換は行われないが、部分的に一致するので異常が報知される。ログ領域122には、発生したイベントのイベントID、および観測時刻がそのまま記載される。   In case 2, the order of events that have occurred is represented by event IDs “A, X, Z”. This event pattern does not match any pattern in the pattern information 112A, but matches the first pattern partway. Specifically, the first two events “A, X” that have occurred coincide with the first two “A, X, Y, B” that is the first pattern of the pattern information 112A. For this reason, since the whole does not match, replacement is not performed, but an abnormality is reported because it partially matches. In the log area 122, the event ID of the event that has occurred and the observation time are described as they are.

ケース3では、イベントCのみが発生した。パターン情報112Aには、イベントCから始まるパターンが存在しないので、パターン認識部112は置換を行わない。そのためログ領域122には、発生したイベントであるイベントC、およびイベントCの観測時刻がそのまま記載される。   In case 3, only event C occurred. Since there is no pattern starting from the event C in the pattern information 112A, the pattern recognition unit 112 does not perform replacement. Therefore, in the log area 122, the event C that has occurred and the observation time of the event C are described as they are.

(フローチャート)
図8および図9は、第1の実施の形態におけるECU100の動作を示すフローチャートである。CPU11は、ECU100において何らかのイベントが発生するたびに図8および図9により動作が表されるプログラムを実行する。以下に説明するフローチャートの各ステップの実行主体は、ECU100のCPU11である。
ステップS302では、CPU11は、発生したイベントを実行する。続くステップS304では、CPU11は時刻レジスタ111から現在時刻を示す情報、すなわちタイムスタンプを取得する。なお以下では、このタイムスタンプにより表される時刻を、「イベントの発生時刻」や「イベントが観測された時刻」とも呼ぶ。続くステップS306において、CPU11はイベント情報113および発生したイベントのイベント識別情報に基づき、発生したイベントのイベントIDを特定する。
(flowchart)
8 and 9 are flowcharts showing the operation of the ECU 100 in the first embodiment. The CPU 11 executes a program whose operation is represented by FIGS. 8 and 9 every time an event occurs in the ECU 100. The execution subject of each step in the flowchart described below is the CPU 11 of the ECU 100.
In step S302, the CPU 11 executes the generated event. In subsequent step S <b> 304, the CPU 11 acquires information indicating the current time, that is, a time stamp, from the time register 111. Hereinafter, the time represented by the time stamp is also referred to as “event occurrence time” or “event observed time”. In subsequent step S306, the CPU 11 specifies the event ID of the event that has occurred based on the event information 113 and the event identification information of the event that has occurred.

続くステップS308では、CPU11は、一時バッファ121に格納されたイベントIDにステップS306において特定したイベントIDを付加したイベントのパターンが、パターン認識部112のいずれかのパターンと前方一致するか否かを判断する。たとえば一時バッファ121に「A,X」が格納され、ステップS306において特定したイベントIDが「Y」の場合には以下のように判断される。すなわち、「A,X」に「Y」を付加した「A,X,Y」は、パターン認識部112の1つ目のパターンである「A,X,Y,B」の先頭の3つと一致するので前方一致検索を肯定判断する。CPU11は、肯定判断する場合はステップS310に進み、否定判断する場合はステップS314に進む。なお、一時バッファ121になにも記録されていない場合は、ステップS306において特定したイベントIDのみを用いた前方一致検索、すなわちステップS306において特定したイベントIDを先頭となるパターンが存在するか否かの判断を行う。   In the subsequent step S308, the CPU 11 determines whether or not the event pattern obtained by adding the event ID specified in step S306 to the event ID stored in the temporary buffer 121 is forwardly matched with any pattern of the pattern recognition unit 112. to decide. For example, when “A, X” is stored in the temporary buffer 121 and the event ID identified in step S306 is “Y”, the following determination is made. That is, “A, X, Y” obtained by adding “Y” to “A, X” matches the first three of “A, X, Y, B” which is the first pattern of the pattern recognition unit 112. Therefore, an affirmative determination is made for the forward match search. If the CPU 11 makes an affirmative determination, the process proceeds to step S310, and if the determination is negative, the CPU 11 proceeds to step S314. If nothing is recorded in the temporary buffer 121, whether or not there is a forward matching search using only the event ID specified in step S306, that is, there is a pattern heading the event ID specified in step S306. Make a decision.

ステップS310では、CPU11はタイムアウトの有無を判断する。すなわち、直前に発生したイベントの発生時刻と今回のイベントの発生時刻との差が、所定の時間よりも長いか否かを判断する。このタイムアウトの時間は、ROM12に格納されていてもよいし、全てのイベントについて同一でもよいし、イベントごとに異なる値が設定されてもよい。ただし本実施の形態では、このタイムアウトの時間とパターン認識部112の想定間隔とは相関がないものとする。CPU11は、タイムアウトが発生していない、すなわち直前に発生したイベントの発生時刻と今回のイベントの発生時刻との差が所定の時間以内であったと判断する場合はステップS312に進み、タイムアウトが発生したと判断する場合はステップS314に進む。   In step S310, the CPU 11 determines whether there is a timeout. That is, it is determined whether or not the difference between the occurrence time of the event that occurred immediately before and the occurrence time of the current event is longer than a predetermined time. The timeout time may be stored in the ROM 12, may be the same for all events, or may be set to a different value for each event. However, in this embodiment, it is assumed that there is no correlation between the timeout time and the assumed interval of the pattern recognition unit 112. If the CPU 11 determines that a timeout has not occurred, that is, the difference between the occurrence time of the event that occurred immediately before and the occurrence time of the current event is within a predetermined time, the CPU 11 proceeds to step S312 and the timeout has occurred. If YES, the process proceeds to step S314.

ステップS312では、CPU11は最新のイベントIDとタイムスタンプ、すなわちステップS306において特定したイベントIDおよびステップS304において取得したタイムスタンプを一時バッファ121に保存して図8および図9により動作が表されるプログラムの実行を終了する。ステップS308またはステップS310において否定判定されると実行されるステップS314では、CPU11は一時バッファ121に何か記録されているか否かを判断する。CPU11は、なにも記録されていないと判断する場合はステップS316に進み、何らかの情報が記録されていると判断する場合は図9のステップS330に進む。ステップS316では、CPU11は最新のイベントIDとタイムスタンプ、すなわちステップS306において特定したイベントIDおよびステップS304において取得したタイムスタンプをログ領域122に保存して図8および図9により動作が表されるプログラムの実行を終了する。   In step S312, the CPU 11 stores the latest event ID and time stamp, that is, the event ID specified in step S306 and the time stamp acquired in step S304 in the temporary buffer 121, and the program whose operation is represented by FIGS. The execution of is terminated. In step S314, which is executed when a negative determination is made in step S308 or step S310, the CPU 11 determines whether something is recorded in the temporary buffer 121 or not. If the CPU 11 determines that nothing is recorded, the process proceeds to step S316. If the CPU 11 determines that some information is recorded, the process proceeds to step S330 in FIG. In step S316, the CPU 11 stores the latest event ID and time stamp, that is, the event ID specified in step S306 and the time stamp acquired in step S304 in the log area 122, and the program whose operation is represented by FIG. 8 and FIG. The execution of is terminated.

図8のステップS314において否定判断されると、図9のステップS330が実行される。このステップS330では、CPU11は、一時バッファ121内のID列、すなわち一時バッファ121に格納されるイベントのパターンが、パターン情報112Aに基づき置換可能か否かを判断する。置換可能と判断する場合はステップS332に進み、置換不可能と判断する場合はステップS340に進む。   If a negative determination is made in step S314 in FIG. 8, step S330 in FIG. 9 is executed. In step S330, the CPU 11 determines whether the ID string in the temporary buffer 121, that is, the event pattern stored in the temporary buffer 121, can be replaced based on the pattern information 112A. If it is determined that replacement is possible, the process proceeds to step S332, and if it is determined that replacement is not possible, the process proceeds to step S340.

ステップS332では、CPU11はステップS330において置換可能と判断された置換により得られるパターン識別子、および置換後のタイムスタンプをログ領域122に保存する。前述のとおり、置換後のタイムスタンプとは該当するパターンに含まれる最後のイベントが発生した時間に対応するタイムスタンプである。続くステップS334では、CPU11は一時バッファを一掃、すなわち一時バッファ121に保存された情報をすべて削除する。続くステップS335では、最新のイベントID、すなわちステップS306において特定したイベントIDがパターン情報112Aに記載されたいずれかのパターンの先頭と一致するか否かを判断する。CPU11は、いずれかのパターンの先頭と一致すると判断する場合はステップS336に進み、いずれとも一致しないと判断する場合はステップS337に進む。ステップS336では、最新のイベントIDとタイムスタンプ、すなわちステップS306において特定したイベントIDおよびステップS304において取得したタイムスタンプを一時バッファ121に保存して図8および図9により動作が表されるプログラムの実行を終了する。ステップS337では、最新のイベントIDとタイムスタンプをログ領域122に保存して図8および図9により動作が表されるプログラムの実行を終了する。   In step S332, the CPU 11 stores the pattern identifier obtained by the replacement determined to be replaceable in step S330 and the time stamp after the replacement in the log area 122. As described above, the time stamp after replacement is a time stamp corresponding to the time when the last event included in the corresponding pattern occurs. In the subsequent step S334, the CPU 11 wipes out the temporary buffer, that is, deletes all the information stored in the temporary buffer 121. In subsequent step S335, it is determined whether or not the latest event ID, that is, the event ID specified in step S306 coincides with the head of any of the patterns described in the pattern information 112A. The CPU 11 proceeds to step S336 when determining that it matches the head of any pattern, and proceeds to step S337 when determining that it does not match any of the patterns. In step S336, the latest event ID and time stamp, that is, the event ID specified in step S306 and the time stamp acquired in step S304 are stored in the temporary buffer 121, and the program whose operation is represented by FIGS. 8 and 9 is executed. Exit. In step S337, the latest event ID and time stamp are stored in the log area 122, and the execution of the program whose operation is represented by FIGS.

ステップS330において否定判断されると実行されるステップS340では、CPU11は、一時バッファ121内の全ての情報をそのままログ領域122に記録し、一時バッファ121内の全ての情報を削除する。続くステップS342では、最新のイベントIDとタイムスタンプ、すなわちステップS306において特定したイベントIDおよびステップS304において取得したタイムスタンプをログ領域122に保存する。続くステップS344では、CPU11は不図示の報知部を用いて異常を報知する。続くステップS346では、CPU11は、ログ領域122に記録されている全ての情報をスナップショット領域123に記録して図8および図9により動作が表されるプログラムの実行を終了する。   In step S340, which is executed when a negative determination is made in step S330, the CPU 11 records all the information in the temporary buffer 121 in the log area 122 as it is, and deletes all the information in the temporary buffer 121. In subsequent step S342, the latest event ID and time stamp, that is, the event ID specified in step S306 and the time stamp acquired in step S304 are stored in the log area 122. In subsequent step S344, the CPU 11 notifies the abnormality using a not-illustrated notification unit. In subsequent step S346, the CPU 11 records all the information recorded in the log area 122 in the snapshot area 123, and ends the execution of the program whose operation is represented by FIGS.

(動作例)
図7に示した各ケースについて、図8〜図9に示したフローチャートにおいてCPU11が行う判断を説明する。ただし以下では主にフローチャートの分岐における判断を説明し、分岐のない箇所の説明は省略する。なお前述のとおり、いずれのケースも最初のイベントが発生する際には、一時バッファ121には何も記録されていない。また、いずれのケースでも図8のステップS310における判断はタイムアウトの発生なし、すなわち肯定判断とする。
(Operation example)
For each case shown in FIG. 7, the determination performed by the CPU 11 in the flowcharts shown in FIGS. 8 to 9 will be described. However, in the following, the determination at the branch of the flowchart will be mainly described, and the description of the part without the branch will be omitted. As described above, nothing is recorded in the temporary buffer 121 when the first event occurs in any case. In any case, the determination in step S310 in FIG. 8 is a time-out occurrence, that is, an affirmative determination.

図7のケース1において、イベントAが発生するとステップS308においてCPU11は肯定判断を行い、ステップS312において一時バッファ121にイベントAとそのタイムスタンプを記録する。イベントX,Y,Bのいずれが発生した場合にも、イベントAの場合と同様の判断がされる。なぜならば、「A」、「A,X」、「A,X,Y」および「A,X,Y,B」のいずれも、図4に示したパターン情報112Aの1つ目のパターンである「A,X,Y,B」を対象とする前方一致検索で肯定判定されるからである。   In the case 1 of FIG. 7, when the event A occurs, the CPU 11 makes an affirmative determination in step S308, and records the event A and its time stamp in the temporary buffer 121 in step S312. When any of events X, Y, and B occurs, the same determination as in event A is made. This is because “A”, “A, X”, “A, X, Y” and “A, X, Y, B” are all the first patterns of the pattern information 112A shown in FIG. This is because an affirmative determination is made in the forward matching search for “A, X, Y, B”.

最後にイベントCが発生すると、CPU11はステップS308において、「A,X,Y,B,C」について「A,X,Y,B」を対象とする前方一致検索で否定判定する。そしてステップS314において一時バッファ121にイベント「A,X,Y,B」が記録されているので否定判定を行ってステップS330に進む。ステップS330ではCPU11は、一時バッファ121に記録されたイベント「A,X,Y,B」が「P」で置換可能なので肯定判断を行いステップS332に進む。ステップS332ではパターン識別子PとイベントBが発生した時刻を示すタイムスタンプをログ領域122に保存し、ステップS334において一時バッファ121内の情報を削除する。そしてステップS335では最新のイベントCはパターン情報112Aのいずれのパターンの先頭にも一致しないのでステップS337に進み、ステップS337においてイベントCとそのタイムスタンプをログ領域122に記録する。   When event C finally occurs, in step S308, CPU 11 makes a negative determination for “A, X, Y, B, C” by a forward matching search for “A, X, Y, B”. In step S314, since the event “A, X, Y, B” is recorded in the temporary buffer 121, a negative determination is made, and the process proceeds to step S330. In step S330, since the event “A, X, Y, B” recorded in the temporary buffer 121 can be replaced with “P”, the CPU 11 makes an affirmative determination and proceeds to step S332. In step S332, the time stamp indicating the time when the pattern identifier P and event B occurred is stored in the log area 122, and the information in the temporary buffer 121 is deleted in step S334. In step S335, since the latest event C does not coincide with the head of any pattern in the pattern information 112A, the process proceeds to step S337, and the event C and its time stamp are recorded in the log area 122 in step S337.

図7のケース2において、イベントAとイベントXが発生した際のCPU11の動作はケース1と同様である。イベントZが発生すると、「A,X,Z」はパターン認識部112のいずれのパターンとも一致しないのでCPU11はステップS308において否定判断を行う。そしてステップS314では一時バッファ121に格納されている情報があるのでCPU11は否定判断を行いステップS330に進む。ステップS330では一時バッファ121内の「A,X」は置換が不可能なのでCPU11は否定判断を行い、ステップS340以下でイベント「A,X,Z」およびそのタイムスタンプをログ領域122に記録する。   In case 2 of FIG. 7, the operation of the CPU 11 when event A and event X occur is the same as in case 1. When the event Z occurs, “A, X, Z” does not match any pattern of the pattern recognition unit 112, so the CPU 11 makes a negative determination in step S 308. In step S314, since there is information stored in the temporary buffer 121, the CPU 11 makes a negative determination and proceeds to step S330. In step S330, since “A, X” in the temporary buffer 121 cannot be replaced, the CPU 11 makes a negative determination, and records the event “A, X, Z” and its time stamp in the log area 122 in step S340 and subsequent steps.

図7のケース3において、CPU11はステップS308を否定判断し、ステップS314を肯定判断し、ステップS316においてイベントCおよびそのタイムスタンプをログ領域122に記録する。   In case 3 of FIG. 7, the CPU 11 makes a negative determination in step S <b> 308, makes a positive determination in step S <b> 314, and records the event C and its time stamp in the log area 122 in step S <b> 316.

上述した第1の実施の形態によれば、次の作用効果が得られる。
(1)車載電子制御装置であるECU100は、発生したイベントのログが記録されるログ領域122と、正常時のイベントの発生順序である正常順序、および正常順序に対応する文字列であるパターン識別子を含むパターン情報112Aが格納される不揮発性メモリ14と、正常順序に代えてパターン識別子をログ領域122に記録することでログを圧縮する圧縮部、すなわちパターン認識部112とを備える。
According to the first embodiment described above, the following operational effects are obtained.
(1) The ECU 100, which is an on-vehicle electronic control device, includes a log area 122 in which a log of an event that has occurred is recorded, a normal order that is a normal event generation order, and a pattern identifier that is a character string corresponding to the normal order. And a compression unit that compresses the log by recording the pattern identifier in the log area 122 instead of the normal order, that is, the pattern recognition unit 112.

正常順序で発生するイベントに関する情報は、障害発生の原因究明において重要度は必ずしも高くないが、正常順序で発生するイベントに関する情報が全く得られなければ原因究明が困難になる。ECU100は、正常順序および正常順序に対応する文字列を記憶するので正常順序を判断できる。さらにECU100は、正常順序そのものを記録する代わりにパターン識別子を記録することで、少ない記憶領域を用いて正常順序でイベントが発生したことを記録することができる。すなわちECU100は、イベントの記録に要する記憶領域を削減することができる。   Information on events that occur in the normal order is not necessarily highly important in investigating the cause of the occurrence of a failure, but it is difficult to find the cause if no information on events that occur in the normal order is obtained. The ECU 100 stores the normal order and the character string corresponding to the normal order, so that the normal order can be determined. Furthermore, the ECU 100 can record the occurrence of events in the normal order using a small storage area by recording the pattern identifier instead of recording the normal order itself. That is, the ECU 100 can reduce the storage area required for event recording.

(2)パターン認識部112は、イベントの発生順序が正常順序に合致しない場合は、ログの圧縮を行わずにイベントをログ領域122に記録する。障害発生の原因究明には、想定される正常な順序で発生するイベントに関する情報よりも、想定しない順序で発生したイベントに関する情報のほうが重要である。そのため、想定しない順序で発生したイベントは圧縮せずにパターン認識部112に記録し、障害の原因究明に役立てることができる。 (2) The pattern recognition unit 112 records the event in the log area 122 without compressing the log when the occurrence order of the event does not match the normal order. For investigating the cause of the occurrence of a failure, information on events that occur in an unexpected order is more important than information on events that occur in an expected normal order. Therefore, events that occur in an unexpected order can be recorded in the pattern recognition unit 112 without being compressed, and can be used for investigating the cause of the failure.

(3)パターン認識部112は、イベントの発生順序が正常順序と完全に一致せず途中まで一致する場合は(図9のステップS330:NO)不図示の報知部を用いて異常の発生を報知する(図9のステップS344)。正常順序と完全に一致せず途中まで一致する場合とは、途中から正常順序と一致しなくなった場合なので、異常の発生が必ずしも明確でない。そのため、報知を行うことにより異常が発生したことを明確にすることができる。 (3) The pattern recognition unit 112 notifies the occurrence of an abnormality using a not-shown notification unit when the event generation order does not completely match the normal order and does not completely match (step S330 in FIG. 9: NO). (Step S344 in FIG. 9). The case where the order does not completely match the normal order but does not match the normal order is not clear because the case where the order does not match the normal order from the middle. Therefore, it can be clarified that abnormality has occurred by performing notification.

(4)パターン認識部112は、イベントが発生するたびに発生したイベントの順序と正常順序との一致判断を行い、正常順序と途中まで一致すると判断すると(図8のステップS308:YES)、一致する範囲を一時的に記憶して(図8のステップS312)次回の一致判断の負荷を軽減する。 (4) Whenever the event occurs, the pattern recognition unit 112 determines whether the order of events that have occurred matches the normal order, and determines that the order matches the normal order (step S308 in FIG. 8: YES). The range to be temporarily stored is stored (step S312 in FIG. 8) to reduce the load of the next match determination.

そのため、パターン認識部112の負荷を平準化してECU100のリアルタイム性を確保することができる。たとえば、一定時間の経過後や所定量のログが蓄積されたた後にパターン情報112Aを参照してまとまった量の置換を行うことも考えられるが、その場合は、蓄積された所定量のログを処理するタイミングでパターン認識部112がECU100の多くのリソースを使用することになる。そのため、そのタイミングでは他のプログラムが使用可能なリソースが減少し、所定の時間内に既定の処理を完了できない恐れ、すなわちリアルタイム性を確保できない恐れがある。前述のようにECU100はリアルタイム性を確保できるので、処理のリアルタイム性が要求される車載用の電子制御装置に適する。   Therefore, the load on the pattern recognition unit 112 can be leveled and the real-time property of the ECU 100 can be ensured. For example, it is conceivable to perform a replacement of a certain amount after referring to the pattern information 112A after a certain amount of time has elapsed or after a predetermined amount of logs has been accumulated. The pattern recognition unit 112 uses many resources of the ECU 100 at the timing of processing. Therefore, at that timing, resources that can be used by other programs are reduced, and there is a possibility that the predetermined processing cannot be completed within a predetermined time, that is, the real-time property may not be ensured. As described above, since the ECU 100 can ensure real-time performance, the ECU 100 is suitable for a vehicle-mounted electronic control device that requires real-time processing.

(変形例1)
パターン情報には、異常時におけるイベントの発生順序である異常順序、および異常順序に対応する異常文字列を含む異常パターン情報が格納されてもよい。異常パターン情報も図4に示したパターン情報112Aと同様に置換前情報と置換後情報から構成される。置換前情報に示されるイベントの順序と発生したイベントの順序が一致すると、ログ領域122にはパターン識別子が記録されるとともに異常検知の報知も行われる。
(Modification 1)
The pattern information may store abnormal pattern information including an abnormal order that is the order of occurrence of events at the time of abnormality and an abnormal character string corresponding to the abnormal order. The abnormal pattern information is also composed of pre-replacement information and post-replacement information, similar to the pattern information 112A shown in FIG. When the order of events indicated in the pre-replacement information matches the order of events that have occurred, a pattern identifier is recorded in the log area 122 and notification of abnormality detection is also performed.

図10は、変形例1におけるパターン情報112Bの一例を示す図である。パターン情報112Bを構成するフィールドは、図4に示したパターン情報112Aと比べて「正常/異常」のフィールドが追加されている。このフィールドは、そのレコードが正常時パターンと異常時パターンのいずれのパターンであるかを示している。すなわち図10に示す例では、図4の例と同じ2つの正常パターンと、1つの異常パターンが示されている。   FIG. 10 is a diagram illustrating an example of the pattern information 112B in the first modification. In the field constituting the pattern information 112B, a “normal / abnormal” field is added as compared with the pattern information 112A shown in FIG. This field indicates whether the record is a normal pattern or an abnormal pattern. That is, in the example shown in FIG. 10, the same two normal patterns and one abnormal pattern as the example of FIG. 4 are shown.

この変形例1によれば、次の作用効果が得られる。
(5)不揮発性メモリ14には、異常時におけるイベントの発生順序である異常順序、および異常順序に対応する異常文字列を含む異常パターン情報が格納される。パターン認識部112は、イベントの発生順序が異常順序に合致する場合は、異常順序に代えて異常文字列をログ領域122に記録するとともに、不図示の報知部を用いて異常の発生を報知する。そのため、発生が想定される異常順序を予め定めておくことにより、ログの記録に要する記憶領域を削減することができる。
According to the first modification, the following operational effects can be obtained.
(5) The non-volatile memory 14 stores abnormal pattern information including an abnormal order that is the order of occurrence of events in the event of an abnormality and an abnormal character string corresponding to the abnormal order. When the event occurrence order matches the abnormal order, the pattern recognition unit 112 records an abnormal character string in the log area 122 instead of the abnormal order, and notifies the occurrence of abnormality using a not-illustrated notification unit. . Therefore, it is possible to reduce the storage area required for log recording by predetermining the abnormal order that is expected to occur.

(変形例2)
上述した第1の実施の形態では、パターン情報112Aに含まれるイベントの発生順番、すなわち置換前情報は、複数のフィールドから構成される表形式で記録されるとした。しかし、トレースが容易なようにツリー形式で記録してもよい。この場合は、パターン認識部112は現在のノード上の位置を記録し、イベントが発生するたびにツリーを1ノードずつ辿るシーケンシャルな検索を行うことで、図8のステップS308および図9のステップS330の判断を行う。
(Modification 2)
In the first embodiment described above, the occurrence order of events included in the pattern information 112A, that is, pre-substitution information is recorded in a table format composed of a plurality of fields. However, it may be recorded in a tree format for easy tracing. In this case, the pattern recognition unit 112 records the current position on the node, and performs a sequential search that traces the tree one node each time an event occurs, whereby step S308 in FIG. 8 and step S330 in FIG. 9 are performed. Make a decision.

図11はツリー形式で記録されるパターン情報112Aの置換前情報の一例を示す図である。図11に示されるイベントの発生順序は、図4に示すパターン情報112Aの例と同一である。図11に示すN1〜N5は、ツリーを構成するノードを識別するために便宜的に付与したものである。図11に示すツリーは、N1を頂点とし図示下方向へ広がる。たとえばN2からはN3またはN5に遷移可能であるが、N3からはN4へしか遷移できない。たとえば、3つのイベントがA,X,Yの順に発生すると、パターン認識部112はツリー上の現在の位置がN3であると認識する。この次にイベントCが発生すると、N3から遷移可能なN4には「C」が格納されていないので遷移不能、すなわち前方一致でないとして図8のステップS308において否定判断を行う。なお同様の判断は、図9のステップS330においても可能である。   FIG. 11 is a diagram showing an example of pre-replacement information of the pattern information 112A recorded in a tree format. The generation order of events shown in FIG. 11 is the same as the example of the pattern information 112A shown in FIG. N1 to N5 shown in FIG. 11 are given for convenience in order to identify the nodes constituting the tree. The tree shown in FIG. 11 spreads downward in the figure with N1 as a vertex. For example, it is possible to transition from N2 to N3 or N5, but from N3 to N4 only. For example, when three events occur in the order of A, X, and Y, the pattern recognition unit 112 recognizes that the current position on the tree is N3. When event C occurs next, “C” is not stored in N4 that can transition from N3, and therefore a negative determination is made in step S308 in FIG. A similar determination can be made in step S330 of FIG.

この変形例2によれば、次の作用効果が得られる。
(6)正常順序はツリー構造のデータベースとして格納され、パターン認識部112は、イベントが発生するたびにツリー構造のデータベースをシーケンシャルに検索する。そのため正常順序における現在の位置に関わらず1回あたりの検索に要する負荷が平準化され、ECU100のリアルタイム性の確保に資する。この効果は正常順序が長いほど顕著である。
According to the second modification, the following operational effects can be obtained.
(6) The normal order is stored as a tree-structured database, and the pattern recognition unit 112 sequentially searches the tree-structured database every time an event occurs. Therefore, the load required for one search is leveled regardless of the current position in the normal order, which contributes to ensuring the real-time property of the ECU 100. This effect becomes more prominent as the normal order is longer.

(変形例3)
上述した第1の実施の形態では、ECU100が異常を検知するとログ領域122に記録されている全ての情報をスナップショット領域123に記録することとしたが(図9のS346)、ECU100の外部にその情報を保存してもよい。またECU100はその情報を同一の車両内に備えられる不図示の診断装置に伝達してもよい。さらにECU100は、異常の検知に基づき何らかの対策、たとえば制動装置の動作を行ってもよい。
(Modification 3)
In the first embodiment described above, when the ECU 100 detects an abnormality, all information recorded in the log area 122 is recorded in the snapshot area 123 (S346 in FIG. 9). The information may be saved. ECU 100 may transmit the information to a diagnostic device (not shown) provided in the same vehicle. Further, the ECU 100 may perform some countermeasure, for example, the operation of the braking device based on the detection of the abnormality.

(変形例4)
上述した第1の実施の形態では、パターン認識部112は置換を行った際にログ領域122に最後のイベントのタイムスタンプを転記した。しかし、全てのイベントのタイムスタンプを転記してもよい。たとえば図7(a)に示したケース1では、イベントPのタイムスタンプを「0,410,2490,2690」として記録してもよい。
(Modification 4)
In the first embodiment described above, the pattern recognition unit 112 transcribes the time stamp of the last event in the log area 122 when replacement is performed. However, the time stamps of all events may be posted. For example, in case 1 shown in FIG. 7A, the time stamp of event P may be recorded as “0, 410, 2490, 2690”.

(変形例5)
上述した第1の実施の形態では、ログ領域122に記録されるイベント識別情報としてイベントIDが用いられた。しかしイベントIDに代えて図4に示すイベント識別情報を用いてもよいし、イベントを識別できる情報であれば図4に記載されていない情報をログ領域122に記録してもよい。本変形例によれば、異常発生時の予期できないイベントをログ領域122に記録することができる。
(Modification 5)
In the first embodiment described above, an event ID is used as event identification information recorded in the log area 122. However, the event identification information shown in FIG. 4 may be used instead of the event ID, or information not shown in FIG. 4 may be recorded in the log area 122 as long as the information can identify the event. According to this modification, an unexpected event when an abnormality occurs can be recorded in the log area 122.

(変形例6)
イベント情報113は、不揮発性メモリ14に直接保存されず、不揮発性メモリ14に格納されるプログラムが実行されることによりRAM12上に作成されてもよい。たとえば不揮発性メモリ14にオペレーティングシステム(OS)が格納され、CPU11がOSを実行するとOSが起動処理の一環としてイベント情報113をRAM12上に作成してもよい。
(Modification 6)
The event information 113 may not be directly saved in the nonvolatile memory 14 but may be created on the RAM 12 by executing a program stored in the nonvolatile memory 14. For example, an operating system (OS) may be stored in the non-volatile memory 14, and when the CPU 11 executes the OS, the OS may create the event information 113 on the RAM 12 as part of the startup process.

(変形例7)
第1の実施の形態では、発生したイベントの順序が正常順序と完全に一致せず途中まで一致する場合のみ異常の発生を報知した。しかし、途中まで一致するか否かに関わらず、正常順序と一致しない場合に異常の発生を報知してもよい。すなわち、図8のステップS316の直前または直後に図9のステップS334およびS346を挿入してもよい。
(Modification 7)
In the first embodiment, the occurrence of an abnormality is notified only when the order of events that have occurred does not completely match the normal order and does not match partway. However, the occurrence of an abnormality may be notified when it does not match the normal order regardless of whether or not it is partially matched. That is, steps S334 and S346 in FIG. 9 may be inserted immediately before or after step S316 in FIG.

(変形例8)
第1の実施の形態では、パターン情報112Aに「想定間隔」のフィールドが含まれなくてもよい。
(Modification 8)
In the first embodiment, the pattern information 112A may not include the “assumed interval” field.

―第2の実施の形態―
図12を参照して、車載電子制御装置であるECUの第2の実施の形態を説明する。以下の説明では、第1の実施の形態と同じ構成要素には同じ符号を付して相違点を主に説明する。特に説明しない点については、第1の実施の形態と同じである。本実施の形態では、主に、CPUがプログラム中でイベントIDを特定する必要がない点で、第1の実施の形態と異なる。第2の実施の形態におけるECUのハードウエア構成は第1の実施の形態と同様なので説明を省略する。ただしROMに格納されるプログラムが第1の実施の形態と異なる。
-Second embodiment-
With reference to FIG. 12, a second embodiment of an ECU that is an in-vehicle electronic control device will be described. In the following description, the same components as those in the first embodiment are denoted by the same reference numerals, and different points will be mainly described. Points that are not particularly described are the same as those in the first embodiment. This embodiment differs from the first embodiment mainly in that the CPU does not need to specify an event ID in the program. Since the hardware configuration of the ECU in the second embodiment is the same as that of the first embodiment, description thereof is omitted. However, the program stored in the ROM is different from that in the first embodiment.

(ECUの機能構成)
図12は、第2の実施の形態におけECU100Aの機能構成を示す図である。ECU100Aは、第1の実施の形態における構成からイベント情報113が除かれている。本実施の形態では、発生するすべてのイベントにイベントIDが付されるのでイベント情報113が不要である。イベントIDは、たとえば不揮発性メモリ14に格納されるOSにより付与される。
(Functional configuration of ECU)
FIG. 12 is a diagram illustrating a functional configuration of the ECU 100A in the second embodiment. In the ECU 100A, the event information 113 is removed from the configuration in the first embodiment. In the present embodiment, event IDs are not required because event IDs are assigned to all events that occur. The event ID is given by the OS stored in the nonvolatile memory 14, for example.

(ECUの動作)
第2の実施の形態におけるECU100Aの動作は、以下の点を除き第1の実施の形態と同様である。すなわち、第2の実施の形態におけるCPU11は、第1の実施の形態の図8におけるステップS306を実行しなくてよい。
(ECU operation)
The operation of the ECU 100A in the second embodiment is the same as that of the first embodiment except for the following points. That is, the CPU 11 in the second embodiment does not have to execute step S306 in FIG. 8 of the first embodiment.

上述した第2の実施の形態によれば、ECU100Aはイベント情報113を記憶する必要がなく、イベント識別情報に基づきイベントIDを特定しなくてよい。   According to the second embodiment described above, the ECU 100A does not need to store the event information 113, and does not have to specify the event ID based on the event identification information.

―第3の実施の形態―
図13〜図17を参照して、車載電子制御装置であるECUの第3の実施の形態を説明する。以下の説明では、第1の実施の形態と同じ構成要素には同じ符号を付して相違点を主に説明する。特に説明しない点については、第1の実施の形態と同じである。本実施の形態では、主に、イベント情報だけでなくタイムスタンプの圧縮も行う点で、第1の実施の形態と異なる。第3の実施の形態におけるECUのハードウエア構成は第1の実施の形態と同様なので説明を省略する。ただしROMに格納されるプログラムが第1の実施の形態と異なる。
-Third embodiment-
A third embodiment of an ECU that is an in-vehicle electronic control device will be described with reference to FIGS. In the following description, the same components as those in the first embodiment are denoted by the same reference numerals, and different points will be mainly described. Points that are not particularly described are the same as those in the first embodiment. This embodiment differs from the first embodiment mainly in that not only event information but also time stamp compression is performed. Since the hardware configuration of the ECU in the third embodiment is the same as that of the first embodiment, the description thereof is omitted. However, the program stored in the ROM is different from that in the first embodiment.

(ECUの機能構成)
図13は、第3の実施の形態におけECU100Bの機能構成を示す図である。ECU100Bは、第1の実施の形態における構成からイベント情報113が除かれ、時刻差バッファ124が追加されている。時刻差バッファ124はRAM13に確保される一時的な記憶領域であり、後述する2階差分を算出するために用いられる。本実施の形態では、第2の実施の形態と同様に、発生するすべてのイベントにイベントIDが付されるのでイベント情報113が不要である。イベントIDは、たとえば不揮発性メモリ14に格納されるOSにより付与される。
(Functional configuration of ECU)
FIG. 13 is a diagram illustrating a functional configuration of the ECU 100B according to the third embodiment. In the ECU 100B, the event information 113 is removed from the configuration in the first embodiment, and a time difference buffer 124 is added. The time difference buffer 124 is a temporary storage area secured in the RAM 13 and is used to calculate a second-order difference described later. In the present embodiment, as in the second embodiment, event IDs are not required because event IDs are attached to all the events that occur. The event ID is given by the OS stored in the nonvolatile memory 14, for example.

(ECUの動作)
本実施の形態におけるCPU11は、イベントのパターンを置換する場合には、パターンの最後のイベントが発生した時刻のタイムスタンプを記録する代わりに、以下に説明する2階差分を記録する。2階差分とは、現実時刻差と想定時刻差の差である。現実時刻差とは、ある2つのイベントが発生する時刻の差であって現実に観測された時刻の差である。想定時刻差とは、ある2つのイベントが発生する時刻の差であって、想定される時刻の差である。想定時刻差は、予め定められた値であり、ROM12または不揮発性メモリ14に格納される。想定時刻差はたとえばパターン情報112Aに「想定間隔」として記録される。
(ECU operation)
When replacing the event pattern, the CPU 11 in the present embodiment records the second-order difference described below instead of recording the time stamp of the time when the last event of the pattern occurred. The second floor difference is a difference between the actual time difference and the assumed time difference. The actual time difference is the difference between the times when two events occur and is the difference between the actually observed times. The assumed time difference is a difference in time when two events occur, and is a difference in expected time. The assumed time difference is a predetermined value and is stored in the ROM 12 or the nonvolatile memory 14. The assumed time difference is recorded as “assumed interval” in the pattern information 112A, for example.

たとえば、イベントAとイベントBの発生時刻がそれぞれ「2016年1月2日3時00分0.000000000秒」、「2016年1月2日3時01分2.333444555秒」と観測された場合に、現実時刻差は「1分2.333444555秒」である。そして、想定時刻差が「1分2.333444333秒」の場合には、現実時刻差と想定時刻差との差分は「0.000000222秒」である。すなわち、「2.22×10−7秒」または「2.22E−7」と表現できるので、2階差分では現実時刻差に比べてデータ量が少ない。なお、時間分解能が高く、想定時刻差と現実時刻差との差が少ないほど、現実時刻差と2階差分とのデータ量は相違が大きくなる。 For example, when the occurrence times of event A and event B are observed as “January 2, 2016 3: 00: 0.000000000” and “January 2, 2016 3: 01: 2.33344555”, respectively. In addition, the actual time difference is “1 minute 2.333444555”. When the assumed time difference is “1 minute 2.33344333 seconds”, the difference between the actual time difference and the assumed time difference is “0.0000000022 seconds”. That is, since it can be expressed as “2.22 × 10 −7 seconds” or “2.22E-7”, the second-order difference has a smaller data amount than the actual time difference. Note that the higher the time resolution and the smaller the difference between the assumed time difference and the actual time difference, the greater the difference in the data amount between the actual time difference and the second-order difference.

(時刻差バッファ)
図14は、時刻差バッファ124の一例を示す図である。時刻差バッファ124はたとえば複数のレコードから構成され、各レコードはどのイベント同士の間隔であるかを示すイベント間フィールドと、現実に観測される時刻の差である現実時刻差のフィールドと、想定される時刻の差である想定時刻差のフィールドと、現実時刻差フィールドの値と想定時刻差フィールドの値の差が格納される2階差分のフィールドとを有する。
(Time difference buffer)
FIG. 14 is a diagram illustrating an example of the time difference buffer 124. The time difference buffer 124 is composed of, for example, a plurality of records, and each record is assumed to be an inter-event field that indicates an interval between events, and a real time difference field that is a difference between actually observed times. And a second-order difference field in which a difference between the value of the actual time difference field and the value of the assumed time difference field is stored.

図14におけるイベントの発生順番、および現実時刻差は図7(a)に示したケース1の先頭の4つのイベントに基づくものである。すなわち、イベントが発生した順番は「A,X,Y,B」であり、それぞれのタイムスタンプは「0,410,2490,2690」である。そのため、現実時刻差が「410,2080,200」となっている。図13における想定時刻差は、図4に示したパターン情報112Aの想定間隔である「500,2000,300」である。図14に示す2階差分は、現実時刻差の値から想定時刻差の値を減じた値としているので、順に「−90、+80、−100」となっている。   The occurrence order of events and the actual time difference in FIG. 14 are based on the top four events in case 1 shown in FIG. That is, the order in which the events occurred is “A, X, Y, B”, and the respective time stamps are “0, 410, 2490, 2690”. Therefore, the actual time difference is “410, 2080, 200”. The assumed time difference in FIG. 13 is “500, 2000, 300” which is the assumed interval of the pattern information 112A shown in FIG. The second-order difference shown in FIG. 14 is a value obtained by subtracting the value of the assumed time difference from the value of the actual time difference, and thus is “−90, +80, −100” in order.

(フローチャート)
図15および図16は、第3の実施の形態におけるECU100Bの動作を示すフローチャートである。ただし第1の実施の形態と共通する動作には同一のステップ番号を付して説明を省略する。CPU11は、ECU100Bにおいて何らかのイベントが発生するたびに図15および図16により動作が表されるプログラムを実行する。以下に説明するフローチャートの各ステップの実行主体は、ECU100BのCPU11である。
(flowchart)
15 and 16 are flowcharts showing the operation of the ECU 100B in the third embodiment. However, the operation common to the first embodiment is denoted by the same step number and the description thereof is omitted. The CPU 11 executes a program whose operation is represented by FIGS. 15 and 16 every time an event occurs in the ECU 100B. The execution subject of each step in the flowchart described below is the CPU 11 of the ECU 100B.

CPU11は、イベントが発生するとイベントを実行し(ステップS302)、時刻レジスタ111からタイムスタンプを取得する。次にステップS308を実行し、肯定判断をするとステップS310に、否定判断をするとステップS314に進む。ステップS310では肯定判断をするとステップS400に進み、否定判断をするとステップS314に進む。ステップS400では、CPU11は一時バッファ121に何か記録されているか否かを判断する。CPU11は、一時バッファ121に何か記録があると判断する場合はステップS402に進み、一時バッファ121に何も記録されていないと判断する場合はステップS312に進む。ステップS402では、一時バッファ121に記録されている最新のイベントとステップS302において実行したイベントとに対応する想定時刻差をROM12または不揮発性メモリ14から読み込み時刻差バッファ124に書き込む。たとえば一時バッファ121に記録されている最新のイベントがAであり、ステップS302において実行したイベントがXの場合は、パターン情報112Aが図4に示すものである場合は「500」が想定時刻差として時刻差バッファ124に書き込まれる。   When the event occurs, the CPU 11 executes the event (step S302) and obtains a time stamp from the time register 111. Next, step S308 is executed. If an affirmative determination is made, the process proceeds to step S310. If a negative determination is made, the process proceeds to step S314. If an affirmative determination is made in step S310, the process proceeds to step S400, and if a negative determination is made, the process proceeds to step S314. In step S <b> 400, the CPU 11 determines whether something is recorded in the temporary buffer 121. If the CPU 11 determines that there is something recorded in the temporary buffer 121, the process proceeds to step S402. If the CPU 11 determines that nothing is recorded in the temporary buffer 121, the process proceeds to step S312. In step S402, the estimated time difference corresponding to the latest event recorded in the temporary buffer 121 and the event executed in step S302 is read from the ROM 12 or the nonvolatile memory 14 and written to the time difference buffer 124. For example, when the latest event recorded in the temporary buffer 121 is A and the event executed in step S302 is X, if the pattern information 112A is as shown in FIG. It is written in the time difference buffer 124.

続くステップS404では、ステップS402において読みこんだ想定時刻差を用いて2階差分を算出して時刻差バッファ124に記録する。すなわち、まず一時バッファ121に記録されている最新のイベントのタイムスタンプと、ステップS304において取得したタイムスタンプとの差を算出して、時刻差バッファ124の現実時刻差のフィールドに記録する。次に時刻差バッファ124の現実時刻差と想定時刻差の差を算出し、これを2階差分として時刻差バッファ124に書き込む。次にステップS312に進む。   In the subsequent step S404, the second-order difference is calculated using the estimated time difference read in step S402 and recorded in the time difference buffer 124. That is, first, the difference between the time stamp of the latest event recorded in the temporary buffer 121 and the time stamp acquired in step S304 is calculated and recorded in the real time difference field of the time difference buffer 124. Next, the difference between the actual time difference and the assumed time difference in the time difference buffer 124 is calculated, and this difference is written in the time difference buffer 124 as a second-order difference. Next, the process proceeds to step S312.

ステップS400において肯定判断された場合、およびステップS404の次に実行されるステップS312では、最新のイベントIDとタイムスタンプを一時バッファ121に記録する。すなわちステップS302において実行したイベントのイベントIDとステップS304において取得したタイムスタンプを一時バッファ121に記録する。そして図15および図16により動作が表されるプログラムの実行を終了する。   When an affirmative determination is made in step S400, and in step S312 executed after step S404, the latest event ID and time stamp are recorded in the temporary buffer 121. That is, the event ID of the event executed in step S302 and the time stamp acquired in step S304 are recorded in the temporary buffer 121. Then, the execution of the program whose operation is represented by FIGS. 15 and 16 is terminated.

ステップS308、またはステップS310において否定判定されると実行されるステップS314では、CPU11は一時バッファ121に何か記録されているか否かを判断する。CPU11は、何も記録されていないと判断する場合はステップS316に進み、何らかの情報が記録されていると判断する場合は図16のステップS330に進む。ステップS316では、CPU11は最新のイベントIDとタイムスタンプ、すなわちステップS306において特定したイベントIDおよびステップS304において取得したタイムスタンプをログ領域122に保存して図15および図16により動作が表されるプログラムの実行を終了する。   In step S <b> 314 that is executed when a negative determination is made in step S <b> 308 or step S <b> 310, the CPU 11 determines whether something is recorded in the temporary buffer 121. If the CPU 11 determines that nothing is recorded, the process proceeds to step S316, and if it determines that any information is recorded, the process proceeds to step S330 in FIG. In step S316, the CPU 11 stores the latest event ID and time stamp, that is, the event ID specified in step S306 and the time stamp acquired in step S304 in the log area 122, and the program whose operation is represented by FIG. 15 and FIG. The execution of is terminated.

図16のステップS330では、CPU11は、一時バッファ121内のID列、すなわち一時バッファ121に格納されるイベントのパターンが、パターン情報112Aに基づき置換可能か否かを判断する。置換可能と判断する場合はステップS412に進み、置換不可能と判断する場合はステップS340に進む。ステップS412では、CPU11はステップS330において置換可能と判断された置換により得られるパターン識別子、および時刻差バッファ124の2階差分の値をログ領域122に保存する。続くステップS414では、CPU11は一時バッファ121および時刻差バッファ124に保存された情報をすべて削除する。続くステップS335以下の処理は第1の実施の形態と同様であり、最新のイベントIDとタイムスタンプを一時バッファ121またはログ領域122に保存して図15および図16により動作が表されるプログラムの実行を終了する。   In step S330 of FIG. 16, the CPU 11 determines whether or not the ID string in the temporary buffer 121, that is, the event pattern stored in the temporary buffer 121, can be replaced based on the pattern information 112A. If it is determined that the replacement is possible, the process proceeds to step S412. If it is determined that the replacement is not possible, the process proceeds to step S340. In step S412, the CPU 11 stores the pattern identifier obtained by the replacement determined to be replaceable in step S330 and the second-order difference value of the time difference buffer 124 in the log area 122. In the subsequent step S414, the CPU 11 deletes all information stored in the temporary buffer 121 and the time difference buffer 124. The subsequent processing from step S335 is the same as that of the first embodiment. The latest event ID and time stamp are stored in the temporary buffer 121 or the log area 122, and the operation of the program whose operations are represented by FIGS. End execution.

ステップS330において否定判断されると実行されるステップS340では、CPU11は、一時バッファ121内の全ての情報をそのままログ領域122に記録し、一時バッファ121内の全ての情報を削除する。続くステップS416では時刻差バッファ124内の全ての情報を削除してステップS342に進む。ステップS342以降の処理は第1の実施の形態と同様なので説明を省略する。   In step S340, which is executed when a negative determination is made in step S330, the CPU 11 records all the information in the temporary buffer 121 in the log area 122 as it is, and deletes all the information in the temporary buffer 121. In the subsequent step S416, all information in the time difference buffer 124 is deleted, and the process proceeds to step S342. Since the process after step S342 is the same as that of the first embodiment, the description thereof is omitted.

(動作例)
図17は、本動作例におけるイベントの発生状況、および全てのイベントが発生した後にログ領域122に記録される情報を示す図である。先頭の4つのイベントがECU100Bにより観測されると、時刻差バッファ124には図14に示す情報が格納される。そして、最後のイベントCが発生すると、図15のステップS308およびS314において否定判断され、図16のステップS330において肯定判断されるので、ステップS412が実行される。そのためログ領域122にイベント識別情報としてパターン識別子Pが記録され、タイムスタンプとして「−90、+80、−100」が記録される。第1の実施の形態では、図7(a)に示すように置換されるパターンに該当する一連のイベントのうち、最後のイベントの観測時刻に対応するタイムスタンプが記録されたが、第3の実施の形態では各イベントが発生した時間の間隔が記録される。
(Operation example)
FIG. 17 is a diagram showing an event occurrence state in this operation example and information recorded in the log area 122 after all events have occurred. When the first four events are observed by the ECU 100B, the time difference buffer 124 stores information shown in FIG. When the last event C occurs, a negative determination is made in steps S308 and S314 in FIG. 15, and an affirmative determination is made in step S330 in FIG. 16, so step S412 is executed. Therefore, the pattern identifier P is recorded as event identification information in the log area 122, and “−90, +80, −100” is recorded as a time stamp. In the first embodiment, the time stamp corresponding to the observation time of the last event among the series of events corresponding to the pattern to be replaced as shown in FIG. 7A is recorded. In the embodiment, the time interval at which each event occurs is recorded.

上述した第3の実施の形態によれば、次の作用効果が得られる。
(7)パターン情報112Aには、パターン情報に含まれる連続する2つのイベントについてあらかじめ想定された発生時刻の差である想定時刻差、すなわち想定間隔が含まれる。パターン認識部112は、現実の時刻の差であってパターン情報に含まれる連続するイベント同士が発生する時刻の差である現実時刻差を算出し、現実時刻差と想定時刻差との差である2階差分をログ領域にさらに記録する。
そのためECU100Bは、少ない記憶領域を使ってイベントが発生した間隔を記録できる。時刻レジスタ111がカウントする時間の分解能が高く、現実時刻差が想定時刻差に近いほどこの効果は顕著である。
According to the third embodiment described above, the following operational effects can be obtained.
(7) The pattern information 112A includes an assumed time difference that is a difference between occurrence times assumed in advance for two consecutive events included in the pattern information, that is, an assumed interval. The pattern recognition unit 112 calculates a real time difference, which is a difference between actual times and a time between successive events included in the pattern information, and is a difference between the real time difference and the assumed time difference. Further record the second floor difference in the log area.
Therefore, the ECU 100B can record an interval at which an event has occurred using a small storage area. This effect becomes more remarkable as the resolution of the time counted by the time register 111 is higher and the actual time difference is closer to the assumed time difference.

(第3の実施の形態の変形例1)
ECU110Bがイベント情報113を備え、CPU11がイベントIDを特定してもよい。すなわち、図15においてステップS304の次にステップS306を実行してからステップS308に進んでもよい。
(Modification 1 of 3rd Embodiment)
The ECU 110B may include the event information 113, and the CPU 11 may specify the event ID. That is, in FIG. 15, step S306 may be executed after step S304, and then the process may proceed to step S308.

(第3の実施の形態の変形例2)
図16のステップS412において、ログ領域122に時刻差バッファ124の値だけでなく、置換されるイベントのいずれかの観測時刻をあわせて記録してもよい。本変形例によれば、ログ領域122に記録された情報を用いて各イベントが発生した時刻も特定することができる。
(Modification 2 of the third embodiment)
In step S412 of FIG. 16, not only the value of the time difference buffer 124 but also the observation time of any event to be replaced may be recorded in the log area 122 together. According to this modification, the time at which each event has occurred can also be specified using the information recorded in the log area 122.

本発明には以下のログ格納方法も含まれる。
(1)発生したイベントのログが記録されるログ領域と、正常時の前記イベントの発生順序である正常順序および前記正常順序に対応する文字列を含むパターン情報が格納される記憶部と、を備える車載電子制御装置において実行されるログ格納方法であって、前記車載電子制御装置が前記正常順序に代えて前記文字列を前記ログ領域に記録することでログを圧縮するログ格納方法。
(2)上記ログ格納方法において、前記イベントの発生順序が前記正常順序に合致しない場合は、前記車載電子制御装置が前記ログの圧縮を行わずに前記イベントを前記ログ領域に記録するログ格納方法。
(3)上記ログ格納方法において、前記イベントの発生順序が前記正常順序と完全に一致せず途中まで一致する場合は前記車載電子制御装置が異常の発生を報知するログ格納方法。
(4)上記ログ格納方法において、前記イベントが発生するたびに前記車載電子制御装置が発生した前記イベントの順序と前記正常順序との一致判断を行い、前記正常順序と途中まで一致すると判断すると、前記車載電子制御装置が一致する範囲を一時的に記憶するログ格納方法。
(5)上記ログ格納方法において、前記正常順序はツリー構造のデータベースとして格納され、前記イベントが発生するたびに前記車載電子制御装置が前記ツリー構造のデータベースをシーケンシャルに検索するログ格納方法。
(6)上記ログ格納方法において、前記パターン情報には、前記パターン情報に含まれる連続する2つのイベントについてあらかじめ想定された発生時刻の差である想定時刻差が含まれ、前記車載電子制御装置が、前記2つのイベントの現実の発生時刻の差である現実時刻差を算出し、前記現実時刻差と前記想定時刻差との差を前記ログ領域にさらに記録するログ格納方法。
(7)上記ログ格納方法において、前記記憶部には、特定の異常時における前記イベントの発生順序である異常順序、および前記異常順序に対応する異常文字列を含む異常パターン情報がさらに格納され、前記イベントの発生順序が前記異常順序に合致する場合は、前記車載電子制御装置が、前記異常順序に代えて前記異常文字列を前記ログ領域に記録するとともに、異常の発生を報知するログ格納方法。
The present invention also includes the following log storage method.
(1) a log area in which a log of an event that has occurred is recorded, and a storage unit in which pattern information including a normal order that is the occurrence order of the event at a normal time and a character string corresponding to the normal order is stored A log storage method executed in an in-vehicle electronic control device, wherein the in-vehicle electronic control device compresses a log by recording the character string in the log area instead of the normal order.
(2) In the log storage method, when the occurrence order of the events does not match the normal order, the on-vehicle electronic control device records the event in the log area without compressing the log. .
(3) In the log storage method, the vehicle-mounted electronic control device notifies the occurrence of an abnormality when the occurrence order of the events does not completely match the normal order but matches partway.
(4) In the log storage method, each time the event occurs, the in-vehicle electronic control device determines whether the order of the events generated and the normal order match, and determines that the normal order matches halfway, A log storage method for temporarily storing a range in which the in-vehicle electronic control device matches.
(5) In the log storage method, the normal order is stored as a tree-structured database, and the in-vehicle electronic control device sequentially searches the tree-structured database every time the event occurs.
(6) In the log storage method, the pattern information includes an assumed time difference that is a difference between occurrence times assumed in advance for two consecutive events included in the pattern information. A log storage method for calculating a real time difference, which is a difference between actual occurrence times of the two events, and further recording a difference between the real time difference and the assumed time difference in the log area.
(7) In the log storage method, the storage unit further stores abnormal pattern information including an abnormal order that is the order of occurrence of the event at the time of a specific abnormality, and an abnormal character string corresponding to the abnormal order, When the event occurrence order matches the abnormality order, the in-vehicle electronic control device records the abnormality character string in the log area instead of the abnormality order, and notifies the occurrence of abnormality .

ECU100が不図示の入出力インタフェースを備え、必要なときに入出力インタフェースとECU100が利用可能な媒体を介して、他の装置からプログラムが読み込まれてもよい。ここで媒体とは、例えば入出力インタフェースに着脱可能な記憶媒体、または通信媒体、すなわち有線、無線、光などのネットワーク、または当該ネットワークを伝搬する搬送波やディジタル信号、を指す。また、プログラムにより実現される機能の一部または全部がハードウエア回路やFPGAにより実現されてもよい。
上述した各実施の形態および変形例は、それぞれ組み合わせてもよい。
上記では、種々の実施の形態および変形例を説明したが、本発明はこれらの内容に限定されるものではない。本発明の技術的思想の範囲内で考えられるその他の態様も本発明の範囲内に含まれる。
The ECU 100 may include an input / output interface (not shown), and a program may be read from another device via an input / output interface and a medium that can be used by the ECU 100 when necessary. Here, the medium refers to, for example, a storage medium that can be attached to and detached from the input / output interface, or a communication medium, that is, a wired, wireless, or optical network, or a carrier wave or digital signal that propagates through the network. Also, part or all of the functions realized by the program may be realized by a hardware circuit or FPGA.
The above-described embodiments and modifications may be combined.
Although various embodiments and modifications have been described above, the present invention is not limited to these contents. Other embodiments conceivable within the scope of the technical idea of the present invention are also included in the scope of the present invention.

14 … 不揮発性メモリ
112 … パターン認識部
112A、112B … パターン情報
113 … イベント情報
121 … 一時バッファ
122 … ログ領域
123 … スナップショット領域
124 … 時刻差バッファ
14 ... Nonvolatile memory
112 ... Pattern recognition unit 112A, 112B ... Pattern information
113… Event information
121… Temporary buffer
122 ... Log area
123 ... Snapshot area
124 ... Time difference buffer

Claims (14)

発生したイベントのログが記録されるログ領域と、
正常時の前記イベントの発生順序である正常順序、および前記正常順序に対応する文字列を含むパターン情報が格納される記憶部と、
前記正常順序に代えて前記文字列を前記ログ領域に記録することで前記ログを圧縮する圧縮部とを備える車載電子制御装置。
A log area where logs of events that occur are recorded,
A storage unit for storing pattern information including a normal order that is the order of occurrence of the events at a normal time and a character string corresponding to the normal order;
An in-vehicle electronic control device comprising: a compression unit that compresses the log by recording the character string in the log area instead of the normal order.
請求項1に記載の車載電子制御装置において、
前記圧縮部は、前記イベントの発生順序が前記正常順序に合致しない場合は、前記ログの圧縮を行わずに前記イベントを前記ログ領域に記録する車載電子制御装置。
The in-vehicle electronic control device according to claim 1,
The compression unit is an in-vehicle electronic control unit that records the event in the log area without compressing the log when the occurrence order of the event does not match the normal order.
請求項1に記載の車載電子制御装置において、
異常の発生を報知する報知部をさらに備え、
前記圧縮部は、前記イベントの発生順序が前記正常順序と完全に一致せず途中まで一致する場合は前記報知部を用いて異常の発生を報知する車載電子制御装置。
The in-vehicle electronic control device according to claim 1,
It further includes a notification unit that notifies the occurrence of an abnormality,
The compression unit is an in-vehicle electronic control device that uses the notification unit to notify the occurrence of an abnormality when the occurrence order of the events does not completely match the normal order and does not completely match.
請求項1に記載の車載電子制御装置において、
前記圧縮部は、前記イベントが発生するたびに発生した前記イベントの順序と前記正常順序との一致判断を行い、前記正常順序と途中まで一致すると判断すると、一致する範囲を一時的に記憶する車載電子制御装置。
The in-vehicle electronic control device according to claim 1,
The compression unit performs a determination of matching between the order of the events that occur each time the event occurs and the normal order, and if it is determined that the order matches the normal order, temporarily stores the matching range. Electronic control device.
請求項4に記載の車載電子制御装置において、
前記正常順序はツリー構造のデータベースとして格納され、
前記圧縮部は、前記イベントが発生するたびに前記ツリー構造のデータベースをシーケンシャルに検索する車載電子制御装置。
The in-vehicle electronic control device according to claim 4,
The normal order is stored as a tree-structured database,
The compression unit is an on-vehicle electronic control device that sequentially searches the tree-structured database every time the event occurs.
請求項1に記載の車載電子制御装置において、
前記パターン情報には、前記パターン情報に含まれる連続する2つのイベントについてあらかじめ想定された発生時刻の差である想定時刻差が含まれ、
前記圧縮部は、前記2つのイベントの現実の発生時刻の差である現実時刻差を算出し、前記現実時刻差と前記想定時刻差との差を前記ログ領域にさらに記録する車載電子制御装置。
The in-vehicle electronic control device according to claim 1,
The pattern information includes an assumed time difference that is a difference between occurrence times assumed in advance for two consecutive events included in the pattern information,
The in-vehicle electronic control device, wherein the compression unit calculates a real time difference that is a difference between actual occurrence times of the two events, and further records a difference between the real time difference and the assumed time difference in the log area.
請求項1に記載の車載電子制御装置において、
異常の発生を報知する報知部をさらに備え、
前記記憶部には、特定の異常時における前記イベントの発生順序である異常順序、および前記異常順序に対応する異常文字列を含む異常パターン情報がさらに格納され、
前記圧縮部は、前記イベントの発生順序が前記異常順序に合致する場合は、前記異常順序に代えて前記異常文字列を前記ログ領域に記録するとともに、前記報知部を用いて異常の発生を報知する車載電子制御装置。
The in-vehicle electronic control device according to claim 1,
It further includes a notification unit that notifies the occurrence of an abnormality,
The storage unit further stores abnormal pattern information including an abnormal order that is the order of occurrence of the event at the time of a specific abnormality, and an abnormal character string corresponding to the abnormal order,
The compression unit records the abnormal character string in the log area instead of the abnormal order when the occurrence order of the events matches the abnormal order, and notifies the occurrence of abnormality using the notification unit. In-vehicle electronic control device.
発生したイベントのログが記録されるログ領域と、正常時の前記イベントの発生順序である正常順序および前記正常順序に対応する文字列を含むパターン情報が格納される記憶部と、を備える車載電子制御装置において実行されるログ格納方法であって、
前記車載電子制御装置が前記正常順序に代えて前記文字列を前記ログ領域に記録することでログを圧縮するログ格納方法。
An in-vehicle electronic device comprising: a log area in which a log of an event that has occurred is recorded; and a storage unit in which pattern information including a normal order that is the order in which the event occurs and a character string that corresponds to the normal order is stored A log storage method executed in a control device,
A log storage method in which the in-vehicle electronic control device compresses a log by recording the character string in the log area instead of the normal order.
請求項8に記載のログ格納方法において、
前記イベントの発生順序が前記正常順序に合致しない場合は、前記車載電子制御装置が前記ログの圧縮を行わずに前記イベントを前記ログ領域に記録するログ格納方法。
The log storage method according to claim 8,
A log storage method in which the in-vehicle electronic control device records the event in the log area without compressing the log when the event occurrence order does not match the normal order.
請求項8に記載のログ格納方法において、
前記イベントの発生順序が前記正常順序と完全に一致せず途中まで一致する場合は前記車載電子制御装置が異常の発生を報知するログ格納方法。
The log storage method according to claim 8,
A log storage method in which the in-vehicle electronic control device notifies the occurrence of an abnormality when the occurrence order of the events does not completely match the normal order and does not completely match.
請求項8に記載のログ格納方法において、
前記イベントが発生するたびに前記車載電子制御装置が発生した前記イベントの順序と前記正常順序との一致判断を行い、前記正常順序と途中まで一致すると判断すると、前記車載電子制御装置が一致する範囲を一時的に記憶するログ格納方法。
The log storage method according to claim 8,
When the event occurs, the in-vehicle electronic control device performs a match determination between the order of the events generated and the normal order. Log storage method to temporarily store.
請求項11に記載のログ格納方法において、
前記正常順序はツリー構造のデータベースとして格納され、
前記イベントが発生するたびに前記車載電子制御装置が前記ツリー構造のデータベースをシーケンシャルに検索するログ格納方法。
The log storage method according to claim 11,
The normal order is stored as a tree-structured database,
A log storage method in which the in-vehicle electronic control device sequentially searches the tree-structured database every time the event occurs.
請求項8に記載のログ格納方法において、
前記パターン情報には、前記パターン情報に含まれる連続する2つのイベントについてあらかじめ想定された発生時刻の差である想定時刻差が含まれ、
前記車載電子制御装置が、前記2つのイベントの現実の発生時刻の差である現実時刻差を算出し、前記現実時刻差と前記想定時刻差との差を前記ログ領域にさらに記録するログ格納方法。
The log storage method according to claim 8,
The pattern information includes an assumed time difference that is a difference between occurrence times assumed in advance for two consecutive events included in the pattern information,
A log storage method in which the in-vehicle electronic control device calculates a real time difference which is a difference between actual occurrence times of the two events, and further records a difference between the real time difference and the assumed time difference in the log area. .
請求項8に記載のログ格納方法において、
前記記憶部には、特定の異常時における前記イベントの発生順序である異常順序、および前記異常順序に対応する異常文字列を含む異常パターン情報がさらに格納され、
前記イベントの発生順序が前記異常順序に合致する場合は、前記車載電子制御装置が、前記異常順序に代えて前記異常文字列を前記ログ領域に記録するとともに、異常の発生を報知するログ格納方法。
The log storage method according to claim 8,
The storage unit further stores abnormal pattern information including an abnormal order that is the order of occurrence of the event at the time of a specific abnormality, and an abnormal character string corresponding to the abnormal order,
When the event occurrence order matches the abnormality order, the in-vehicle electronic control device records the abnormality character string in the log area instead of the abnormality order, and notifies the occurrence of abnormality .
JP2017000648A 2017-01-05 2017-01-05 In-vehicle electronic control device, log storage method Active JP6735683B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2017000648A JP6735683B2 (en) 2017-01-05 2017-01-05 In-vehicle electronic control device, log storage method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2017000648A JP6735683B2 (en) 2017-01-05 2017-01-05 In-vehicle electronic control device, log storage method

Publications (2)

Publication Number Publication Date
JP2018109900A true JP2018109900A (en) 2018-07-12
JP6735683B2 JP6735683B2 (en) 2020-08-05

Family

ID=62844450

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2017000648A Active JP6735683B2 (en) 2017-01-05 2017-01-05 In-vehicle electronic control device, log storage method

Country Status (1)

Country Link
JP (1) JP6735683B2 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06282468A (en) * 1993-03-30 1994-10-07 Toshiba Corp Information processor
JP2006259811A (en) * 2005-03-15 2006-09-28 Nec Corp Log creating device, and program
JP2009043020A (en) * 2007-08-08 2009-02-26 Nomura Research Institute Ltd Log analysis support device
JP2013086583A (en) * 2011-10-14 2013-05-13 Toyota Motor Corp Vehicle operation history storage device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06282468A (en) * 1993-03-30 1994-10-07 Toshiba Corp Information processor
JP2006259811A (en) * 2005-03-15 2006-09-28 Nec Corp Log creating device, and program
JP2009043020A (en) * 2007-08-08 2009-02-26 Nomura Research Institute Ltd Log analysis support device
JP2013086583A (en) * 2011-10-14 2013-05-13 Toyota Motor Corp Vehicle operation history storage device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
木村 達明 他: "大規模ネットワークの故障診断に向けた監視ログの可視化法", 電子情報通信学会技術研究報告, vol. 第112巻 第463号, JPN6020005895, 28 February 2013 (2013-02-28), JP, pages 495 - 498, ISSN: 0004215980 *

Also Published As

Publication number Publication date
JP6735683B2 (en) 2020-08-05

Similar Documents

Publication Publication Date Title
CN106656536B (en) Method and equipment for processing service calling information
CN109308227B (en) Fault detection control method and related equipment
CN102143008A (en) Method and device for diagnosing fault event in data center
CN111078513A (en) Log processing method, device, equipment, storage medium and log alarm system
JPWO2014049804A1 (en) System operation tracing method in distributed system
CN111177165A (en) Method, device and equipment for detecting data consistency
KR101459868B1 (en) Communication test device and method thereof
CN107357619B (en) Method, device, equipment and storage medium for generating card configuration file
WO2018066661A1 (en) Log analysis method, system, and recording medium
CN109861843B (en) Method, device and equipment for completely collecting and confirming log files
CN110750533A (en) Data storage method, device and equipment based on multiple service attributes
CN109284331B (en) Certificate making information acquisition method based on service data resources, terminal equipment and medium
US8682899B2 (en) Apparatus and method for managing systems each including a plurality of configuration items
CN111897737B (en) Missing detection method and device for program test of micro-service system
JP2018109900A (en) In-vehicle electronic control apparatus and log storing method
US10706207B2 (en) Circuit design verification apparatus and program
CN112463913A (en) Abnormal event discovery method and system
CN115544120A (en) Multi-sensor event generation system, method, electronic device and storage medium
JP2009266031A (en) Computer system and computer
CN111339100B (en) Data checking method and device
CN114141302A (en) Test method of solid state disk and electronic equipment
US10318371B2 (en) Apparatus and method to determine a setting item causing an incident based on action records therefor
JP3498702B2 (en) Computer system and trace information control method used therefor
KR20160043378A (en) Apparatus and method for updating vehicle device having multiple modules
CN115118793B (en) BLF file analysis fault tolerance method and device and computer equipment

Legal Events

Date Code Title Description
RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20170403

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20170927

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20190311

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20200127

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20200218

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20200408

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: 20200707

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20200714

R150 Certificate of patent or registration of utility model

Ref document number: 6735683

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350