JP2019175263A - Log recording device, control method, and program - Google Patents

Log recording device, control method, and program Download PDF

Info

Publication number
JP2019175263A
JP2019175263A JP2018064567A JP2018064567A JP2019175263A JP 2019175263 A JP2019175263 A JP 2019175263A JP 2018064567 A JP2018064567 A JP 2018064567A JP 2018064567 A JP2018064567 A JP 2018064567A JP 2019175263 A JP2019175263 A JP 2019175263A
Authority
JP
Japan
Prior art keywords
time
log
information
time information
communication
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
JP2018064567A
Other languages
Japanese (ja)
Other versions
JP6920738B2 (en
Inventor
英二 杉原
Eiji Sugihara
英二 杉原
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.)
Silex Technology Inc
Original Assignee
Silex Technology Inc
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 Silex Technology Inc filed Critical Silex Technology Inc
Priority to JP2018064567A priority Critical patent/JP6920738B2/en
Publication of JP2019175263A publication Critical patent/JP2019175263A/en
Application granted granted Critical
Publication of JP6920738B2 publication Critical patent/JP6920738B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

To provide a log recording device capable of giving appropriate time information to a log before time synchronization is performed.SOLUTION: A log recording device 10 is provided with: a clock unit 13 which counts time starting from a first point of time; a communication IF 11 which transmits or receives communication data; a generation unit 14 which generates and holds log information including content of the communication data and first time information showing time of the clock unit 13 in transmission or reception by the communication IF 11; and a conversion unit 15 which acquires second time information showing time starting from a second point of time from the outside, compares the acquired second time information with time counted by the clock unit 13, and converts the first time information included in the log information held by the generation unit 14 into third time information starting from the second point of time to record the log information in a recording medium.SELECTED DRAWING: Figure 2

Description

本発明は、ログ記録装置、制御方法、及び、プログラムに関する。   The present invention relates to a log recording device, a control method, and a program.

車両内のネットワークにおける通信データのログを記録するログ記録装置が利用されている。ログ記録装置は、通信データの内容を示す情報と、当該通信データを送信又は受信した時刻を示す時刻情報とを含むログを記録する。   A log recording device that records a log of communication data in a network in a vehicle is used. The log recording device records a log including information indicating the content of communication data and time information indicating the time when the communication data is transmitted or received.

従来、プロセッサからのメッセージをログとして記録するロギングシステムが開示されている(特許文献1)。特許文献1に開示されるロギングシステムは、当該ロギングシステムが備える時計が生成する時刻情報をログに含めて記録する。   Conventionally, a logging system that records a message from a processor as a log is disclosed (Patent Document 1). The logging system disclosed in Patent Literature 1 records time information generated by a clock included in the logging system in a log.

特開2015−95061号公報JP2015-95061A

ところで、車両内のネットワークには複数の通信装置が接続されている。また、このネットワークには、時刻情報を配信する時刻サーバが接続されており、複数の通信装置は、時刻サーバにより配信される時刻情報を受信することによって、時刻同期を図る。   Incidentally, a plurality of communication devices are connected to the network in the vehicle. In addition, a time server that distributes time information is connected to the network, and the plurality of communication devices achieve time synchronization by receiving the time information distributed by the time server.

しかしながら、通信装置は、起動してから、時刻サーバにより配信される時刻情報を受信するまでの間には、時刻同期がなされていない状態になる。この状態で通信装置が通信データのログを記録すると、他の通信装置との同期がなされていない時刻をログに記録することになり、ログに記録される時刻が不正確になるという問題がある。   However, the communication apparatus is in a state in which time synchronization is not performed between the time when the communication apparatus is activated and the time information distributed by the time server is received. When the communication device records a log of communication data in this state, the time that is not synchronized with other communication devices is recorded in the log, and there is a problem that the time recorded in the log becomes inaccurate. .

本発明は、上記問題を解決するためになされたものであり、時刻同期がなされる前のログに適切な時刻情報を付与できるログ記録装置等を提供することを目的とする。   The present invention has been made to solve the above problem, and an object thereof is to provide a log recording device and the like that can give appropriate time information to a log before time synchronization is performed.

上記課題を解決するために、本発明の一態様に係るログ記録装置は、第一時点を起点とした時刻を計時する時計部と、通信データの送信又は受信をする通信インタフェースと、前記通信データの内容と、前記通信インタフェースによる前記送信又は前記受信の時の前記時計部の時刻を示す第一時刻情報とを含むログ情報を生成し、保持する生成部と、第二時点を起点とした時刻を示す第二時刻情報を外部から取得し、取得した前記第二時刻情報と、前記時計部が計時している時刻とを比較して、前記生成部が保持している前記ログ情報に含まれている前記第一時刻情報を、前記第二時点を起点とした第三時刻情報に変換して、前記ログ情報を記録媒体に記録する変換部とを備える。   In order to solve the above-described problem, a log recording apparatus according to an aspect of the present invention includes a clock unit that measures time starting from a first time point, a communication interface that transmits or receives communication data, and the communication data And a generation unit that generates and holds log information including the contents of the first time information indicating the time of the clock unit at the time of transmission or reception by the communication interface, and a time starting from the second time point Is included in the log information held by the generation unit by comparing the acquired second time information and the time measured by the clock unit. And converting the first time information into third time information starting from the second time point, and recording the log information on a recording medium.

これによれば、ログ記録装置は、当該ログ記録装置の外部の時刻サーバから時刻情報を受信する前に生成したログ情報を保持している。そして、外部の時刻サーバから時刻情報を受信したら、過去に遡って、受信した時刻情報に基づいて、保持しているログ情報に含まれる時刻情報を変換する。これにより、外部の時刻サーバから時刻情報を受信する前に生成したログ情報にも、外部の時刻サーバが計時している時刻情報の起点を起点とする時刻情報を付与して記録媒体に記録することができる。このようにして、ログ記録装置は、時刻同期がなされる前のログに適切な時刻情報を付与することができる。   According to this, the log recording device holds log information generated before receiving time information from a time server external to the log recording device. When the time information is received from the external time server, the time information included in the retained log information is converted based on the received time information retroactively. As a result, the time information starting from the starting point of the time information measured by the external time server is also added to the log information generated before receiving the time information from the external time server and recorded on the recording medium. be able to. In this way, the log recording apparatus can give appropriate time information to the log before time synchronization is performed.

また、前記生成部は、前記変換部が第二時刻情報を取得した後に前記通信インタフェースが送信又は受信をした通信データの内容と、前記通信インタフェースによる前記送信又は前記受信の時の前記時計部の時刻を示す第一時刻情報とを含むログ情報を生成し、前記変換部は、前記生成部が生成した前記ログ情報に含まれている前記第一時刻情報を、前記第二時点を起点とした第四時刻情報に変換して、前記ログ情報を記録媒体に記録してもよい。   In addition, the generation unit includes the content of communication data transmitted or received by the communication interface after the conversion unit acquires second time information, and the clock unit at the time of transmission or reception by the communication interface. Log information including first time information indicating a time, and the conversion unit starts the second time point with the first time information included in the log information generated by the generation unit. The log information may be recorded on a recording medium after being converted into fourth time information.

これによれば、ログ記録装置は、外部の時刻サーバから時刻情報を取得した後には、外部の時刻サーバが計時している時刻情報の起点を起点とする時刻情報を付与したログ情報を記録媒体に記録する。よって、ログ記録装置は、時刻同期がなされる前後に亘って適切な時刻情報を付与することができる。   According to this, after acquiring time information from an external time server, the log recording apparatus records log information to which time information is added starting from the start point of the time information timed by the external time server. To record. Therefore, the log recording apparatus can give appropriate time information before and after time synchronization is performed.

また、前記変換部は、前記ログ情報を前記記録媒体内のファイルに記録し、前記第二時刻情報を取得した後に、さらに、新たな第二時刻情報を取得した場合には、前記新たな第二時刻情報を取得した後に前記生成部が生成したログ情報を、前記記録媒体内の新たなファイルに記録してもよい。   Further, the recording unit records the log information in a file in the recording medium, acquires the second time information, and then acquires new second time information. The log information generated by the generation unit after obtaining the two-time information may be recorded in a new file in the recording medium.

これによれば、ログ記録装置は、外部の時刻サーバから新たな時刻情報を取得した場合には、その取得より後のログ情報を新たなファイルに記録する。仮に新たな時刻情報を取得した場合に、その取得の前後で同一のファイルにログ情報を記録するとすれば、一のファイル内に時刻情報の起点が異なるログ情報が混在することになり、一のファイル内のログ情報間での時間差が不正確になったり、ログ情報の順序の逆転が起こったりする。そこで、外部の時刻サーバから新たな時刻情報を取得した場合にログ情報を新たなファイルに記録するようにすることで、上記の時間差の不正確さ、及び、順序の逆転などを回避することができる。よって、ログ記録装置は、ログファイルにおける時間差の不正確さ、及び、順序の逆転などを回避しながら、時刻同期がなされる前のログに適切な時刻情報を付与することができる。   According to this, when new time information is acquired from an external time server, the log recording device records log information after the acquisition in a new file. If new time information is acquired and log information is recorded in the same file before and after the acquisition, log information with different origins of time information will be mixed in one file. The time difference between the log information in the file becomes inaccurate or the order of the log information is reversed. Therefore, when new time information is acquired from an external time server, the log information is recorded in a new file, thereby avoiding the inaccuracy of the time difference and the reverse of the order. it can. Therefore, the log recording device can give appropriate time information to the log before time synchronization is performed while avoiding inaccuracies in the time difference in the log file and reversal of the order.

