JP2010187323A - Gateway device - Google Patents

Gateway device Download PDF

Info

Publication number
JP2010187323A
JP2010187323A JP2009031603A JP2009031603A JP2010187323A JP 2010187323 A JP2010187323 A JP 2010187323A JP 2009031603 A JP2009031603 A JP 2009031603A JP 2009031603 A JP2009031603 A JP 2009031603A JP 2010187323 A JP2010187323 A JP 2010187323A
Authority
JP
Japan
Prior art keywords
data
lin
timing
communication schedule
network
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
JP2009031603A
Other languages
Japanese (ja)
Other versions
JP5218128B2 (en
Inventor
Hirotaka Ito
寛隆 伊藤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Denso Corp
Original Assignee
Denso Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Denso Corp filed Critical Denso Corp
Priority to JP2009031603A priority Critical patent/JP5218128B2/en
Publication of JP2010187323A publication Critical patent/JP2010187323A/en
Application granted granted Critical
Publication of JP5218128B2 publication Critical patent/JP5218128B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Small-Scale Networks (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To improve efficiency of data transfer in a gateway device connecting a plurality of networks in a vehicle. <P>SOLUTION: In a gateway device for performing data transfer between a CAN and a LIN, the timing of reception in the CAN is detected and the timing to start a communication schedule in the LIN is adjusted to start the communication schedule just after the reception timing. In the case where the communication schedule in the LIN is constituted of (transmission of) a transmission frame and (reception of) a reception frame, when the communication schedule in the LIN is started just after the reception timing in the CAN, data received in the CAN are immediately transferred to the LIN in accordance with the communication schedule, like a LIN communication schedule pattern (11), thereby improving transfer efficiency. <P>COPYRIGHT: (C)2010,JPO&INPIT

Description

本発明は、車両に搭載される車両ネットワークにおいて用いられ、その車両ネットワークにおける複数のネットワーク間を接続してデータの転送処理を行うゲートウェイ装置に関する。   The present invention relates to a gateway device that is used in a vehicle network mounted on a vehicle and performs data transfer processing by connecting a plurality of networks in the vehicle network.

車両に搭載される車両ネットワークとしては、電子制御装置(以下、ECUと記載する)と、センサやアクチュエータとの間を1ないし複数本のワイヤハーネスで接続し、そのワイヤハーネスを介して、個々の仕様に応じた信号をやりとりするようにしたものがある。   As a vehicle network mounted on a vehicle, one or more wire harnesses are connected between an electronic control device (hereinafter referred to as an ECU) and sensors or actuators, and individual wiring harnesses are used to connect individual devices. There is one that exchanges signals according to the specifications.

車両においては制御の高度化・複雑化に伴いやりとりすべき情報量は増大傾向にあり、上記のような車両ネットワークではより多くのワイヤハーネスが必要となっていた。このため、搭載性が悪化したり重量やコストが増加したりしてしまうという問題があった。
そこで、近年では、CAN(Controller Area Network)やLIN(Local Interconnect Network)などの多重通信ネットワークが利用される場合がある。CANの通信仕様は、CSMA/CA(Carrier Sence Multiple Access/Collision Avoidance)方式である。CANでは、各通信装置(例えばECU)は、通信バスが空いていれば即時にデータを送信することが可能である。
In vehicles, the amount of information to be exchanged tends to increase as control becomes more sophisticated and complicated, and more wire harnesses are required in such a vehicle network. For this reason, there existed a problem that mounting property deteriorated or a weight and cost increased.
Therefore, in recent years, a multiple communication network such as a CAN (Controller Area Network) or a LIN (Local Interconnect Network) may be used. The CAN communication specification is a CSMA / CA (Carrier Sense Multiple Access / Collection Avidance) system. In CAN, each communication device (for example, ECU) can immediately transmit data if the communication bus is free.

一方、LINの通信仕様は、シングルマスタ/マルチスレーブ方式である。LINでは、マスタが1台あり、そのマスタによるスケジューリングに従って通信が行われる。例えば、スレーブは、マスタの指示がないかぎりデータを送信することはできない。   On the other hand, the communication specification of LIN is a single master / multi-slave system. In the LIN, there is one master, and communication is performed according to scheduling by the master. For example, the slave cannot transmit data unless instructed by the master.

図19は、車両ネットワークの構成の一例を示す図面である。   FIG. 19 is a diagram illustrating an example of a configuration of a vehicle network.

図19に示す車両ネットワーク300は、ECU301,302を備えている。そのECU301,302は、周知のマイコンを備え、CAN通信線307を介して接続され、CANのプロトコルに従って通信可能なように構成されている。   A vehicle network 300 illustrated in FIG. 19 includes ECUs 301 and 302. The ECUs 301 and 302 include known microcomputers, are connected via a CAN communication line 307, and are configured to be communicable according to a CAN protocol.

また、ECU301は、ワイヤハーネス304,305を介して制御対象としての制御装置303と接続される。そして、ECU301は、ワイヤハーネス304,305を介して制御装置303との間でデータの送受信を行う。また、ECU302は、ワイヤハーネス306を介して制御装置303と接続される。そして、ECU302は、ワイヤハーネス306を介して制御装置303との間でデータの送受信を行う。図19の例では、ワイヤハーネスは3本用いられている。   The ECU 301 is connected to a control device 303 as a control target via wire harnesses 304 and 305. ECU 301 transmits and receives data to and from control device 303 via wire harnesses 304 and 305. ECU 302 is connected to control device 303 via wire harness 306. ECU 302 transmits and receives data to and from control device 303 via wire harness 306. In the example of FIG. 19, three wire harnesses are used.

図20は、CAN及びLINを利用した車両ネットワークの構成の一例を示す図面であり、図19におけるワイヤハーネス304,305,306による接続をLIN通信線404による接続に置き換え、LINのプロトコルに従って通信するようにしたものである。   FIG. 20 is a diagram illustrating an example of a configuration of a vehicle network using CAN and LIN. The connection using the wire harnesses 304, 305, and 306 in FIG. 19 is replaced with the connection using the LIN communication line 404, and communication is performed according to the LIN protocol. It is what I did.

図20に示す車両ネットワーク400は、ECU401,402を備えている。そのECU401,402は、CAN通信線405を介して互いに接続され、CANのプロトコルに従って通信可能なように構成されている。   A vehicle network 400 illustrated in FIG. 20 includes ECUs 401 and 402. The ECUs 401 and 402 are connected to each other via a CAN communication line 405 and configured to be communicable according to a CAN protocol.

そして、ECU401は、LIN通信線404を介して制御対象としての制御装置403と接続され、そのLIN通信線404を介してLINのプロトコルに従って制御装置403との間でデータの送受信を行う。図20のLINにおいて、ECU401がマスタであり、制御装置403がスレーブである。   The ECU 401 is connected to a control device 403 as a control target via the LIN communication line 404, and transmits and receives data to and from the control device 403 via the LIN communication line 404 according to the LIN protocol. In LIN in FIG. 20, the ECU 401 is a master and the control device 403 is a slave.

そして、図20において、ECU401は、CANとLINとを接続するゲートウェイとしても機能し、CAN上で例えばECU402から受信したデータをLINに送ったり、LIN上で例えば制御装置403から受信したデータをCANに送ったりする。ECU402は、ECU401を介して制御装置403と通信を行うこと、及びその制御装置403を制御することが可能である。尚、複数のネットワーク間を接続してデータを転送するようなゲートウェイ装置について、例えば特許文献1に記載されている。   In FIG. 20, the ECU 401 also functions as a gateway that connects CAN and LIN. For example, the data received from the ECU 402 on the CAN is sent to the LIN, or the data received from the control device 403 on the LIN is sent to the CAN. Or send to. The ECU 402 can communicate with the control device 403 via the ECU 401 and can control the control device 403. For example, Patent Document 1 discloses a gateway device that transfers data by connecting a plurality of networks.

ここで、図21は、LINにおいて送受信されるメッセージフレームの構成及びLINにおける通信のスケジュール(以下、単に通信スケジュールと記載する)の例を表す図である。尚、以下、LINにおける通信のことを簡略化してLIN通信と記載する。CANについても同様に、CANにおける通信のことをCAN通信と記載することとする。   Here, FIG. 21 is a diagram illustrating an example of a configuration of a message frame transmitted and received in the LIN and a communication schedule in the LIN (hereinafter simply referred to as a communication schedule). Hereinafter, communication in LIN is simplified and described as LIN communication. Similarly for CAN, communication in CAN is referred to as CAN communication.

LIN通信におけるメッセージフレームは、マスタによって初期化されたヘッダと、それに続くレスポンスとで構成される。マスタから定期的にヘッダが送出され、そのヘッダの内容に従って、マスタ或いはスレーブからレスポンスが送出される。   A message frame in LIN communication is composed of a header initialized by the master and a response following the header. A header is periodically sent from the master, and a response is sent from the master or slave according to the contents of the header.

ヘッダは、図21に示すように、Synch Break(同期ブレーク)、Synch Field(同期フィールド)、及びIdent Field(識別子フィールド)の3つのフィールドで構成される。Synch Break(同期ブレーク)はフレームの始まりを表す。Synch Field(同期フィールド)は、スレーブのボーレートの調整に用いられる。Ident Field(識別子フィールド)は識別子バイトを含んでいる。識別子バイトはメッセージフレームの目的を一意に定めるものである。   As shown in FIG. 21, the header includes three fields: Sync Break (synchronization break), Sync Field (synchronization field), and Ident Field (identifier field). Sync Break (synchronous break) represents the beginning of a frame. The Synch Field (synchronization field) is used to adjust the baud rate of the slave. An Identity Field (identifier field) contains an identifier byte. The identifier byte uniquely defines the purpose of the message frame.

レスポンスは、図21に示すように、Data Field(データフィールド)、及びCheck Sum(チェックサム)の2つのフィールドで構成される。Data Field(データフィールド)は、具体的なデータを格納する。Check Sum(チェックサム)は、エラー検出の機能を果たす。   As shown in FIG. 21, the response includes two fields, Data Field (data field) and Check Sum (checksum). The Data Field (data field) stores specific data. Check Sum (checksum) performs an error detection function.

メッセージフレームは、マスタからスレーブへのデータが格納された送信フレームと、スレーブからマスタへのデータが格納された受信フレームとに区別される。
次に通信のスケジュールの例について説明する。図21の例において、送信フレーム及び受信フレーム共にデータ量が4[byte]で、転送ボーレートが19.2[kbps]であるとすると、1つの送信フレーム或いは受信フレームの転送時間は約6.2[msec]となる。そして、送信フレーム及び受信フレームの2つのフレームの送受信で1つの通信スケジュール(以下、1スケジュールとも記載する)を構成するとした場合、マスタは、ヘッダを例えば8[msec]毎に送信すれば良い。この8[msec]という値は、上記の6.2[msec]に余裕分を含めたものである。このとき、1スケジュールの時間は16[msec]となる。ところで、LINでは、所定の周期で起動する定期タスクを基準にスケジュールが制御される。4[msec]の周期で起動する定期タスクで通信スケジュールを制御するとした場合、4周期毎(定期タスク4個毎)に1スケジュールが完了することとなる。
The message frame is classified into a transmission frame in which data from the master to the slave is stored and a reception frame in which data from the slave to the master is stored.
Next, an example of a communication schedule will be described. In the example of FIG. 21, if the data amount of both the transmission frame and the reception frame is 4 [bytes] and the transfer baud rate is 19.2 [kbps], the transfer time of one transmission frame or reception frame is about 6.2. [Msec]. When one communication schedule (hereinafter also referred to as one schedule) is configured by transmission / reception of two frames of a transmission frame and a reception frame, the master may transmit a header every 8 [msec], for example. The value of 8 [msec] is obtained by adding a margin to the above 6.2 [msec]. At this time, the time of one schedule is 16 [msec]. By the way, in LIN, a schedule is controlled based on a periodic task that is activated at a predetermined cycle. If the communication schedule is controlled by a periodic task activated at a cycle of 4 [msec], one schedule is completed every four cycles (every four periodic tasks).

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

ここで、図22は、CANとLINとの間におけるデータの転送例を表す図である。具体的には、CANからLINへのデータの転送例を表す。例えば、図20においてECU401がCANからLINにデータを転送する場合を想定する。   Here, FIG. 22 is a diagram illustrating an example of data transfer between CAN and LIN. Specifically, an example of data transfer from CAN to LIN is shown. For example, in FIG. 20, it is assumed that the ECU 401 transfers data from CAN to LIN.

ECU401は、CANにおいて転送対象のデータを16[msec]の周期で受信するとする。また、ECU401がマスタとして動作するLINにおける定期タスクの周期が4[msec]であるとともに通信スケジュールの周期が16[msec]であるとする。通信スケジュールは送信フレームの送受信と受信フレームの送受信とで構成される(図21参照)ものとする。   It is assumed that the ECU 401 receives data to be transferred in the CAN at a cycle of 16 [msec]. Further, it is assumed that the periodic task period in the LIN in which the ECU 401 operates as a master is 4 [msec] and the communication schedule period is 16 [msec]. The communication schedule is composed of transmission / reception of transmission frames and transmission / reception of reception frames (see FIG. 21).

ECU401は、CANにおいて受信したデータ1をLINに転送する場合、LINにおける次の通信スケジュールの開始までLINにデータ1を転送することはできない。例えば、LINにおける通信スケジュールの開始直後にCANにおいてデータ1を受信したとすると、LINにそのデータ1を転送するためには、LINにおける次の通信スケジュールまでのおおよそ1周期分(通信スケジュールの1周期分)、待たなくてはならない。   When the ECU 401 transfers the data 1 received in the CAN to the LIN, the ECU 401 cannot transfer the data 1 to the LIN until the start of the next communication schedule in the LIN. For example, if data 1 is received in CAN immediately after the start of the communication schedule in LIN, in order to transfer the data 1 to LIN, approximately one period until the next communication schedule in LIN (one period of the communication schedule) Min), I have to wait.

次に、図23を用いて、CANからLINへのデータ転送についてさらに具体的に説明する。   Next, the data transfer from CAN to LIN will be described more specifically with reference to FIG.

図23は、例えばECU401(図20参照)が、CANにおいて16[msec]の周期で受信するデータをLINに転送する場合の例である。LINでは、4[msec]周期で起動する定期タスクにて通信スケジュールが制御されている。1つの通信スケジュールは送信フレームの送受信と受信フレームの送受信とで構成される。この例では、1つの通信スケジュール毎に送信フレームが送受信される(ECU401が送信フレームを送信する)。言い換えると、定期タスク4個分(以下、4タスク分というように記載する)に相当する16[msec]毎に送信フレームが送受信されるようになっている。図23には、LINの通信スケジュールの開始タイミングが1タスク分(4[msec])づつ異なる4つのパターン(LIN通信スケジュールパターン(11)〜(14))を示している。   FIG. 23 shows an example in which, for example, the ECU 401 (see FIG. 20) transfers data received in the CAN at a cycle of 16 [msec] to the LIN. In LIN, the communication schedule is controlled by a periodic task that starts at a cycle of 4 [msec]. One communication schedule includes transmission / reception of transmission frames and transmission / reception of reception frames. In this example, a transmission frame is transmitted and received for each communication schedule (the ECU 401 transmits a transmission frame). In other words, a transmission frame is transmitted and received every 16 [msec] corresponding to four periodic tasks (hereinafter referred to as four tasks). FIG. 23 shows four patterns (LIN communication schedule patterns (11) to (14)) in which the start timing of the LIN communication schedule differs by one task (4 [msec]).

図23に示すように、LIN通信スケジュールパターン(11)〜(14)のうち、通信スケジュールパターン(11)において、CANにて受信されたデータが最短でLINに転送されることとなる。   As shown in FIG. 23, in the communication schedule pattern (11) among the LIN communication schedule patterns (11) to (14), the data received by the CAN is transferred to the LIN in the shortest time.

一方、LIN通信スケジュールパターン(12)〜(14)では、CANにて受信されたデータがLINに転送されるまでには、LIN通信スケジュールパターン(11)と比較して遅れが生じる。   On the other hand, in the LIN communication schedule patterns (12) to (14), there is a delay compared to the LIN communication schedule pattern (11) until the data received by the CAN is transferred to the LIN.

具体的に、LIN通信スケジュールパターン(12)では1タスク分(通信スケジュールの周期の1/4)だけ遅れが生じ、LIN通信スケジュールパターン(13)では2タスク分(通信スケジュールの周期の2/4)だけ遅れが生じ、LIN通信スケジュールパターン(14)では3タスク分(通信スケジュールの周期の3/4)だけ遅れが生じる。   Specifically, the LIN communication schedule pattern (12) is delayed by one task (1/4 of the communication schedule period), and the LIN communication schedule pattern (13) is two tasks (2/4 of the communication schedule period). ), And the LIN communication schedule pattern (14) is delayed by 3 tasks (3/4 of the communication schedule period).

このように、CANとLINとの間でデータ転送する場合、CANにおけるデータの受信周期と、LINにおける通信スケジュールの周期とが異なれば、CANからLINへのデータの転送に遅れが生じる場合がある。   In this way, when data is transferred between CAN and LIN, if the data reception cycle in CAN and the communication schedule cycle in LIN are different, there may be a delay in data transfer from CAN to LIN. .

次に、図24は、例えばECU401(図20参照)が、LINにて受信するデータをCANに転送する場合の態様の例を示す図面である。LINでは、4[msec]周期で起動する定期タスクにて通信スケジュールが制御されている。1つの通信スケジュールは送信フレームの送受信と受信フレームの送受信とで構成される。この例では、通信スケジュールの1周期毎(4タスク分:16[msec]毎)に受信フレームが送受信されるようになっている。図24には、LINの通信スケジュールの開始タイミングが1タスク分(4[msec])づつ異なる4つのパターン(LIN通信スケジュールパターン(15)〜(18))を示している。   Next, FIG. 24 is a diagram illustrating an example of a mode in a case where the ECU 401 (see FIG. 20) transfers data received by the LIN to the CAN, for example. In LIN, the communication schedule is controlled by a periodic task that starts at a cycle of 4 [msec]. One communication schedule includes transmission / reception of transmission frames and transmission / reception of reception frames. In this example, the received frame is transmitted and received every cycle of the communication schedule (4 tasks: every 16 [msec]). FIG. 24 shows four patterns (LIN communication schedule patterns (15) to (18)) in which the start timing of the LIN communication schedule differs by one task (4 [msec]).

図24に示すように、LIN通信スケジュールパターン(15)〜(18)のうち、通信スケジュールパターン(18)において、LINにて受信されたデータが最短でCANに転送されることとなる。   As shown in FIG. 24, in the communication schedule pattern (18) among the LIN communication schedule patterns (15) to (18), the data received by the LIN is transferred to the CAN in the shortest time.

一方、LIN通信スケジュールパターン(15)〜(17)では、LINにて受信されたデータがCANに転送されるまでには、LIN通信スケジュールパターン(18)と比較して遅れが生じる。   On the other hand, in the LIN communication schedule patterns (15) to (17), there is a delay compared to the LIN communication schedule pattern (18) until the data received by the LIN is transferred to the CAN.

具体的に、LIN通信スケジュールパターン(17)では1タスク分(通信スケジュールの周期の1/4)だけ遅れが生じ、LIN通信スケジュールパターン(16)では2タスク分(通信スケジュールの周期の2/4)だけ遅れが生じ、LIN通信スケジュールパターン(15)では3タスク分(通信スケジュールの周期の3/4)だけ遅れが生じる。   Specifically, the LIN communication schedule pattern (17) is delayed by one task (1/4 of the communication schedule period), and the LIN communication schedule pattern (16) is two tasks (2/4 of the communication schedule period). ), And the LIN communication schedule pattern (15) is delayed by 3 tasks (3/4 of the communication schedule period).

