JP6920738B2 - Logging device, control method, and program - Google Patents

Logging device, control method, and program Download PDF

Info

Publication number
JP6920738B2
JP6920738B2 JP2018064567A JP2018064567A JP6920738B2 JP 6920738 B2 JP6920738 B2 JP 6920738B2 JP 2018064567 A JP2018064567 A JP 2018064567A JP 2018064567 A JP2018064567 A JP 2018064567A JP 6920738 B2 JP6920738 B2 JP 6920738B2
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.)
Active
Application number
JP2018064567A
Other languages
Japanese (ja)
Other versions
JP2019175263A (en
Inventor
英二 杉原
英二 杉原
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

Landscapes

  • Debugging And Monitoring (AREA)

Description

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

車両内のネットワークにおける通信データのログを記録するログ記録装置が利用されている。ログ記録装置は、通信データの内容を示す情報と、当該通信データを送信又は受信した時刻を示す時刻情報とを含むログを記録する。 A log recording device that records a log of communication data in the network in the vehicle is used. The log recording device records a log including information indicating the content of the 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 has been disclosed (Patent Document 1). The logging system disclosed in Patent Document 1 includes and records time information generated by a clock included in the logging system in a log.

特開2015−95061号公報Japanese Unexamined Patent Publication No. 2015-95061

ところで、車両内のネットワークには複数の通信装置が接続されている。また、このネットワークには、時刻情報を配信する時刻サーバが接続されており、複数の通信装置は、時刻サーバにより配信される時刻情報を受信することによって、時刻同期を図る。 By the way, 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 this network, and a plurality of communication devices attempt to synchronize the time by receiving the time information distributed by the time server.

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

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

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

これによれば、ログ記録装置は、当該ログ記録装置の外部の時刻サーバから時刻情報を受信する前に生成したログ情報を保持している。そして、外部の時刻サーバから時刻情報を受信したら、過去に遡って、受信した時刻情報に基づいて、保持しているログ情報に含まれる時刻情報を変換する。これにより、外部の時刻サーバから時刻情報を受信する前に生成したログ情報にも、外部の時刻サーバが計時している時刻情報の起点を起点とする時刻情報を付与して記録媒体に記録することができる。このようにして、ログ記録装置は、時刻同期がなされる前のログに適切な時刻情報を付与することができる。 According to this, the log recording device holds the log information generated before receiving the time information from the time server outside the log recording device. Then, when the time information is received from the external time server, the time information included in the held log information is converted based on the received time information retroactively. As a result, the log information generated before receiving the time information from the external time server is also added with the time information starting from the time information measured by the external time server and recorded on the recording medium. be able to. In this way, the log recording device can add appropriate time information to the log before the 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 the second time information, and the clock unit at the time of transmission or reception by the communication interface. The log information including the first time information indicating the time is generated, and the conversion unit uses the first time information included in the log information generated by the generation unit as a starting point from the second time point. The log information may be recorded on a recording medium after being converted into the fourth time information.

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

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

これによれば、ログ記録装置は、外部の時刻サーバから新たな時刻情報を取得した場合には、その取得より後のログ情報を新たなファイルに記録する。仮に新たな時刻情報を取得した場合に、その取得の前後で同一のファイルにログ情報を記録するとすれば、一のファイル内に時刻情報の起点が異なるログ情報が混在することになり、一のファイル内のログ情報間での時間差が不正確になったり、ログ情報の順序の逆転が起こったりする。そこで、外部の時刻サーバから新たな時刻情報を取得した場合にログ情報を新たなファイルに記録するようにすることで、上記の時間差の不正確さ、及び、順序の逆転などを回避することができる。よって、ログ記録装置は、ログファイルにおける時間差の不正確さ、及び、順序の逆転などを回避しながら、時刻同期がなされる前のログに適切な時刻情報を付与することができる。 According to this, when the log recording device acquires new time information from an external time server, the log recording device records the 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, and the order of the log information is reversed. Therefore, by recording the log information in a new file when new time information is acquired from an external time server, it is possible to avoid the above-mentioned inaccuracy of time difference and reversal of order. can. Therefore, the log recording device can add appropriate time information to the log before the time synchronization is performed while avoiding the inaccuracy of the time difference in the log file and the 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 logging 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, the device or 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 easily acquire the creation time of the file from the file, and can add appropriate time information to the log before the time synchronization is performed.

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

これによれば、ログ記録装置は、外部の時刻サーバから時刻情報を取得できない場合には、自装置が計時している時刻情報を付したログ情報を記憶する。よって、ログ記録装置は、時刻同期がなされない場合に時刻情報が付されないログ情報が記録されることを回避することができる。 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 measured by the own device. Therefore, the log recording device can avoid recording the log information without the time information when the time is not synchronized.

また、前記生成部は、生成した前記ログ情報を記録媒体に記録することで保持し、前記変換部は、前記生成部が前記ログ情報を記録した前記記録媒体から前記ログ情報を読み出して前記変換をしてもよい。 Further, the generation unit holds the generated log information by recording it 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 converts the log information. You may do.

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

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

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

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

これにより、上記ログ記録装置と同様の効果を奏する。 As a result, the same effect as that of the log recording device is obtained.

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

これにより、上記ログ記録装置と同様の効果を奏する。 As a result, the same effect as that of the log recording device is obtained.

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

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

図1は、実施の形態に係る通信システムの構成を示す説明図である。FIG. 1 is an explanatory diagram showing a configuration of a communication system according to an embodiment. 図2は、実施の形態に係るログ記録装置の構成を示すブロック図である。FIG. 2 is a block diagram showing a configuration of a log recording device according to an embodiment. 図3は、ログ記録装置がネットワークから取得する時刻情報を含むフレームの説明図である。FIG. 3 is an explanatory diagram of a frame including time information acquired by the log recording device from the network. 図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 showing a method of converting time information by the conversion unit according to the embodiment. 図6は、実施の形態に係るログ記録装置が外部から取得した時刻情報を用いてログを記録する処理を示すフロー図である。FIG. 6 is a flow chart showing a process of recording a log using time information acquired from the outside by the log recording device according to the embodiment. 図7は、実施の形態に係る、ログ記録装置が外部から時刻情報を取得した後にログを記録する処理を示すフロー図である。FIG. 7 is a flow chart showing a process of recording a log after the log recording device 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. Numerical values, shapes, materials, components, arrangement positions and connection forms of components, steps, order of steps, etc. shown in the following embodiments are examples, and are not intended to limit the present invention. Further, among the components in the following embodiments, the components not described in the independent claims indicating the highest level concept of the present invention will be described as arbitrary components constituting the more preferable form. The same components may be designated by the same reference numerals and description thereof may be omitted.

(実施の形態)
本実施の形態において、時刻同期がなされる前のログに適切な時刻情報を付与できるログ記録装置について説明する。
(Embodiment)
In the present embodiment, a log recording device capable of adding appropriate time information to the log before time synchronization is performed will be 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, for example, a communication system connected to CAN (Control Area Network), which is a network deployed in a vehicle, and controlled by a CAN protocol.

図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 of the above components is connected to network N and can communicate with each other via 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 inside the server 5, and repeatedly transmits the current time to the network N. The starting point of the time measured by the time server 5 is also referred to as a 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 such as a vehicle engine, brake, or steering (not shown). The ECU 101 is connected to the network N, and receives control data for controlling the engine or the like from another device such as an ECU via the network N. Further, the ECU 101 transmits response data to other devices such as the ECU via the network N. Further, the ECU 101 receives the time information distributed by the time server 5 via the network N, and sets the received time information in the own device to connect with the time server 5 and other devices in the communication system 1. Synchronize the time of.

ECU102及び103は、それぞれ、ECU101と同様の制御ユニットであり、ECU101とは独立に動作する。なお、ここでは、通信システム1が3つのECUを備える場合を例として説明しているが、ECUの個数はこれに限定されない。 Each of the ECUs 102 and 103 is a control unit similar to the ECU 101, and operates independently of the ECU 101. Although the case where the communication system 1 includes three ECUs is described here as an example, 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 contents of the communication data and time information at the time of transmission or reception. Further, the log recording device 10 receives the time information distributed by the time server 5 via the network N, and records the log by using the received time information.

このようにして、ログ記録装置10は、時刻サーバ5と同期した時刻情報をログに記録する。ログ記録装置10が計時している時刻の起点を第一時点ともいう。第一時点は、一般には、時刻サーバ5が計時している時刻情報の起点である第二時点とは異なる。 In this way, the log recording device 10 records the 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 a first time point. The first time point is generally different from the second time point, which is the starting point of the time information measured by the time server 5.

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

そこで、同期されていない状態での時刻情報が付されたログの生成を抑制し、時刻サーバ5が配信する時刻情報を受信する前に生成されたログ情報にも適切な時刻情報を付与することができるログ記録装置10について以降で詳しく説明する。 Therefore, it is necessary to suppress the generation of the log with the time information in the unsynchronized state, and add appropriate time information to the log information generated before the time information delivered by the time server 5 is received. The log recording device 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 device 10 according to the present embodiment.

図2に示されるように、ログ記録装置10は、通信IF(インタフェース)11と、機能部12と、時計部13と、生成部14と、変換部15と、記憶部16とを備える。なお、ログ記録装置10は、ログを記録する専用の装置として実現されてもよいし、他の所定の機能を発揮する装置内の一機能として実現されてもよい。 As shown 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. The log recording device 10 may be realized as a dedicated device for recording a log, or may be realized as a function in a device that exerts another predetermined function.

通信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 functional unit 12, the communication IF 11 transmits a frame including the acquired data to the network N. Further, the communication IF 11 receives a frame from another device such as the ECU 101 via the network N, and when the received frame contains data to be provided to the functional unit 12, the received frame is used as the functional unit. Provided to 12. Further, the communication IF 11 receives a frame (also referred to as a “time frame”) including time information distributed by the time server 5. The time frame received by the communication IF 11 is provided to the conversion unit 15. The frame transmitted / received by the communication IF 11 is, for example, a communication frame that follows the CAN protocol.

機能部12は、所定の情報処理を行い、ネットワークNに接続された他の装置との間で情報を送受信する処理部である。機能部12は、例えば、CANデータに基づくコマンド生成に関する情報処理を行う。ログ記録装置10が、他の所定の機能を発揮する装置内の一機能として実現される場合には、他の所定の機能を発揮する部分が機能部12に相当する。なお、機能部12は、必須の構成要素ではない。 The functional unit 12 is a processing unit that performs predetermined information processing and transmits / receives information to / from another device connected to the network N. The functional unit 12 performs information processing related to command generation based on CAN data, for example. When the log recording device 10 is realized as one function in the device that exerts another predetermined function, the portion that exerts the other predetermined function 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 fixedly predetermined to 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 an 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 / 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. In addition, the generation unit 14 temporarily holds the generated log information 17. The log information 17 is held in a volatile recording medium such as RAM (Random Access Memory) or a non-volatile recording medium such as HDD (Hard Disk Drive) or 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 this is recorded in the storage unit 16. Here, the “external” means an external device of the log recording device 10, in other words, another device connected to the network N, and one specific example thereof is the time server 5. At the time of this conversion, the conversion unit 15 reads the log information 17 generated by the generation unit 14 and held in the recording medium, and then performs the conversion. The time information indicating the time starting 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. Acquiring 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 on which log information 17 is recorded. The storage unit 16 is a non-volatile recording medium such as an HDD or SSD. In the storage unit 16, the log information 17 after conversion by the conversion unit 15 is stored as a file 18. The file 18 in which the log information 17 is stored is switched when the time is newly synchronized with the time server 5. As a result, the storage unit 16 is in a state in which 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 the time information from the time server 5, the generation unit 14 determines 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 the time starting from the second time point (also referred to as the fourth time information), and converts the log information 17 into 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 it. 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 provided with 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 in which 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, and the inaccuracy of the time difference between the log information 17 and the reversal of the order are avoided. be able to.

なお、変換部15は、1つのファイル18が所定のサイズ(例えば数百キロバイト)を超えると、新たなファイル18を作成するようにしてもよい。このようにすることで、ログ情報であるファイル18を取得する(ダウンロードする)際の取得時間を軽減できる。また、変換部15は、前回の時刻同期から所定時間が経過した場合には、ファイル18が上記所定のサイズを超えていなくても、新たなファイル18を作成してもよい。ここで所定時間は、例えば、時刻サーバ5の時刻と時計部13の時刻のずれが許容範囲を超えるまでの時間を採用することができる。時刻サーバ5の時刻と時計部13の時刻とを監視しておくことで、時間経過に伴ってこの時間のずれがどのように変化するかを知ることができる。そしてこの時間のずれが時間経過に伴って増大する場合には、この時間のずれが許容範囲を超えるまでの時間を予測することができる。したがって上記のような新たなファイル18の作成が可能となる。このようにすることで、ファイル18は、時刻同期がなされる前(つまり、時刻同期がなされていないとき)に生成されたログ情報17が含まれたファイル18と、時刻同期がなされた後に生成されたログ情報17が含まれたファイル18とを分けてファイル管理することができる利点がある。 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 so, it is possible to reduce the acquisition time when acquiring (downloading) the file 18 which is the log information. Further, when a predetermined time has elapsed from 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, as the predetermined time, 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 permissible range can be adopted. By monitoring the time of the time server 5 and the time of the clock unit 13, it is possible to know how this time lag changes with the passage of time. When this time lag increases with the passage of time, it is possible to predict the time until this time lag exceeds the permissible range. Therefore, it is possible to create a new file 18 as described above. By doing so, the file 18 is generated after the time synchronization is performed with the file 18 containing 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 the file can be managed separately from the file 18 containing the log information 17.

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

図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 contains information that identifies the date and the time. The information for specifying the date and time is shown in, for example, the information for specifying the date in the date format (“2018/01/01” in FIG. 3, that is, January 1, 2018) and the information in the hour, minute, and second format. It includes information for specifying the time (“01:02:03” in FIG. 3, that is, 1: 2: 3). The format of the information described in the time information field 22 is not limited to the above. Specifically, the order of year, month, day, or hour, minute, and second may be different. In addition, the year, month, day, or hour, minute, and second delimiters "/" and ":" 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 contents 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. File 31 corresponds to file 18 in FIG.

ヘッダ部32は、ファイル31内の先頭に配置されるフィールドであり、ファイル31が作成された日付及び時刻が所定のフォーマットで記載されている。ヘッダ部32には、時刻サーバ5から取得した時刻情報に基づいて、第二時点を起点としたファイル31の作成時刻が変換部15により記録されている。ヘッダ部32は、1つのファイル31に1つ存在する。 The header unit 32 is a field arranged at the beginning of the file 31, and the date and time when the file 31 is created is described in a predetermined format. In the header unit 32, the creation time of the file 31 starting from the second time point is recorded by the conversion unit 15 based on the time information acquired from the time server 5. There is one header unit 32 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 after 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 the 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 the transmission or reception of one communication data. The time information 35 is the time information after being converted by the conversion unit 15.

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

図5には、時刻サーバ5が計時している時刻tの軸(つまり同期時刻情報の時間軸)と、時計部13が計時している時刻uの軸(つまり内部時刻情報の時間軸)とが上下に並べて示されている。図5において、同一の時刻は、左右方向において同一の位置に示されている。 In FIG. 5, the axis of time t timed by the time server 5 (that is, the time axis of synchronized time information) and the axis of time u timed by the clock unit 13 (that is, the time axis of internal time information) are shown. 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 synchronous time information is set to time t0, and the starting point (first time point) of the internal time information is set to time u0. Further, the time in the internal time information included in the log information 17 generated and held by the generation unit 14 is set to time u1, and the time when the time u1 is expressed by the synchronous time information is set to time t1. Further, the time when the time server 5 delivers the time information is defined as the time t2 in the synchronized time information, and the time when the time t2 is expressed by the internal time information is defined as u2.

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

t1=u1−(t2−u2) (式1) t1 = u1- (t2-u2) (Equation 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, it corresponds to obtaining the time t1 in the synchronized time information by shifting the time u1 in the internal time information by using the time difference (t2-u2) between the internal time information and the synchronized time information.

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

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

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

図6は、本実施の形態に係るログ記録装置10が外部の時刻サーバから取得した時刻情報を用いてログを記録する処理を示すフロー図である。 FIG. 6 is a flow chart showing a process of recording a log by using the time information acquired from an external time server by the log recording device 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 shown in FIG. 6, in step S101, the generation unit 14 determines whether or not 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 the frame (Yes in step S101), the process proceeds to step S102, and 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 by the functional unit 12 to another device via the network N, and the frame received by the communication IF 11 is a frame received by the functional unit 12 from another device via the network N. This is the frame to receive.

ステップ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 S102, the generation unit 14 determines whether or not the end condition of the predetermined acquisition period for acquiring the 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, and 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 end condition of the acquisition period can be, for example, that a predetermined time (for example, about 10 seconds to 1 minute) has elapsed from the initialization of the communication IF11. As a result, if the conversion unit cannot acquire the time information from the time server 5 even after a predetermined time has elapsed from the initialization of the communication IF 11, the conversion unit records the log information 17 in the storage unit 16 without conversion. It will be. In addition, as the end condition of the acquisition period, it is adopted that a predetermined number of frames are transmitted / received from the initialization of the communication IF11, a predetermined amount of data is transmitted / received from the initialization of the communication IF11, and the like. Can be done. For example, the predetermined number can be 10,000, and the predetermined amount of data can be 200 kByte. These values may vary depending on the amount of communication expected 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 the communication data included in the frame received by the communication IF 11 in step S101 and the 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 or not 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, and 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 compares the time difference between the two ((t2-u2) in (Equation 1)). Is calculated. Then, the conversion unit 15 converts the time information included in the log information 17 held in step S103 into the time information (third time information) in the synchronization time information.

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

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

図7は、本実施の形態に係る、ログ記録装置10が外部の時刻サーバから時刻情報を取得した後にログを記録する処理を示すフロー図である。図7に示される処理は、図6に示される一連の処理が終了した後に実行される。 FIG. 7 is a flow chart showing a process of recording a log after the log recording device 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. 6 is completed.

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

ステップS202において、生成部14は、ステップS201で通信IF11が受信したフレームが、時刻フレームであるか否かを判定する。時刻フレームである場合(ステップS202でYes)には、ステップS203に進み、そうでない場合(ステップS202でNo)には、ステップS206に進む。 In step S202, the generation unit 14 determines whether or not 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, and 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 measured by the clock unit 13 with the time information included in the frame received in step S201, and compares the time information between the two ((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 beginning of the generated new file 18. The process of step S205 is also referred to as a file 18 update process.

ステップS206において、生成部14は、ステップS201で受信したフレームに含まれる通信データの内容と、当該フレームの送信又は受信の時を示す時刻情報とを含むログ情報17を生成する。生成部14は、上記ログ情報17を生成する際には、時計部13が示す時刻情報を含めたログ情報17を生成した後に、その含められた時刻情報を同期時刻情報に変換したものである。 In step S206, the generation unit 14 generates log information 17 including the content of the communication data included in the frame received in step S201 and the time information indicating the time of transmission or reception of the frame. When the log information 17 is generated, 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. After completing step S207, 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 the communication data to be transmitted / received and the time information at the time of transmission or reception.

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

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

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

また、ログ記録装置は、外部の時刻サーバから新たな時刻情報を取得した場合には、その取得より後のログ情報を新たなファイルに記録する。仮に新たな時刻情報を取得した場合に、その取得の前後で同一のファイルにログ情報を記録するとすれば、一のファイル内に時刻情報の起点が異なるログ情報が混在することになり、一のファイル内のログ情報間での時間差が不正確になったり、ログ情報の順序の逆転が起こったりする。そこで、外部の時刻サーバから新たな時刻情報を取得した場合にログ情報を新たなファイルに記録するようにすることで、上記の時間差の不正確さ、及び、順序の逆転などを回避することができる。よって、ログ記録装置は、ログファイルにおける時間差の不正確さ、及び、順序の逆転などを回避しながら、時刻同期がなされる前のログに適切な時刻情報を付与することができる。 Further, when the log recording device acquires new time information from an external time server, the log recording device records the 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, and the order of the log information is reversed. Therefore, by recording the log information in a new file when new time information is acquired from an external time server, it is possible to avoid the above-mentioned inaccuracy of time difference and reversal of order. can. Therefore, the log recording device can add appropriate time information to the log before the time synchronization is performed while avoiding the inaccuracy of the time difference in the log file and the 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, the device or 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 easily acquire the creation time of the file from the file, and can add appropriate time information to the log before the time synchronization is performed.

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

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

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

なお、本発明は、装置として実現できるだけでなく、その装置を構成する処理手段をステップとする方法として実現したり、それらステップをコンピュータに実行させるプログラムとして実現したり、そのプログラムを記録したコンピュータ読み取り可能なCD−ROMなどの記録媒体として実現したり、そのプログラムを示す情報、データ又は信号として実現したりすることもできる。そして、それらプログラム、情報、データ及び信号は、インターネット等の通信ネットワークを介して配信してもよい。 The present invention can be realized not only as an apparatus, but also as a method in which the processing means constituting the apparatus is used as a step, as a program for causing a computer to execute those steps, or as a computer reading in which the program is recorded. 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. Then, those 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 above based on the embodiment, the present invention is not limited to this embodiment. As long as the gist of the present invention is not deviated, various modifications that can be conceived by those skilled in the art are applied to the present embodiment, and a form constructed by combining components in different embodiments is also included in the scope of the present invention. ..

本発明は、時刻同期がなされる前のログに適切な時刻情報を付与できるログ記録装置に適用され得る。具体的には、車両内のネットワークを含む各種ネットワークにおける通信ログを記録するログ記録装置に適用され得る。 The present invention can be applied to a log recording device capable of adding appropriate time information to a log before time synchronization is performed. Specifically, it 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 ネットワーク
1 Communication system 5 Time server 10 Log recording device 11 Communication IF
12 Functional unit 13 Clock unit 14 Generation unit 15 Conversion unit 16 Storage unit 17 Log information 18, 31 File 21 Frame 22 Time information field 32 Header unit 33 Log entry 35 Time information 36 Communication data content 101, 102, 103 ECU
N network

Claims (9)

第一時点を起点とした時刻を計時する時計部と、
通信データの送信又は受信をする通信インタフェースと、
前記通信データの内容と、前記通信インタフェースによる前記送信又は前記受信の時の前記時計部の時刻を示す第一時刻情報とを含むログ情報を生成し、保持する生成部と、
第二時点を起点とした時刻を示す第二時刻情報を外部から取得し、取得した前記第二時刻情報と、前記時計部が計時している時刻とを比較して、前記生成部が保持している前記ログ情報に含まれている前記第一時刻情報を、前記第二時点を起点とした第三時刻情報に変換して、前記第三時刻情報を含む前記ログ情報を記録媒体に記録する変換部とを備え、
前記生成部は、
前記変換部が第二時刻情報を取得した後に前記通信インタフェースが送信又は受信をした通信データの内容と、前記通信インタフェースによる前記送信又は前記受信の時の前記時計部の時刻を示す第一時刻情報とを含むログ情報を生成し、
前記変換部は、
前記生成部が生成した前記ログ情報に含まれている前記第一時刻情報を、前記第二時点を起点とした第四時刻情報に変換して、前記第四時刻情報を含む前記ログ情報を前記記録媒体に記録する
ログ記録装置。
A clock unit that measures the time starting from the first point in time,
A communication interface that sends or receives communication data,
A generation unit that generates and holds log information including the content of the communication data and the first time information indicating the time of the clock unit at the time of transmission or reception by the communication interface.
The 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 information. The first time information included in the log information is converted into the third time information starting from the second time point, and the log information including the third time information is recorded on the recording medium. Equipped with a conversion unit
The generator
First time information indicating the content of communication data transmitted or received by the communication interface after the conversion unit has acquired the second time information, and the time of the clock unit at the time of transmission or reception by the communication interface. Generate log information including and
The conversion unit
The first time information included in the log information generated by the generation unit is converted into the fourth time information starting from the second time point, and the log information including the fourth time information is converted into the log information. A log recording device that records on a recording medium.
前記変換部によって前記記録媒体に記録された、前記第三時刻情報を含む前記ログ情報は、前記記録媒体内のファイルに記録されており、
前記変換部は、
前記第二時刻情報を取得した後に、さらに、新たな第二時刻情報を取得した場合には、前記新たな第二時刻情報を取得した後に前記生成部が生成した新たなログ情報に含まれている前記第一時刻情報を第四時刻情報に変換して、前記第四時刻情報を含む前記新たなログ情報を、前記記録媒体内の新たなファイルに記録する
請求項1に記載のログ記録装置。
The log information including the third time information recorded on the recording medium by the conversion unit is recorded in a file in the recording medium.
The conversion unit
When new second time information is acquired after the second time information is acquired, it is included in the new log information generated by the generation unit after the new second time information is acquired. The log recording device according to claim 1, wherein the first time information is converted into the fourth time information, and the new log information including the fourth time information is recorded in a new file in the recording medium. ..
前記変換部は、前記新たなファイル内の先頭に、前記第二時点を起点とした前記新たな
ファイルの作成時刻を記録する
請求項2に記載のログ記録装置。
The log recording device according to claim 2, 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〜3のいずれか1項に記載のログ記録装置。
If the conversion unit cannot acquire the second time information even after a predetermined time has elapsed from the initialization of the communication interface, the conversion unit obtains the log information including the first time information without performing the conversion. The log recording device according to any one of claims 1 to 3, which records on the recording medium.
前記生成部は、生成した前記第一時刻情報を含む前記ログ情報を保持用記録媒体に記録することで保持し、
前記変換部は、前記生成部が前記第一時刻情報を含む前記ログ情報を記録した前記保持用記録媒体から、前記第一時刻情報を含む前記ログ情報を読み出して前記変換をする
請求項1〜4のいずれか1項に記載のログ記録装置。
The generation unit holds the log information including the generated first time information by recording it on a holding recording medium.
The conversion unit performs the conversion by reading the log information including the first time information from the holding recording medium in which the generation unit has recorded the log information including the first time information. The log recording device according to any one of 4.
前記通信インタフェースは、車両内のネットワークに前記通信データを送信又は受信する
請求項1〜5のいずれか1項に記載のログ記録装置。
The log recording device according to any one of claims 1 to 5, wherein the communication interface transmits or receives the communication data to a network in a vehicle.
前記生成部は、生成した前記第一時刻情報を含む前記ログ情報を揮発性記録媒体に保持し、
前記記録媒体は、不揮発性記録媒体である
請求項1〜6のいずれか1項に記載のログ記録装置。
The generation unit holds the log information including the generated first time information in a volatile recording medium, and holds the log information.
The log recording device according to any one of claims 1 to 6, wherein the recording medium is a non-volatile recording medium.
ログ記録装置の制御方法であって、
第一時点を起点とした時刻を計時する計時ステップと、
通信データの送信又は受信をする通信ステップと、
前記通信データの内容と、前記通信ステップでの前記送信又は前記受信の時に前記計時ステップで計時された時刻を示す第一時刻情報とを含むログ情報を生成し、保持する生成ステップと、
第二時点を起点とした時刻を示す第二時刻情報を外部から取得し、取得した前記第二時刻情報と、前記計時ステップで計時している時刻とを比較して、前記生成ステップで保持した前記ログ情報に含まれている前記第一時刻情報を、前記第二時点を起点とした第三時刻情報に変換して、前記第三時刻情報を含む前記ログ情報を記録媒体に記録する変換ステップとを含み、
前記生成ステップでは、
前記変換ステップで第二時刻情報を取得した後に前記通信ステップで送信又は受信をした通信データの内容と、前記通信ステップでの前記送信又は前記受信の時に前記計時ステップで計時された時刻を示す第一時刻情報とを含むログ情報を生成し、
前記変換ステップでは、
前記生成ステップで生成した前記ログ情報に含まれている前記第一時刻情報を、前記第二時点を起点とした第四時刻情報に変換して、前記第四時刻情報を含む前記ログ情報を記録媒体に記録する
制御方法。
It is a control method of the logging device.
A timekeeping step that measures the time starting from the first time point,
Communication steps for sending or receiving communication data,
A generation step of generating and holding log information including the content of the communication data and the first time information indicating the time measured in the timekeeping step at the time of the transmission or the reception in the communication step.
The second time information indicating the time starting from the second time point was acquired from the outside, the acquired second time information was compared with the time measured in the time counting 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 including the third time information on a recording medium. Including and
In the generation step,
A second indicating the content of the communication data transmitted or received in the communication step after acquiring the second time information in the conversion step, and the time measured in the timing step at the time of the transmission or reception in the communication step. Generate log information including timekeeping information
In the conversion step
The first time information included in the log information generated in the generation step is converted into the fourth time information starting from the second time point, and the log information including the fourth time information is recorded. A control method for recording on a medium.
請求項8に記載のログ記録装置の制御方法をコンピュータに実行させるためのプログラム。
A program for causing a computer to execute the control method of the logging device 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 JP2019175263A (en) 2019-10-10
JP6920738B2 true 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)

Families Citing this family (2)

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

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3778652B2 (en) * 1997-04-18 2006-05-24 株式会社日立製作所 Log data collection management method and apparatus
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

Also Published As

Publication number Publication date
JP2019175263A (en) 2019-10-10

Similar Documents

Publication Publication Date Title
JP6920738B2 (en) Logging device, control method, and program
CA2990840C (en) Pps tagging of acoustic sample data
CN110162523B (en) Data storage method, system, device and equipment
US8208763B2 (en) Image processing method and apparatus
CN109560895A (en) Data transmission method and device
JP2004112602A (en) Digital information input system, information generation device, information management method, program, and computer readable recording medium
US8214682B2 (en) Synchronizing signals related to the operation of a computer system
JP6381426B2 (en) Information processing apparatus, control method, and program
JP2016016579A (en) Information processing apparatus, control method thereof, and information processing system
WO2023019984A1 (en) Clock synchronization method for control system, and control system
CN112905106A (en) Data processing method, device, system, equipment and storage medium
JP2024048944A (en) VEHICLE CONTROL SYSTEM, CONTROL METHOD FOR VEHICLE CONTROL SYSTEM, ELECTRONIC DEVICE, AND PROGRAM
CN116015523A (en) Time synchronization method and device and electronic equipment
WO2017036308A1 (en) File uploading method, access method, device and apparatus
US7085948B2 (en) Method, apparatus, and computer program product for implementing time synchronization correction in computer systems
JP6979429B2 (en) Controls, control methods, and programs
CN110515907B (en) Data synchronization method and related device for distributed storage nodes
CN114928425A (en) Terminal device time synchronization system, method, device and storage medium
JP2003207586A (en) Electronic equipment and its internal time information control method
US11513769B2 (en) Data acquisition system, input device, data acquisition apparatus, and data combining apparatus
CN113985431A (en) Data acquisition method, system, device, electronic equipment and storage medium
JP7189743B2 (en) Measurement result receiving device, measuring device, method, program and recording medium thereof
CN113259039A (en) Time synchronization method and device, computer equipment and storage medium
CN113098939B (en) Data transmission method, data transmission device and electronic equipment
WO2019047348A1 (en) Data sending method and receiving method based on audio interface

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 Written amendment

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 Written amendment

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