また、前記変換部は、前記新たなファイル内の先頭に、前記第二時点を起点とした前記新たなファイルの作成時刻を記録してもよい。   Further, the conversion unit may record the creation time of the new file starting from the second time point at the beginning of the new file.

これによれば、ログ記録装置は、ファイル内の先頭の所定の位置にファイルの作成時刻が記録されたファイルを生成する。よって、ログ記録装置が生成したログを利用する装置又はユーザは、ファイル内の所定の位置を読み出すだけでファイルの作成時刻を取得することができる。よって、ログ記録装置は、ファイルの作成時刻を当該ファイルから取得しやすくしながら、時刻同期がなされる前のログに適切な時刻情報を付与することができる。   According to this, the log recording device generates a file in which the creation time of the file is recorded at a predetermined position at the beginning of the file. Therefore, a device or a user who uses the log generated by the log recording device can acquire the creation time of the file simply by reading a predetermined position in the file. Therefore, the log recording device can give appropriate time information to the log before time synchronization is performed while easily obtaining the creation time of the file from the file.

また、前記変換部は、前記通信インタフェースの初期化時から所定時間が経過しても前記第二時刻情報を取得できない場合には、前記変換をすることなく、前記ログ情報を前記記録媒体に記録してもよい。   The conversion unit records the log information on the recording medium without performing the conversion when the second time information cannot be acquired even after a predetermined time has elapsed since the initialization of the communication interface. May be.

これによれば、ログ記録装置は、外部の時刻サーバから時刻情報を取得できない場合には、自装置が計時している時刻情報を付したログ情報を記憶する。よって、ログ記録装置は、時刻同期がなされない場合に時刻情報が付されないログ情報が記録されることを回避することができる。   According to this, when the time information cannot be acquired from the external time server, the log recording device stores the log information with the time information timed by itself. Therefore, the log recording device can avoid recording log information without time information when time synchronization is not performed.

また、前記生成部は、生成した前記ログ情報を記録媒体に記録することで保持し、前記変換部は、前記生成部が前記ログ情報を記録した前記記録媒体から前記ログ情報を読み出して前記変換をしてもよい。   The generation unit holds the generated log information by recording the log information on a recording medium, and the conversion unit reads the log information from the recording medium on which the generation unit has recorded the log information and performs the conversion. You may do.

これによれば、ログ記録装置は、記録媒体を用いることで、より容易に、外部の時刻サーバから時刻情報を受信する前に生成したログ情報を保持することができる。   According to this, the log recording apparatus can hold log information generated before receiving time information from an external time server more easily by using the recording medium.

また、前記通信インタフェースは、車両内のネットワークに前記通信データを送信又は受信してもよい。   The communication interface may transmit or receive the communication data to a network in the vehicle.

これによれば、ログ記録装置は、車両内のネットワークにおいて、時刻同期がなされる前のログに適切な時刻情報を付与することができる。   According to this, the log recording device can give appropriate time information to the log before time synchronization is performed in the network in the vehicle.

また、本発明の一態様に係る制御方法は、ログ記録装置の制御方法であって、第一時点を起点とした時刻を計時する計時ステップと、通信データの送信又は受信をする通信ステップと、前記通信データの内容と、前記通信ステップでの前記送信又は前記受信の時に前記計時ステップで計時された時刻を示す第一時刻情報とを含むログ情報を生成し、保持する生成ステップと、第二時点を起点とした時刻を示す第二時刻情報を外部から取得し、取得した前記第二時刻情報と、前記計時ステップで計時している時刻とを比較して、前記生成ステップで保持した前記ログ情報に含まれている前記第一時刻情報を、前記第二時点を起点とした第三時刻情報に変換して、前記ログ情報を記録媒体に記録する変換ステップとを含む。   Further, the control method according to one aspect of the present invention is a method for controlling a log recording apparatus, a time measuring step for measuring a time starting from the first time point, a communication step for transmitting or receiving communication data, A generation step of generating and holding log information including the content of the communication data and first time information indicating the time measured in the time measurement step at the time of transmission or reception in the communication step; The second time information indicating the time starting from the time is acquired from the outside, the acquired second time information is compared with the time measured in the time measuring step, and the log held in the generation step Converting the first time information included in the information into third time information starting from the second time point, and recording the log information on a recording medium.

これにより、上記ログ記録装置と同様の効果を奏する。   Thereby, there exists an effect similar to the said log recording apparatus.

また、本発明の一態様に係るプログラムは、上記のログ記録装置の制御方法をコンピュータに実行させるためのプログラムである。   A program according to an aspect of the present invention is a program for causing a computer to execute the control method of the log recording device.

これにより、上記ログ記録装置と同様の効果を奏する。   Thereby, there exists an effect similar to the said log recording apparatus.

なお、本発明は、装置として実現できるだけでなく、その装置を構成する処理手段をステップとする方法として実現したり、それらステップをコンピュータに実行させるプログラムとして実現したり、そのプログラムを記録したコンピュータ読み取り可能なCD−ROMなどの記録媒体として実現したり、そのプログラムを示す情報、データ又は信号として実現したりすることもできる。そして、それらプログラム、情報、データ及び信号は、インターネット等の通信ネットワークを介して配信してもよい。   Note that the present invention can be realized not only as an apparatus but also as a method using steps as processing units constituting the apparatus, as a program for causing a computer to execute the steps, or as a computer read recording the program. It can also be realized as a possible recording medium such as a CD-ROM, or as information, data or a signal indicating the program. These programs, information, data, and signals may be distributed via a communication network such as the Internet.

本発明により、ログ記録装置は、時刻同期がなされる前のログに適切な時刻情報を付与することができる。   According to the present invention, the log recording apparatus can give appropriate time information to a log before time synchronization is performed.

図1は、実施の形態に係る通信システムの構成を示す説明図である。FIG. 1 is an explanatory diagram illustrating a configuration of a communication system according to an embodiment. 図2は、実施の形態に係るログ記録装置の構成を示すブロック図である。FIG. 2 is a block diagram illustrating a configuration of the log recording apparatus according to the embodiment. 図3は、ログ記録装置がネットワークから取得する時刻情報を含むフレームの説明図である。FIG. 3 is an explanatory diagram of a frame including time information acquired from the network by the log recording apparatus. 図4は、実施の形態に係るログ情報を記録したファイルの内容を示す説明図である。FIG. 4 is an explanatory diagram showing the contents of a file in which log information according to the embodiment is recorded. 図5は、実施の形態に係る変換部による時刻情報の変換方法を示す説明図である。FIG. 5 is an explanatory diagram illustrating a method of converting time information by the conversion unit according to the embodiment. 図6は、実施の形態に係るログ記録装置が外部から取得した時刻情報を用いてログを記録する処理を示すフロー図である。FIG. 6 is a flowchart showing a process of recording a log using time information acquired from the outside by the log recording apparatus according to the embodiment. 図7は、実施の形態に係る、ログ記録装置が外部から時刻情報を取得した後にログを記録する処理を示すフロー図である。FIG. 7 is a flowchart showing a process of recording a log after the log recording apparatus acquires time information from the outside according to the embodiment.

以下、実施の形態について、図面を参照しながら具体的に説明する。   Hereinafter, embodiments will be specifically described with reference to the drawings.

以下で説明する実施の形態は、いずれも本発明の好ましい一具体例を示すものである。以下の実施の形態で示される数値、形状、材料、構成要素、構成要素の配置位置及び接続形態、ステップ、ステップの順序などは、一例であり、本発明を限定する主旨ではない。また、以下の実施の形態における構成要素のうち、本発明の最上位概念を示す独立請求項に記載されていない構成要素については、より好ましい形態を構成する任意の構成要素として説明される。なお、同一の構成要素には同一の符号を付し、説明を省略する場合がある。   Each of the embodiments described below shows a preferred specific example of the present invention. The numerical values, shapes, materials, constituent elements, arrangement positions and connecting forms of the constituent elements, steps, order of steps, and the like shown in the following embodiments are merely examples, and are not intended to limit the present invention. In addition, among the constituent elements in the following embodiments, constituent elements that are not described in the independent claims indicating the highest concept of the present invention are described as optional constituent elements that constitute a more preferable embodiment. In addition, the same code | symbol is attached | subjected to the same component and description may be abbreviate | omitted.