このように、CANとLINとの間でデータ転送する場合、CANにおけるデータの送信周期と、LINにおける通信スケジュールの周期とが異なれば、LINからCANへのデータの転送に遅れが生じる場合がある。   As described above, when data is transferred between CAN and LIN, if the data transmission cycle in CAN and the communication schedule cycle in LIN are different, there may be a delay in data transfer from LIN to CAN. .

本発明は、こうした問題に鑑みなされたもので、車両における複数のネットワーク間を接続するゲートウェイ装置において、データ転送の効率を向上させることを目的とする。   The present invention has been made in view of these problems, and an object thereof is to improve the efficiency of data transfer in a gateway device that connects a plurality of networks in a vehicle.

上記目的を達成するためになされた請求項1に記載の発明は、車両内の複数のネットワークに接続されてそのネットワーク間でのデータ転送を行うゲートウェイ装置であって、少なくとも、マスタ装置によって定期的に起動される通信スケジュールに従って、データの送受信が行われるネットワーク(以下、第1のネットワークと称する)と他のネットワーク(以下、第2のネットワークと称する)との間のデータ転送を行うゲートウェイ装置において、マスタ装置として動作して通信スケジュールを起動するように構成されている。   In order to achieve the above object, the invention described in claim 1 is a gateway device connected to a plurality of networks in a vehicle and transferring data between the networks, and at least periodically by a master device. In a gateway apparatus for transferring data between a network (hereinafter referred to as a first network) in which data is transmitted and received according to a communication schedule activated by the network (hereinafter referred to as a second network) It is configured to operate as a master device and activate a communication schedule.

そして、第1のネットワーク及び第2のネットワークを監視し、転送対象のデータが第1のネットワーク上で送受信される場合の送受信タイミング、及びその転送対象のデータが第2のネットワーク上で送受信される場合の送受信タイミングを検出する検出手段と、検出手段の検出結果に基づき、第1のネットワーク上での送信タイミングと第2のネットワーク上での受信タイミングとが同期するため、或いは第1のネットワーク上での受信タイミングと第2のネットワーク上での送信タイミングとが同期するための通信スケジュールの起動タイミングを算出する算出手段と、を備え、算出手段により算出された起動タイミングで通信スケジュールを起動するようになっている。   Then, the first network and the second network are monitored, transmission / reception timing when the transfer target data is transmitted / received on the first network, and the transfer target data is transmitted / received on the second network. Detection means for detecting the transmission / reception timing in this case, and because the transmission timing on the first network and the reception timing on the second network are synchronized based on the detection result of the detection means, or on the first network Calculating means for calculating a start timing of the communication schedule for synchronizing the reception timing at the transmission and the transmission timing on the second network, so that the communication schedule is started at the start timing calculated by the calculating means It has become.

このようなゲートウェイ装置によれば、第1のネットワーク上での送信タイミングと第2のネットワーク上での受信タイミングとが同期するように第1のネットワークにおける通信スケジュールが起動するため、第1のネットワークで受信されるデータを即座に第2のネットワークに送信できるようになる。また、第1のネットワーク上での受信タイミングと第2のネットワーク上での送信タイミングとが同期するように第1のネットワークにおける通信スケジュールが起動するため、第2のネットワークで受信されるデータを即座に第1のネットワークに送信できるようになる。つまり、第1のネットワークと第2のネットワークとの間において、転送対象のデータをより短時間で転送できるようになる。   According to such a gateway device, since the communication schedule in the first network is activated so that the transmission timing on the first network and the reception timing on the second network are synchronized, the first network The data received at can be immediately transmitted to the second network. In addition, since the communication schedule in the first network is activated so that the reception timing on the first network and the transmission timing on the second network are synchronized, the data received on the second network is immediately Can be transmitted to the first network. That is, data to be transferred can be transferred in a shorter time between the first network and the second network.

また、検出手段を備えていることによって、所望のデータについて送受信タイミングを検出することができる。このため、状況に応じて送受信タイミングの検出対象(言い換えると、同期をとる対象)のデータを変更しても良く、その時々に応じて転送の最適化を図ることが可能である。   Further, by providing the detection means, it is possible to detect the transmission / reception timing for the desired data. For this reason, the data of the transmission / reception timing detection target (in other words, the target of synchronization) may be changed according to the situation, and the transfer can be optimized according to the time.

特に、転送対象のデータが複数あるような場合には、請求項2のように構成すると良い。   In particular, when there are a plurality of data to be transferred, it is preferable to configure as in claim 2.

請求項2のゲートウェイ装置は、請求項1のゲートウェイ装置において、転送対象のデータは複数種類あり、その複数種類のデータには重要度を表す情報が含まれ、検出手段は、複数種類のデータのうち重要度が最も高いデータについて、第1のネットワーク上での送受信タイミング、及び第2のネットワーク上での送受信タイミングを検出するようになっている。   The gateway device according to claim 2 is the gateway device according to claim 1, wherein there are a plurality of types of data to be transferred, the plurality of types of data includes information indicating importance, and the detection means Of the data having the highest importance, the transmission / reception timing on the first network and the transmission / reception timing on the second network are detected.

このようなゲートウェイ装置によれば、重要度の最も高いデータについて、第1のネットワーク上での送受信タイミング、及び第2のネットワーク上での送受信タイミングが検出されるため、その重要度の最も高いデータについて、第1のネットワーク上での送信タイミングと第2のネットワーク上での受信タイミングとが同期する、或いは第1のネットワーク上での受信タイミングと第2のネットワーク上での送信タイミングとが同期するようになる。従って、その重要度の最も高いデータがより短時間に転送されるようになる。   According to such a gateway apparatus, since the transmission / reception timing on the first network and the transmission / reception timing on the second network are detected for the data having the highest importance, the data having the highest importance is detected. The transmission timing on the first network and the reception timing on the second network are synchronized, or the reception timing on the first network and the transmission timing on the second network are synchronized. It becomes like this. Therefore, the data having the highest importance level is transferred in a shorter time.

また、転送対象のデータが複数ある場合においては、請求項3のように構成しても良い。   Further, when there are a plurality of data to be transferred, a configuration as in claim 3 may be adopted.

請求項3のゲートウェイ装置は、請求項1のゲートウェイ装置において、転送対象のデータは複数種類あり、算出手段は、転送対象のデータの第2のネットワーク上における送受信タイミングの度数分布を算出し、その度数分布に基づき、第1のネットワーク上での送信のタイミングと第2のネットワーク上での受信のピークとが同期するため、或いは第1のネットワーク上での受信のタイミングと第2のネットワーク上での送信のピークとが同期するための通信スケジュールの起動タイミングを算出するようになっている。   The gateway device according to claim 3 is the gateway device according to claim 1, wherein there are a plurality of types of data to be transferred, and the calculating means calculates a frequency distribution of transmission / reception timings of the data to be transferred on the second network, Based on the frequency distribution, the transmission timing on the first network and the reception peak on the second network are synchronized, or the reception timing on the first network and the second network The start timing of the communication schedule for synchronizing with the peak of transmission is calculated.

この場合、第1のネットワーク上の送信のタイミングと、第2のネットワーク上にて受信の発生が相対的に多いタイミングとが同期する。或いは、第1のネットワークの受信のタイミングと、第2のネットワーク上にて送信の発生が相対的に多いタイミングとが同期する。このような構成によれば、複数のデータを対象として、全体的に転送時間を短くし得る。   In this case, the transmission timing on the first network is synchronized with the timing at which a relatively large number of receptions occur on the second network. Alternatively, the reception timing of the first network is synchronized with the timing at which transmissions are relatively frequent on the second network. According to such a configuration, the transfer time can be shortened as a whole for a plurality of data.

次に、請求項4のゲートウェイ装置は、請求項1〜3のゲートウェイ装置において、通信スケジュールの起動タイミングを所定量づつ徐々に変更して算出手段により算出された起動タイミングに一致させることを特徴としている。   Next, the gateway device according to claim 4 is characterized in that, in the gateway device according to claims 1 to 3, the activation timing of the communication schedule is gradually changed by a predetermined amount to coincide with the activation timing calculated by the calculating means. Yes.

通信スケジュールの起動タイミングを、算出手段により算出された起動タイミングに変更する場合、その変更量が大きいと、通信に影響が出ることも懸念される。例えば、変更の結果起動タイミングが大幅に遅れた場合、受信側において通信途絶と判断されてしまうような可能性もある。   When the activation timing of the communication schedule is changed to the activation timing calculated by the calculating means, there is a concern that if the change amount is large, communication is affected. For example, when the activation timing is greatly delayed as a result of the change, there is a possibility that the receiving side may determine that communication is interrupted.

例えば、本来、1回目の通信スケジュールが時刻T1で起動して、その後は通信スケジュールが10[msec]毎に起動する例があるとする。つまり、通信スケジュールの起動タイミングは、T1、T1+10、T1+20、T1+30、T1+40、T1+50・・・である。   For example, it is assumed that there is an example in which the first communication schedule starts at time T1, and thereafter the communication schedule starts every 10 [msec]. That is, the activation timing of the communication schedule is T1, T1 + 10, T1 + 20, T1 + 30, T1 + 40, T1 + 50.

これを、T1にて通信スケジュールを起動した後に、T1+16、T1+26、T1+36、T1+46、T1+56・・・というように通信スケジュールの起動タイミングを変更したいとする。そうすると、T1で起動した後に16[msec]待って次の通信スケジュールを起動すれば良いわけであるが、本来のT1+10から見て6[msec]も遅れ、その間はデータの送受信がなされないため、不都合が生じる可能性もある。   Assume that after starting the communication schedule at T1, it is desired to change the start timing of the communication schedule such as T1 + 16, T1 + 26, T1 + 36, T1 + 46, T1 + 56. Then, after starting at T1, it is only necessary to start the next communication schedule after waiting for 16 [msec]. However, 6 [msec] is delayed from the original T1 + 10, and no data is transmitted or received during that time. There may be inconveniences.

この点、本請求項4の発明では、所定量ずつ徐々に変更して目標とする起動タイミングに近づける。例えば、上記のように、T1+16、T1+26、T1+36、T1+46、T1+56・・・という起動タイミングに変更したい場合、当初は2[msec]づつずらし、T1、T1+12、T1+24、T1+36・・・とし、その後は10[msec]毎に起動してT1+46、T+56・・・とするような例が考えられる。これによれば、起動タイミングを徐々にずらしつつ、最終的には目標とする起動タイミングに一致させることができる。このように、目標とする起動タイミングに一致させるまでの変更量を小さくできるため、例えば通信途絶と誤判断されてしまうような事態を回避し得る。   In this regard, in the invention of claim 4, it is gradually changed by a predetermined amount to approach the target activation timing. For example, as described above, when it is desired to change to the start timings of T1 + 16, T1 + 26, T1 + 36, T1 + 46, T1 + 56... An example of starting every 10 [msec] to T1 + 46, T + 56. According to this, it is possible to finally match the target start timing while gradually shifting the start timing. As described above, since the amount of change until the target activation timing is matched can be reduced, for example, it is possible to avoid a situation in which it is erroneously determined that communication is interrupted.

ところで、データの転送がより緊急を要する場合、請求項5のように構成しても良い。   By the way, when data transfer is more urgent, it may be configured as in claim 5.

請求項5のゲートウェイ装置は、請求項1〜3のゲートウェイ装置において、転送対象のデータには緊急度を表す情報が含まれ、緊急度を表す情報に基づき緊急を要するか否かを判断し、緊急を要すると判断すると、現在動作中の通信スケジュールを中止し、新たな通信スケジュールを起動するようになっている。   The gateway apparatus according to claim 5 is the gateway apparatus according to claims 1 to 3, wherein the data to be transferred includes information indicating an urgency level, and determines whether or not an urgent situation is required based on the information indicating the urgency level. If it is determined that an emergency is required, the currently operating communication schedule is canceled and a new communication schedule is activated.

これによれば、現在動作中の通信スケジュールが終了するまで待つという必要がなくなり、即座に所望のタイミングで新たな通信スケジュールを開始できる。従って、第1のネットワーク上での送信タイミングと第2のネットワーク上での受信タイミング、或いは第1のネットワーク上での受信タイミングと第2のネットワーク上での送信タイミング、とを即座に同期させることも可能である。   According to this, it is not necessary to wait until the currently operating communication schedule is completed, and a new communication schedule can be started immediately at a desired timing. Therefore, the transmission timing on the first network and the reception timing on the second network, or the reception timing on the first network and the transmission timing on the second network are immediately synchronized. Is also possible.

次に、請求項6のゲートウェイ装置は、請求項1〜5のゲートウェイ装置において、通信スケジュールの起動タイミングを変更した後、予め定められた時間が経過するまでは再度の変更を行わないようになっている。   Next, the gateway device according to claim 6 does not change again in the gateway device according to claims 1 to 5 until a predetermined time elapses after the activation timing of the communication schedule is changed. ing.

通信スケジュールの起動タイミングの変更を頻繁に行うと、通信スケジュールの起動タイミングが一定でなくなったりして、かえって転送効率が悪くなるおそれがある。そこで、請求項6のように構成すれば、起動タイミングの頻繁な変更を抑制することができ、かえって通信効率が悪くなるというような問題が生じることを防止することができる。   If the start timing of the communication schedule is frequently changed, the start timing of the communication schedule may not be constant, and the transfer efficiency may be deteriorated. Therefore, if it is configured as in claim 6, it is possible to suppress frequent changes in the start timing, and it is possible to prevent the occurrence of problems such as poor communication efficiency.

次に、請求項7のゲートウェイ装置は、請求項1のゲートウェイ装置において、所定の転送対象のデータに代え、その転送対象のデータと同じタイミングでダミーデータの送受信を行うダミーデータ送受信手段を備え、検出手段は、ダミーデータが第1のネットワーク上で送受信される場合の送受信タイミング、及びそのダミーデータが第2のネットワーク上で送受信される場合の送受信タイミングを検出し、算出手段は、ダミーデータについて、第1のネットワーク上での送信タイミングと第2のネットワーク上での受信タイミングとが同期するため、或いは第1のネットワーク上での受信タイミングと第2のネットワーク上での送信タイミングとが同期するための通信スケジュールの起動タイミングを算出するようになっている。   Next, the gateway device according to claim 7 includes dummy data transmission / reception means for transmitting / receiving dummy data at the same timing as the data to be transferred instead of the predetermined data to be transferred in the gateway device according to claim 1, The detection means detects transmission / reception timing when dummy data is transmitted / received on the first network and transmission / reception timing when dummy data is transmitted / received on the second network. The transmission timing on the first network and the reception timing on the second network are synchronized, or the reception timing on the first network and the transmission timing on the second network are synchronized. The start timing of the communication schedule is calculated.

このような構成によれば、例えばゲートウェイ装置がデータ転送や制御対象の制御を行わない時間(例えば、起動直後の初期化処理中など)に、ダミーデータを用いて通信スケジュールの起動タイミングを予め調整することができる。   According to such a configuration, the activation timing of the communication schedule is adjusted in advance using dummy data, for example, when the gateway device does not perform data transfer or control of the control target (for example, during initialization processing immediately after activation). can do.

予め調整しておくことで、例えばデータ転送を頻繁に行う必要があるときや制御対象の制御中などに通信スケジュールの起動タイミングを変更しなくても良くなる。   By adjusting in advance, it is not necessary to change the start timing of the communication schedule, for example, when it is necessary to frequently transfer data or during control of a control target.

次に、請求項8のゲートウェイ装置は、請求項1〜7に記載のゲートウェイ装置において、通信スケジュールの起動タイミングを変更することを表す情報を第1のネットワーク及び第2のネットワークの両方又は一方に送出するようになっている。   Next, the gateway device according to claim 8 is the gateway device according to any one of claims 1 to 7, wherein information indicating that the activation timing of the communication schedule is changed is provided to both or one of the first network and the second network. It is supposed to be sent out.

これによれば、第1のネットワーク上、第2のネットワーク上における通信装置は、データの送受信のタイミングが変更されることを認識できるようになる。   According to this, the communication devices on the first network and the second network can recognize that the data transmission / reception timing is changed.

例えば、送受信のタイミングが変更された場合、通信装置がその変更を認識できなければ、場合によっては通信途絶と判断する可能性もある。一方、通信装置が送受信のタイミングの変更を認識できれば、それに伴いその通信装置において通信途絶の判定処理を無効にするようなことも可能であり、通信装置において不要に通信途絶と判断されるような事態を回避することができる。   For example, when the transmission / reception timing is changed, if the communication device cannot recognize the change, it may be determined that communication is interrupted in some cases. On the other hand, if the communication device can recognize the change in transmission / reception timing, it is possible to invalidate the communication interruption determination process in the communication device, and the communication device determines that the communication interruption is unnecessarily unnecessary. The situation can be avoided.

本実施形態の車両ネットワークを示す図面である。It is drawing which shows the vehicle network of this embodiment. 本実施形態のECU101(ゲートウェイ)の構成を示す図面である。It is drawing which shows the structure of ECU101 (gateway) of this embodiment. 前提条件判定処理の流れを表すフローチャートである。It is a flowchart showing the flow of a precondition determination process. 前提条件を説明するための図である(その1)。It is a figure for demonstrating a precondition (the 1). 前提条件を説明するための図である(その2)。It is a figure for demonstrating a precondition (the 2). 前提条件を説明するための図である(その3)。It is a figure for demonstrating a precondition (the 3). 前提条件を説明するための図である(その4)。It is a figure for demonstrating a precondition (the 4). 前提条件を説明するための図である(その5)。It is a figure for demonstrating a precondition (the 5). 前提条件を説明するための図である(その6)。It is a figure for demonstrating a precondition (the 6). ECU101の通信同期装置202において実行される処理を表すフローチャートである。3 is a flowchart illustrating processing executed in a communication synchronization device 202 of the ECU 101. ECU101のLIN通信スケジューラ206において実行される処理を表すフローチャートである。3 is a flowchart showing processing executed in a LIN communication scheduler 206 of the ECU 101. 変形例1を説明するための図面である(CANからLINへの転送)。It is a figure for demonstrating the modification 1 (transfer from CAN to LIN). 変形例1を説明するための図面である(LINからCANへの転送)。It is a figure for demonstrating the modification 1 (transfer from LIN to CAN). 変形例2を説明するための図面である。10 is a diagram for explaining a second modification. 変形例3を説明するための図面である。10 is a diagram for explaining a third modification. 変形例4を説明するための図面である。10 is a diagram for explaining a modification example 4; 変形例5を説明するための図面である(タイムチャート)。It is drawing for demonstrating the modification 5 (time chart). 変形例5を説明するための図面である(グラフ)。It is drawing for demonstrating the modification 5 (graph). 従来の車両ネットワークの一例示す図面である。It is drawing which shows an example of the conventional vehicle network. 従来の車両ネットワークの一例示す図面である(多重通信)。It is drawing which shows an example of the conventional vehicle network (multiplex communication). LINにおけるフレームの構成を説明する図面である。It is drawing explaining the structure of the flame | frame in LIN. CANからLINへのデータ転送の態様の一例を表す図面である。It is drawing which shows an example of the aspect of the data transfer from CAN to LIN. CANからLINへのデータ転送の態様のパターンを表す図面である。It is a figure showing the pattern of the aspect of the data transfer from CAN to LIN. LINからCANへのデータ転送の態様のパターンを表す図面である。It is a figure showing the pattern of the aspect of the data transfer from LIN to CAN.

以下、本発明の実施形態を図面に基づき説明する。
[第1実施形態]
図1は、本実施形態の車両ネットワークを示す図面である。尚、図1に示す車両ネットワーク100は、図20に示す車両ネットワーク400と比較して符号のみが異なり、構成はその車両ネットワーク400と同じである。このため、ここでは車両ネットワーク100の構成の説明は省略する。
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
[First Embodiment]
FIG. 1 is a diagram illustrating a vehicle network according to the present embodiment. The vehicle network 100 shown in FIG. 1 differs from the vehicle network 400 shown in FIG. 20 only in reference numerals and has the same configuration as the vehicle network 400. For this reason, the description of the configuration of the vehicle network 100 is omitted here.

図2は、図1におけるECU101の具体的構成を表す構成図である。   FIG. 2 is a configuration diagram showing a specific configuration of ECU 101 in FIG.

図2に示すように、本実施形態のECU101は、通信同期装置202と、CAN通信ドライバ203と、データベース204と、LIN通信ドライバ205と、LIN通信スケジューラ206と、を備えている。   As shown in FIG. 2, the ECU 101 of this embodiment includes a communication synchronization device 202, a CAN communication driver 203, a database 204, a LIN communication driver 205, and a LIN communication scheduler 206.

CAN通信ドライバ203は、CAN通信線207からのデータを受信し、その受信したデータをデータベース204に格納するとともに、データの受信完了通知を通信同期装置202に送る。   The CAN communication driver 203 receives data from the CAN communication line 207, stores the received data in the database 204, and sends a data reception completion notification to the communication synchronization apparatus 202.

通信同期装置202は、CAN通信ドライバ203から受信完了通知を受けると、通信スケジュールの調整指示をLIN通信スケジューラ206に送る。   Upon receiving a reception completion notification from the CAN communication driver 203, the communication synchronization apparatus 202 sends a communication schedule adjustment instruction to the LIN communication scheduler 206.

LIN通信スケジューラ206は、通信同期装置202からの調整指示に基づき、通信スケジュール(通信の開始時間)を調整したうえで、LIN通信ドライバ205に通信指示を送る。   The LIN communication scheduler 206 adjusts the communication schedule (communication start time) based on the adjustment instruction from the communication synchronization apparatus 202 and then sends the communication instruction to the LIN communication driver 205.

LIN通信ドライバ205は、LIN通信スケジューラ206から通信指示を受けると、その通信指示に基づき、データベース204から該当データを取得し、その取得したデータをLIN通信線208に送出する。そして、データの送出が完了すると、LIN通信スケジューラ206が送信完了通知を通信同期装置202に送る。   Upon receiving a communication instruction from the LIN communication scheduler 206, the LIN communication driver 205 acquires the corresponding data from the database 204 based on the communication instruction, and sends the acquired data to the LIN communication line 208. When the data transmission is completed, the LIN communication scheduler 206 sends a transmission completion notification to the communication synchronization apparatus 202.

このようにして、CANからLINにデータが転送される。   In this way, data is transferred from CAN to LIN.

また、LIN通信ドライバ205は、LIN通信線208からのデータを受信し、その受信したデータをデータベース204に格納するとともに、データの受信完了通知をLIN通信スケジューラ206に送る。   The LIN communication driver 205 receives data from the LIN communication line 208, stores the received data in the database 204, and sends a data reception completion notification to the LIN communication scheduler 206.

LIN通信スケジューラ206は、通信同期装置202に受信完了通知を送る。また、通信同期装置202は、LIN通信スケジューラ206から受信完了通知を受けた旨をCAN通信ドライバ203に送る。   The LIN communication scheduler 206 sends a reception completion notification to the communication synchronization apparatus 202. Further, the communication synchronization apparatus 202 sends a notification that the reception completion notification has been received from the LIN communication scheduler 206 to the CAN communication driver 203.

CAN通信ドライバ203は、通信同期装置202からのその通知に基づき、データベース204から該当データを取得し、その取得したデータをCAN通信線207に送出する。ここで、CAN通信ドライバ203は、送出対象のデータの送信周期或いは送信タイミングが予め定められている場合は、その送信周期或いは送信タイミングに従ってデータを送出する。この際に、CAN通信線207が空いていれば、CAN通信ドライバ203からCAN通信線207上にデータが送出される。一方、他のデータの送受信によりCAN通信線207が空いていなければ、再度送出の処理が行われる。そして、CAN通信ドライバ203は、データの送出が完了すると、送信完了通知を通信同期装置202に送る。   The CAN communication driver 203 acquires the corresponding data from the database 204 based on the notification from the communication synchronization apparatus 202, and sends the acquired data to the CAN communication line 207. Here, if the transmission cycle or transmission timing of the transmission target data is predetermined, the CAN communication driver 203 transmits the data according to the transmission cycle or transmission timing. At this time, if the CAN communication line 207 is free, data is transmitted from the CAN communication driver 203 onto the CAN communication line 207. On the other hand, if the CAN communication line 207 is not free due to transmission / reception of other data, transmission processing is performed again. Then, when the transmission of data is completed, the CAN communication driver 203 sends a transmission completion notification to the communication synchronization apparatus 202.

このようにして、LINからCANにデータが転送される。   In this way, data is transferred from LIN to CAN.

このような本実施形態では、ECU101の通信同期装置202が図10の処理を実行し、ECU101のLIN通信スケジューラ206が図11に示す処理を実行して、CANにおける送受信タイミングとLINにおける送受信タイミング(通信スケジュール)との同期をとるようになっている。   In this embodiment, the communication synchronization device 202 of the ECU 101 executes the process of FIG. 10, and the LIN communication scheduler 206 of the ECU 101 executes the process shown in FIG. Communication schedule).

ここで、本実施形態では、予め、転送対象のデータのCANにおける送受信周期(以下、CAN送受信周期、Tcとも記載する)と、LINの通信スケジュールの周期(以下、LIN通信スケジュール周期、Tlとも記載する)とを解析し、周期についての前提条件が成立するか否かを判定する。   Here, in the present embodiment, the transmission / reception cycle (hereinafter also referred to as CAN transmission / reception cycle, Tc) of CAN to be transferred and the LIN communication schedule cycle (hereinafter, also referred to as LIN communication schedule cycle, Tl). To determine whether or not a precondition for the period is satisfied.

この周期についての前提条件が成立するか否かの判定に係る処理の流れを表すフローチャートを、図3に示す。図3に示す前提条件判定処理は、例えば車両ネットワーク100を仮想的に構築して動作をシミュレーションする図示しないコンピュータにおいて実行される。そして、そのコンピュータにおける処理結果を使用者が見て、周期についての前提条件が成立するか否かを確認する。尚、図3に示す前提条件判定処理は車両ネットワーク100のECU101において実行されるようにしても良いが、前者のように他のコンピュータにおいて実行されるようにすることで、ECU101の処理負荷を抑えることができる。   FIG. 3 shows a flowchart showing the flow of processing related to the determination as to whether or not the precondition for this cycle is satisfied. The precondition determination process shown in FIG. 3 is executed, for example, in a computer (not shown) that virtually constructs the vehicle network 100 and simulates the operation. Then, the user sees the processing result in the computer, and confirms whether or not the precondition for the cycle is satisfied. 3 may be executed in the ECU 101 of the vehicle network 100, but the processing load on the ECU 101 is suppressed by being executed in another computer like the former. be able to.

図3の前提条件判定処理では、図示しないコンピュータのCPUは、まずS10において、CAN送受信周期と、LIN通信スケジュール周期とが等しいか否かを判定し、等しいと判定すると(S10:YES)、有効である(周期についての前提条件が成立する)と判断して当該処理を終了する。   In the precondition determination process of FIG. 3, the CPU of the computer (not shown) first determines in S10 whether the CAN transmission / reception cycle and the LIN communication schedule cycle are equal, and if it is determined that they are equal (S10: YES), it is valid. (The precondition for the period is satisfied) and the process is terminated.

一方、S10においてCAN送受信周期とLIN通信スケジュール周期とが等しくないと判定すると(S10:NO)、S20に移行する。尚、S20の処理の内容については、図4〜9の説明の際にも補足する。   On the other hand, if it is determined in S10 that the CAN transmission / reception period is not equal to the LIN communication schedule period (S10: NO), the process proceeds to S20. Note that the content of the processing of S20 will be supplemented in the description of FIGS.

S20では、CAN送受信周期とLIN通信スケジュール周期との最小公倍数の期間において、CANの送受信タイミングとLINの通信スケジュールの開始タイミングとのずれのパターンが、とり得る全パターン現れるか否かを判定し、全パターンは出現しないと判定すると(S20:YES)、有効である(周期に関する前提条件が成立する)と判断して当該処理を終了する。   In S20, in the period of the least common multiple of the CAN transmission / reception cycle and the LIN communication schedule cycle, it is determined whether or not all possible patterns appear as patterns of deviation between the CAN transmission / reception timing and the start timing of the LIN communication schedule, If it is determined that all the patterns do not appear (S20: YES), it is determined that the pattern is valid (the precondition regarding the cycle is satisfied), and the process ends.

一方、S20で全パターン出現すると判定すると(S20:NO)、無効である(周期に関する前提条件が成立しない)と判断して当該処理を終了する。   On the other hand, if it is determined in S20 that all patterns appear (S20: NO), it is determined that the pattern is invalid (the precondition regarding the cycle is not satisfied), and the process ends.

S20でYESと肯定判定される場合(周期についての前提条件が成立すると判定される場合)と、NOと否定判定される場合(周期についての前提条件が成立しないと判定される場合)とについて、図4〜9を用いて具体的に説明する。   In S20, when YES is determined (when it is determined that the precondition for the cycle is satisfied) and when NO is determined as negative (when it is determined that the precondition for the cycle is not satisfied), This will be specifically described with reference to FIGS.

図4〜6は、CANにおいて受信されたデータをLINに転送する場合のそのCANとLINとの間の周期のずれのパターンの態様を示すものである。   FIGS. 4 to 6 show aspects of a pattern of a shift in period between CAN and LIN when data received in CAN is transferred to LIN.

図7〜9は、LINにおいて受信されたデータをCANに転送する場合のそのLINとCANとの間の周期のずれのパターンの態様を示すものである。   FIGS. 7 to 9 show aspects of the pattern of the shift of the period between the LIN and the CAN when the data received in the LIN is transferred to the CAN.

ここで、LINにおいては、所定の周期で定期タスクが起動し、その定期タスクに従って通信スケジュールが開始される。図4〜9の上段には定期タスクを示しており、1周期毎に「1」から続く連続番号を付している。以下、便宜的に、CANにおける送受信周期も定期タスクを基準にして表す。
〈図4の例:CAN→LIN〉
まず、図4は、CANにおける受信周期(以下、CAN受信周期とも記載する)が定期タスク4個分、LIN通信スケジュール周期が定期タスク6個分の場合である。そして、CANにけるデータの受信タイミングは、それぞれ、LINにおける定期タスク4、定期タスク8、定期タスク12、定期タスク16、定期タスク20、定期タスク24・・・のタイミングに相当しているものとする。尚、その受信されるデータを順に、data(1)、data(2)、data(3)、data(4)、data(5)、data(6)・・・とする。また、data(1)の前に受信されるデータはdata(0)とし、さらにその前に受信されるデータはdata(−1)とする。CANにおいて受信されるそのようなdata(−1)〜(6)は、LINの通信スケジュールに従ってLINに転送される。
Here, in LIN, a periodic task is activated at a predetermined cycle, and a communication schedule is started in accordance with the periodic task. The upper part of FIGS. 4 to 9 shows periodic tasks, and serial numbers that continue from “1” are given for each period. Hereinafter, for the sake of convenience, the transmission / reception cycle in the CAN is also expressed on the basis of the periodic task.
<Example of FIG. 4: CAN->LIN>
First, FIG. 4 shows a case where the CAN reception cycle (hereinafter also referred to as a CAN reception cycle) is for four regular tasks and the LIN communication schedule cycle is for six regular tasks. The data reception timing in the CAN corresponds to the timing of the regular task 4, the regular task 8, the regular task 12, the regular task 16, the regular task 20, the regular task 24,. To do. The received data is sequentially referred to as data (1), data (2), data (3), data (4), data (5), data (6). Further, data received before data (1) is data (0), and data received before that is data (-1). Such data (-1) to (6) received at the CAN is transferred to the LIN according to the communication schedule of the LIN.

CANにおける受信タイミングに対する、LINにおける通信スケジュールの開始タイミングがとり得るパターンとしては、図4の例では6通り考えられる(offset=0〜5)。   There are six possible patterns in the example of FIG. 4 for the start timing of the communication schedule in LIN relative to the reception timing in CAN (offset = 0 to 5).

offset=0〜5の段は、それぞれ、LINにおける通信スケジュールが、定期タスク1,7,13,19・・・で開始される場合(offset=0の場合)、定期タスク2,8,14,20・・・で開始される場合(offset=1の場合)、定期タスク3,9,15,21・・・で開始される場合(offset=2の場合)、定期タスク4,10,16,22・・・で開始される場合(offset=3の場合)、定期タスク5,11,17,23・・・で開始される場合(offset=4の場合)、定期タスク6,12,18,24・・・で開始される場合(offset=5の場合)を表す。   In the stage of offset = 0 to 5, when the communication schedule in LIN is started with the periodic tasks 1, 7, 13, 19... (when offset = 0), the periodic tasks 2, 8, 14, When started with 20... (Offset = 1), when started with periodic tasks 3, 9, 15, 21... (When offset = 2), scheduled tasks 4, 10, 16,. When started with 22... (When offset = 3), when started with periodic tasks 5, 11, 17, 23... (When offset = 4), scheduled tasks 6, 12, 18,. This represents the case where the period starts at 24... (When offset = 5).

ここで、offset=0〜5のそれぞれのパターンについて、CANにてデータが受信されるタイミングが、LINにおける通信スケジュールの開始タイミングからみて幾つ目の定期タスクに相当するかを検討する。尚、この幾つ目であるかを表す数字を図中に併記している。図5〜9においても同様に併記している。また、以下、この幾つ目であるかを表す数字をNclと定義する。   Here, with respect to each pattern of offset = 0 to 5, it is examined whether the timing at which data is received by the CAN corresponds to the number of regular tasks as viewed from the start timing of the communication schedule in the LIN. In addition, the number showing this number is also written in the figure. This is also shown in FIGS. Further, hereinafter, a number representing the number of times is defined as Ncl.

offset=0の例では、まず、最初の通信スケジュールの開始タイミング(定期タスク1)から数えて、4個目の定期タスク(以下、4タスク目というように記載する)でCANにてデータが受信されている。   In the example of offset = 0, data is first received by CAN at the fourth periodic task (hereinafter referred to as the fourth task), counting from the start timing of the first communication schedule (periodic task 1). Has been.

続いて、次の通信スケジュールの開始タイミング(定期タスク7)から数えて、2タスク目(Ncl=2)にCANにてデータが受信されている。さらに、同じ通信スケジュールの開始タイミング(定期タスク7)から数えて、6タスク目(Ncl=6)にCANにてデータが受信されている。   Subsequently, data is received by the CAN at the second task (Ncl = 2) counting from the start timing of the next communication schedule (periodic task 7). Furthermore, data is received by CAN at the sixth task (Ncl = 6) counting from the start timing of the same communication schedule (periodic task 7).

このようにしてLINの通信スケジュールの開始タイミングから見てCANにおける受信タイミングが何タスク目であるか(つまりNclの値)を、CAN受信周期とLIN通信スケジュール周期との最小公倍数の期間(つまり定期タスク1〜12の期間)について抽出すると、offset=0の例では、Nclは(2,4,6)の値をとり得る。   In this way, the task at which the reception timing in CAN is viewed from the start timing of the LIN communication schedule (that is, the value of Ncl) is the period of the least common multiple of the CAN reception period and the LIN communication schedule period (that is, periodic In the example of offset = 0, Ncl can take a value of (2, 4, 6).

同じようにして、offset=1の例について抽出した場合、Nclは(1,3,5)の値をとり得る。   In the same way, when extracting for the example of offset = 1, Ncl can take the value of (1, 3, 5).

そして、offset=2,4の例の場合はoffset=0と同じくNclは(2,4,6)の値をとり、offset=3,5の例の場合はoffset=1と同じくNclは(1,3,5)の値をとり得る。   In the case of the example of offset = 2, 4, Ncl takes the value of (2, 4, 6) as in the case of offset = 0, and in the case of the example of offset = 3, 5, Ncl is equal to (1 , 3, 5).

このように、図4の例では、Nclが(1,3,5,)、(2,4,6)の何れかをとり、(1,2,3,4,5,6)という全ての値(パターン)をとる例はないから、図3の前提条件判定処理におけるS20では、全パターン出現しないというように肯定判定され(S20:YES)、有効である(周期についての前提条件が成立する)と判断される。言い換えると、CAN受信周期とLIN通信スケジュール周期との同期をとることの実効性が得られると判断される。   Thus, in the example of FIG. 4, Ncl takes either (1, 3, 5,) or (2, 4, 6), and all of (1, 2, 3, 4, 5, 6) Since there is no example of taking a value (pattern), in S20 in the precondition determination process of FIG. 3, an affirmative determination is made that all patterns do not appear (S20: YES), and it is valid (the precondition for the period is satisfied). ). In other words, it is determined that the effectiveness of synchronizing the CAN reception cycle and the LIN communication schedule cycle can be obtained.

実効性の有無について検討するために、CAN受信周期とLIN通信スケジュール周期との最小公倍数の期間(つまり、定期タスク1〜12の期間)について、CANにてデータを受信してから、そのデータをLINに転送するまで(LINの通信スケジュールが開始するまで)に要する時間の合計(以下、合計転送時間と記載する)を検討する。   In order to examine the presence or absence of effectiveness, after receiving data at the CAN for the period of the least common multiple of the CAN reception period and the LIN communication schedule period (that is, the period of the periodic tasks 1 to 12), Consider the total time required to transfer to the LIN (until the LIN communication schedule starts) (hereinafter referred to as the total transfer time).

offset=0の例では、定期タスク1〜12の期間において、data(0),(1)がLINに転送されている。data(0)については、CANにおける受信タイミング(図示しないが、定期タスク1の直前)とLINへの転送タイミング(通信スケジュールの開始タイミングであり、定期タスク1)とは同期しており、転送の遅れは発生していない。次に、data(1)については、定期タスク4中に相当するタイミングでCANにて受信され、その後定期タスク7にてLINに転送開始(LINの通信スケジュールが開始)されており、転送開始までには2タスク分の遅れがある。以上より、合計転送時間は2タスク分である。   In the example of offset = 0, data (0) and (1) are transferred to LIN during the period of the regular tasks 1 to 12. Regarding data (0), the reception timing in CAN (not shown, immediately before the regular task 1) and the transfer timing to the LIN (communication schedule start timing, the regular task 1) are synchronized, There is no delay. Next, the data (1) is received by the CAN at a timing corresponding to the regular task 4, and then the transfer to the LIN is started (the LIN communication schedule is started) by the regular task 7, until the transfer starts. Has a delay of two tasks. From the above, the total transfer time is two tasks.

同様にして、offset=1〜5の例の場合について合計転送時間を検討すると、offset=1の例では4タスク分となり、offset=2の例では2タスク分となり、offset=3の例では4タスク分となり、offset=4の例では2タスク分となり、offset=5の例では4タスク分となる。   Similarly, considering the total transfer time for the case of offset = 1 to 5, there are 4 tasks for the example of offset = 1, 2 tasks for the example of offset = 2, and 4 for the example of offset = 3. There are two tasks in the example of offset = 4, and four tasks in the example of offset = 5.

このような図4の例では、offset=1,3,5の場合、合計転送時間が2タスク分となるようにLINにおける通信スケジュールの開始タイミングを調整する(CAN受信周期とLIN通信スケジュール周期との同期をとる)ことができるはずである。つまり、転送に要する時間を短くする(最短にする)ことができ、同期をとることの実効性が得られるということになる。
〈図5の例:CAN→LIN〉
次に、図5は、CAN受信周期が定期タスク4個分、LIN通信スケジュール周期が定期タスク5個分の場合である。そして、CANにけるデータの受信タイミングは、それぞれ、LINにおける定期タスク4、定期タスク8、定期タスク12、定期タスク16、定期タスク20・・・のタイミングに相当しているものとする。
In the example of FIG. 4, when offset = 1, 3, and 5, the start timing of the communication schedule in the LIN is adjusted so that the total transfer time is 2 tasks (the CAN reception cycle and the LIN communication schedule cycle). Can be synchronized). In other words, the time required for transfer can be shortened (minimized), and the effectiveness of synchronization can be obtained.
<Example of FIG. 5: CAN → LIN>
Next, FIG. 5 shows a case where the CAN reception cycle is four regular tasks and the LIN communication schedule cycle is five regular tasks. The data reception timing in CAN corresponds to the timings of the regular task 4, the regular task 8, the regular task 12, the regular task 16, the regular task 20,.