(実施の形態)
本実施の形態において、時刻同期がなされる前のログに適切な時刻情報を付与できるログ記録装置について説明する。
(Embodiment)
In this embodiment, a log recording apparatus that can give appropriate time information to a log before time synchronization is described.

図1は、本実施の形態に係る通信システム1の構成を示す説明図である。通信システム1は、例えば、車両内に配備されるネットワークであるCAN(Controller Area Network)に接続され、CANプロトコルによって制御される通信システムである。   FIG. 1 is an explanatory diagram showing a configuration of a communication system 1 according to the present embodiment. The communication system 1 is a communication system that is connected to a CAN (Controller Area Network), which is a network provided in a vehicle, and is controlled by a CAN protocol, for example.

図1に示されるように、通信システム1は、時刻サーバ5と、ログ記録装置10と、ECU(Electronic Control Unit)101、102及び103とを備える。上記の各構成要素はネットワークNに接続されており、ネットワークNを介して互いに通信可能である。   As shown in FIG. 1, the communication system 1 includes a time server 5, a log recording device 10, and ECUs (Electronic Control Units) 101, 102, and 103. Each component described above is connected to the network N and can communicate with each other via the network N.

時刻サーバ5は、ネットワークNに時刻情報を配信するサーバ装置である。時刻サーバ5は、その内部に備える時計部によって現在時刻を計時しており、その現在時刻を繰り返しネットワークNに送信する。時刻サーバ5が計時している時刻の起点を第二時点ともいう。   The time server 5 is a server device that distributes time information to the network N. The time server 5 measures the current time by a clock unit provided therein, and repeatedly transmits the current time to the network N. The starting point of the time that the time server 5 measures is also referred to as the second time point.

ECU101は、車両のエンジン、ブレーキ又はステアリング(不図示)などの機能を制御する制御ユニットである。ECU101は、ネットワークNに接続されており、ネットワークNを介して、他のECUなどの装置からエンジンなどを制御するための制御データを受信する。また、ECU101は、他のECUなどの装置に対してネットワークNを介して応答データを送信する。また、ECU101は、ネットワークNを介して時刻サーバ5が配信する時刻情報を受信し、受信した時刻情報を自装置に設定することで、時刻サーバ5、及び、通信システム1内の他の装置との時刻の同期をとる。   The ECU 101 is a control unit that controls functions of a vehicle engine, a brake, a steering (not shown), and the like. The ECU 101 is connected to the network N, and receives control data for controlling the engine and the like from other devices such as an ECU via the network N. In addition, the ECU 101 transmits response data to a device such as another ECU via the network N. In addition, the ECU 101 receives time information distributed by the time server 5 via the network N, and sets the received time information in its own device, so that the time server 5 and other devices in the communication system 1 Synchronize the time.

ECU102及び103は、それぞれ、ECU101と同様の制御ユニットであり、ECU101とは独立に動作する。なお、ここでは、通信システム1が3つのECUを備える場合を例として説明しているが、ECUの個数はこれに限定されない。   The ECUs 102 and 103 are control units similar to the ECU 101, and operate independently of the ECU 101. Here, the case where the communication system 1 includes three ECUs is described as an example, but the number of ECUs is not limited to this.

ログ記録装置10は、通信データのログを記録するログ記録装置である。ログ記録装置10は、通信データを送信又は受信し、通信データの内容と、その送信時又は受信時の時刻情報とを含むログを記録する記録装置である。また、ログ記録装置10は、ネットワークNを介して時刻サーバ5が配信する時刻情報を受信し、受信した時刻情報を利用してログを記録する。   The log recording device 10 is a log recording device that records a log of communication data. The log recording device 10 is a recording device that transmits or receives communication data and records a log including the content of the communication data and time information at the time of transmission or reception. In addition, the log recording device 10 receives time information distributed by the time server 5 via the network N, and records a log using the received time information.

このようにして、ログ記録装置10は、時刻サーバ5と同期した時刻情報をログに記録する。ログ記録装置10が計時している時刻の起点を第一時点ともいう。第一時点は、一般には、時刻サーバ5が計時している時刻情報の起点である第二時点とは異なる。   In this way, the log recording device 10 records time information synchronized with the time server 5 in the log. The starting point of the time measured by the log recording device 10 is also referred to as the first time point. In general, the first time point is different from the second time point, which is the starting point of the time information timed by the time server 5.

ログ記録装置10は、起動してから、時刻サーバ5が配信する時刻情報を受信するまでの間には、時刻サーバ5、及び、通信システム1内の他の装置との時刻の同期がなされない。ログ記録装置10がこの状態で、内部で保有している時刻情報を用いてログを記録すると、同期されていない時刻情報が付与されたログが生成され得る。   The log recording device 10 is not synchronized in time with the time server 5 and other devices in the communication system 1 from when it is activated until it receives the time information distributed by the time server 5. . When the log recording apparatus 10 records a log using the time information held internally in this state, a log to which time information that is not synchronized is added can be generated.

そこで、同期されていない状態での時刻情報が付されたログの生成を抑制し、時刻サーバ5が配信する時刻情報を受信する前に生成されたログ情報にも適切な時刻情報を付与することができるログ記録装置10について以降で詳しく説明する。   Therefore, it is possible to suppress generation of a log to which time information is attached in an unsynchronized state, and to give appropriate time information to log information generated before receiving time information distributed by the time server 5. The log recording apparatus 10 capable of performing the above will be described in detail below.

図2は、本実施の形態に係るログ記録装置10の構成を示すブロック図である。   FIG. 2 is a block diagram showing a configuration of the log recording apparatus 10 according to the present embodiment.

図2に示されるように、ログ記録装置10は、通信IF(インタフェース)11と、機能部12と、時計部13と、生成部14と、変換部15と、記憶部16とを備える。なお、ログ記録装置10は、ログを記録する専用の装置として実現されてもよいし、他の所定の機能を発揮する装置内の一機能として実現されてもよい。   As illustrated in FIG. 2, the log recording device 10 includes a communication IF (interface) 11, a function unit 12, a clock unit 13, a generation unit 14, a conversion unit 15, and a storage unit 16. Note that the log recording device 10 may be realized as a dedicated device for recording logs, or may be realized as one function in a device that exhibits other predetermined functions.

通信IF11は、ネットワークNに接続される通信インタフェースである。通信IF11は、ECU101などの他の装置に送信すべきデータを機能部12から取得すると、取得したデータを含むフレームをネットワークNに送信する。また、通信IF11は、ECU101などの他の装置からネットワークNを介してフレームを受信し、受信したフレームに、機能部12に提供すべきデータが含まれている場合に、受信したフレームを機能部12に提供する。また、通信IF11は、時刻サーバ5が配信する時刻情報を含むフレーム(「時刻フレーム」ともいう)を受信する。通信IF11が受信した時刻フレームは、変換部15に提供される。なお、通信IF11が送受信するフレームは、例えばCANプロトコルに従う通信フレームである。   The communication IF 11 is a communication interface connected to the network N. When the communication IF 11 acquires data to be transmitted to another device such as the ECU 101 from the function unit 12, the communication IF 11 transmits a frame including the acquired data to the network N. The communication IF 11 receives a frame from another device such as the ECU 101 via the network N. When the received frame includes data to be provided to the function unit 12, the communication IF 11 12 to provide. Further, the communication IF 11 receives a frame including time information distributed by the time server 5 (also referred to as “time frame”). The time frame received by the communication IF 11 is provided to the conversion unit 15. Note that the frame transmitted and received by the communication IF 11 is, for example, a communication frame according to the CAN protocol.

機能部12は、所定の情報処理を行い、ネットワークNに接続された他の装置との間で情報を送受信する処理部である。機能部12は、例えば、CANデータに基づくコマンド生成に関する情報処理を行う。ログ記録装置10が、他の所定の機能を発揮する装置内の一機能として実現される場合には、他の所定の機能を発揮する部分が機能部12に相当する。なお、機能部12は、必須の構成要素ではない。   The function unit 12 is a processing unit that performs predetermined information processing and transmits / receives information to / from other devices connected to the network N. For example, the function unit 12 performs information processing related to command generation based on CAN data. When the log recording device 10 is realized as one function in the device that exhibits other predetermined functions, the portion that performs the other predetermined functions corresponds to the functional unit 12. The functional unit 12 is not an essential component.

時計部13は、所定の時点(つまり第一時点)を起点とした時刻を計時する。所定の時点は、ログ記録装置10に予め固定的に定められた過去の時点である。時計部13が計時する時刻の精度は、例えば、ミリ秒程度である。時計部13が計時している時刻を内部時刻ともいい、内部時刻を示す情報を内部時刻情報ともいう。時計部13が計時している時刻は、例えば、ログ記録装置10に備わるOS(Operating System)(不図示)に依存して算出されてもよい。   The clock unit 13 measures the time starting from a predetermined time point (that is, the first time point). The predetermined time point is a past time point fixed in advance in the log recording device 10. The accuracy of the time measured by the clock unit 13 is, for example, about milliseconds. The time measured by the clock unit 13 is also referred to as internal time, and the information indicating the internal time is also referred to as internal time information. The time measured by the clock unit 13 may be calculated depending on, for example, an OS (Operating System) (not shown) provided in the log recording device 10.

生成部14は、通信IF11により送受信される通信データの内容と、その送信又は受信の時の時計部13の時刻を示す時刻情報(第一時刻情報ともいう)とを含むログ情報17を生成する処理部である。また、生成部14は、生成したログ情報17を一旦保持する。なお、ログ情報17は、RAM(Random Access Memory)等の揮発性記録媒体、又は、HDD(Hard Disk Drive)又はSSD(Solid State Drive)などの不揮発性記録媒体に保持される。   The generation unit 14 generates log information 17 including the contents of communication data transmitted and received by the communication IF 11 and time information (also referred to as first time information) indicating the time of the clock unit 13 at the time of transmission or reception. It is a processing unit. Further, the generation unit 14 temporarily holds the generated log information 17. The log information 17 is held in a volatile recording medium such as a RAM (Random Access Memory) or a non-volatile recording medium such as an HDD (Hard Disk Drive) or an SSD (Solid State Drive).

変換部15は、生成部14が生成したログ情報17を変換し、変換後のログ情報17を記憶部16に記録する処理部である。変換部15は、第二時点を起点とした時刻を示す時刻情報を外部から取得し、取得した時刻情報と、時計部13が計時している時刻(内部時刻)とを比較して、生成部14が生成したログ情報17に含まれている第一時刻情報を、第二時点を起点とした時刻情報(第三時刻情報ともいう)に変換し、これを記憶部16に記録する。ここで「外部」とは、ログ記録装置10の外部、言い換えれば、ネットワークNに接続された他の装置を意味し、その具体例の1つは時刻サーバ5である。変換部15は、この変換の際には、生成部14が生成して記録媒体に保持しているログ情報17を読み出してから変換を行う。なお、変換部15が時刻サーバ5から取得した、第二時点を起点とした時刻を示す時刻情報を、同期時刻情報又は第二時刻情報ともいう。変換部15が、時刻サーバ5から同期時刻情報を取得することを、時刻同期をとる、ともいう。   The conversion unit 15 is a processing unit that converts the log information 17 generated by the generation unit 14 and records the converted log information 17 in the storage unit 16. The conversion unit 15 acquires time information indicating the time starting from the second time point from the outside, compares the acquired time information with the time (internal time) measured by the clock unit 13, and generates the generation unit. The first time information included in the log information 17 generated by 14 is converted into time information (also referred to as third time information) starting from the second time point, and is recorded in the storage unit 16. Here, “external” means the outside of the log recording apparatus 10, in other words, another apparatus connected to the network N, and one specific example is the time server 5. In this conversion, the conversion unit 15 performs conversion after reading the log information 17 generated by the generation unit 14 and held in the recording medium. Note that the time information indicating the time from the second time point acquired by the conversion unit 15 from the time server 5 is also referred to as synchronization time information or second time information. Acquisition of the synchronization time information from the time server 5 by the conversion unit 15 is also referred to as time synchronization.

記憶部16は、ログ情報17が記録される記憶媒体である。記憶部16は、例えばHDD又はSSDなどの不揮発性記録媒体である。記憶部16には、変換部15による変換後のログ情報17がファイル18として格納される。ログ情報17が格納されるファイル18は、新たに時刻サーバ5との時刻同期をしたときに切り替えられる。その結果、記憶部16は、1以上のファイル18が格納された状態になる。   The storage unit 16 is a storage medium in which log information 17 is recorded. The storage unit 16 is a nonvolatile recording medium such as an HDD or an SSD. The storage unit 16 stores log information 17 after conversion by the conversion unit 15 as a file 18. The file 18 in which the log information 17 is stored is switched when the time synchronization with the time server 5 is newly performed. As a result, the storage unit 16 is in a state where one or more files 18 are stored.

なお、変換部15が時刻サーバ5から時刻情報を取得した後には、生成部14が、通信IF11が送信又は受信をした通信データの内容と、通信IF11による送信又は受信の時の時計部13の時刻を示す時刻情報とを含むログ情報17を生成する。そして、変換部15は、生成部14が生成したログ情報17に含まれている時刻情報を、第二時点を起点とした時刻(第四時刻情報ともいう)に変換して、ログ情報17を記録媒体に記録する。ここで、生成部14は、生成したログ情報17を一旦保持することなく、変換部15に提供してよい。変換部15が既に時刻サーバ5から同期時刻情報を取得しているので、ログ情報17の提供を受けた変換部15がすぐに時刻情報の変換をすることができるからである。   After the conversion unit 15 acquires time information from the time server 5, the generation unit 14 includes the contents of the communication data transmitted or received by the communication IF 11 and the clock unit 13 at the time of transmission or reception by the communication IF 11. Log information 17 including time information indicating the time is generated. Then, the conversion unit 15 converts the time information included in the log information 17 generated by the generation unit 14 into a time starting from the second time point (also referred to as fourth time information), and the log information 17 Record on a recording medium. Here, the generation unit 14 may provide the generated log information 17 to the conversion unit 15 without temporarily holding the log information 17. This is because the conversion unit 15 has already acquired the synchronization time information from the time server 5, so that the conversion unit 15 that has received the log information 17 can immediately convert the time information.

また、このとき、変換部15は、ログ情報17を新たなファイル18に記録する。その結果、記憶部16は、複数のファイル18が記録された状態になる。これにより、複数のファイル18のそれぞれの中に含まれるログ情報17は、時刻情報の起点がただ1つになり、ログ情報17間の時間差の不正確さ、及び、順序の逆転などを回避することができる。   At this time, the conversion unit 15 records the log information 17 in a new file 18. As a result, the storage unit 16 is in a state where a plurality of files 18 are recorded. As a result, the log information 17 included in each of the plurality of files 18 has only one starting point of the time information, thereby avoiding inaccuracy of the time difference between the log information 17 and reversal of the order. be able to.

なお、変換部15は、1つのファイル18が所定のサイズ(例えば数百キロバイト)を超えると、新たなファイル18を作成するようにしてもよい。このようにすることで、ログ情報であるファイル18を取得する(ダウンロードする)際の取得時間を軽減できる。また、変換部15は、前回の時刻同期から所定時間が経過した場合には、ファイル18が上記所定のサイズを超えていなくても、新たなファイル18を作成してもよい。ここで所定時間は、例えば、時刻サーバ5の時刻と時計部13の時刻のずれが許容範囲を超えるまでの時間を採用することができる。時刻サーバ5の時刻と時計部13の時刻とを監視しておくことで、時間経過に伴ってこの時間のずれがどのように変化するかを知ることができる。そしてこの時間のずれが時間経過に伴って増大する場合には、この時間のずれが許容範囲を超えるまでの時間を予測することができる。したがって上記のような新たなファイル18の作成が可能となる。このようにすることで、ファイル18は、時刻同期がなされる前(つまり、時刻同期がなされていないとき)に生成されたログ情報17が含まれたファイル18と、時刻同期がなされた後に生成されたログ情報17が含まれたファイル18とを分けてファイル管理することができる利点がある。   Note that the conversion unit 15 may create a new file 18 when one file 18 exceeds a predetermined size (for example, several hundred kilobytes). By doing in this way, the acquisition time at the time of acquiring (downloading) the file 18 which is log information can be reduced. Further, when a predetermined time has elapsed since the previous time synchronization, the conversion unit 15 may create a new file 18 even if the file 18 does not exceed the predetermined size. Here, for example, the time until the time difference between the time of the time server 5 and the time of the clock unit 13 exceeds the allowable range can be adopted as the predetermined time. By monitoring the time of the time server 5 and the time of the clock unit 13, it is possible to know how the time difference changes with the passage of time. When this time lag increases with the passage of time, the time until the time lag exceeds the allowable range can be predicted. Therefore, the new file 18 as described above can be created. By doing in this way, the file 18 is generated after the time synchronization with the file 18 including the log information 17 generated before the time synchronization is performed (that is, when the time synchronization is not performed). There is an advantage that file management can be performed separately from the file 18 containing the log information 17 that has been recorded.

図3は、ログ記録装置10がネットワークNから取得する時刻情報を含むフレーム21の説明図である。フレーム21は、例えば時刻サーバ5がネットワークNに送信したものであるがこれに限られない。   FIG. 3 is an explanatory diagram of the frame 21 including time information acquired from the network N by the log recording apparatus 10. The frame 21 is, for example, transmitted by the time server 5 to the network N, but is not limited thereto.