CANにおける受信タイミングに対する、LINにおける通信スケジュールの開始タイミングがとり得るパターンとしては、図5の例では5通り考えられる(offset=0〜4)。   There are five possible patterns in the communication schedule start timing in LIN with respect to the reception timing in CAN in the example of FIG. 5 (offset = 0 to 4).

offset=0〜4の段は、それぞれ、LINにおける通信スケジュールが、定期タスク1,6,11,16・・・で開始される場合(offset=0の場合)、定期タスク2,7,12,17・・・で開始される場合(offset=1の場合)、定期タスク3,8,13,18・・・で開始される場合(offset=2の場合)、定期タスク4,9,14,19・・・で開始される場合(offset=3)、定期タスク5,10,15,20・・・で開始される場合(offset=4)を表す。   In the stage of offset = 0 to 4, when the communication schedule in LIN is started by the periodic tasks 1, 6, 11, 16,... (when offset = 0), the periodic tasks 2, 7, 12, When started with 17 ... (when offset = 1), when started with periodic tasks 3, 8, 13, 18 ... (when offset = 2), with periodic tasks 4, 9, 14, This represents a case where it is started at 19... (Offset = 3), and a case where it is started at periodic tasks 5, 10, 15, 20.

ここで、offset=0〜4のそれぞれのパターンについて、CANにてデータが受信されるタイミングが、LINにおける通信スケジュールの開始タイミングからみて幾つ目の定期タスクに相当するかを検討する。つまり、Nclの値を検討する。   Here, for each pattern of offset = 0 to 4, it is examined how many regular tasks the timing at which data is received by the CAN corresponds to the start timing of the communication schedule in the LIN. That is, consider the value of Ncl.

offset=0の例では、まず、最初の通信スケジュールの開始タイミング(定期タスク1)から数えて、4タスク目(Ncl=4)にCANにてデータが受信されている。また、次の通信スケジュールの開始タイミング(定期タスク6)から数えて、3タスク目(Ncl=3)にCANにてデータが受信されている。さらに、次の通信スケジュールの開始タイミング(定期タスク11)から数えて、2タスク目(Ncl=2)にCANにてデータが受信されている。さらに次の通信スケジュールの開始タイミング(定期タスク16)から数えて、1タスク目(Ncl=1)にCANにてデータが受信されている。そして、同じ通信スケジュールの開始タイミング(定期タスク16)から数えて、5タスク目(Ncl=5)にCANにてデータが受信されている。   In the example of offset = 0, first, data is received by CAN at the fourth task (Ncl = 4), counting from the start timing of the first communication schedule (periodic task 1). In addition, data is received by CAN at the third task (Ncl = 3) from the start timing of the next communication schedule (periodic task 6). Furthermore, data is received by CAN at the second task (Ncl = 2), counting from the start timing of the next communication schedule (periodic task 11). Further, data is received by CAN at the first task (Ncl = 1) counting from the start timing of the next communication schedule (periodic task 16). Then, data is received by CAN at the fifth task (Ncl = 5) counting from the start timing of the same communication schedule (periodic task 16).

このようにしてLINの通信スケジュールの開始タイミングから見てCANにおける受信タイミングが何タスク目であるか(つまりNclの値)を、CAN受信周期とLIN通信スケジュール周期との最小公倍数の期間(つまり定期タスク1〜20の期間)について抽出すると、offset=0の例では、Nclは(1,2,3,4,5,)の値をとり得る。   In this way, the task at which the reception timing in CAN is viewed from the start timing of the LIN communication schedule (that is, the value of Ncl) is the period of the least common multiple of the CAN reception period and the LIN communication schedule period (that is, periodic In the example of offset = 0, Ncl can take a value of (1, 2, 3, 4, 5,).

offset=1〜4の例の場合も同様にNclは(1,2,3,4,5,)の値をとり得る。   Similarly, in the case of the example of offset = 1 to 4, Ncl can take a value of (1, 2, 3, 4, 5,).

このように、図5の例では、Nclが(1,2,3,4,5,)という全ての値(パターン)をとるから、図3の前提条件判定処理におけるS20では、全パターン出現するというように否定判定され(S20:NO)、無効である(周期についての前提条件が成立しない)と判断される。言い換えると、CAN受信周期とLIN通信スケジュール周期との同期をとることの実効性が得られないと判断される。   In this way, in the example of FIG. 5, Ncl takes all values (patterns) of (1, 2, 3, 4, 5,), so all patterns appear in S20 in the precondition determination process of FIG. Thus, a negative determination is made (S20: NO), and it is determined to be invalid (a prerequisite for the period is not satisfied). In other words, it is determined that the effectiveness of synchronizing the CAN reception cycle and the LIN communication schedule cycle cannot be obtained.

実効性の有無について検討するために、CAN受信周期とLIN通信スケジュール周期との最小公倍数の期間(つまり、定期タスク1〜20の期間)について、CANにてデータを受信してから、そのデータをLINに転送するまで(LINの通信スケジュールが開始するまで)に要する時間の合計(合計転送時間)を検討する。   In order to examine the presence or absence of effectiveness, after receiving data at the CAN for the period of the least common multiple of the CAN reception period and the LIN communication schedule period (that is, the period of the periodic tasks 1 to 20), Consider the total time (total transfer time) required to transfer to the LIN (until the LIN communication schedule starts).

offset=0の例では、定期タスク1〜20の期間において、data(0)〜(3)がLINに転送されている。data(0)については、CANにおける受信タイミング(図示しないが、定期タスク1の直前)とLINへの転送タイミング(通信スケジュールの開始タイミングであり、定期タスク1)とは同期しており、転送の遅れは発生していない。次に、data(1)については、定期タスク4中に相当するタイミングでCANにて受信され、その後定期タスク6で転送開始(LINの通信スケジュールが開始)されており、転送開始までには1タスク分(定期タスク5の分)の遅れがある。data(2)については、定期タスク8に相当するタイミングでCANにて受信され、その後定期タスク11で転送開始(LINの通信スケジュールが開始)されており、転送開始までには2タスク分(定期タスク9,10の分)の遅れがある。data(3)については、定期タスク12に相当するタイミングでCANにて受信され、その後定期タスク16で転送開始(LINの通信スケジュールが開始)されており、転送開始までには3タスク分(定期タスク13,14,15の分)の遅れがある。以上より、1タスク分、2タスク分、及び3タスク分を合計して合計転送時間は6タスク分となる。   In the example of offset = 0, data (0) to (3) are transferred to the LIN during the period of the regular tasks 1 to 20. Regarding data (0), the reception timing in CAN (not shown, immediately before the regular task 1) and the transfer timing to the LIN (communication schedule start timing, the regular task 1) are synchronized, There is no delay. Next, data (1) is received by the CAN at a timing corresponding to the regular task 4, and then the transfer is started by the regular task 6 (the LIN communication schedule is started). There is a delay of tasks (minutes of periodic task 5). The data (2) is received by the CAN at a timing corresponding to the regular task 8, and then the transfer is started by the regular task 11 (the LIN communication schedule is started). There is a delay of tasks 9 and 10). The data (3) is received by the CAN at a timing corresponding to the regular task 12, and then the transfer is started by the regular task 16 (the LIN communication schedule is started). There is a delay of tasks 13, 14, and 15). As described above, one task, two tasks, and three tasks are totaled to obtain a total transfer time of six tasks.

同様にして、offset=1〜4の例の場合について合計転送時間を検討すると、全て6タスク分となる。つまり、これ以上は合計転送時間を小さくすることはできないということになる。つまり、CAN受信周期とLIN通信スケジュール周期との同期をとることの実効性は得られないということになる。
〈図6の例:CAN→LIN〉
次に、図6は、CAN受信周期が定期タスク4個分、LIN通信スケジュール周期が定期タスク2個分の場合である。そして、CANにけるデータの受信タイミングは、それぞれ、LINにおける定期タスク4、定期タスク8、定期タスク12、定期タスク16、定期タスク20・・・のタイミングに相当しているものとする。
Similarly, considering the total transfer time for the case of offset = 1 to 4, all of them are for 6 tasks. In other words, the total transfer time cannot be reduced beyond this. In other words, the effectiveness of synchronizing the CAN reception cycle and the LIN communication schedule cycle cannot be obtained.
<Example of FIG. 6: CAN → LIN>
Next, FIG. 6 shows a case where the CAN reception cycle is four regular tasks and the LIN communication schedule cycle is two regular tasks. The data reception timing in CAN corresponds to the timings of the regular task 4, the regular task 8, the regular task 12, the regular task 16, the regular task 20,.

CANにおける受信タイミングに対する、LINにおける通信スケジュールの開始タイミングがとり得るパターンとしては、図6の例では2通り考えられる(offset=0,1)。   There are two possible patterns of the start timing of the communication schedule in LIN relative to the reception timing in CAN in the example of FIG. 6 (offset = 0, 1).

offset=0,1の段は、それぞれ、LINにおける通信スケジュールが、定期タスク1,3,5,7,9,・・・で開始される場合(offset=0の場合)、定期タスク2,4,6,8,10・・・で開始される場合(offset=1の場合)を表す。   In the stage of offset = 0, 1, when the communication schedule in LIN is started by the periodic tasks 1, 3, 5, 7, 9,... (when offset = 0), the periodic tasks 2, 4 respectively. , 6, 8, 10... (When offset = 1).

ここで、offset=0,1のそれぞれのパターンにおいて、通信スケジュールの開始タイミングからみて、幾つ目の定期タスクにてCANにおいてデータが受信されるかを検討する。つまり、Nclの値を検討する。   Here, in each of the patterns of offset = 0 and 1, it is examined how many times the task receives data in the CAN from the start timing of the communication schedule. That is, consider the value of Ncl.

offset=0の例では、通信スケジュールの開始タイミング(定期タスク3)から数えて、2タスク目(Ncl=2)にCANにてデータが受信されている。また、通信スケジュールの開始タイミング(定期タスク7)から数えて、2タスク目(Ncl=2)にCANにてデータが受信されている。以降も同様に、直前の通信スケジュールの開始タイミングから数えて、2タスク目(Ncl=2)にCANにてデータが受信されている。   In the example of offset = 0, data is received by CAN at the second task (Ncl = 2), counting from the communication schedule start timing (periodic task 3). In addition, data is received by CAN at the second task (Ncl = 2) counting from the start timing of the communication schedule (periodic task 7). Similarly, data is received by CAN at the second task (Ncl = 2) counting from the start timing of the immediately preceding communication schedule.

このようにしてLINの通信スケジュールの開始タイミングから見てCANにおける受信タイミングが何タスク目であるか(つまりNclの値)を、CAN受信周期とLIN通信スケジュール周期との最小公倍数の期間(つまり、定期タスク1〜4の期間)について抽出すると、offset=0の例では、Nclは(2)の値をとり得る。   In this way, the task at which the reception timing in CAN is seen from the start timing of the LIN communication schedule (that is, the value of Ncl) is the period of the least common multiple of the CAN reception period and the LIN communication schedule period (that is, In the example of offset = 0, Ncl can take the value of (2).

同じようにして、offset=1の例について抽出した場合、Nclは(1)の値をとり得る。   In the same way, when extracting for the example of offset = 1, Ncl can take the value of (1).

このように、図6の例では、Nclが(1)、(2)の何れかをとり、(1,2)という全ての値(パターン)をとる例はないから、図3の前提条件判定処理におけるS20では、全パターン出現しないというように肯定判定され(S20:YES)、有効である(周期についての前提条件が成立する)と判断される。言い換えると、CAN受信周期とLIN通信スケジュール周期との同期をとることの実効性が得られると判断される。   Thus, in the example of FIG. 6, there is no example in which Ncl takes either (1) or (2) and takes all values (patterns) of (1, 2). In S20 in the process, an affirmative determination is made so that all patterns do not appear (S20: YES), and it is determined that the condition is valid (a prerequisite for the period is satisfied). In other words, it is determined that the effectiveness of synchronizing the CAN reception cycle and the LIN communication schedule cycle can be obtained.

実効性の有無について検討するために、CAN受信周期とLIN通信スケジュール周期との最小公倍数の期間(つまり、定期タスク1〜4の期間)について、CANにてデータを受信してから、そのデータをLINに転送するまで(LINの通信スケジュールが開始するまで)に要する時間の合計(合計転送時間)を検討する。   In order to examine the presence or absence of effectiveness, after receiving data at the CAN for the period of the least common multiple of the CAN reception period and the LIN communication schedule period (that is, the period of the periodic tasks 1 to 4), Consider the total time (total transfer time) required to transfer to the LIN (until the LIN communication schedule starts).

offset=0の例では、定期タスク1〜4の期間において、data(0)がLINに転送されている。data(0)は、CANにおいて受信されると(図示しないが、定期タスク1の直前に受信される)、その後、定期タスク1,3で開始される通信スケジュールですぐにLINに転送されるようになっており、転送の遅れは発生していない。以上より、合計転送時間は0タスク分である。   In the example of offset = 0, data (0) is transferred to LIN during the period of the periodic tasks 1 to 4. When data (0) is received at CAN (not shown, but received immediately before periodic task 1), it is immediately transferred to LIN in the communication schedule started by periodic tasks 1 and 3 thereafter. Therefore, there is no transfer delay. From the above, the total transfer time is 0 tasks.

offset=1の例では、定期タスク1〜4の期間において、data(0)がLINに転送されている。data(0)は、CANにおいて受信されると、その後、定期タスク2,4で開始される通信スケジュールでLINに転送されるようになっており、転送開始までには1タスク分(定期タスク1の分)の遅れが発生している。以上より、合計転送時間は1タスク分である。   In the example of offset = 1, data (0) is transferred to LIN during the period of the periodic tasks 1 to 4. When data (0) is received at the CAN, it is transferred to the LIN in accordance with a communication schedule started at the periodic tasks 2 and 4 after that. )). From the above, the total transfer time is one task.

このような図6の例では、offset=1の例の場合、合計転送時間が0タスク分となるようにLINにおける通信スケジュールの開始タイミングを調整する(CAN受信周期とLIN通信スケジュール周期との同期をとる)ことができるはずである。つまり、転送に要する時間を短くする(最短にする)ことができ、同期をとることの実効性が得られるということになる。   In the example of FIG. 6, in the case of offset = 1, the start timing of the communication schedule in LIN is adjusted so that the total transfer time is 0 tasks (synchronization between the CAN reception cycle and the LIN communication schedule cycle). ). In other words, the time required for transfer can be shortened (minimized), and the effectiveness of synchronization can be obtained.

図7〜9は、前述のようにLINにおいて受信されたデータをCANに転送する場合のそのLINとCANとの間の周期のずれのパターンの態様を示すものである。
〈図7の例:LIN→CAN〉
まず、図7は、CANにおける送信周期(以下、CAN送信周期とも記載する)が定期タスク4個分、LIN通信スケジュール周期が定期タスク6個分の場合である。そして、CANにおけるデータの送信タイミングは、それぞれ、LINにおける定期タスク4、定期タスク8、定期タスク12、定期タスク16、定期タスク20、定期タスク24・・・のタイミングに相当しているものとする。
FIGS. 7 to 9 show aspects of the pattern of the shift in the period between the LIN and the CAN when the data received in the LIN is transferred to the CAN as described above.
<Example of FIG. 7: LIN → CAN>
First, FIG. 7 shows a case where a CAN transmission cycle (hereinafter also referred to as a CAN transmission cycle) is for four regular tasks and a LIN communication schedule cycle is for six regular tasks. The data transmission timing in CAN corresponds to the timing of the regular task 4, the regular task 8, the regular task 12, the regular task 16, the regular task 20, the regular task 24,. .

CANにおける送信タイミングに対する、LINにおける通信スケジュールの開始タイミングがとり得るパターンとしては、図7の例では6通り考えられる(offset=0〜5)。   There are six possible patterns in the LIN communication schedule start timing for the CAN transmission timing in the example of FIG. 7 (offset = 0 to 5).

offset=0〜5の段は、それぞれ、LINにおける通信スケジュールが、定期タスク1,7,13,19・・・で開始される場合(offset=0の場合)、定期タスク2,8,14,20・・・で開始される場合(offset=1の場合)、定期タスク3,9,15,21・・・で開始される場合(offset=2の場合)、定期タスク4,10,16,22・・・で開始される場合(offset=3の場合)、定期タスク5,11,17,23・・・で開始される場合(offset=4の場合)、定期タスク6,12,18,24・・・で開始される場合(offset=5の場合)を表す。   In the stage of offset = 0 to 5, when the communication schedule in LIN is started with the periodic tasks 1, 7, 13, 19... (when offset = 0), the periodic tasks 2, 8, 14, When started with 20... (Offset = 1), when started with periodic tasks 3, 9, 15, 21... (When offset = 2), scheduled tasks 4, 10, 16,. When started with 22... (When offset = 3), when started with periodic tasks 5, 11, 17, 23... (When offset = 4), scheduled tasks 6, 12, 18,. This represents the case where the period starts at 24... (When offset = 5).

ここで、offset=0〜5のそれぞれのパターンにおいて、CANにてデータが送信されるタイミングが、LINにおける通信スケジュールの開始タイミングからみて幾つ目の定期タスクに相当するかを検討する。尚、以下、この幾つ目であるかを表す数字をNlcと定義する。   Here, in each pattern of offset = 0 to 5, it is examined whether the timing at which data is transmitted by CAN corresponds to the number of periodic tasks as seen from the start timing of the communication schedule in LIN. In the following, the number representing this number is defined as Nlc.

offset=0の例では、まず、最初の通信スケジュールの開始タイミング(定期タスク1)から数えて、4タスク目(Nlc=4)にCANにてデータが送信されている。   In the example of offset = 0, first, data is transmitted by CAN at the fourth task (Nlc = 4), counting from the start timing of the first communication schedule (periodic task 1).

続いて、次の通信スケジュールの開始タイミング(定期タスク7)から数えて、2タスク目(Nlc=2)にCANにてデータが送信されている。さらに、同じ通信スケジュールの開始タイミング(定期タスク7)から数えて、6タスク目(Nlc=6)にCANにてデータが送信されている。   Subsequently, data is transmitted by CAN to the second task (Nlc = 2), counting from the start timing of the next communication schedule (periodic task 7). Furthermore, data is transmitted by CAN at the sixth task (Nlc = 6) counting from the start timing of the same communication schedule (periodic task 7).

このようにしてLINの通信スケジュールの開始タイミングから見てCANにおける送信タイミングが何タスク目であるか(つまりNlcの値)を、CAN送信周期とLIN通信スケジュール周期との最小公倍数の期間(つまり定期タスク1〜12の期間)について抽出すると、Nlcは(2,4,6,)の値をとり得る。   In this way, the task at which the CAN transmission timing is viewed from the start timing of the LIN communication schedule (that is, the value of Nlc) is the period of the least common multiple of the CAN transmission cycle and the LIN communication schedule cycle (that is, periodic Nlc can take the values (2, 4, 6,).

同じようにして、offset=1の例について抽出した場合、Nlcは(1,3,5)の値をとり得る。   Similarly, when extracting for the example where offset = 1, Nlc can take the value of (1, 3, 5).

そして、offset=2,4の例の場合はoffset=0と同じくNlcは(2,4,6)の値をとり、offset=3,5の例の場合はoffset=1と同じくNlcは(1,3,5)の値をとり得る。   In the example of offset = 2, 4, Nlc takes the value of (2, 4, 6) as in offset = 0, and in the example of offset = 3, 5, Nlc is equal to (1 , 3, 5).

このように、図7の例では、Nlcが(1,3,5,)、(2,4,6)の何れかをとり、(1,2,3,4,5,6)という全ての値(パターン)をとる例はないから、図3の前提条件判定処理におけるS20では、全パターン出現しないというように肯定判定され(S20:YES)、有効である(周期についての前提条件が成立する)と判断される。言い換えると、CAN送信周期とLIN通信スケジュール周期との同期をとることの実効性が得られると判断される。   Thus, in the example of FIG. 7, Nlc takes either (1, 3, 5,) or (2, 4, 6), and all of (1, 2, 3, 4, 5, 6) Since there is no example of taking a value (pattern), in S20 in the precondition determination process of FIG. 3, an affirmative determination is made that all patterns do not appear (S20: YES), and it is valid (the precondition for the period is satisfied). ). In other words, it is determined that the effectiveness of synchronizing the CAN transmission cycle and the LIN communication schedule cycle can be obtained.

実効性の有無について検討するために、CAN送信周期とLIN通信スケジュール周期との最小公倍数の期間(つまり、定期タスク1〜12の期間)について、LINの通信スケジュールの開始点を起点として、CAN送信(転送)が発生するまでの時間の合計(合計転送時間)を検討する。   In order to examine whether or not there is effectiveness, CAN transmission is started from the start point of the LIN communication schedule for the least common multiple period of the CAN transmission period and the LIN communication schedule period (that is, the period of the periodic tasks 1 to 12). Consider the total time (total transfer time) until (transfer) occurs.

offset=0の例では、定期タスク1でLINの通信スケジュールが開始し、定期タスク4に相当するタイミングでCAN送信が発生し、その間は3タスク分(定期タスク1,2,3の分)の時間がある。また、定期タスク7で通信スケジュールが開始し、定期タスク8,12に相当するそれぞれのタイミングでCAN送信が発生し、その間はそれぞれ、1タスク分(定期タスク7の分)、5タスク分(定期タスク7,8,9,10,11の分)の時間がある。以上より、3タスク分、1タスク分、及び5タスク分を合計して合計転送時間は9タスク分である。   In the example of offset = 0, the LIN communication schedule starts in the periodic task 1, and CAN transmission occurs at the timing corresponding to the periodic task 4, during which 3 tasks (periodic tasks 1, 2 and 3) I have time. In addition, the communication schedule starts at the regular task 7, and CAN transmission occurs at the timing corresponding to the regular tasks 8 and 12, and during that period, one task (for the regular task 7) and five tasks (for the regular task) Task 7, 8, 9, 10, 11 minutes). From the above, the total transfer time is 9 tasks by adding 3 tasks, 1 task, and 5 tasks.

同様にして、offset=1〜5の例の場合について合計転送時間を検討すると、offset=1の例では6タスク分となり、offset=2の例では9タスク分となり、offset=3の例では6タスク分となり、offset=4の例では9タスク分となり、offset=5の例では6タスク分となる。   Similarly, considering the total transfer time in the case of the example of offset = 1 to 5, it becomes 6 tasks in the example of offset = 1, 9 tasks in the example of offset = 2, and 6 in the example of offset = 3. In the example of offset = 4, there are 9 tasks, and in the example of offset = 5, there are 6 tasks.

このような図7の例では、offset=0,2,4の例の場合、合計転送時間が6タスク分となるようにLINにおける通信スケジュールの開始タイミングを調整する(CAN送信周期とLIN通信スケジュール周期との同期をとる)ことができるはずである。つまり、転送に要する時間を短くする(最短にする)ことができ、同期をとることの実効性が得られるということになる。
〈図8の例:LIN→CAN〉
次に、図8は、CAN送信周期が定期タスク4個分、LIN通信スケジュール周期が定期タスク5個分の場合である。例えば、そして、CANにけるデータの送信タイミングは、それぞれ、LINにおける定期タスク4、定期タスク8、定期タスク12、定期タスク16、定期タスク20・・・のタイミングに相当しているものとする。
In the example of FIG. 7, in the case of offset = 0, 2, 4 example, the start timing of the communication schedule in LIN is adjusted so that the total transfer time is 6 tasks (CAN transmission cycle and LIN communication schedule) Should be synchronized with the period). In other words, the time required for transfer can be shortened (minimized), and the effectiveness of synchronization can be obtained.
<Example of FIG. 8: LIN → CAN>
Next, FIG. 8 shows a case where the CAN transmission cycle is four regular tasks and the LIN communication schedule cycle is five regular tasks. For example, it is assumed that the transmission timing of data in CAN corresponds to the timing of the regular task 4, the regular task 8, the regular task 12, the regular task 16, the regular task 20,.

CANにおける送信タイミングに対する、LINにおける通信スケジュールの開始タイミングがとり得るパターンとしては、図8の例では5通り考えられる(offset=0〜4)。   There are five possible patterns in the example of FIG. 8 for the start timing of the communication schedule in LIN relative to the transmission timing in CAN (offset = 0 to 4).

offset=0〜4の段は、それぞれ、LINにおける通信スケジュールが、定期タスク1,6,11,16・・・で開始される場合(offset=0の場合)、定期タスク2,7,12,17・・・で開始される場合(offset=1の場合)、定期タスク3,8,13,18・・・で開始される場合(offset=2の場合)、定期タスク4,9,14,19・・・で開始される場合(offset=3)、定期タスク5,10,15,20・・・で開始される場合(offset=4)を表す。   In the stage of offset = 0 to 4, when the communication schedule in LIN is started by the periodic tasks 1, 6, 11, 16,... (when offset = 0), the periodic tasks 2, 7, 12, When started with 17 ... (when offset = 1), when started with periodic tasks 3, 8, 13, 18 ... (when offset = 2), with periodic tasks 4, 9, 14, This represents a case where it is started at 19... (Offset = 3), and a case where it is started at periodic tasks 5, 10, 15, 20.

ここで、offset=0〜4のそれぞれのパターンにおいて、CANにてデータが送信されるタイミングが、LINにおける通信スケジュールの開始タイミングからみて幾つ目の定期タスクに相当するかを検討する。つまり、Nlcを検討する。   Here, in each pattern of offset = 0 to 4, it is examined how many regular tasks the timing at which data is transmitted by CAN corresponds to the start timing of the communication schedule in LIN. That is, consider Nlc.

offset=0の例では、まず、最初の通信スケジュールの開始タイミング(定期タスク1)から数えて、4タスク目(Nlc=4)にCANにてデータが送信されている。また、次の通信スケジュールの開始タイミング(定期タスク6)から数えて、3タスク目(Nlc=3)にCANにてデータが送信されている。さらに、次の通信スケジュールの開始タイミング(定期タスク11)から数えて、2タスク目(Nlc=2)にCANにてデータが送信されている。さらに次の通信スケジュールの開始タイミング(定期タスク16)から数えて、1タスク目(Nlc=1)にCANにてデータが送信されている。そして、同じ通信スケジュールの開始タイミング(定期タスク16)から数えて、5タスク目(Nlc=5)にCANにてデータが送信されている。   In the example of offset = 0, first, data is transmitted by CAN at the fourth task (Nlc = 4), counting from the start timing of the first communication schedule (periodic task 1). In addition, data is transmitted by CAN at the third task (Nlc = 3) from the start timing of the next communication schedule (periodic task 6). Further, data is transmitted by CAN at the second task (Nlc = 2), counting from the start timing of the next communication schedule (periodic task 11). Further, data is transmitted by CAN at the first task (Nlc = 1) counting from the start timing of the next communication schedule (periodic task 16). Then, data is transmitted by CAN at the fifth task (Nlc = 5) counting from the start timing of the same communication schedule (periodic task 16).