図3に示されるようにフレーム21は、時刻情報フィールド22を含む。時刻情報フィールド22は、日付と時刻とを特定する情報を含む。日付と時刻を特定する情報は、例えば年月日形式で示される日付を特定する情報(図3における「2018/01/01」つまり2018年1月1日)と、時分秒形式で示される時刻を特定する情報(図3における「01:02:03」つまり1時2分3秒)とを含む。なお、時刻情報フィールド22に記載される情報のフォーマットは、上記に限定されない。具体的には、年月日の順序、又は、時分秒の順序が異なっていてもよい。また、年月日又は時分秒の区切り文字である「/」及び「:」が異なっていてもよいし、なくてもよい。   As shown in FIG. 3, the frame 21 includes a time information field 22. The time information field 22 includes information specifying the date and time. The information for specifying the date and time is, for example, information for specifying the date shown in the year / month / day format (“2018/01/01” in FIG. 3, that is, January 1, 2018), and the hour / minute / second format. And information specifying the time ("01:02:03" in FIG. 3, that is, 1: 2: 3). The format of information described in the time information field 22 is not limited to the above. Specifically, the order of year / month / day or the order of hour / minute / second may be different. In addition, “/” and “:”, which are delimiters for year / month / day or hour / minute / second, may or may not be different.

図4は、本実施の形態に係るログ情報17を記録したファイル31の内容の一例を示す説明図である。なお、図4に示すファイル31の内容について、以下の要素が含まれていればフォーマットは限定しない。   FIG. 4 is an explanatory diagram showing an example of the contents of the file 31 in which the log information 17 according to the present embodiment is recorded. The format of the file 31 shown in FIG. 4 is not limited as long as the following elements are included.

図4に示されるように、ファイル31は、ヘッダ部32と、1以上のログエントリ33とを含む。ファイル31は、図2におけるファイル18に相当する。   As shown in FIG. 4, the file 31 includes a header portion 32 and one or more log entries 33. The file 31 corresponds to the file 18 in FIG.

ヘッダ部32は、ファイル31内の先頭に配置されるフィールドであり、ファイル31が作成された日付及び時刻が所定のフォーマットで記載されている。ヘッダ部32には、時刻サーバ5から取得した時刻情報に基づいて、第二時点を起点としたファイル31の作成時刻が変換部15により記録されている。ヘッダ部32は、1つのファイル31に1つ存在する。   The header part 32 is a field arranged at the head in the file 31 and describes the date and time when the file 31 was created in a predetermined format. Based on the time information acquired from the time server 5, the creation time of the file 31 starting from the second time point is recorded in the header part 32 by the conversion part 15. One header section 32 exists in one file 31.

1以上のログエントリ33は、ファイル31内のヘッダ部32より後方に存在するフィールドである。1以上のログエントリ33のそれぞれは、ログ情報17に対応しており、通信データが送信又は受信された時刻を示す時刻情報35と、その通信データの内容36とを含む。1以上のログエントリ33のそれぞれは、1つの通信データの送信又は受信に対応して設けられる。時刻情報35は、変換部15によって変換された後の時刻情報である。   One or more log entries 33 are fields existing behind the header portion 32 in the file 31. Each of the one or more log entries 33 corresponds to the log information 17 and includes time information 35 indicating the time when the communication data is transmitted or received and the content 36 of the communication data. Each of the one or more log entries 33 is provided corresponding to transmission or reception of one communication data. The time information 35 is time information after being converted by the conversion unit 15.

図5は、本実施の形態に係る変換部15による時刻情報の変換方法を示す説明図である。   FIG. 5 is an explanatory diagram showing a time information conversion method by the conversion unit 15 according to the present embodiment.

図5には、時刻サーバ5が計時している時刻tの軸(つまり同期時刻情報の時間軸)と、時計部13が計時している時刻uの軸(つまり内部時刻情報の時間軸)とが上下に並べて示されている。図5において、同一の時刻は、左右方向において同一の位置に示されている。   FIG. 5 shows an axis of time t that is timed by the time server 5 (that is, a time axis of synchronization time information), an axis of time u that is timed by the clock unit 13 (that is, a time axis of internal time information), and Are shown side by side. In FIG. 5, the same time is shown at the same position in the left-right direction.

図5において、同期時刻情報の起点(第二時点)を時刻t0とし、内部時刻情報の起点(第一時点)を時刻u0としている。また、生成部14が生成して保持しているログ情報17に含まれている、内部時刻情報における時刻を時刻u1とし、時刻u1を同期時刻情報で表現した場合の時刻を時刻t1とする。また、時刻サーバ5が時刻情報を配信した時刻を同期時刻情報における時刻t2とし、時刻t2を内部時刻情報で表現した場合の時刻をu2とする。   In FIG. 5, the starting point (second time point) of the synchronization time information is time t0, and the starting point (first time point) of the internal time information is time u0. The time in the internal time information included in the log information 17 generated and held by the generation unit 14 is time u1, and the time when the time u1 is expressed by the synchronization time information is time t1. Also, the time when the time server 5 distributes the time information is time t2 in the synchronization time information, and the time when the time t2 is expressed by the internal time information is u2.

このとき、変換部15は、以下の(式1)を用いて、時刻u1を、同期時刻情報における時刻t1に変換する。   At this time, the conversion unit 15 converts the time u1 to the time t1 in the synchronization time information using the following (Equation 1).

t1=u1−(t2−u2) (式1)   t1 = u1- (t2-u2) (Formula 1)

この関係式は、内部時刻情報の時間軸を、同期時刻情報の時間軸に変換する機能を有する。より具体的には、内部時刻情報における時刻u1を、内部時刻情報と同期時刻情報との時間差(t2−u2)を用いてずらすことにより、同期時刻情報における時刻t1を得ることに相当する。   This relational expression has a function of converting the time axis of the internal time information into the time axis of the synchronous time information. More specifically, this corresponds to obtaining the time t1 in the synchronization time information by shifting the time u1 in the internal time information using the time difference (t2−u2) between the internal time information and the synchronization time information.

なお、変換部15が行う変換を以下の(式2)のように表現することもできる。この場合、時刻t1は、同期時刻情報における時刻t2を、内部時刻情報における時間差(u2−u1)だけ過去に遡った時刻として得られる。   Note that the conversion performed by the conversion unit 15 can also be expressed as in (Equation 2) below. In this case, time t1 is obtained as time t2 in the synchronization time information traced back by the time difference (u2-u1) in the internal time information.

t1=t2−(u2−u1) (式2)   t1 = t2- (u2-u1) (Formula 2)

この変換を用いることで、変換部15は、保持しているすべてのログ情報17に含まれる時刻u1を、外部時刻情報(同期時刻情報)における時刻t1に変換する。   By using this conversion, the conversion unit 15 converts the time u1 included in all held log information 17 into the time t1 in the external time information (synchronization time information).

図6は、本実施の形態に係るログ記録装置10が外部の時刻サーバから取得した時刻情報を用いてログを記録する処理を示すフロー図である。   FIG. 6 is a flowchart showing a process of recording a log using time information acquired from an external time server by the log recording apparatus 10 according to the present embodiment.

図6に示されるように、ステップS101において、生成部14は、通信IF11がネットワークNからフレームを送信又は受信したか否かを判定する。通信IF11がフレームを送信又は受信したと判定した場合(ステップS101でYes)には、ステップS102に進み、そうでない場合(ステップS101でNo)には、ステップS101を再び実行する。つまり、生成部14は、通信IF11がフレームを送信又は受信するまでステップS101で待機する。例えば、通信IF11が送信するフレームは、機能部12がネットワークNを介して他の装置に送信するフレームであり、通信IF11が受信するフレームは、機能部12がネットワークNを介して他の装置から受信するフレームである。   As illustrated in FIG. 6, in step S <b> 101, the generation unit 14 determines whether the communication IF 11 has transmitted or received a frame from the network N. If it is determined that the communication IF 11 has transmitted or received a frame (Yes in step S101), the process proceeds to step S102. If not (No in step S101), step S101 is executed again. That is, the generation unit 14 waits in step S101 until the communication IF 11 transmits or receives a frame. For example, the frame transmitted by the communication IF 11 is a frame transmitted from the functional unit 12 to another device via the network N, and the frame received by the communication IF 11 is transmitted from the other device via the network N by the functional unit 12. This is a frame to be received.