このようにしてLINの通信スケジュールの開始タイミングから見てCANにおける送信タイミングが何タスク目であるか(つまりNlcの値)を、CAN送信周期とLIN通信スケジュール周期との最小公倍数の期間(つまり定期タスク1〜20の期間)について抽出すると、Nlcは(1,2,3,4,5)の値をとり得る。   In this way, the task at which the CAN transmission timing is viewed from the start timing of the LIN communication schedule (that is, the value of Nlc) is the period of the least common multiple of the CAN transmission cycle and the LIN communication schedule cycle (that is, periodic Nlc can take the values (1, 2, 3, 4, 5).

offset=1〜4の例の場合も同様にNlcは(1,2,3,4,5)の値をとり得る。   Similarly, in the case of the example of offset = 1 to 4, Nlc can take a value of (1, 2, 3, 4, 5).

このように、図8の例では、Nlcが(1,2,3,4,5,)という全ての値(パターン)をとるから、図3の前提条件判定処理におけるS20では、全パターン出現するというように否定判定され(S20:NO)、無効である(周期についての前提条件が成立しない)と判断される。言い換えると、CAN送信周期とLIN通信スケジュール周期との同期をとることの実効性が得られないと判断される。   In this way, in the example of FIG. 8, since Nlc takes all values (patterns) of (1, 2, 3, 4, 5,), all patterns appear in S20 in the precondition determination process of FIG. Thus, a negative determination is made (S20: NO), and it is determined to be invalid (a prerequisite for the period is not satisfied). In other words, it is determined that the effectiveness of synchronizing the CAN transmission cycle and the LIN communication schedule cycle cannot be obtained.

実効性の有無について検討するために、CAN送信周期とLIN通信スケジュール周期との最小公倍数の期間(つまり、定期タスク1〜20の期間)について、LINの通信スケジュールの開始点を起点として、CAN送信(転送)が発生するまでの時間の合計(合計転送時間)を検討する。   In order to examine whether or not there is effectiveness, CAN transmission is started from the start point of the LIN communication schedule for the period of the least common multiple of the CAN transmission period and the LIN communication schedule period (that is, the period of the periodic tasks 1 to 20). Consider the total time (total transfer time) until (transfer) occurs.

offset=0の例では、定期タスク1でLINの通信スケジュールが起動し、定期タスク4に相当するタイミングでCAN送信が発生し、その間は3タスク分(定期タスク1,2,3の分)の時間がある。また、定期タスク6で通信スケジュールが起動し、定期タスク8に相当するタイミングでCAN送信が発生し、その間は2タスク分(定期タスク6,7の分)の時間がある。また、定期タスク11で通信スケジュールが起動し、定期タスク12に相当するタイミングでCAN送信が発生し、その間は1タスク分(定期タスク11の分)の時間がある。また、定期タスク16で通信スケジュールが起動し、定期タスク16,20に相当するそれぞれのタイミングでCAN送信が発生し、その間はそれぞれ、0タスク分、4タスク分(定期タスク16,17,18,19の分)の時間がある。以上より、3タスク分、2タスク分、1タスク分、及び4タスク分を合計して合計転送時間は10タスク分である。   In the example of offset = 0, the LIN communication schedule is activated in the periodic task 1, and CAN transmission occurs at a timing corresponding to the periodic task 4, during which 3 tasks (periodic tasks 1, 2 and 3) I have time. In addition, the communication schedule is activated by the regular task 6, CAN transmission occurs at a timing corresponding to the regular task 8, and there are two tasks (periods 6 and 7) in the meantime. In addition, a communication schedule is activated by the periodic task 11, CAN transmission occurs at a timing corresponding to the periodic task 12, and there is a time corresponding to one task (for the periodic task 11). In addition, the communication schedule is activated by the regular task 16, and CAN transmission occurs at the timings corresponding to the regular tasks 16 and 20, respectively, for 0 task and 4 tasks (periodic tasks 16, 17, 18, There are 19 minutes). From the above, the total transfer time is 10 tasks by summing 3 tasks, 2 tasks, 1 task, and 4 tasks.

同様にして、offset=1〜4の例の場合について合計転送時間を検討すると、全て10タスク分となる。つまり、これ以上は合計転送時間を小さくすることはできないということになる。つまり、CAN受信周期とLIN通信スケジュール周期との同期をとることの実効性は得られないということになる。
〈図9の例:LIN→CAN〉
次に、図9は、CAN送信周期が定期タスク4個分、LIN通信スケジュール周期が定期タスク2個分の場合である。そして、CANにけるデータの送信タイミングは、それぞれ、LINにおける定期タスク4、定期タスク8、定期タスク12、定期タスク16、定期タスク20・・・のタイミングに相当しているものとする。
Similarly, if the total transfer time is examined for the cases of offset = 1 to 4, all are 10 tasks. In other words, the total transfer time cannot be reduced beyond this. In other words, the effectiveness of synchronizing the CAN reception cycle and the LIN communication schedule cycle cannot be obtained.
<Example of FIG. 9: LIN → CAN>
Next, FIG. 9 shows a case where the CAN transmission cycle is four regular tasks and the LIN communication schedule cycle is two regular tasks. It is assumed that the data transmission timing in the CAN corresponds to the timings of the regular task 4, the regular task 8, the regular task 12, the regular task 16, the regular task 20,.

CANにおける送信タイミングに対する、LINにおける通信スケジュールの開始タイミングがとり得るパターンとしては、図9の例では2通り考えられる(offset=0,1)。   There are two possible patterns in the LIN communication schedule start timing for the CAN transmission timing in the example of FIG. 9 (offset = 0, 1).

offset=0,1の段は、それぞれ、LINにおける通信スケジュールが、定期タスク1,3,5,7,9,・・・で開始される場合(offset=0の場合)、定期タスク2,4,6,8,10・・・で開始される場合(offset=1の場合)を表す。   In the stage of offset = 0, 1, when the communication schedule in LIN is started by the periodic tasks 1, 3, 5, 7, 9,... (when offset = 0), the periodic tasks 2, 4 respectively. , 6, 8, 10... (When offset = 1).

ここで、offset=0,1のそれぞれのパターンにおいて、CANにてデータが送信されるタイミングが、LINにおける通信スケジュールの開始タイミングからみて幾つ目の定期タスクに相当するかを検討する。つまり、Nlcを検討する。   Here, in each pattern of offset = 0, 1, it is examined how many regular tasks the timing at which data is transmitted by CAN corresponds to the start timing of the communication schedule in LIN. That is, consider Nlc.

offset=0の例では、通信スケジュールの開始タイミング(定期タスク3)から数えて、2タスク目(Nlc=2)にCANにてデータが送信されている。また、通信スケジュールの開始タイミング(定期タスク7)から数えて、2タスク目(Nlc=2)にCANにてデータが送信されている。以降も同様に、直前の通信スケジュールの開始タイミングから数えて、2タスク目(Nlc=2)にCANにてデータが送信されている。   In the example of offset = 0, data is transmitted by CAN at the second task (Nlc = 2) counting from the communication schedule start timing (periodic task 3). In addition, data is transmitted by CAN at the second task (Nlc = 2) counting from the start timing of the communication schedule (periodic task 7). Similarly, data is transmitted by CAN to the second task (Nlc = 2) counting from the start timing of the immediately preceding communication schedule.

このようにしてLINの通信スケジュールの開始タイミングから見てCANにおける送信タイミングが何タスク目であるか(つまりNlcの値)を、CAN送信周期とLIN通信スケジュール周期との最小公倍数の期間(つまり、定期タスク1〜4の期間)について抽出すると、Nlcは(2)の値をとり得る。   In this way, the task at which the transmission timing in the CAN is viewed from the start timing of the LIN communication schedule (that is, the value of Nlc) is the period of the least common multiple of the CAN transmission cycle and the LIN communication schedule cycle (that is, When extracting for the period of the periodic tasks 1 to 4, Nlc can take the value of (2).

同じようにして、offset=1の例について抽出した場合、Nlcは(1)の値をとり得る。   Similarly, when extracting for the example of offset = 1, Nlc can take the value of (1).

このように、図9の例では、Nlcが(1)、(2)の何れかをとり、(1,2)という全ての値(パターン)をとる例はないから、図3の前提条件判定処理におけるS20では、全パターン出現しないというように肯定判定され(S20:YES)、有効である(周期についての前提条件が成立する)と判断される。言い換えると、CAN受信周期とLIN通信スケジュール周期との同期をとることの実効性が得られると判断される。   Thus, in the example of FIG. 9, there is no example where Nlc takes either (1) or (2) and takes all values (patterns) of (1, 2). In S20 in the process, an affirmative determination is made so that all patterns do not appear (S20: YES), and it is determined that the condition is valid (a prerequisite for the period is satisfied). In other words, it is determined that the effectiveness of synchronizing the CAN reception cycle and the LIN communication schedule cycle can be obtained.

実効性の有無について検討するために、CAN送信周期とLIN通信スケジュール周期との最小公倍数の期間(つまり、定期タスク1〜4の期間)について、LINの通信スケジュールの開始点を起点として、CAN送信(転送)が発生するまでの時間の合計(合計転送時間)を検討する。   In order to examine whether or not it is effective, CAN transmission is started from the start point of the LIN communication schedule for the period of the least common multiple of the CAN transmission period and the LIN communication schedule period (that is, the period of the periodic tasks 1 to 4). Consider the total time (total transfer time) until (transfer) occurs.

offset=0の例では、定期タスク3でLINの通信スケジュールが開始してから定期タスク4に相当するタイミングでCAN送信が発生し、その間は1タスク分(定期タスク3の分)の時間がある。以上より、合計転送時間は1タスク分である。   In the example of offset = 0, CAN transmission occurs at a timing corresponding to the periodic task 4 after the LIN communication schedule is started in the periodic task 3, and there is a time corresponding to one task (for the periodic task 3). . From the above, the total transfer time is one task.

offset=1の例では、定期タスク4でLINの通信スケジュールが開始してから定期タスク4に相当するタイミングでCAN送信が発生し、その間はタイムラグがない。以上より、合計転送時間は0タスク分である。   In the example of offset = 1, CAN transmission occurs at a timing corresponding to the periodic task 4 after the LIN communication schedule starts in the periodic task 4, and there is no time lag during that period. From the above, the total transfer time is 0 tasks.

このような図9の例では、offset=0の例の場合、合計転送時間が0タスク分となるようにLINにおける通信スケジュールの開始タイミングを調整する(CAN受信周期とLIN通信スケジュール周期との同期をとる)ことができるはずである。つまり、転送に要する時間を短くする(最短にする)ことができ、同期をとることの実効性が得られるということになる。   In the example of FIG. 9, in the case of offset = 0, the start timing of the communication schedule in the LIN is adjusted so that the total transfer time is 0 tasks (synchronization between the CAN reception cycle and the LIN communication schedule cycle). ). In other words, the time required for transfer can be shortened (minimized), and the effectiveness of synchronization can be obtained.

続いて、図10の処理について説明する。前述のように、図10の通信スケジュール調整処理は、ECU101の通信同期装置202が所定期間毎に実行する処理である。   Next, the process of FIG. 10 will be described. As described above, the communication schedule adjustment process of FIG. 10 is a process executed by the communication synchronization apparatus 202 of the ECU 101 at predetermined intervals.

通信同期装置202は、図10の通信スケジュール調整処理において、まずS110で、転送対象のデータについて、CANにおけるそのデータの送信時刻(送信タイミング)或いは受信時刻(受信タイミング)を計測し、送信周期或いは受信周期を算出する。尚、ここでは、CAN通信ドライバ203からの送信完了通知に基づき送信時刻(送信タイミング)を計測し、また、CAN通信ドライバ203からの受信完了通知に基づき受信時刻(受信タイミング)を計測する。また、データの送信時刻(送信タイミング)は、LINからCANへのデータ転送に際して計測し、データの受信時刻(受信タイミング)は、CANからLINへのデータ転送に際して計測する。   In the communication schedule adjustment process of FIG. 10, the communication synchronization apparatus 202 first measures the transmission time (transmission timing) or reception time (reception timing) of the data in the CAN for the data to be transferred, and transmits the transmission period or Calculate the reception period. Here, the transmission time (transmission timing) is measured based on the transmission completion notification from the CAN communication driver 203, and the reception time (reception timing) is measured based on the reception completion notification from the CAN communication driver 203. The data transmission time (transmission timing) is measured at the time of data transfer from LIN to CAN, and the data reception time (reception timing) is measured at the time of data transfer from CAN to LIN.

次に、S120に移行し、LINの通信スケジュールの開始タイミングを調整可能か否かを判定する。ここでは、後述する転送開始条件とインターバル条件とが共に成立したか否かに基づき判定し、共に成立したと判断した場合に調整可能と判定する。   Next, the process proceeds to S120, and it is determined whether or not the start timing of the LIN communication schedule can be adjusted. Here, the determination is made based on whether or not both a transfer start condition and an interval condition, which will be described later, are satisfied, and if it is determined that both are satisfied, it is determined that adjustment is possible.

転送開始条件は、データ転送が確実に開始されていることを確認するための条件である。例えば、(イ)車両の図示しないイグニションスイッチがオン状態であること、(ロ)起動後転送対象のデータの初受信が完了したこと、(ハ)LINにて通信スケジュールが開始したこと、などが転送開始条件成立の要件として挙げられる。本実施形態では、(イ)〜(ハ)の要件の何れかでも成立した場合に転送開始条件が成立したと判定されるようになっている。   The transfer start condition is a condition for confirming that data transfer has been started reliably. For example, (a) the ignition switch (not shown) of the vehicle is in an ON state, (b) the first reception of data to be transferred after activation is completed, and (c) the communication schedule is started at LIN. This is listed as a requirement for establishing the transfer start condition. In the present embodiment, it is determined that the transfer start condition is satisfied when any of the requirements (A) to (C) is satisfied.

インターバル条件は、通信スケジュールの開始タイミングの前回の調整から所定時間(以下、インターバル時間とも記載する)経過したか否かを確認するための条件である。即ち、通信スケジュールの開始タイミングの前回の調整からインターバル時間が経過した場合、インターバル条件が成立したと判定される。これは、通信スケジュールの調整の頻繁な発生を防止する趣旨のものである。通信スケジュールの調整が頻繁に発生すると、かえってデータ転送が非効率になってしまったり、LINにて通信スケジュールが開始されなくなってしまったりするという弊害が生じてしまう可能性もあるためである。尚、インターバル時間は、例えば、CAN送受信周期(Tc)とLIN通信スケジュール周期(Tl)との最小公倍数に定期タスクの時間を乗じた時間以上とすることができる。   The interval condition is a condition for confirming whether or not a predetermined time (hereinafter also referred to as interval time) has elapsed since the previous adjustment of the start timing of the communication schedule. That is, when the interval time has elapsed since the previous adjustment of the start timing of the communication schedule, it is determined that the interval condition is satisfied. This is intended to prevent frequent occurrence of adjustment of the communication schedule. This is because if the communication schedule is frequently adjusted, data transfer may become inefficient or the communication schedule may not be started in LIN. The interval time can be set to, for example, a time obtained by multiplying the least common multiple of the CAN transmission / reception cycle (Tc) and the LIN communication schedule cycle (Tl) by the time of the regular task.

S120で調整可能と判定した場合(S120:YES)はS130に進み、S120で調整可能でないと判定した場合(S120:NO)には再びS110に戻る。S120から戻ったS110では、他の転送対象のデータについて、送信時刻(送信タイミング)或いは受信時刻(受信タイミング)を計測する。そして、その後の処理を続ける。   If it is determined in S120 that adjustment is possible (S120: YES), the process proceeds to S130. If it is determined in S120 that adjustment is not possible (S120: NO), the process returns to S110 again. In S110 returned from S120, the transmission time (transmission timing) or the reception time (reception timing) is measured for other transfer target data. Then, the subsequent processing is continued.

S130では、転送対象のデータについてのCAN送受信周期と、LIN通信スケジュール周期とが同一であるか否かを判定し、同一であると判定すると(S130::YES)、S140に移行し、同一でないと判定すると(S130:NO)、S150に移行する。CAN送受信周期とLIN通信スケジュール周期とが同一である場合は、それらの開始タイミングの同期をとれば、CANの送受信のタイミングとLINの通信スケジュールの開始タイミングとが完全に一致することとなる。一方、CAN送受信周期とLIN通信スケジュール周期とが同一でない場合は、図4〜9の例に示したように調整不要の場合もあるため、調整の要否を判定する必要がある。   In S130, it is determined whether or not the CAN transmission / reception cycle for the data to be transferred and the LIN communication schedule cycle are the same. If it is determined that they are the same (S130 :: YES), the process proceeds to S140 and is not the same. (S130: NO), the process proceeds to S150. If the CAN transmission / reception cycle and the LIN communication schedule cycle are the same, the CAN transmission / reception timing and the LIN communication schedule start timing completely coincide with each other by synchronizing their start timings. On the other hand, when the CAN transmission / reception cycle and the LIN communication schedule cycle are not the same, adjustment may not be necessary as shown in the examples of FIGS.

S140では、オフセットするタスク数を算出する。具体的に、LINの通信スケジュールの開始タイミングの調整量を算出する。   In S140, the number of tasks to be offset is calculated. Specifically, the adjustment amount of the start timing of the LIN communication schedule is calculated.

ここで、CANからLINへのデータ転送に際しては、CANにおける受信が発生した直後の定期タスクにおいてLINの通信スケジュールが開始されるようにすると、CANからLINへのデータ転送の遅れが最も少なくなる。そこで、S140の処理では、CANからLINへのデータ転送に際してオフセットするタスク数を以下の(a)式及び(b)式により算出する。   Here, at the time of data transfer from CAN to LIN, if the LIN communication schedule is started in the periodic task immediately after reception at CAN, the delay in data transfer from CAN to LIN is minimized. Therefore, in the process of S140, the number of tasks offset at the time of data transfer from CAN to LIN is calculated by the following equations (a) and (b).

OFScl=n1・Tc−(Tl−Ncl)・・・(a)式
n1=CEILING((Tl−Ncl)/Tc)・・・(b)式
OFScl:オフセットするタスク数
CEILING:小数点以下切り上げを行う関数
Tl:通信スケジュール周期(定期タスクの数)
Tc:CAN送受信周期(定期タスクの数)
次に、LINからCANへのデータ転送に際しては、CANにおける送信が発生する直前の定期タスクにおいてLINの通信スケジュールが終了すると、LINからCANへのデータ転送の遅れが最も少なくなる。そこで、S140の処理では、LINからCANへのデータ転送に際してオフセットするタスク数を以下の(c)式及び(d)式により算出する。
OFScl = n1 · Tc− (Tl−Ncl) (a) Expression n1 = CEILING ((Tl−Ncl) / Tc) (b) Expression OFScl: Number of tasks to be offset CEILING: Round up the decimal point Function Tl: Communication schedule cycle (number of periodic tasks)
Tc: CAN transmission / reception cycle (number of periodic tasks)
Next, when transferring data from LIN to CAN, the delay in data transfer from LIN to CAN is minimized when the LIN communication schedule ends in a periodic task immediately before transmission in CAN occurs. Therefore, in the process of S140, the number of tasks offset at the time of data transfer from LIN to CAN is calculated by the following equations (c) and (d).

OFScl=(n2・Tc−1)−(Tl−Nlc)・・・(c)式
n2=1+FLOOR((Tl−Nlc)/Tc)・・・(d)式
OFScl:オフセットするタスク数
FLOOR:小数点以下切り捨てを行う関数
S140の後はS180に移行し、S140で算出したオフセットするタスク数に基づき、通信スケジュールの調整指示をLIN通信スケジューラ206に出力する。そして再びS110に戻る。尚、オフセットするタスク数がゼロである場合には調整指示の通知は行わない。
OFScl = (n2 · Tc−1) − (T1−Nlc) (c) Expression n2 = 1 + FLOOR ((T1−Nlc) / Tc) (d) Expression OFScl: Number of tasks to be offset FLOOR: Decimal point After the truncation function S140, the process proceeds to S180, and a communication schedule adjustment instruction is output to the LIN communication scheduler 206 based on the number of tasks to be offset calculated in S140. And it returns to S110 again. When the number of tasks to be offset is zero, no adjustment instruction is notified.

一方、S130にて否定判定して移行したS150では、S110の計測結果に基づき、前述のNcl或いはNlcの出現パターンを判別する。例えば、前述のインターバル時間中においてNcl或いはNlcの値を計測することで、その出現パターンを判別できる。   On the other hand, in S150, where a negative determination is made in S130 and the process proceeds, the above-described Ncl or Nlc appearance pattern is determined based on the measurement result in S110. For example, the appearance pattern can be discriminated by measuring the value of Ncl or Nlc during the aforementioned interval time.

S150の後はS160に進み、通信スケジュールの開始タイミングの調整の要否を判定する。本実施形態では、Ncl或いはNlcの出現パターン毎に通信スケジュールの開始タイミングの調整が有効となるのか否かを示す情報(以下、調整要否情報とも記載する)を予めECU101において記憶しておく。そして、その調整要否情報を参照することによって調整の要否を判定する。例えば、図4の例でみると、offset=0,2,4の例の場合のようにNclの出現パターンが(4,2、6)となる場合は調整不要と設定しておき、offset=1,3,5の例の場合のようにNlcの出現パターンが(3,1,5)となる場合は調整要と設定しておく。   After S150, the process proceeds to S160, and it is determined whether or not adjustment of the start timing of the communication schedule is necessary. In the present embodiment, the ECU 101 stores in advance information indicating whether adjustment of the start timing of the communication schedule is effective for each Ncl or Nlc appearance pattern (hereinafter also referred to as adjustment necessity information). Then, the necessity of adjustment is determined by referring to the adjustment necessity information. For example, in the example of FIG. 4, when the appearance pattern of Ncl is (4, 2, 6) as in the case of offset = 0, 2, 4, 4, it is set that no adjustment is necessary, and offset = When the appearance pattern of Nlc is (3, 1, 5) as in the case of 1, 3, 5, the adjustment is set as necessary.

S160で調整が必要でないと判定すると(S160:NO)、再びS110に戻る。一方、S160で調整が必要であると判定すると(S160:YES)、S170に移行する。S170では、オフセットするタスク数を算出する。本実施形態では、図4〜9に示すような各パターン毎に、合計転送時間を最短とするためにオフセットすべきタスク数を予めECU101において記憶しておく。そして、その情報を参照してオフセットするタスク数を算出できるようにする。例えば図4の例でみると、offset=1の例では、通信スケジュールの開始タイミングを1タスク分だけオフセットする(早くする)と、offset=0の例と一致し、合計転送時間が2タスク分まで減少する。したがって、例えば図4のoffset=1のパターンをとる場合はオフセットするタスク数は1とする、という情報を予め持っておくようにする。   If it is determined in S160 that no adjustment is necessary (S160: NO), the process returns to S110 again. On the other hand, if it is determined in S160 that adjustment is required (S160: YES), the process proceeds to S170. In S170, the number of tasks to be offset is calculated. In this embodiment, the number of tasks to be offset in order to minimize the total transfer time is stored in the ECU 101 in advance for each pattern as shown in FIGS. Then, the number of tasks to be offset can be calculated with reference to the information. For example, in the example of FIG. 4, in the case of offset = 1, if the start timing of the communication schedule is offset by one task (accelerated), it matches the example of offset = 0, and the total transfer time is two tasks. Decrease to. Therefore, for example, when the pattern of offset = 1 in FIG. 4 is taken, information that the number of tasks to be offset is 1 is previously stored.

S170の後はS180に移行し、通信スケジュールの開始タイミングの調整指示をLIN通信スケジューラ206に出力する。   After S170, the process proceeds to S180, and a communication schedule start timing adjustment instruction is output to the LIN communication scheduler 206.

次に、図11の処理について説明する。前述のように、図11の通信スケジュール開始処理は、ECU101のLIN通信スケジューラ206が所定期間毎に実行する。   Next, the process of FIG. 11 will be described. As described above, the communication schedule start process of FIG. 11 is executed by the LIN communication scheduler 206 of the ECU 101 every predetermined period.

LIN通信スケジューラ206は、図11の通信スケジュール開始処理において、まずS210で、通信同期装置202からの通信スケジュールの調整指示を受けたか否かを判定する。通信スケジュールの調整指示は、前述の図10のS180において通信同期装置202から出力される。   In the communication schedule start process of FIG. 11, the LIN communication scheduler 206 first determines whether or not a communication schedule adjustment instruction has been received from the communication synchronization apparatus 202 in S210. The communication schedule adjustment instruction is output from the communication synchronization apparatus 202 in S180 of FIG.

S210において調整指示を受けていないと判定すると(S210:NO)、S230に移行し、予め設定されているタイミング(定期タスク)で通信スケジュールを開始(起動)する。そしてその後、当該処理を終了する。   If it is determined in S210 that an adjustment instruction has not been received (S210: NO), the process proceeds to S230, and a communication schedule is started (activated) at a preset timing (periodic task). Thereafter, the process is terminated.

一方、S210で調整指示を受けたと判定すると(S210:YES)、S220に移行し、予め設定されているタイミングから、オフセットするタスク数分の時間が経過したか否かを判定する。オフセットするタスク数の情報は、通信同期装置202からの調整指示に含まれている。   On the other hand, if it is determined in S210 that an adjustment instruction has been received (S210: YES), the process proceeds to S220, and it is determined whether or not a time corresponding to the number of tasks to be offset has elapsed from a preset timing. Information on the number of tasks to be offset is included in the adjustment instruction from the communication synchronization apparatus 202.

S220でオフセットするタスク数分の時間が経過していないと判定すると(S220:NO)、再びS220の処理を繰り返す(オフセットするタスク数分の時間が経過するまで待機する)。一方、S220でオフセットするタスク数分の時間が経過したと判定すると(S220:YES)、同期タイミングと判断してS230に移行し、通信スケジュールを開始する。そしてその後、当該処理を終了する。   If it is determined in S220 that the time corresponding to the number of tasks to be offset has not elapsed (S220: NO), the processing in S220 is repeated again (waiting until the time corresponding to the number of tasks to be offset has elapsed). On the other hand, when it is determined in S220 that the time corresponding to the number of tasks to be offset has elapsed (S220: YES), the synchronization timing is determined, and the process proceeds to S230 to start the communication schedule. Thereafter, the process is terminated.

以上説明したように、本実施形態においては、ECU101は、CANとLINとに接続するECU101において、そのCAN及びLIN間のデータ転送に際し、転送に要する時間が最短となるようにLINにおける通信スケジュールの開始タイミングを調整するようになっている。具体的には、CANからLINへのデータ転送に際し、CANにおける受信タイミングとLINにおける送信タイミングとが同期するように、LINにて通信スケジュールが開始されるようにする。このため、CANで受信されたデータが即座にLINに転送されるようになる。また、LINからCANへのデータ転送に際し、CANにおける送信タイミングとLINにおける受信タイミングとが同期するように、LINにて通信スケジュールが開始されるようにする。このため、LINで受信されたデータが即座にCANに転送されるようになる。   As described above, in this embodiment, the ECU 101 connected to the CAN and the LIN determines the communication schedule in the LIN so that the time required for the data transfer between the CAN and the LIN is minimized. The start timing is adjusted. Specifically, at the time of data transfer from CAN to LIN, the communication schedule is started at LIN so that the reception timing at CAN and the transmission timing at LIN are synchronized. For this reason, data received by the CAN is immediately transferred to the LIN. Further, at the time of data transfer from the LIN to the CAN, the communication schedule is started at the LIN so that the transmission timing at the CAN and the reception timing at the LIN are synchronized. For this reason, the data received by the LIN is immediately transferred to the CAN.

このような本実施形態では、CANからLINへのデータ転送、或いはLINからCANへのデータ転送に際し、タイムラグの発生が抑えられるようになっている。これによれば、CANからLINへのデータ転送、或いはLINからCANへのデータ転送がスムーズなものとなり、転送効率の向上に寄与できる。   In this embodiment, the occurrence of a time lag can be suppressed during data transfer from CAN to LIN or data transfer from LIN to CAN. According to this, data transfer from CAN to LIN or data transfer from LIN to CAN becomes smooth, which can contribute to improvement of transfer efficiency.

尚、本実施形態において、S110の処理が検出手段に相当し、S140、S170の処理が算出手段に相当している。
[変形例1]
次に、上記実施形態の変形例1について、図12、図13を用いて説明する。尚、図12はCANからLINへのデータ転送の態様を表し、図13はLINからCANへのデータ転送の態様を表す。
In the present embodiment, the process of S110 corresponds to the detection unit, and the processes of S140 and S170 correspond to the calculation unit.
[Modification 1]
Next, Modification 1 of the above embodiment will be described with reference to FIGS. 12 shows a mode of data transfer from CAN to LIN, and FIG. 13 shows a mode of data transfer from LIN to CAN.

本変形例1では、図12に示すように、4つのフレームの送受信でLINの通信スケジュールが構成される。また、LIN通信スケジュール周期は4タスクである。具体的には、データAの送信、データBの受信、データCの受信、データDの送信の順で通信スケジュールが構成され、そのデータAの送信、データBの受信、データCの受信、データDの送信のそれぞれで定期タスク1個分を占める。   In the first modification, as shown in FIG. 12, a LIN communication schedule is configured by transmitting and receiving four frames. The LIN communication schedule cycle is 4 tasks. Specifically, a communication schedule is configured in the order of transmission of data A, reception of data B, reception of data C, transmission of data D, transmission of data A, reception of data B, reception of data C, data Each transmission of D occupies one periodic task.

図12において、前述した図10、図11の処理によりCAN受信周期とLIN通信スケジュール周期との同期をとった場合、LIN通信スケジュールパターン(1)に示すように、CANの受信タイミングの直後の定期タスクでLINの通信スケジュールが開始されるようになる。前述のようにLINにおける通信スケジュールはデータAの送信、データBの受信、データCの受信、データDの送信の順で構成されるから、データAがCANからLINに最短で転送され得る。   In FIG. 12, when the CAN reception cycle and the LIN communication schedule cycle are synchronized by the processes of FIGS. 10 and 11, the period immediately after the CAN reception timing is set as shown in the LIN communication schedule pattern (1). The task starts the LIN communication schedule. As described above, since the communication schedule in LIN is configured in the order of transmission of data A, reception of data B, reception of data C, and transmission of data D, data A can be transferred from CAN to LIN in the shortest time.

ここで、例えばデータDを最短で転送しようとする場合には、LIN通信スケジュールパターン(2)に示すように、LINの通信スケジュールの開始タイミングを1タスク分オフセットする(遅らせる)。これにより、「データDの送信」というタスクがCANにおける受信の直後に発生することになるため、データDがCANからLINに最短で転送され得るようになる。   For example, when the data D is to be transferred in the shortest time, the start timing of the LIN communication schedule is offset (delayed) by one task as shown in the LIN communication schedule pattern (2). As a result, the task “transmission of data D” occurs immediately after reception in CAN, so that data D can be transferred from CAN to LIN in the shortest time.

次に、図13において、前述した図10、図11の処理によりCAN送信周期とLIN通信スケジュールとの同期をとった場合、LIN通信スケジュールパターン(3)に示すように、データCがLINからCANに最短で転送され得る。   Next, in FIG. 13, when the CAN transmission cycle and the LIN communication schedule are synchronized by the processing of FIGS. 10 and 11, the data C is transferred from the LIN to the CAN as shown in the LIN communication schedule pattern (3). Can be transferred in the shortest time.

ここで、例えばデータBを最短で転送しようとする場合には、LIN通信スケジュールパターン(4)に示すように、LINの通信スケジュールの開始タイミングを1タスク分オフセットする(遅らせる)。これにより、「データBの受信」というタスクがCANにおける送信の直前に発生することとなるため、データBがLINからCANに最短で転送され得るようになる。   Here, for example, when data B is to be transferred in the shortest time, as shown in the LIN communication schedule pattern (4), the start timing of the LIN communication schedule is offset (delayed) by one task. As a result, the task of “reception of data B” occurs immediately before transmission in CAN, so that data B can be transferred from LIN to CAN in the shortest time.

以上のように、本変形例1は、CAN送受信周期とLIN通信スケジュール周期との同期をとり、さらに、最短で転送したいデータに合わせて追加でオフセットを実行するものである。   As described above, in the first modification, the CAN transmission / reception cycle and the LIN communication schedule cycle are synchronized, and an offset is additionally executed according to the data to be transferred in the shortest time.

これによれば、LINの通信スケジュールが複数のフレームの送受信で構成される場合において、複数のフレームのうち所望のフレーム(所望のデータ)を対象として転送時間を最短にすることができるようになる。これによれば、所望のデータを最短で転送することをより確実に実現できる。   According to this, when the LIN communication schedule is configured by transmitting and receiving a plurality of frames, the transfer time can be minimized for a desired frame (desired data) among the plurality of frames. . According to this, it is possible to more reliably realize transfer of desired data in the shortest time.

尚、最短で転送したいデータは予め設定されるように構成しても良いが、以下に示す変形例2のように、最短で転送したいデータが動的に変更されるように構成しても良い。
[変形例2]
本変形例2について、図14を用いて説明する。尚、本変形例2は、図3の前提条件判定処理で無効である(周期に関する前提条件が成立しない)と判断される場合でも適用することができる。
The data to be transferred in the shortest time may be set in advance, but the data to be transferred in the shortest time may be dynamically changed as in Modification 2 shown below. .
[Modification 2]
Modification 2 will be described with reference to FIG. The second modification can be applied even when it is determined that the precondition determination process in FIG. 3 is invalid (the precondition regarding the period is not satisfied).

図14の例では、LINの通信スケジュールは、送信フレームαの送受信(データAの送受信)、及び送信フレームβの送受信(データBの送受信)の順で構成されるものとする。また、LIN通信スケジュール周期は6タスクである。具体的には、送信フレームαの送受信、及び送信フレームβの送受信でそれぞれ3タスク分を占める。   In the example of FIG. 14, the LIN communication schedule is configured in the order of transmission / reception of transmission frame α (transmission / reception of data A) and transmission / reception of transmission frame β (transmission / reception of data B). The LIN communication schedule cycle is 6 tasks. Specifically, transmission / reception of the transmission frame α and transmission / reception of the transmission frame β occupy three tasks.

一方、CANにおいては、CANフレーム1(データA)、CANフレーム2(データB)が、それぞれ、6タスクに相当する周期で受信されるものとする。例えば、CANフレーム1が、定期タスク2の直後、定期タスク8の直後のタイミングでそれぞれ受信され、CANフレーム2が、例えば定期タスク3の直後、定期タスク9の直後のタイミングでそれぞれ受信される。   On the other hand, in CAN, it is assumed that CAN frame 1 (data A) and CAN frame 2 (data B) are received at a period corresponding to 6 tasks. For example, CAN frame 1 is received immediately after regular task 2 and immediately after regular task 8, and CAN frame 2 is received, for example, immediately after regular task 3 and immediately after regular task 9, respectively.

CANフレーム1(データA)に同期して転送を行う場合(データAを最短で転送する場合)、図14のLIN通信スケジュールパターン(5)に示すように、CANフレーム1の受信の直後の定期タスクで通信スケジュールが開始するように、その通信スケジュールの開始タイミングが調整される(図10、図11の処理)。これにより、データAが最短で転送され得るようになる。   When data is transferred in synchronization with CAN frame 1 (data A) (when data A is transferred in the shortest time), as shown in LIN communication schedule pattern (5) in FIG. The start timing of the communication schedule is adjusted so that the task starts the communication schedule (the processes of FIGS. 10 and 11). As a result, the data A can be transferred in the shortest time.

一方、データBについてであるが、LIN通信スケジュールパターン(5)では、定期タスク3の直後にCANフレーム2(データB)がCANにて受信されてから、定期タスク6にて送信フレームβ(データB)がLINに送信されるまでの間、転送に遅れが生じることとなる。   On the other hand, for data B, in the LIN communication schedule pattern (5), CAN frame 2 (data B) is received by CAN immediately after periodic task 3, and then transmission frame β (data There will be a delay in the transfer until B) is sent to LIN.

ここで、本変形例2では、データBを最短で転送しようとする場合、データBを格納するCANフレーム2に、データBについて同期をとるための同期指示(以下、データB同期指示とも記載する)が格納される。   Here, in the second modification, when data B is to be transferred in the shortest time, a synchronization instruction for synchronizing the data B with the CAN frame 2 storing the data B (hereinafter also referred to as a data B synchronization instruction). ) Is stored.