ステップS102において、生成部14は、時刻サーバ5から時刻情報を取得するための所定の取得期間の終了条件が満たされたか否かを判定する。終了条件が満たされたと判定した場合(ステップS102でYes)、ステップS103に進み、そうでない場合(ステップS102でNo)には、ステップS106に進む。ここで、取得期間とは、ログ記録装置10が時刻サーバ5から時刻情報を取得するための定められた期間である。また、取得期間の終了条件には、例えば、通信IF11の初期化時から所定時間(例えば10秒〜1分程度)が経過したこと、とすることができる。これにより、変換部は、通信IF11の初期化時から所定時間が経過しても時刻サーバ5から時刻情報を取得できない場合には、変換をすることなく、ログ情報17を記憶部16に記録することになる。なお、取得期間の終了条件には、他にも、通信IF11の初期化から所定数個のフレームを送受信したこと、通信IF11の初期化から所定のデータ量のフレームを送受信したこと、などを採用し得る。例えば、所定数は10,000とすることができ、所定のデータ量は200kByteとすることができる。これらの値は、ネットワークNに流れると想定される通信量によって変動し得る。   In step S <b> 102, the generation unit 14 determines whether an end condition for a predetermined acquisition period for acquiring time information from the time server 5 is satisfied. If it is determined that the end condition is satisfied (Yes in step S102), the process proceeds to step S103. If not (No in step S102), the process proceeds to step S106. Here, the acquisition period is a predetermined period for the log recording device 10 to acquire time information from the time server 5. Further, the acquisition period end condition may be, for example, that a predetermined time (for example, about 10 seconds to 1 minute) has elapsed since the initialization of the communication IF 11. Thereby, the conversion unit records the log information 17 in the storage unit 16 without conversion when the time information cannot be acquired from the time server 5 even after a predetermined time has elapsed since the initialization of the communication IF 11. It will be. In addition, the acquisition period end condition includes that a predetermined number of frames have been transmitted / received since the initialization of the communication IF 11 and that a frame having a predetermined amount of data has been transmitted / received since the initialization of the communication IF 11. Can do. For example, the predetermined number can be 10,000, and the predetermined data amount can be 200 kBytes. These values may vary depending on the traffic that is assumed to flow through the network N.

ステップS103において、生成部14は、ステップS101で通信IF11が受信したフレームに含まれる通信データの内容と、当該フレームの送信又は受信の時を示す時刻情報とを含むログ情報17を生成する。そして、生成部14は、生成したログ情報17を保持する。   In step S103, the generation unit 14 generates log information 17 including the content of communication data included in the frame received by the communication IF 11 in step S101 and time information indicating the time of transmission or reception of the frame. Then, the generation unit 14 holds the generated log information 17.

ステップS104において、生成部14は、ステップS101で通信IF11が受信したフレームが時刻フレームであるか否かを判定する。時刻フレームである場合(ステップS104でYes)には、ステップS105に進み、そうでない場合(ステップS104でNo)には、ステップS101に進む。   In step S104, the generation unit 14 determines whether the frame received by the communication IF 11 in step S101 is a time frame. If it is a time frame (Yes in step S104), the process proceeds to step S105. If not (No in step S104), the process proceeds to step S101.

ステップS105において、変換部15は、通信IF11が受信した時刻フレームを取得する。そして、変換部15は、時計部13が計時している時刻と、ステップS101で受信したフレームに含まれる時刻情報とを比較して、両者の時間差((式1)における(t2−u2))を算出する。そして、変換部15は、ステップS103で保持したログ情報17に含まれている時刻情報を、同期時刻情報における時刻情報(第三時刻情報)に変換する。   In step S105, the conversion unit 15 acquires the time frame received by the communication IF 11. Then, the conversion unit 15 compares the time measured by the clock unit 13 with the time information included in the frame received in step S101, and the time difference between them ((t2-u2) in (Equation 1)). Is calculated. And the conversion part 15 converts the time information contained in the log information 17 hold | maintained at step S103 into the time information (3rd time information) in synchronous time information.

ステップS106において、変換部15は、ステップS105で変換した後のログ情報17を記憶部16内のファイル18に記憶する。   In step S <b> 106, the conversion unit 15 stores the log information 17 converted in step S <b> 105 in the file 18 in the storage unit 16.

図6に示される一連の処理により、ログ記録装置10は、時刻同期がなされる前のログに適切な時刻情報を付与して記録することができる。   Through the series of processes shown in FIG. 6, the log recording apparatus 10 can record by adding appropriate time information to the log before time synchronization is performed.

図7は、本実施の形態に係る、ログ記録装置10が外部の時刻サーバから時刻情報を取得した後にログを記録する処理を示すフロー図である。図7に示される処理は、図6に示される一連の処理が終了した後に実行される。   FIG. 7 is a flowchart showing a process of recording a log after the log recording apparatus 10 acquires time information from an external time server according to the present embodiment. The process shown in FIG. 7 is executed after the series of processes shown in FIG.

図7に示されるように、ステップS201において、生成部14は、通信IF11がネットワークNからフレームを送信又は受信したか否かを判定する。通信IF11がフレームを送信又は受信したと判定した場合(ステップS201でYes)には、ステップS202に進み、そうでない場合(ステップS201でNo)には、ステップS201を再び実行する。つまり、生成部14は、通信IF11がフレームを送信又は受信するまでステップS201で待機する。通信IF11が送信するフレームについては、図6のステップS101と同様である。   As illustrated in FIG. 7, in step S <b> 201, the generation unit 14 determines whether the communication IF 11 has transmitted or received a frame from the network N. If it is determined that the communication IF 11 has transmitted or received a frame (Yes in step S201), the process proceeds to step S202. If not (No in step S201), step S201 is executed again. That is, the generation unit 14 waits in step S201 until the communication IF 11 transmits or receives a frame. The frame transmitted by the communication IF 11 is the same as step S101 in FIG.

ステップS202において、生成部14は、ステップS201で通信IF11が受信したフレームが、時刻フレームであるか否かを判定する。時刻フレームである場合(ステップS202でYes)には、ステップS203に進み、そうでない場合(ステップS202でNo)には、ステップS206に進む。   In step S202, the generation unit 14 determines whether the frame received by the communication IF 11 in step S201 is a time frame. If it is a time frame (Yes in step S202), the process proceeds to step S203, and if not (No in step S202), the process proceeds to step S206.

ステップS203において、生成部14は、前回のファイル18の更新処理(後述するステップS205)から所定時間が経過しているか否かを判定する。所定時間が経過していると判定した場合(ステップS203でYes)には、ステップS204に進み、そうでない場合(ステップS203でNo)にはステップS206に進む。   In step S203, the generation unit 14 determines whether or not a predetermined time has elapsed since the previous update process of the file 18 (step S205 described later). If it is determined that the predetermined time has elapsed (Yes in step S203), the process proceeds to step S204. If not (No in step S203), the process proceeds to step S206.

ステップS204において、生成部14は、時計部13が計時している時刻と、ステップS201で受信したフレームに含まれる時刻情報とを比較して、両者の時間差((式1)における(t2−u2))を算出する。   In step S204, the generation unit 14 compares the time counted by the clock unit 13 with the time information included in the frame received in step S201, and compares the time difference between them ((t2-u2 in (Equation 1)). )) Is calculated.

ステップS205において、変換部15は、記憶部16内に新たなファイル18を生成し、生成した新たなファイル18内の先頭に、同期時刻情報におけるファイル18の作成時刻を記録する。なお、ステップS205の処理をファイル18の更新処理ともいう。   In step S205, the conversion unit 15 generates a new file 18 in the storage unit 16, and records the creation time of the file 18 in the synchronization time information at the top of the generated new file 18. Note that the processing in step S205 is also referred to as file 18 update processing.

ステップS206において、生成部14は、ステップS201で受信したフレームに含まれる通信データの内容と、当該フレームの送信又は受信の時を示す時刻情報とを含むログ情報17を生成する。生成部14は、上記ログ情報17を生成する際には、時計部13が示す時刻情報を含めたログ情報17を生成した後に、その含められた時刻情報を同期時刻情報に変換したものである。   In step S206, the generation unit 14 generates log information 17 including the content of communication data included in the frame received in step S201 and time information indicating the time of transmission or reception of the frame. When generating the log information 17, the generation unit 14 generates the log information 17 including the time information indicated by the clock unit 13, and then converts the included time information into synchronous time information. .

ステップS207において、生成部14は、ステップS206で生成したログ情報17を記憶部16に記憶する。ステップS207を終了したら、ステップS201を実行する。   In step S207, the generation unit 14 stores the log information 17 generated in step S206 in the storage unit 16. When step S207 is completed, step S201 is executed.

図7に示される一連の処理により、ログ記録装置10は、送受信する通信データの内容と、その送信時又は受信時の時刻情報とを含むログを記録する。   Through a series of processes shown in FIG. 7, the log recording device 10 records a log including the contents of communication data to be transmitted and received and time information at the time of transmission or reception.

なお、車両それぞれに配備される通信システム1が、外部ネットワークに接続されていてもよい。そして、車両それぞれのログ記録装置10と外部ネットワークを介して接続される外部のログ記録装置が配備されていてもよい。この場合、外部のログ記録装置は、外部ネットワークを介して、各ログ記録装置10からログファイルを収集する。この構成では、外部のログ記録装置の管理者は、車両のユーザに代わって、各車両内で制御された制御データを、外部のログ記録装置において参照し、活用することができる利点がある。   In addition, the communication system 1 deployed in each vehicle may be connected to an external network. An external log recording device connected to the log recording device 10 of each vehicle via an external network may be provided. In this case, the external log recording device collects log files from each log recording device 10 via the external network. This configuration has an advantage that an administrator of an external log recording device can refer to and utilize the control data controlled in each vehicle on the external log recording device on behalf of the user of the vehicle.

以上のように、本実施の形態のログ記録装置は、当該ログ記録装置の外部の時刻サーバから時刻情報を受信する前に生成したログ情報を保持している。そして、外部の時刻サーバから時刻情報を受信したら、過去に遡って、受信した時刻情報に基づいて、保持しているログ情報に含まれる時刻情報を変換する。これにより、外部の時刻サーバから時刻情報を受信する前に生成したログ情報にも、外部の時刻サーバが計時している時刻情報の起点を起点とする時刻情報を付与して記録媒体に記録することができる。このようにして、ログ記録装置は、時刻同期がなされる前のログに適切な時刻情報を付与することができる。   As described above, the log recording apparatus according to the present embodiment holds log information generated before receiving time information from a time server external to the log recording apparatus. When the time information is received from the external time server, the time information included in the retained log information is converted based on the received time information retroactively. As a result, the time information starting from the starting point of the time information measured by the external time server is also added to the log information generated before receiving the time information from the external time server and recorded on the recording medium. be able to. In this way, the log recording apparatus can give appropriate time information to the log before time synchronization is performed.

また、ログ記録装置は、外部の時刻サーバから時刻情報を取得した後には、外部の時刻サーバが計時している時刻情報の起点を起点とする時刻情報を付与したログ情報を記録媒体に記録する。よって、ログ記録装置は、時刻同期がなされる前後に亘って適切な時刻情報を付与することができる。   In addition, after acquiring the time information from the external time server, the log recording device records the log information to which the time information starting from the starting point of the time information measured by the external time server is recorded on the recording medium. . Therefore, the log recording apparatus can give appropriate time information before and after time synchronization is performed.

また、ログ記録装置は、外部の時刻サーバから新たな時刻情報を取得した場合には、その取得より後のログ情報を新たなファイルに記録する。仮に新たな時刻情報を取得した場合に、その取得の前後で同一のファイルにログ情報を記録するとすれば、一のファイル内に時刻情報の起点が異なるログ情報が混在することになり、一のファイル内のログ情報間での時間差が不正確になったり、ログ情報の順序の逆転が起こったりする。そこで、外部の時刻サーバから新たな時刻情報を取得した場合にログ情報を新たなファイルに記録するようにすることで、上記の時間差の不正確さ、及び、順序の逆転などを回避することができる。よって、ログ記録装置は、ログファイルにおける時間差の不正確さ、及び、順序の逆転などを回避しながら、時刻同期がなされる前のログに適切な時刻情報を付与することができる。   Further, when new time information is acquired from an external time server, the log recording device records log information after the acquisition in a new file. If new time information is acquired and log information is recorded in the same file before and after the acquisition, log information with different origins of time information will be mixed in one file. The time difference between the log information in the file becomes inaccurate or the order of the log information is reversed. Therefore, when new time information is acquired from an external time server, the log information is recorded in a new file, thereby avoiding the inaccuracy of the time difference and the reverse of the order. it can. Therefore, the log recording device can give appropriate time information to the log before time synchronization is performed while avoiding inaccuracies in the time difference in the log file and reversal of the order.

また、ログ記録装置は、ファイル内の先頭の所定の位置にファイルの作成時刻が記録されたファイルを生成する。よって、ログ記録装置が生成したログを利用する装置又はユーザは、ファイル内の所定の位置を読み出すだけでファイルの作成時刻を取得することができる。よって、ログ記録装置は、ファイルの作成時刻を当該ファイルから取得しやすくしながら、時刻同期がなされる前のログに適切な時刻情報を付与することができる。   In addition, the log recording device generates a file in which the creation time of the file is recorded at a predetermined position at the beginning of the file. Therefore, a device or a user who uses the log generated by the log recording device can acquire the creation time of the file simply by reading a predetermined position in the file. Therefore, the log recording device can give appropriate time information to the log before time synchronization is performed while easily obtaining the creation time of the file from the file.

また、ログ記録装置は、外部の時刻サーバから時刻情報を取得できない場合には、自装置が計時している時刻情報を付したログ情報を記憶する。よって、ログ記録装置は、時刻同期がなされない場合に時刻情報が付されないログ情報が記録されることを回避することができる。   In addition, when the time information cannot be acquired from an external time server, the log recording device stores log information with time information timed by itself. Therefore, the log recording device can avoid recording log information without time information when time synchronization is not performed.

また、ログ記録装置は、記録媒体を用いることで、より容易に、外部の時刻サーバから時刻情報を受信する前に生成したログ情報を保持することができる。   In addition, the log recording apparatus can more easily hold log information generated before receiving time information from an external time server by using a recording medium.

また、ログ記録装置は、車両内のネットワークにおいて、時刻同期がなされる前のログに適切な時刻情報を付与することができる。   Further, the log recording device can give appropriate time information to the log before time synchronization is performed in the network in the vehicle.

なお、本発明は、装置として実現できるだけでなく、その装置を構成する処理手段をステップとする方法として実現したり、それらステップをコンピュータに実行させるプログラムとして実現したり、そのプログラムを記録したコンピュータ読み取り可能なCD−ROMなどの記録媒体として実現したり、そのプログラムを示す情報、データ又は信号として実現したりすることもできる。そして、それらプログラム、情報、データ及び信号は、インターネット等の通信ネットワークを介して配信してもよい。   Note that the present invention can be realized not only as an apparatus but also as a method using steps as processing units constituting the apparatus, as a program for causing a computer to execute the steps, or as a computer read recording the program. It can also be realized as a possible recording medium such as a CD-ROM, or as information, data or a signal indicating the program. These programs, information, data, and signals may be distributed via a communication network such as the Internet.

以上、本発明のログ記録装置等について、実施の形態に基づいて説明したが、本発明は、この実施の形態に限定されるものではない。本発明の趣旨を逸脱しない限り、当業者が思いつく各種変形を本実施の形態に施したものや、異なる実施の形態における構成要素を組み合わせて構築される形態も、本発明の範囲内に含まれる。   Although the log recording device and the like of the present invention have been described based on the embodiment, the present invention is not limited to this embodiment. Unless it deviates from the meaning of this invention, the form which carried out the various deformation | transformation which those skilled in the art will think to this embodiment, and the form constructed | assembled combining the component in different embodiment are also contained in the scope of the present invention. .

本発明は、時刻同期がなされる前のログに適切な時刻情報を付与できるログ記録装置に適用され得る。具体的には、車両内のネットワークを含む各種ネットワークにおける通信ログを記録するログ記録装置に適用され得る。   The present invention can be applied to a log recording apparatus that can give appropriate time information to a log before time synchronization. Specifically, the present invention can be applied to a log recording device that records communication logs in various networks including a network in a vehicle.

1 通信システム
5 時刻サーバ
10 ログ記録装置
11 通信IF
12 機能部
13 時計部
14 生成部
15 変換部
16 記憶部
17 ログ情報
18、31 ファイル
21 フレーム
22 時刻情報フィールド
32 ヘッダ部
33 ログエントリ
35 時刻情報
36 通信データの内容
101、102、103 ECU
N ネットワーク
DESCRIPTION OF SYMBOLS 1 Communication system 5 Time server 10 Log recording device 11 Communication IF
12 functional section 13 clock section 14 generation section 15 conversion section 16 storage section 17 log information 18, 31 file 21 frame 22 time information field 32 header section 33 log entry 35 time information 36 contents of communication data 101, 102, 103 ECU
N network

Claims (9)