CANフレーム2において、データBとともに、データB同期指示が格納されている場合、データBが最短で転送され得るように、LINの通信スケジュールの開始タイミングが調整される。具体的には、LIN通信スケジュールパターン(6)に示すように、CANフレーム2の受信の直後の定期タスクで「送信フレームβの送受信」のタスクが発生するように、LINの通信スケジュールの開始タイミングがオフセットされる。   In the CAN frame 2, when the data B synchronization instruction is stored together with the data B, the start timing of the LIN communication schedule is adjusted so that the data B can be transferred in the shortest time. Specifically, as shown in the LIN communication schedule pattern (6), the start timing of the LIN communication schedule so that the task “transmission / reception of transmission frame β” occurs in the periodic task immediately after reception of the CAN frame 2. Is offset.

このオフセットの手順をより具体的に説明すると、まず、CANフレーム2の受信周期とLIN通信スケジュール周期とが同期するように、LINの通信スケジュールの開始タイミングが調整される(図10の処理)。加えて、LINの通信スケジュールの開始タイミングが、送信フレームαの送受信に要する時間(図14の例では3タスク分)だけ減算される(早くなる)。このような手順により、CANフレーム2の受信の直後の定期タスクで「送信フレームβの送受信」のタスクが発生するようになり、データBが最短で転送され得るようになる。   The offset procedure will be described more specifically. First, the start timing of the LIN communication schedule is adjusted so that the reception period of the CAN frame 2 and the LIN communication schedule period are synchronized (the process of FIG. 10). In addition, the start timing of the LIN communication schedule is subtracted (accelerated) by the time required for transmission / reception of the transmission frame α (three tasks in the example of FIG. 14). According to such a procedure, a task “transmission / reception of transmission frame β” occurs in a periodic task immediately after reception of CAN frame 2, and data B can be transferred in the shortest time.

尚、ここでは、CANからLINへのデータ転送の場合について説明したが、LINからCANへのデータ転送の場合も同様の手法で調整できる。
[変形例3]
次に、変形例3について図15を用いて説明する。
Although the case of data transfer from CAN to LIN has been described here, the same method can be used for data transfer from LIN to CAN.
[Modification 3]
Next, Modification 3 will be described with reference to FIG.

図15の例は、CANからLINにデータを転送する場合の態様を表す。CAN受信周期は4タスクであり、例えば、定期タスク4の直後、定期タスク8の直後、定期タスク12の直後、定期タスク16の直後、のタイミングで、CANにて受信が発生するものとする。   The example of FIG. 15 represents a mode in which data is transferred from CAN to LIN. The CAN reception cycle is 4 tasks. For example, it is assumed that reception occurs at the CAN immediately after the regular task 4, immediately after the regular task 8, just after the regular task 12, and just after the regular task 16.

また、LINの通信スケジュールは送信フレームの送受信、及び受信フレームの送受信の順に構成され、LIN通信スケジュール周期は4タスクであるとする。   The LIN communication schedule is configured in the order of transmission / reception of transmission frames and transmission / reception of reception frames, and the LIN communication schedule cycle is assumed to be four tasks.

図15における「同期前」の例に示すように、LINの通信スケジュールの開始タイミングが定期タスク3,7,11,15・・・であるとすると、例えば定期タスク4の直後にCANにて受信されたデータが最短でLINに転送されるようにするには、LINの通信スケジュールの開始を、2/4周期(つまり2タスク分)だけ待つ必要がある。具体的には、LINの通信スケジュールが、定期タスク5,9,13・・・で開始されるようにする必要がある。   As shown in the example of “before synchronization” in FIG. 15, if the start timing of the LIN communication schedule is regular tasks 3, 7, 11, 15,... In order to transfer the processed data to the LIN in the shortest time, it is necessary to wait for 2/4 period (that is, two tasks) for the start of the LIN communication schedule. Specifically, the LIN communication schedule needs to be started by the periodic tasks 5, 9, 13.

この本変形例3では、LINの通信スケジュールの開始タイミングを徐々にずらし、CAN受信周期とLIN通信スケジュール周期との同期をとるようになっている。   In this third modification, the start timing of the LIN communication schedule is gradually shifted to synchronize the CAN reception cycle and the LIN communication schedule cycle.

まず、図15の「同期処理(1回目)」の段に示すように、1回目の同期処理にて、LINの通信スケジュールの開始タイミングを1タスク分だけ遅らせる(1タスク分待機する)。具体的には、本来は定期タスク7で開始される通信スケジュールを、1タスク分後の定期タスク8で開始させる。   First, as shown in the stage of “synchronization process (first time)” in FIG. 15, the start timing of the LIN communication schedule is delayed by one task in the first synchronization process (waits for one task). Specifically, the communication schedule originally started by the periodic task 7 is started by the periodic task 8 after one task.

続いて、図15の「同期処理(2回目)」の段に示すように、2回目の同期処理にて、LINの通信スケジュールの開始タイミングをさらに1タスク分だけ遅らせる。その後は、図示は省略するが4タスクの周期で通信スケジュールを開始する。   Subsequently, as shown in the stage of “synchronization process (second time)” in FIG. 15, the start timing of the LIN communication schedule is further delayed by one task in the second synchronization process. Thereafter, although not shown, the communication schedule is started at a cycle of 4 tasks.

これにより、LINの通信スケジュールの開始タイミングが、目標とするタイミングに一致する。即ち、LINの通信スケジュールが定期タスク13,17・・・で開始されるようになる。言い換えると、CANにおける受信の発生直後の定期タスクにて、LINの通信スケジュールが開始されるようになる。   As a result, the start timing of the LIN communication schedule matches the target timing. That is, the LIN communication schedule starts with the periodic tasks 13, 17,. In other words, the LIN communication schedule is started in the periodic task immediately after the occurrence of reception in the CAN.

このような変形例3のように、LINの通信スケジュールの開始タイミングを1回の同期処理で調整するのではなく複数回の同期処理に分けて徐々に調整することにより、1回あたりの調整量(オフセット量)を小さくすることができる。言い換えると、通信スケジュールの開始タイミングが1回の調整で大幅に変更されないようにできる。通信スケジュールの開始タイミングが1回の調整で大幅に変更されてしまうと、ネットワーク上においてその変更を認識できない装置など(例えば図1における制御装置103)が、通信に関する故障が生じたとか通信途絶が生じたというように誤判断する可能性もあるが、本変形例3の構成によれば、そのような問題が生じることを回避し得る。   As in the third modification example, the adjustment amount per time is adjusted by gradually adjusting the start timing of the LIN communication schedule in multiple synchronization processes instead of adjusting the start timing in one synchronization process. (Offset amount) can be reduced. In other words, the start timing of the communication schedule can be prevented from being significantly changed by one adjustment. If the start timing of the communication schedule is changed significantly by a single adjustment, a device or the like that cannot recognize the change on the network (for example, the control device 103 in FIG. 1) has a communication failure or communication interruption. Although it may be erroneously determined that it has occurred, according to the configuration of the third modification, it is possible to avoid the occurrence of such a problem.

尚、ここでは、CANからLINへのデータ転送の場合について説明したが、LINからCANへのデータ転送の場合も同様の手法で調整できる。
[変形例4]
次に、変形例4について図16を用いて説明する。尚、本変形例4は、図3の前提条件判定処理で無効である(周期に関する前提条件が成立しない)と判断される場合でも適用することができる。
Although the case of data transfer from CAN to LIN has been described here, the same method can be used for data transfer from LIN to CAN.
[Modification 4]
Next, Modification 4 will be described with reference to FIG. Note that the fourth modification can be applied even when it is determined that the precondition determination process in FIG. 3 is invalid (the precondition regarding the period is not satisfied).

図16の例は、CANからLINにデータを転送する場合の態様を表す。CANにおいては、CANフレーム1(データA)、CANフレーム2(データB)が、それぞれ、6タスクに相当する周期で受信されるものとする。より具体的には、CANフレーム1が、例えば定期タスク2の直後、定期タスク8の直後のタイミングでそれぞれ受信され、CANフレーム2が、例えば定期タスク5の直後、定期タスク11の直後のタイミングでそれぞれ受信される。   The example of FIG. 16 represents an aspect in the case where data is transferred from CAN to LIN. In CAN, it is assumed that CAN frame 1 (data A) and CAN frame 2 (data B) are received at a period corresponding to 6 tasks. More specifically, the CAN frame 1 is received, for example, immediately after the regular task 2 and the timing immediately after the regular task 8, and the CAN frame 2 is received, for example, immediately after the regular task 5, and immediately after the regular task 11. Received respectively.

また、LINの通信スケジュールは送信フレームの送受信(データA及びデータBの送受信)、及び受信フレームの送受信(データCの送受信)の順に構成され、LIN通信スケジュール周期は6タスクであるとする。   The LIN communication schedule is configured in the order of transmission / reception of transmission frames (transmission / reception of data A and data B) and transmission / reception of reception frames (transmission / reception of data C), and the LIN communication schedule cycle is assumed to be 6 tasks.

そして、図16におけるLIN通信スケジュールパターン(7)の例では、データAが最短で転送されるように構成されている。具体的には、LINの通信スケジュールが、CANフレーム1の受信(データAの受信)が発生した直後の定期タスクで開始されるようになっている。一方、データBについてであるが、例えば定期タスク5の直後にCANフレーム2(データB)がCANにて受信されてから、定期タスク9にて送信フレーム(データA及びデータB)がLINにて送受信されるまでの間、転送に遅れが生じることとなる。   In the example of the LIN communication schedule pattern (7) in FIG. 16, the data A is configured to be transferred in the shortest time. Specifically, the LIN communication schedule is started by a periodic task immediately after the reception of CAN frame 1 (data A). On the other hand, for data B, for example, CAN frame 2 (data B) is received by CAN immediately after periodic task 5, and then transmission frames (data A and data B) are transmitted by LIN in periodic task 9. There will be a delay in the transfer until it is transmitted and received.

本変形例4では、例えばデータBを緊急に転送しようとする場合、データBを格納するCANフレーム2に、データBが緊急で転送されるべきデータ(以下、緊急データとも記載する)である旨の情報が格納される。   In the fourth modification, for example, when data B is urgently transferred, the data B is data to be urgently transferred to the CAN frame 2 storing the data B (hereinafter also referred to as emergency data). Is stored.

CANフレーム2において、データBとともに、緊急データの情報が格納されている場合、データBが緊急(最短)で転送され得るように、LINの通信スケジュールの開始タイミングが調整される。具体的には、現在の通信スケジュールが中止され、LIN通信スケジュールパターン(8)に示すように、データBをすぐに転送できるような新たな通信スケジュールが開始される。   In the CAN frame 2, when emergency data information is stored together with the data B, the start timing of the LIN communication schedule is adjusted so that the data B can be transferred in an emergency (shortest). Specifically, the current communication schedule is canceled and a new communication schedule is started so that the data B can be transferred immediately as shown in the LIN communication schedule pattern (8).

例えば、図16の例では、CANにてCANフレーム2が受信された後、定期タスク6にて本来発生するはずであった「受信フレームの送受信(データCの送受信)」のタスクがキャンセルされ(現状の通信スケジュールがキャンセルされ)、定期タスク7にて新たに通信スケジュールが開始される。これにより、CANにて受信されたCANフレーム2(データB)が、即座にLINに転送され得るようになる。   For example, in the example of FIG. 16, after the CAN frame 2 is received by the CAN, the task “transmission / reception of received frame (transmission / reception of data C)” that should have occurred in the periodic task 6 is canceled ( The current communication schedule is canceled), and a new communication schedule is started in the periodic task 7. As a result, the CAN frame 2 (data B) received by the CAN can be immediately transferred to the LIN.

このような変形例4によれば、受信フレームの送受信(データCの送受信)の終了まで待つことなく、すぐに所望のデータBをCANからLINに転送できる。   According to the fourth modification, the desired data B can be immediately transferred from the CAN to the LIN without waiting for the end of transmission / reception of the received frame (transmission / reception of the data C).

尚、ここでは、CANからLINへのデータ転送の場合について説明したが、LINからCANへのデータ転送の場合も同様である。LINにおける受信フレームに、緊急データである旨の情報が格納されるようにすれば良い。受信フレームに緊急データである旨の情報が格納されている場合、その受信フレームの受信タイミングとCANにおける送信タイミングとが同期するように、LINにおける通信スケジュールの開始タイミングを調整すれば良い。
[変形例5]
次に、変形例5について図17、図18を用いて説明する。
Although the case of data transfer from CAN to LIN has been described here, the same applies to the case of data transfer from LIN to CAN. Information indicating emergency data may be stored in the received frame in the LIN. When information indicating emergency data is stored in the received frame, the start timing of the communication schedule in the LIN may be adjusted so that the reception timing of the received frame is synchronized with the transmission timing in the CAN.
[Modification 5]
Next, Modification 5 will be described with reference to FIGS. 17 and 18.

上記実施形態では、ある1つのデータを対象として、そのデータが最短で転送されるように、LINにおける通信スケジュールの開始タイミングを調整するようにしていた。本変形例5は、複数のデータを対象とし、それらのデータがなるべく遅れなく転送されるようにするものである。   In the embodiment described above, the start timing of the communication schedule in the LIN is adjusted so that certain data is transferred in the shortest time. In the fifth modification, a plurality of data is targeted, and the data are transferred as much as possible without delay.

図17の例において、転送対象のデータとして、CANにてCANフレーム1、CANフレーム2、CANフレーム3の3種類が受信されるものとする。尚、CANフレーム1、CANフレーム2の受信周期は16[ms]であり、CANフレーム3の受信周期は24[ms]である。   In the example of FIG. 17, it is assumed that the CAN frame 1, CAN frame 2, and CAN frame 3 are received as data to be transferred by the CAN. Note that the reception cycle of CAN frame 1 and CAN frame 2 is 16 [ms], and the reception cycle of CAN frame 3 is 24 [ms].

ここで、本変形例では、ECU101において以下のような処理が実行されるようにする。   Here, in the present modification, the ECU 101 executes the following process.

まず、予め設定された所定の長さの区間毎に各フレームの受信タイミングを検出する。ここでは、16[msec]の期間を1つの区間として受信タイミングを検出する。   First, the reception timing of each frame is detected for each section having a predetermined length. Here, the reception timing is detected with a period of 16 [msec] as one section.

そして、複数の区間の検出結果を重ね合わせる。具体的に、1〜16[msec]、16〜32[msec]、・・・n×16〜(n+1)×16[msec]の区間の検出結果を重ね合わる。   Then, the detection results of a plurality of sections are overlaid. Specifically, the detection results in the sections of 1 to 16 [msec], 16 to 32 [msec],... N × 16 to (n + 1) × 16 [msec] are overlapped.

そして、受信タイミングのヒストグラムを作成する。   Then, a reception timing histogram is created.

この場合のヒストグラムを図18に示す。1〜16[msec]、16〜32[msec]、・・・n×16〜(n+1)×16[msec]の区間の検出結果を重ね合わせ、まず、CANフレーム1、CANフレーム2、及びCANフレーム3のそれぞれについて、受信タイミングのヒストグラムを作成する。   A histogram in this case is shown in FIG. 1 to 16 [msec], 16 to 32 [msec],... N × 16 to (n + 1) × 16 [msec] are overlapped, and first, CAN frame 1, CAN frame 2, and CAN For each frame 3, a reception timing histogram is created.

CANフレーム1は定期タスク[n×16+1]のタイミングで受信されるため、CANフレーム1の受信タイミングのピークは定期タスク[n×16+1]の箇所に現れる。   Since CAN frame 1 is received at the timing of periodic task [n × 16 + 1], the peak reception timing of CAN frame 1 appears at the location of periodic task [n × 16 + 1].