第一時点を起点とした時刻を計時する時計部と、
通信データの送信又は受信をする通信インタフェースと、
前記通信データの内容と、前記通信インタフェースによる前記送信又は前記受信の時の前記時計部の時刻を示す第一時刻情報とを含むログ情報を生成し、保持する生成部と、
第二時点を起点とした時刻を示す第二時刻情報を外部から取得し、取得した前記第二時刻情報と、前記時計部が計時している時刻とを比較して、前記生成部が保持している前記ログ情報に含まれている前記第一時刻情報を、前記第二時点を起点とした第三時刻情報に変換して、前記ログ情報を記録媒体に記録する変換部とを備える
ログ記録装置。
A clock unit for measuring the time starting from the first time point,
A communication interface for transmitting or receiving communication data; and
A generating unit that generates and holds log information including the content of the communication data and first time information indicating the time of the clock unit at the time of transmission or reception by the communication interface;
Second time information indicating the time starting from the second time point is acquired from the outside, the acquired second time information is compared with the time measured by the clock unit, and the generation unit holds the second time information. A conversion unit that converts the first time information included in the log information into third time information starting from the second time point and records the log information on a recording medium. apparatus.
前記生成部は、
前記変換部が第二時刻情報を取得した後に前記通信インタフェースが送信又は受信をした通信データの内容と、前記通信インタフェースによる前記送信又は前記受信の時の前記時計部の時刻を示す第一時刻情報とを含むログ情報を生成し、
前記変換部は、
前記生成部が生成した前記ログ情報に含まれている前記第一時刻情報を、前記第二時点を起点とした第四時刻情報に変換して、前記ログ情報を記録媒体に記録する
請求項1に記載のログ記録装置。
The generator is
First time information indicating the content of communication data transmitted or received by the communication interface after the conversion unit has acquired second time information, and the time of the clock unit at the time of transmission or reception by the communication interface Log information including
The converter is
2. The first time information included in the log information generated by the generation unit is converted into fourth time information starting from the second time point, and the log information is recorded on a recording medium. The log recording device described in 1.
前記変換部は、
前記ログ情報を前記記録媒体内のファイルに記録し、
前記第二時刻情報を取得した後に、さらに、新たな第二時刻情報を取得した場合には、前記新たな第二時刻情報を取得した後に前記生成部が生成したログ情報を、前記記録媒体内の新たなファイルに記録する
請求項1又は2に記載のログ記録装置。
The converter is
Recording the log information in a file in the recording medium;
After acquiring the second time information, if new second time information is acquired, the log information generated by the generating unit after acquiring the new second time information is stored in the recording medium. The log recording apparatus according to claim 1, wherein the log recording apparatus records the new file.
前記変換部は、前記新たなファイル内の先頭に、前記第二時点を起点とした前記新たなファイルの作成時刻を記録する
請求項3に記載のログ記録装置。
The log recording apparatus according to claim 3, wherein the conversion unit records the creation time of the new file starting from the second time point at the beginning of the new file.
前記変換部は、前記通信インタフェースの初期化時から所定時間が経過しても前記第二時刻情報を取得できない場合には、前記変換をすることなく、前記ログ情報を前記記録媒体に記録する
請求項1〜4のいずれか1項に記載のログ記録装置。
The conversion unit records the log information on the recording medium without performing the conversion when the second time information cannot be acquired even after a predetermined time has elapsed since the initialization of the communication interface. Item 5. The log recording device according to any one of Items 1 to 4.
前記生成部は、生成した前記ログ情報を記録媒体に記録することで保持し、
前記変換部は、前記生成部が前記ログ情報を記録した前記記録媒体から前記ログ情報を読み出して前記変換をする
請求項1〜5のいずれか1項に記載のログ記録装置。
The generation unit holds the generated log information by recording it on a recording medium,
The log recording apparatus according to claim 1, wherein the conversion unit performs the conversion by reading the log information from the recording medium on which the generation unit has recorded the log information.
前記通信インタフェースは、車両内のネットワークに前記通信データを送信又は受信する
請求項1〜6のいずれか1項に記載のログ記録装置。
The log recording device according to any one of claims 1 to 6, wherein the communication interface transmits or receives the communication data to a network in a vehicle.
ログ記録装置の制御方法であって、
第一時点を起点とした時刻を計時する計時ステップと、
通信データの送信又は受信をする通信ステップと、
前記通信データの内容と、前記通信ステップでの前記送信又は前記受信の時に前記計時ステップで計時された時刻を示す第一時刻情報とを含むログ情報を生成し、保持する生成ステップと、
第二時点を起点とした時刻を示す第二時刻情報を外部から取得し、取得した前記第二時刻情報と、前記計時ステップで計時している時刻とを比較して、前記生成ステップで保持した前記ログ情報に含まれている前記第一時刻情報を、前記第二時点を起点とした第三時刻情報に変換して、前記ログ情報を記録媒体に記録する変換ステップとを含む
制御方法。
A method of controlling a log recording device,
A time measuring step for measuring the time starting from the first time point;
A communication step for transmitting or receiving communication data; and
Generating and storing log information including the content of the communication data and first time information indicating the time measured in the time measuring step at the time of transmission or reception in the communication step; and
Second time information indicating the time starting from the second time point is acquired from the outside, the acquired second time information is compared with the time measured in the time measuring step, and held in the generation step A conversion step of converting the first time information included in the log information into third time information starting from the second time point and recording the log information on a recording medium.
請求項8に記載のログ記録装置の制御方法をコンピュータに実行させるためのプログラム。   A program for causing a computer to execute the method for controlling the log recording apparatus according to claim 8.
JP2018064567A 2018-03-29 2018-03-29 Logging device, control method, and program Active JP6920738B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2018064567A JP6920738B2 (en) 2018-03-29 2018-03-29 Logging device, control method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2018064567A JP6920738B2 (en) 2018-03-29 2018-03-29 Logging device, control method, and program

Publications (2)

Publication Number Publication Date
JP2019175263A true JP2019175263A (en) 2019-10-10
JP6920738B2 JP6920738B2 (en) 2021-08-18

Family

ID=68167037

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2018064567A Active JP6920738B2 (en) 2018-03-29 2018-03-29 Logging device, control method, and program

Country Status (1)

Country Link
JP (1) JP6920738B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111552621A (en) * 2020-04-27 2020-08-18 中国银行股份有限公司 Log information processing method and device and service equipment
CN114724276A (en) * 2022-04-12 2022-07-08 广州文远知行科技有限公司 Processing method, playing method and related equipment of multi-type log data

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH10293704A (en) * 1997-04-18 1998-11-04 Hitachi Ltd Information processor collecting and managing log data
JP2000285037A (en) * 1999-03-29 2000-10-13 Seiko Epson Corp Portable information collector and information collection method
JP2006155367A (en) * 2004-11-30 2006-06-15 Canon Inc Image forming apparatus, data processing method, image forming method, and program
JP2008262500A (en) * 2007-04-13 2008-10-30 Ricoh Co Ltd Log information recording device, electronic equipment, log information recording method, log information recording program, and computer-readable storage medium
JP2009193395A (en) * 2008-02-15 2009-08-27 Denso Corp Communication data gathering device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH10293704A (en) * 1997-04-18 1998-11-04 Hitachi Ltd Information processor collecting and managing log data
JP2000285037A (en) * 1999-03-29 2000-10-13 Seiko Epson Corp Portable information collector and information collection method
JP2006155367A (en) * 2004-11-30 2006-06-15 Canon Inc Image forming apparatus, data processing method, image forming method, and program
JP2008262500A (en) * 2007-04-13 2008-10-30 Ricoh Co Ltd Log information recording device, electronic equipment, log information recording method, log information recording program, and computer-readable storage medium
JP2009193395A (en) * 2008-02-15 2009-08-27 Denso Corp Communication data gathering device

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111552621A (en) * 2020-04-27 2020-08-18 中国银行股份有限公司 Log information processing method and device and service equipment
CN111552621B (en) * 2020-04-27 2023-09-01 中国银行股份有限公司 Log information processing method and device and service equipment
CN114724276A (en) * 2022-04-12 2022-07-08 广州文远知行科技有限公司 Processing method, playing method and related equipment of multi-type log data
CN114724276B (en) * 2022-04-12 2023-10-24 广州文远知行科技有限公司 Processing method, playing method and related equipment for multi-type log data

Also Published As

Publication number Publication date
JP6920738B2 (en) 2021-08-18

Similar Documents

Publication Publication Date Title
CN109542889B (en) Stream data column storage method, device, equipment and storage medium
JP6399136B1 (en) Control device, control program, and control system
US8413169B2 (en) Time-based event processing using punctuation events
EP3329292B1 (en) Pps tagging of acoustic sample data
US8208763B2 (en) Image processing method and apparatus
JP6920738B2 (en) Logging device, control method, and program
WO2016133711A1 (en) Optimized visibility for sleep sessions over time
CN111327385A (en) Clock synchronization method, device and equipment of Internet of things equipment
JP2007293861A (en) Hybrid computer security clock
JP2004112602A (en) Digital information input system, information generation device, information management method, program, and computer readable recording medium
JP4964559B2 (en) Vehicle data collection device and vehicle data collection method
US20140359080A1 (en) File download method, system, and computing device
CN107291524B (en) Remote command processing method and device
CN106815126B (en) General file system log recording method and device
JP6973427B2 (en) Communication systems, communication methods, and programs
JP2016016579A (en) Information processing apparatus, control method thereof, and information processing system
US11513769B2 (en) Data acquisition system, input device, data acquisition apparatus, and data combining apparatus
JP7189743B2 (en) Measurement result receiving device, measuring device, method, program and recording medium thereof
JP2010055217A (en) Content file management system
US9979787B2 (en) Information processing system, network storage device, and non-transitory recording medium
WO2019047348A1 (en) Data sending method and receiving method based on audio interface
CN114168683A (en) Data exchange task optimization method and device based on DataX and application thereof
KR102207727B1 (en) Method and apparatus for backing up information
JP2006038694A (en) Data sampling system
JP2008228011A (en) Packet collecting apparatus, monitoring system, and packet collecting program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20201020

A871 Explanation of circumstances concerning accelerated examination

Free format text: JAPANESE INTERMEDIATE CODE: A871

Effective date: 20201020

A975 Report on accelerated examination

Free format text: JAPANESE INTERMEDIATE CODE: A971005

Effective date: 20201027

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20210212

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20210302

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20210428

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20210525

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20210622

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20210716

R150 Certificate of patent or registration of utility model

Ref document number: 6920738

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150