同様に、CANフレーム2は定期タスク[n×16+3]のタイミングで受信されるため、CANフレーム1の受信タイミングのピークは定期タスク[n×16+3]の箇所に現れる。   Similarly, since CAN frame 2 is received at the timing of regular task [n × 16 + 3], the peak reception timing of CAN frame 1 appears at the location of regular task [n × 16 + 3].

CANフレーム3は定期タスク[n×16+4]、及び定期タスク[n×16+12]のタイミングで受信されることとなり、CANフレーム3の受信タイミングのピークは定期タスク[n×16+4]と定期タスク[n×16+12]とに現れる。   The CAN frame 3 is received at the timing of the periodic task [n × 16 + 4] and the periodic task [n × 16 + 12], and the peak reception timing of the CAN frame 3 is the periodic task [n × 16 + 4] and the periodic task [n. X16 + 12].

つぎに、CANフレーム1、CANフレーム2、及びCANフレーム3それぞれのヒストグラムを全て合成する。そうすると、図18に示すように、ピークがおおよそ定期タスク[n×16+2]或いは定期タスク[n×16+3]のタイミングと、定期タスク[n×16+12]とに現れることが分かり、特に前者のピークが大きい。つまり、定期タスク[n×16+2]或いは定期タスク[n×16+3]のタイミングで、CANにおける受信が最も多く発生していることが分かる。   Next, all the histograms of CAN frame 1, CAN frame 2, and CAN frame 3 are combined. Then, as shown in FIG. 18, it can be seen that peaks appear at the timing of the regular task [n × 16 + 2] or the regular task [n × 16 + 3] and the regular task [n × 16 + 12]. large. That is, it can be seen that the CAN reception is most frequently generated at the timing of the regular task [n × 16 + 2] or the regular task [n × 16 + 3].

そこで、本変形例5では、そのピークの直後の定期タスクにてLINの通信スケジュールが開始されるように、LINの通信スケジュールの開始タイミングを調整する。   Therefore, in the fifth modification, the start timing of the LIN communication schedule is adjusted so that the LIN communication schedule is started in the periodic task immediately after the peak.

このような本変形例5によれば、複数のデータについて平均的に、転送遅れが大きくなってしまうことを防止し得る。   According to the fifth modification, it is possible to prevent the transfer delay from increasing on average for a plurality of data.

尚、ここでは、CANからLINへのデータ転送の場合について説明したが、LINからCANへのデータ転送の場合も同様である。この場合、CANにおける送信タイミングのヒストグラムを作成し、CANにおける送信タイミングのピークとLINにおける受信タイミングとが同期するように、通信スケジュールの開始タイミングを調整すれば良い。
[変形例6]
上記実施形態では、CAN及びLINにて実際に送受信されるデータを対象に、最短で転送したいデータを定め、そのデータの送受信タイミングを検出してCANにおける送受信タイミングとLINにおける送受信タイミング(LINにおける通信スケジュールの開始タイミング)との同期をとるようにしていた。
Although the case of data transfer from CAN to LIN has been described here, the same applies to the case of data transfer from LIN to CAN. In this case, a transmission timing histogram in CAN is created, and the start timing of the communication schedule may be adjusted so that the peak transmission timing in CAN and the reception timing in LIN are synchronized.
[Modification 6]
In the above embodiment, for data that is actually transmitted and received by CAN and LIN, the data to be transferred is determined in the shortest time, the transmission / reception timing of the data is detected, and the transmission / reception timing at CAN and the transmission / reception timing at LIN (Schedule start timing).

一方、CAN及びLINにて実際に送受信されるデータに代えて、ダミーデータを用いてLINの通信スケジュールの開始タイミングを調整するようにしても良い。   On the other hand, instead of data actually transmitted and received by CAN and LIN, the start timing of the LIN communication schedule may be adjusted using dummy data.

具体的に、CAN通信ドライバ203(図2参照)を介してCANにてダミーデータを送受信し、また、LIN通信ドライバ205を介してLINにてダミーデータを送受信するようにすれば良い。ダミーデータの送受信タイミングは、予め設定しておくことができる。例えば、外部コンピュータにおいて車両ネットワーク100を仮想的に構築して動作のシミュレーションを実行することで、所定のデータの送受信タイミングを割り出すことができ、このようにして割り出された送受信タイミングをECU101において予め設定しておけば良い。   Specifically, dummy data may be transmitted / received by CAN via CAN communication driver 203 (see FIG. 2), and dummy data may be transmitted / received by LIN via LIN communication driver 205. The transmission / reception timing of dummy data can be set in advance. For example, by virtually constructing the vehicle network 100 in an external computer and executing an operation simulation, the transmission / reception timing of predetermined data can be determined, and the transmission / reception timing thus determined is preliminarily stored in the ECU 101. Set it up.

ダミーデータを用いてLINにおける通信スケジュールの開始タイミングを調整するような構成によれば、例えば、ECU101がデータ転送を頻繁に行わなくてはならないときや制御装置103の制御中などにLINの通信スケジュールの開始タイミングを調整することを避け、例えば、起動直後の初期化処理中などにLINの通信スケジュールの開始タイミングを調整しておくようにすることができる。これによれば、データ転送の効率化により寄与することができる。   According to the configuration in which the start timing of the communication schedule in the LIN is adjusted using the dummy data, for example, when the ECU 101 has to frequently transfer data or during the control of the control device 103, the LIN communication schedule For example, it is possible to adjust the start timing of the LIN communication schedule during the initialization process immediately after startup. According to this, it can contribute by efficiency improvement of data transfer.

尚、この場合、例えばCAN通信ドライバ203、LIN通信ドライバ205がダミーデータ送受信手段に相当する。
[変形例7]
また、上記実施形態においては、ECU101は、LINにおける通信スケジュールの開始タイミングの変更の伴い、その開始タイミングを変更することを表す情報をLINに送出するようにしても良い。
In this case, for example, the CAN communication driver 203 and the LIN communication driver 205 correspond to dummy data transmission / reception means.
[Modification 7]
In the above embodiment, the ECU 101 may send information indicating that the start timing is changed to the LIN in accordance with the change of the start timing of the communication schedule in the LIN.

これによれば、例えばLIN上の通信装置は通信スケジュールの開始タイミングの変更を認識し得るようになる。このため、LIN上の通信装置において、変更が原因で通信に異常が生じたと誤判断されたり通信途絶と誤判断されたりしてしまうことを防止することができる。   According to this, for example, the communication device on the LIN can recognize the change of the start timing of the communication schedule. For this reason, it is possible to prevent the communication apparatus on the LIN from being erroneously determined to have an abnormality in communication due to the change or erroneously determined to be a communication interruption.

以上、本発明の一実施形態について説明したが、本発明は上記実施形態に限定されるものではなく、本発明の技術範囲内において種々の形態をとることができる。   As mentioned above, although one Embodiment of this invention was described, this invention is not limited to the said embodiment, A various form can be taken within the technical scope of this invention.

例えば、上記実施形態において、車両ネットワーク100の構成は一例であり、例えばECUや制御対象が更に複数接続される構成でも良い。   For example, in the above embodiment, the configuration of the vehicle network 100 is an example, and for example, a configuration in which a plurality of ECUs and control targets are further connected may be used.

また、上記実施形態の転送開始条件の判定において、(イ)車両の図示しないイグニションスイッチがオン状態であること、(ロ)起動後転送対象のデータの初受信が完了したこと、(ハ)LINにて通信スケジュールが開始したこと、の全てが成立した場合に転送開始条件が成立したと判定されるようにしても良い。   In the determination of the transfer start condition of the above embodiment, (b) the ignition switch (not shown) of the vehicle is in the ON state, (b) the initial reception of the data to be transferred after activation is completed, and (c) LIN. It may be determined that the transfer start condition is satisfied when all of the communication schedule has started.

また、上記の変形例5において、所定の区間の長さは16[msec]としているが、どのような長さにしても良い。   Further, in the above-mentioned modification 5, the length of the predetermined section is 16 [msec], but any length may be used.

尚、上記変形例1〜7の構成は組み合わせても良い。   In addition, you may combine the structure of the said modifications 1-7.

100…車両ネットワーク、202…通信同期装置、203…CAN通信ドライバ、204…データベース、205…LIN通信ドライバ、206…LIN通信スケジューラ、207…CAN通信線、208…LIN通信線、300…車両ネットワーク、303…制御装置、304…ワイヤハーネス、306…ワイヤハーネス、307…CAN通信線、400…車両ネットワーク、403…制御装置、404…LIN通信線、405…CAN通信線。 DESCRIPTION OF SYMBOLS 100 ... Vehicle network, 202 ... Communication synchronization apparatus, 203 ... CAN communication driver, 204 ... Database, 205 ... LIN communication driver, 206 ... LIN communication scheduler, 207 ... CAN communication line, 208 ... LIN communication line, 300 ... Vehicle network, DESCRIPTION OF SYMBOLS 303 ... Control apparatus, 304 ... Wire harness, 306 ... Wire harness, 307 ... CAN communication line, 400 ... Vehicle network, 403 ... Control apparatus, 404 ... LIN communication line, 405 ... CAN communication line

Claims (8)

車両内の複数のネットワークに接続されてそのネットワーク間でのデータ転送を行うゲートウェイ装置であって、少なくとも、
マスタ装置によって定期的に起動される通信スケジュールに従って、データの送受信が行われるネットワーク(以下、第1のネットワークと称する)と他のネットワーク(以下、第2のネットワークと称する)との間のデータ転送を行うゲートウェイ装置において、
マスタ装置として動作して通信スケジュールを起動するように構成され、
第1のネットワーク及び第2のネットワークを監視し、転送対象のデータが第1のネットワーク上で送受信される場合の送受信タイミング、及びその転送対象のデータが第2のネットワーク上で送受信される場合の送受信タイミングを検出する検出手段と、
検出手段の検出結果に基づき、第1のネットワーク上での送信タイミングと第2のネットワーク上での受信タイミングとが同期するため、或いは第1のネットワーク上での受信タイミングと第2のネットワーク上での送信タイミングとが同期するための通信スケジュールの起動タイミングを算出する算出手段と、を備え、
算出手段により算出された起動タイミングで通信スケジュールを起動するようになっていることを特徴とするゲートウェイ装置。
A gateway device connected to a plurality of networks in a vehicle and transferring data between the networks, at least,
Data transfer between a network (hereinafter referred to as a first network) in which data is transmitted and received and another network (hereinafter referred to as a second network) in accordance with a communication schedule periodically started by the master device In the gateway device that performs
It is configured to operate as a master device and start a communication schedule,
When the first network and the second network are monitored and transmission target data is transmitted / received on the first network, and the transmission target data is transmitted / received on the second network Detection means for detecting transmission / reception timing;
Based on the detection result of the detection means, the transmission timing on the first network and the reception timing on the second network are synchronized, or the reception timing on the first network and the second network Calculating means for calculating the start timing of the communication schedule for synchronizing with the transmission timing of
A gateway apparatus, wherein a communication schedule is activated at an activation timing calculated by a calculation means.
請求項1に記載のゲートウェイ装置において、
転送対象のデータは複数種類あり、
その複数種類のデータには重要度を表す情報が含まれ、
検出手段は、複数種類のデータのうち重要度が最も高いデータについて、第1のネットワーク上での送受信タイミング、及び第2のネットワーク上での送受信タイミングを検出するようになっていることを特徴とするゲートウェイ装置。
The gateway device according to claim 1,
There are multiple types of data to be transferred.
The multiple types of data contain information representing importance,
The detecting means is configured to detect transmission / reception timing on the first network and transmission / reception timing on the second network for data having the highest importance among a plurality of types of data. Gateway device.
請求項1に記載のゲートウェイ装置において、
転送対象のデータは複数種類あり、
算出手段は、転送対象のデータの第2のネットワーク上における送受信タイミングの度数分布を算出し、その度数分布に基づき、第1のネットワーク上での送信のタイミングと第2のネットワーク上での受信のピークとが同期するため、或いは第1のネットワーク上での受信のタイミングと第2のネットワーク上での送信のピークとが同期するための通信スケジュールの起動タイミングを算出するようになっていることを特徴とするゲートウェイ装置。
The gateway device according to claim 1,
There are multiple types of data to be transferred.
The calculating means calculates a frequency distribution of transmission / reception timing of the data to be transferred on the second network, and based on the frequency distribution, the transmission timing on the first network and the reception timing on the second network. In order to synchronize with the peak, or to calculate the start timing of the communication schedule to synchronize the reception timing on the first network and the transmission peak on the second network. A gateway device characterized.
請求項1ないし請求項3の何れか1項に記載のゲートウェイ装置において、
通信スケジュールの起動タイミングを所定量づつ徐々に変更して算出手段により算出された起動タイミングに一致させることを特徴とするゲートウェイ装置。
The gateway device according to any one of claims 1 to 3,
A gateway apparatus characterized by gradually changing the activation timing of the communication schedule by a predetermined amount to match the activation timing calculated by the calculation means.
請求項1ないし請求項3の何れか1項に記載のゲートウェイ装置において、
転送対象のデータには緊急度を表す情報が含まれ、
緊急度を表す情報に基づき緊急を要するか否かを判断し、緊急を要すると判断すると、現在動作中の通信スケジュールを中止し、新たな通信スケジュールを起動するようになっていることを特徴とするゲートウェイ装置。
The gateway device according to any one of claims 1 to 3,
The data to be transferred contains information indicating the urgency,
Based on the information indicating the degree of urgency, it is determined whether or not an emergency is required, and if it is determined that an emergency is required, the communication schedule that is currently operating is canceled and a new communication schedule is started. Gateway device.
請求項1ないし請求項5の何れか1項に記載のゲートウェイ装置において、
通信スケジュールの起動タイミングを変更した後、予め定められた時間が経過するまでは再度の変更を行わないようになっていることを特徴とするゲートウェイ装置。
The gateway device according to any one of claims 1 to 5,
A gateway apparatus characterized in that, after changing the activation timing of the communication schedule, the change is not made again until a predetermined time elapses.
請求項1に記載のゲートウェイ装置において、
所定の転送対象のデータに代え、その転送対象のデータと同じタイミングでダミーデータの送受信を行うダミーデータ送受信手段を備え、
検出手段は、ダミーデータが第1のネットワーク上で送受信される場合の送受信タイミング、及びそのダミーデータが第2のネットワーク上で送受信される場合の送受信タイミングを検出し、
算出手段は、ダミーデータについて、第1のネットワーク上での送信タイミングと第2のネットワーク上での受信タイミングとが同期するため、或いは第1のネットワーク上での受信タイミングと第2のネットワーク上での送信タイミングとが同期するための通信スケジュールの起動タイミングを算出することを特徴とするゲートウェイ装置。
The gateway device according to claim 1,
In place of predetermined transfer target data, dummy data transmission / reception means for transmitting / receiving dummy data at the same timing as the transfer target data is provided,
The detection means detects transmission / reception timing when dummy data is transmitted / received on the first network, and transmission / reception timing when dummy data is transmitted / received on the second network,
For the dummy data, the calculation means synchronizes the transmission timing on the first network and the reception timing on the second network, or the reception timing on the first network and the second network. The gateway apparatus characterized by calculating the starting timing of the communication schedule for synchronizing with the transmission timing of.
請求項1ないし請求項7の何れか1項に記載のゲートウェイ装置において、
通信スケジュールの起動タイミングを変更することを表す情報を第1のネットワーク及び第2のネットワークの両方又は一方に送出するようになっていることを特徴とするゲートウェイ装置。
The gateway device according to any one of claims 1 to 7,
A gateway apparatus characterized in that information representing changing the activation timing of a communication schedule is sent to both or one of the first network and the second network.
JP2009031603A 2009-02-13 2009-02-13 Gateway device Active JP5218128B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009031603A JP5218128B2 (en) 2009-02-13 2009-02-13 Gateway device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009031603A JP5218128B2 (en) 2009-02-13 2009-02-13 Gateway device

Publications (2)

Publication Number Publication Date
JP2010187323A true JP2010187323A (en) 2010-08-26
JP5218128B2 JP5218128B2 (en) 2013-06-26

Family

ID=42767681

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009031603A Active JP5218128B2 (en) 2009-02-13 2009-02-13 Gateway device

Country Status (1)

Country Link
JP (1) JP5218128B2 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101165046B1 (en) 2010-09-13 2012-07-13 주식회사 만도 Controller area network-bus controlling module and the controlling mehod therof
JP2014146243A (en) * 2013-01-30 2014-08-14 Fujitsu Semiconductor Ltd Timing adjustment device, processing device, and timing adjustment method
JP2015041946A (en) * 2013-08-23 2015-03-02 日本電信電話株式会社 Node
JP2015133646A (en) * 2014-01-15 2015-07-23 日本電信電話株式会社 node and scheduler
JP6410914B1 (en) * 2017-11-27 2018-10-24 三菱電機株式会社 Serial communication system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007240436A (en) * 2006-03-10 2007-09-20 Denso Corp Vehicle diagnosis system
JP2008306648A (en) * 2007-06-11 2008-12-18 Nissan Motor Co Ltd Data relaying apparatus, data relaying method and communication network system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007240436A (en) * 2006-03-10 2007-09-20 Denso Corp Vehicle diagnosis system
JP2008306648A (en) * 2007-06-11 2008-12-18 Nissan Motor Co Ltd Data relaying apparatus, data relaying method and communication network system

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101165046B1 (en) 2010-09-13 2012-07-13 주식회사 만도 Controller area network-bus controlling module and the controlling mehod therof
JP2014146243A (en) * 2013-01-30 2014-08-14 Fujitsu Semiconductor Ltd Timing adjustment device, processing device, and timing adjustment method
JP2015041946A (en) * 2013-08-23 2015-03-02 日本電信電話株式会社 Node
JP2015133646A (en) * 2014-01-15 2015-07-23 日本電信電話株式会社 node and scheduler
JP6410914B1 (en) * 2017-11-27 2018-10-24 三菱電機株式会社 Serial communication system

Also Published As

Publication number Publication date
JP5218128B2 (en) 2013-06-26

Similar Documents

Publication Publication Date Title
JP4917649B2 (en) Network and method for setting a time reference for nodes in the network
JP5717240B2 (en) Communication system and communication apparatus
JP5843020B2 (en) Communication apparatus and communication method
JP5218128B2 (en) Gateway device
JP5664799B2 (en) Communication system and communication method
US20160127118A1 (en) Method and apparatus for providing in-vehicle network time synchronization using redundant grandmaster
US20110128855A1 (en) Data communication network system
JP2006287738A (en) Network system
JP6838848B2 (en) Systems and methods for synchronizing processor operations over communication networks
JP2011109452A (en) In-vehicle communication system
JP2007060400A (en) Method and system for controlling communication timing
JP4241343B2 (en) Transmission timing determination method, bus usage right arbitration method, network system, program
JP2008306648A (en) Data relaying apparatus, data relaying method and communication network system
JP2008022072A (en) Communication network system and error verification method
JP2016009365A (en) Information service display system and time synchronization method
JP2016119616A (en) Ring type network system, and master node thereof
JP6455220B2 (en) Communications system
JP2010141819A (en) Communication device, communication method, and communication program
KR101498561B1 (en) System and method for can communication based tdma digital technology for global synchronization
CN107769879B (en) System and method for clock synchronization in computer networks
KR101165046B1 (en) Controller area network-bus controlling module and the controlling mehod therof
JP2008022071A (en) Communication network system and method for informing reception error
JP2007243747A (en) Transmission timing setting method of on-vehicle lan and electronic control unit
JP2004064123A (en) Network communication system and control processing system using this network communication system
JP2008103922A (en) Communication system and communication equipment

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20110829

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20121105

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20121113

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20121226

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20130218

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20160315

Year of fee payment: 3

R151 Written notification of patent or utility model registration

Ref document number: 5218128

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20160315

Year of fee payment: 3

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250