JP2013126119A - Gateway unit and network system - Google Patents

Gateway unit and network system Download PDF

Info

Publication number
JP2013126119A
JP2013126119A JP2011274022A JP2011274022A JP2013126119A JP 2013126119 A JP2013126119 A JP 2013126119A JP 2011274022 A JP2011274022 A JP 2011274022A JP 2011274022 A JP2011274022 A JP 2011274022A JP 2013126119 A JP2013126119 A JP 2013126119A
Authority
JP
Japan
Prior art keywords
message
bus
transfer
gateway device
buses
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.)
Pending
Application number
JP2011274022A
Other languages
Japanese (ja)
Inventor
Tatsuhiko Masuda
達彦 増田
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.)
Suzuki Motor Corp
Original Assignee
Suzuki Motor 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 Suzuki Motor Corp filed Critical Suzuki Motor Corp
Priority to JP2011274022A priority Critical patent/JP2013126119A/en
Publication of JP2013126119A publication Critical patent/JP2013126119A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Small-Scale Networks (AREA)

Abstract

PROBLEM TO BE SOLVED: To reduce delay in data transfer of a network as a whole.SOLUTION: A plurality of CAN buses 1, 2, 3 are connected with a gateway unit 5. The gateway unit 5 has a function for transferring a message from some CAN bus to other CAN bus. When transferring a message to the plurality of CAN buses, the gateway unit 5 performs transfer processing for each bus by software processing. According to a routing table 14, the order of transferring the message is determined by the time occupied by a CAN bus that is the transfer destination of a message having a transmission priority higher than that of a message to be transferred.

Description

この発明は、ネットワーク上で同一メッセージを複数のバスに転送する場合には一バスごとに転送処理を行うゲートウェイ装置及び当該ゲートウェイ装置を含むネットワークシステムに関する。   The present invention relates to a gateway apparatus that performs transfer processing for each bus when the same message is transferred to a plurality of buses on a network, and a network system including the gateway apparatus.

車両内のネットワークにCAN(Controller Area Network)通信が広く利用されている。CAN通信では、送信するメッセージごとに当該メッセージのID番号により送信の優先度が設定されており、バス送信時に送信要求が同時に発生した場合は当該優先度に基づき調停がなされ、ID番号の小さいメッセージから送信される。
また、バスが複数存在する場合は、バス間のデータを中継するゲートウェイ装置を設けることが一般的である。ゲートウェイ装置はメッセージを受信すると、受信・送信バスの情報を記録したルーティングテーブル(ゲートウェイ装置が備えている)に従って送信先のバスへの転送処理(ルーティング処理)を行う。
CAN (Controller Area Network) communication is widely used for in-vehicle networks. In CAN communication, the priority of transmission is set for each message to be transmitted by the ID number of the message, and when a transmission request is generated at the same time during bus transmission, arbitration is performed based on the priority and a message with a small ID number Sent from
When there are a plurality of buses, a gateway device that relays data between the buses is generally provided. When the gateway device receives the message, the gateway device performs transfer processing (routing processing) to the destination bus according to a routing table (provided by the gateway device) in which information of the reception / transmission bus is recorded.

特開2008‐306648号公報JP 2008-306648 A

ところで、CAN通信のバス(CANバス)を複数備えたネットワークでは、ゲートウェイ装置が1つのバス(CANバス以外のバスも含む)から受信したメッセージを2つ以上のCANバスに転送する場合がある。
この場合に、ルーティング処理をソフトウェア処理により実施すると、複数のバスへのメッセージの転送を同時に処理することはできず、一バスごとに処理を行うことになるため、ソフトウェア遅延が発生し、処理の順番が遅いバスほどゲートウェイ装置における遅延時間が長くなってしまう。
By the way, in a network provided with a plurality of CAN communication buses (CAN buses), the gateway device may transfer a message received from one bus (including buses other than the CAN bus) to two or more CAN buses.
In this case, if routing processing is performed by software processing, message transfer to a plurality of buses cannot be processed at the same time, and processing is performed for each bus. The slower the order, the longer the delay time in the gateway device.

この場合の処理の順番はバス負荷率(ある期間内でバスを使用している時間の割合)が高いCANバスの順とするのが一般的である。
しかしながら、CANバスごとに送信対象となるメッセージのID番号の分布は異なっているために、あるCANバスにゲートウェイ装置で転送するメッセージよりも優先されるメッセージの数と当該CANバスでのバス負荷率との間に相関関係はなく、ルーティング処理における処理の順番はバス負荷率の高い順とすることは、システム全体のデータ転送の早期完了の観点からは必ずしも全てのメッセージについて最適であるとはいえないという不具合がある。
本発明の目的は、データ転送の遅延をネットワーク全体として低減させることができるようにすることである。
In this case, the processing order is generally the order of CAN buses having the highest bus load factor (ratio of time during which the bus is used within a certain period).
However, since the distribution of ID numbers of messages to be transmitted is different for each CAN bus, the number of messages prior to the message transferred to a certain CAN bus by the gateway device and the bus load factor on the CAN bus. The order of processing in routing processing is the order in which the bus load factor is high, but it is not necessarily optimal for all messages from the viewpoint of early completion of data transfer of the entire system. There is a bug that there is no.
An object of the present invention is to make it possible to reduce data transfer delay as a whole network.

(1)本発明の一態様は、ネットワーク上で同一メッセージを複数のバスに転送する場合には一バスごとに転送処理を行うゲートウェイ装置において、前記バスに接続されているいずれかのノードから送信されたメッセージを受信する受信手段と、前記メッセージの識別表示ごとに当該メッセージの転送先となる前記バス及び複数の前記バスに同一のメッセージを転送する場合の転送の順序を記録している記録手段と、前記受信手段で受信した前記メッセージの前記識別表示について前記記録手段を参照して当該識別表示に対応する前記転送先のバスを決定する決定手段と、前記決定手段で決定された前記転送先のバスに転送メッセージを送信する送信手段と、を備え、前記記録手段は、前記転送の順序として、当該転送の対象となるメッセージより送信の優先度の高いメッセージが前記転送先となるバスを占有する時間が長いバス順となるように記録している、ことを特徴とするゲートウェイ装置である。   (1) According to one aspect of the present invention, when the same message is transferred to a plurality of buses on a network, the gateway device performs transfer processing for each bus and transmits from any of the nodes connected to the bus. Receiving means for receiving the received message, and recording means for recording the order of transfer when the same message is transferred to the bus and a plurality of the buses to which the message is transferred for each identification display of the message Determining means for determining the transfer destination bus corresponding to the identification display with reference to the recording means for the identification display of the message received by the reception means, and the transfer destination determined by the determination means Transmitting means for transmitting a transfer message to the bus, wherein the recording means is a message to be transferred as the transfer order. Time higher priority transmission from di message occupies the bus serving as the transfer destination is recorded as a long bus order, it is a gateway apparatus according to claim.

(2)この場合に、前記記録手段は、前記転送の対象となるメッセージより送信の優先度の高いメッセージが前記転送先となるバスを占有する時間が複数のバスで等しい場合は、バス負荷率が高いバスの順に転送するように記録している、ことを特徴とする、ようにしてもよい。
(3)本発明の別の態様は、ゲートウェイ装置と複数のバスとがネットワーク上で接続されているネットワークシステムにおいて、前記ゲートウェイ装置は、(1)又は(2)のゲートウェイ装置である、ことを特徴とするネットワークシステムである。
(2) In this case, if the time for which a message having a higher priority of transmission than the message to be transferred occupies the transfer destination bus is the same for a plurality of buses, the recording means May be recorded so that data is transferred in the order of higher buses.
(3) According to another aspect of the present invention, in the network system in which a gateway device and a plurality of buses are connected on a network, the gateway device is the gateway device according to (1) or (2). This is a featured network system.

本発明の態様によれば、データ転送の遅延をネットワーク全体として低減させることができる。   According to the aspect of the present invention, the delay of data transfer can be reduced as a whole network.

本発明の一実施の形態であるネットワークシステムの全体構成を示すブロック図である。1 is a block diagram showing an overall configuration of a network system according to an embodiment of the present invention. 本発明の一実施の形態であるネットワークシステムのルーティングテーブルの説明図である。It is explanatory drawing of the routing table of the network system which is one embodiment of this invention. 本発明の一実施の形態であるネットワークシステムのゲートウェイ装置が実行するメッセージの転送処理のフローチャートである。It is a flowchart of the transfer process of the message which the gateway apparatus of the network system which is one embodiment of this invention performs. 本発明の一実施の形態であるネットワークシステムで送受信されるメッセージの一例を説明する説明図である。It is explanatory drawing explaining an example of the message transmitted / received by the network system which is one embodiment of this invention. 本発明の一実施の形態であるネットワークシステムのゲートウェイ装置の動作を説明するタイミングチャートである。It is a timing chart explaining operation | movement of the gateway apparatus of the network system which is one embodiment of this invention. 比較例であるゲートウェイ装置の動作を説明する説明図である。It is explanatory drawing explaining operation | movement of the gateway apparatus which is a comparative example. 本発明の一実施の形態であるネットワークシステムのゲートウェイ装置の動作を説明する説明図である。It is explanatory drawing explaining operation | movement of the gateway apparatus of the network system which is one embodiment of this invention.

以下、本発明の一実施の形態について説明する。
図1は、本発明の一実施の形態であるネットワークシステムの全体構成を示すブロック図である。このネットワークシステムは、例えば車両に搭載されるシステムであり、複数のバス1,2,3を備えている。各バス1,2,3は、この例では、CAN(Controller Area Network)通信でデータの送受信を行うCANバスである。各CANバス1,2,3は、ゲートウェイ装置5にそれぞれ接続されている。もちろん、ゲートウェイ装置5には、CAN通信以外の通信プロトコルで通信を行うバスが接続されていてもよい。各CANバス1,2,3にはそれぞれ1つ以上のノード6が接続されている。各ノード6は、エンジン・コントロール・ユニット(ECU)などの制御装置やセンサ等である。なお、図1においては各ノード6に当該ノード6の識別番号を付している
ゲートウェイ装置5は、マイクロコンピュータにより動作して、メッセージ受信手段11、メッセージ転送先設定手段12、メッセージ送信手段13の各機能を実現し、また、ルーティングテーブル14を備えている。
Hereinafter, an embodiment of the present invention will be described.
FIG. 1 is a block diagram showing the overall configuration of a network system according to an embodiment of the present invention. This network system is a system mounted on a vehicle, for example, and includes a plurality of buses 1, 2, and 3. In this example, each of the buses 1, 2, and 3 is a CAN bus that transmits and receives data by CAN (Controller Area Network) communication. Each CAN bus 1, 2, 3 is connected to the gateway device 5. Of course, the gateway device 5 may be connected to a bus that performs communication using a communication protocol other than CAN communication. One or more nodes 6 are connected to each CAN bus 1, 2, 3 respectively. Each node 6 is a control device such as an engine control unit (ECU), a sensor, or the like. In FIG. 1, the gateway device 5 in which the identification number of the node 6 is assigned to each node 6 is operated by the microcomputer, and the message receiving unit 11, the message transfer destination setting unit 12, and the message transmitting unit 13 are operated. Each function is realized and a routing table 14 is provided.

メッセージ受信手段11は、CANバス1,2,3のいずれかのノード6から送信されたメッセージを受信する受信手段となる。
ルーティングテーブル14は、図2に示すように、ネットワークシステム1でやりとりするメッセージの識別表示となるID番号ごとに当該メッセージの転送先となるCANバスの特定及び複数のCANバスに同一のメッセージを転送する場合のCANバス間の転送の順序を記録している記録手段となる。
The message receiving unit 11 is a receiving unit that receives a message transmitted from any one of the nodes 6 of the CAN buses 1, 2, and 3.
As shown in FIG. 2, the routing table 14 specifies the CAN bus that is the transfer destination of the message and transfers the same message to a plurality of CAN buses for each ID number that is an identification display of the message exchanged in the network system 1. In this case, the recording means records the order of transfer between the CAN buses.

メッセージ転送先設定手段12は、メッセージ受信手段11で受信したメッセージのID番号についてルーティングテーブル14を参照して当該ID番号に対応するメッセージの転送先となるCANバスを決定する決定手段となる。
メッセージ送信手段13は、メッセージ転送先設定手段12で決定された転送先のCANバスに転送するメッセージを送信する送信手段となる。
The message transfer destination setting unit 12 is a determining unit that determines a CAN bus that is a transfer destination of a message corresponding to the ID number by referring to the routing table 14 for the ID number of the message received by the message receiving unit 11.
The message transmission unit 13 is a transmission unit that transmits a message to be transferred to the transfer destination CAN bus determined by the message transfer destination setting unit 12.

図2は、ルーティングテーブル14の説明図である。図2に示すルーティングテーブル14の例では、“100”、“150”、“300”のID番号のメッセージについて、ゲートウェイ装置5がメッセージを受信すべきCANバスである“受信バス”、最初にメッセージを転送すべきCANバスである“転送先バス1”、次にメッセージを転送すべきCANバスである“転送先バス2”が互いに関連付けられて記録されている(CANバスは符号のみ表示)。例えば、ID番号“100”のメッセージについては、“受信バス”がCANバス1、最初にメッセージを転送すべき“転送先バス1”がCANバス3、次にメッセージを転送すべき“転送先バス2”がCANバス2である。   FIG. 2 is an explanatory diagram of the routing table 14. In the example of the routing table 14 shown in FIG. 2, for messages having ID numbers “100”, “150”, and “300”, the gateway device 5 is the CAN bus that should receive the message. “Transfer destination bus 1”, which is a CAN bus to which the message is to be transferred, and “transfer destination bus 2”, which is the CAN bus to which the message is to be transferred next, are recorded in association with each other (only the code is displayed on the CAN bus). For example, for the message with ID number “100”, the “reception bus” is the CAN bus 1, the “transfer destination bus 1” to which the message is to be transferred first is the CAN bus 3, and the “transfer destination bus” to which the message is to be transferred next. 2 ″ is the CAN bus 2.

図3は、ゲートウェイ装置5が実行するメッセージの転送処理のフローチャートである。ゲートウェイ装置5はメッセージの転送処理(ルーティング処理)をソフトウェア処理により実行する。図3の処理は、周期的な繰り返し処理で行われる場合と、ノード6にそれぞれ内蔵されているCANコントローラ(図示せず)がメッセージを受信した際に起動する割り込み処理によって実施される場合が考えられる。まず、メッセージ受信手段11によりメッセージを受信すると(ステップS1)、当該メッセージのID番号を取得し、当該ID番号によりルーティングテーブル14からルーティング情報を検索する(ステップS2)。次に、ルーティングテーブル14の情報により当該メッセージの受信したCANバス以外のCANバスへの転送の有無を判断する(ステップS3)。メッセージの受信したCANバス以外のCANバスへの転送が必要なルーティング対象のメッセージであったときは(ステップS3のY)、メッセージを転送すべき各CANバスへの転送処理順序をルーティングテーブル14の情報により決定する(ステップS4)。もちろん、メッセージを転送すべきCANバスが一つであれば、当該CANバスにのみメッセージが転送される。そして、転送対象のCANバスの送信メッセージボックス(図示せず)に保存し、送信設定する(ステップS5)。この状態ではメッセージは送信待ちの状態となり、CANバスにおける調停に従い優先権を取得した時点でメッセージが目的のCANバスに転送される。   FIG. 3 is a flowchart of message transfer processing executed by the gateway device 5. The gateway device 5 executes message transfer processing (routing processing) by software processing. The processing of FIG. 3 is considered to be performed by periodic repetitive processing or by interrupt processing that is activated when a CAN controller (not shown) built in each node 6 receives a message. It is done. First, when a message is received by the message receiving means 11 (step S1), the ID number of the message is acquired, and routing information is searched from the routing table 14 by the ID number (step S2). Next, based on the information in the routing table 14, it is determined whether or not the message is transferred to a CAN bus other than the CAN bus that has received the message (step S3). If the message is a routing target message that needs to be transferred to a CAN bus other than the received CAN bus (Y in step S3), the transfer processing order to each CAN bus to which the message is to be transferred is set in the routing table 14. It is determined by the information (step S4). Of course, if there is one CAN bus to which a message is to be transferred, the message is transferred only to that CAN bus. Then, the data is stored in a transmission message box (not shown) of the CAN bus to be transferred and set for transmission (step S5). In this state, the message is waiting to be transmitted, and when the priority is acquired according to the arbitration in the CAN bus, the message is transferred to the target CAN bus.

次に、かかるメッセージの転送処理について具体例により詳細に説明する。CAN通信では、送信するメッセージごとに当該メッセージのID番号により送信の優先度が設定されており、バス送信時に送信要求が同時に発生した場合は当該優先度に基づき調停がなされ、ID番号の数値の小さいメッセージから送信される。
ここで使用されているCAN通信の通信プロトコルには、次のような特徴がある。
Next, the message transfer process will be described in detail with a specific example. In CAN communication, the priority of transmission is set for each message to be transmitted by the ID number of the message. When transmission requests are generated simultaneously during bus transmission, arbitration is performed based on the priority, and the numerical value of the ID number is set. Sent from a small message.
The CAN communication protocol used here has the following characteristics.

(1)マルチマスタ:CANバスが空いていれば全てのノード6がメッセージを送信することができる。
(2)マルチキャスト:全てのノード6はメッセージを同時に受信する。
(3)システム柔軟性:メッセージの内容はメッセージに対応付けられたCANバス内で固有の識別表示であるID番号により定義され、このID番号により送信元と受信元のデバイスが特定される。
(1) Multi-master: All nodes 6 can transmit messages if the CAN bus is free.
(2) Multicast: All nodes 6 receive messages simultaneously.
(3) System flexibility: The content of the message is defined by an ID number that is a unique identification display in the CAN bus associated with the message, and the sender and receiver devices are specified by this ID number.

(4)衝突検出方法:メッセージに付加されるID番号がネットワークシステム上の優先順位も定義し、複数のノード6が同時にメッセージを送信しようとすると、バス調停により優先順位の高いID番号(番号が小さいほど優先度が高い)のメッセージが送信権を取得し、優先順位の低いID番号のメッセージは送信を中止する。 (4) Collision detection method: The ID number added to the message also defines the priority on the network system, and when a plurality of nodes 6 try to send a message at the same time, the ID number (number is higher) due to bus arbitration. A message having a higher priority (the smaller the priority is) obtains the transmission right, and a message having an ID number with a lower priority is stopped.

前述のとおり、図3の処理は、周期的な繰り返し処理で行われる場合と、ノード6にそれぞれ内蔵されているCANコントローラ(図示せず)がメッセージを受信した際に起動する割り込み処理によって実施される場合が考えられるが、周期的な繰り返し処理で行われる場合には、周期の短いものに高い優先度を割り付けている。   As described above, the process in FIG. 3 is performed by a cyclic process that is repeated and an interrupt process that is activated when a CAN controller (not shown) built in each node 6 receives a message. However, when it is carried out by periodic repetitive processing, a high priority is assigned to one having a short cycle.

図4は、本ネットワークシステムで送受信されるメッセージの一例を説明する説明図である。図4においては、複数のメッセージについて、その「ID番号」、「周期(msec)」(メッセージを周期的な繰り返し処理で送信する場合の周期)、「データフィールド」(何バイトのデータが送信されるかを示す)を示している。また、CANバス1,2,3それぞれについて各メッセージにつき、送信メッセージ、ゲートウェイ転送メッセージ、これらのメッセージの送信なし、の別を、二重丸、一重丸、“−”により示している。送信メッセージは、CANバス1,2又は3により送信されるメッセージである。ゲートウェイ転送メッセージは、ゲートウェイ装置5によりCANバス1,2,3のうちの1又は複数に転送されるメッセージである。送信メッセージの二重丸にカッコ書きで付記されている数字はどのノード6から送信されるか、そのノード6の番号である(図1参照)。CANバス1、CANバス2、CANバス3の文字の下にカッコ書きで付記されている5%、12.5%、15.5%の各値は、バス負荷率(ある期間内でバスを使用している時間の割合)であり、この例では、メッセージ長を250μsecとして算出した値である。また、前述のとおり、ID番号の数値の小さいメッセージほど送信の優先度が高い。さらに、周期の短いメッセージほど高い優先度を割り付けている。よって、図4は、上に表示されるメッセージほど送信の優先度が高い。   FIG. 4 is an explanatory diagram for explaining an example of a message transmitted and received in the network system. In FIG. 4, with respect to a plurality of messages, the “ID number”, “cycle (msec)” (cycle when the message is transmitted in a cyclic repetition process), and “data field” (how many bytes of data are transmitted) Indicates). Further, for each message on each of the CAN buses 1, 2, and 3, a transmission message, a gateway transfer message, and no transmission of these messages are indicated by a double circle, a single circle, and “−”. The transmission message is a message transmitted through the CAN bus 1, 2 or 3. The gateway transfer message is a message transferred to one or a plurality of CAN buses 1, 2, 3 by the gateway device 5. The number added in parentheses to the double circle of the transmission message is the node 6 from which the node 6 is transmitted (see FIG. 1). The values of 5%, 12.5%, and 15.5% in parentheses below the CAN bus 1, CAN bus 2, and CAN bus 3 characters indicate the bus load factor (the bus is In this example, the message length is 250 μsec. As described above, a message having a smaller ID number has a higher transmission priority. Furthermore, a message with a shorter period is assigned a higher priority. Therefore, in FIG. 4, the message displayed above has a higher transmission priority.

まず、図4の各ID番号のメッセージは、二重丸の付されたCANバスに送信される。この例では、二重丸にカッコ書きで付記されている数字はどのノード6から送信されるか、そのノード6の番号であるから、ID番号が“100”、“150”、“300”のメッセージにおいては、それぞれノード番号が“11”、“12”、“13”のノード6からCANバス1に送信され、いずれもゲートウェイ装置5により転送されてCANバス2、CANバス3に転送されることになる。   First, the message of each ID number in FIG. 4 is transmitted to the CAN bus with a double circle. In this example, the number in parentheses in the double circle is the node 6 from which the node 6 is transmitted, so the ID number is “100”, “150”, “300”. In the message, the node numbers “11”, “12”, and “13” are transmitted from the node 6 to the CAN bus 1, and all are transferred by the gateway device 5 and transferred to the CAN bus 2 and the CAN bus 3. It will be.

ID番号が“100”のメッセージは本例で最も優先度が高いため、各CANバスにおける調停では常に優先され、転送先のCANバスにおいて送信待ちとなれば、他のメッセージが送信中に別のノード6のメッセージが送信開始待ちになった場合でもバス調停に勝つ。よって、送信中の他のメッセージの送信完了と同時にID番号が“100”のメッセージの送信が開始される。   Since the message with the ID number “100” has the highest priority in this example, arbitration in each CAN bus always takes priority, and if the transfer destination CAN bus waits for transmission, another message is sent during transmission. The bus arbitration is won even when the message of the node 6 is waiting to be transmitted. Therefore, the transmission of the message whose ID number is “100” is started simultaneously with the completion of the transmission of the other message being transmitted.

ID番号が“150”のメッセージは、CANバス3においてはゲートウェイ装置5が転送する他のメッセージを除いて最も優先度が高い。そのため、ID番号が“100”のメッセージと同様に、転送先のCANバス3において送信待ちになったとき、別のメッセージが送信中の場合は送信中の別のメッセージの送信完了と同時にID番号が“150”のメッセージの送信が開始される。一方、CANバス2においては、ゲートウェイ装置5が転送する他のメッセージを除いて最も優先度が低いため、別のノード6のメッセージが送信開始待ちになった場合にはバス調停に負け、送信開始待ちになった全てのメッセージが送信完了しなければ送信が開始されず、ゲートウェイ装置5における転送遅延時間が長くなってしまう。   The message with the ID number “150” has the highest priority on the CAN bus 3 except for other messages transferred by the gateway device 5. Therefore, like the message with the ID number “100”, when waiting for transmission on the transfer destination CAN bus 3, if another message is being transmitted, the ID number is simultaneously with the completion of transmission of the other message being transmitted. The transmission of the message “150” is started. On the other hand, the CAN bus 2 has the lowest priority except for other messages transferred by the gateway device 5, so when a message from another node 6 waits for transmission start, it loses bus arbitration and starts transmission. If transmission of all the waiting messages is not completed, transmission is not started, and the transfer delay time in the gateway device 5 becomes long.

このような状況は、バス負荷率に応じた確率で発生するため、CANバス内の優先度が低いメッセージの転送においては調停負けが発生する確率の高いCANバスほどゲートウェイ装置5の遅延を小さくすることが必要となる。   Since such a situation occurs with a probability corresponding to the bus load factor, the delay of the gateway device 5 is reduced as the CAN bus has a higher probability of arbitration loss in the transfer of a message with a low priority in the CAN bus. It will be necessary.

前述のとおり、ルーティング処理をソフトウェア処理により実施する場合は、図5のタイミングチャートに示すように、1つのCANバスごとに順次処理を行うためソフトウェア遅延が発生し、処理の順番が遅いCANバスほどゲートウェイ装置5における遅延時間が長くなってしまう。すなわち、図5の例では、ゲートウェイ装置5は、(1)のタイミングで、メッセージを送信するCANバス(この例でCANバス1)からメッセージを受信し、(2)のタイミングでメッセージの転送先、転送順を決定し、この決定により、(3)のタイミングで1つ目のCANバス(この例でCANバス3)に送信し、さらに、(4)のタイミングで2つ目のCANバス(この例でCANバス2)に送信している。   As described above, when the routing processing is performed by software processing, as shown in the timing chart of FIG. 5, since processing is sequentially performed for each CAN bus, a software delay occurs, and a CAN bus with a slower processing order. The delay time in the gateway device 5 becomes long. That is, in the example of FIG. 5, the gateway device 5 receives a message from the CAN bus (CAN bus 1 in this example) that transmits a message at the timing (1), and forwards the message at the timing (2). The transfer order is determined, and by this determination, the data is transmitted to the first CAN bus (CAN bus 3 in this example) at the timing (3), and then the second CAN bus ( In this example, it is transmitted to the CAN bus 2).

したがって、転送するメッセージより優先度の高いメッセージが転送するメッセージの例えば送信周期内に転送先のCANバスを占有する時間が長いCANバスの順にルーティング処理を行う必要がある。図2に示すルーティングテーブル14の例では、このようなルーティング処理を行えるような設定としている(ID番号が“150”、“300”のメッセージの場合)。   Therefore, it is necessary to perform routing processing in the order of CAN buses that occupy the CAN bus of the transfer destination within a transmission cycle of a message transferred by a message having a higher priority than the message to be transferred. In the example of the routing table 14 shown in FIG. 2, settings are made so that such routing processing can be performed (in the case of messages with ID numbers “150” and “300”).

より詳細な具体例について説明する。図4のID番号“150”のメッセージにおいては、CANバス1でメッセージの送信が行われ、CANバス2,3にメッセージを転送することになる。そして、ID番号“150”のメッセージより高い優先度のメッセージが、転送するメッセージの送信周期である10msec内に転送先のCANバスを占有する時間は次のようになる。メッセージ長を250μsecとすると、CANバス2では、10msec周期の高い優先度のメッセージが4つあるため(ID番号が“100”〜“130”の4つ)、“250×4=1000μsec”となる。CANバス3では、10msec周期の高い優先度のメッセージが1つだけなので(ID番号が“100”の1つ)、“250×1=250μsec”となる。よって、バス負荷率が低くてもCANバス2の方をCANバス3に優先させてメッセージの転送処理をする方が有利となる。   A more specific example will be described. In the message with the ID number “150” in FIG. 4, the message is transmitted through the CAN bus 1, and the message is transferred to the CAN buses 2 and 3. The time during which a message having a higher priority than the message having the ID number “150” occupies the transfer destination CAN bus within 10 msec, which is the transmission cycle of the message to be transferred, is as follows. If the message length is 250 μsec, the CAN bus 2 has four high priority messages with a 10 msec cycle (four ID numbers “100” to “130”), so “250 × 4 = 1000 μsec”. . In the CAN bus 3, since there is only one high-priority message with a 10 msec period (one ID number is “100”), “250 × 1 = 250 μsec”. Therefore, even if the bus load factor is low, it is advantageous to perform message transfer processing by giving priority to the CAN bus 2 over the CAN bus 3.

このようなファイル転送の順番とすることで、ゲートウェイ装置5でのファイルの転送処理中に転送先のCANバスにおいて他のノード6がメッセージの送信を開始しようとした場合のメッセージの転送遅延時間を少なくすることができる。   By adopting such a file transfer order, the message transfer delay time when another node 6 tries to start transmitting a message on the transfer destination CAN bus during the file transfer process in the gateway device 5 is set. Can be reduced.

例えば、2つのCANバスにメッセージを転送する場合に、2つ目のCANバスへのメッセージの転送処理中に転送先のCANバスで高い優先度のメッセージの送信要求が発生した場合に、バス負荷率の高いCANバスの順番にメッセージを転送する場合は、図6の比較例に示すようにネットワークシステム全体として転送に要する時間が大きくなってしまうが、本実施形態のように、転送するメッセージより優先度の高いメッセージが転送するメッセージの例えば送信周期内に転送先のCANバスを占有する時間が長いCANバスの順にルーティング処理を行うようにルーティングテーブル14を設定しておけば、図7に示すようにCANバス2、CANバス3における転送に要する時間の合計を図6の例より小さくすることができる。   For example, when a message is transferred to two CAN buses, if a message transmission request with a high priority occurs in the transfer destination CAN bus during the transfer process of the message to the second CAN bus, the bus load When messages are transferred in the order of CAN buses with a high rate, the time required for transfer as a whole network system increases as shown in the comparative example of FIG. 6, but as compared with the messages to be transferred as in this embodiment. If the routing table 14 is set so that routing processing is performed in the order of CAN buses that occupy the transfer destination CAN bus within the transmission cycle of the messages transferred by the high priority message, for example, as shown in FIG. Thus, the total time required for transfer in the CAN bus 2 and the CAN bus 3 can be made smaller than the example of FIG.

すなわち、図6、図7の例について詳細に説明すると、まず、横方向には時間経過を示している。メッセージを受信する「受信バス」となるCANバス1でID番号が“150”のメッセージの送信がなされる。「ゲートウェイ処理時間」は図5の(1)〜(4)に対応してゲートウェイ装置5での各処理時間を(1)〜(4)で示している。そして、CANバス2,3におけるメッセージの転送に要する時間を「転送に要する時間」として示している。   That is, the example of FIGS. 6 and 7 will be described in detail. First, the passage of time is shown in the horizontal direction. A message having an ID number of “150” is transmitted on the CAN bus 1 which is a “reception bus” for receiving the message. “Gateway processing time” indicates each processing time in the gateway device 5 as (1) to (4) corresponding to (1) to (4) in FIG. The time required for message transfer on the CAN buses 2 and 3 is indicated as “time required for transfer”.

図6の例では、ゲートウェイ装置5で“(3)1つ目の転送先バスへの送信処理”を行った直後に、バス負荷率の高いCANバス3においてID番号が“150”のメッセージの転送を開始している。そして、その後に転送先であるCANバス2の他ノード6でメッセージの送信を開始する(その開始時刻を“他ノード送信要求時刻”として示している)。この場合に送信するのは、“110”、“120”、“130”のID番号のメッセージであるが、これらのメッセージはID番号が“150”のメッセージよりID番号が小さく、送信の優先度が高い。そのため、ゲートウェイ装置5で“(4)2つ目の転送先バスへの送信処理”がなされても、ただちにID番号が“150”のメッセージの転送は開始されず、“110”、“120”、“130”のID番号のメッセージの送信後に開始される。そのため、ID番号が“150”のメッセージの「転送に要する時間」は長くなっている。   In the example of FIG. 6, immediately after “(3) transmission processing to the first transfer destination bus” is performed in the gateway device 5, the message with the ID number “150” in the CAN bus 3 with a high bus load factor is displayed. The transfer has started. Then, transmission of the message is started on the other node 6 of the CAN bus 2 as the transfer destination (the start time is indicated as “other node transmission request time”). In this case, messages with ID numbers “110”, “120”, and “130” are transmitted. These messages have ID numbers smaller than those with ID numbers “150”, and the priority of transmission is high. Is expensive. Therefore, even if the gateway device 5 performs “(4) transmission processing to the second transfer destination bus”, the transfer of the message with the ID number “150” is not started immediately, but “110”, “120”. , And started after transmission of a message having an ID number of “130”. For this reason, the “time required for transfer” of the message whose ID number is “150” is long.

これに対し、図7の本実施形態の場合は、転送するメッセージより優先度の高いメッセージが転送するメッセージの例えば送信周期内に転送先のCANバスを占有する時間が長いCANバスの順にルーティング処理を行うようにルーティングテーブル14を設定しているので、ゲートウェイ装置5で“(3)1つ目の転送先バスへの送信処理”を行った直後に、CANバス2においてID番号が“150”のメッセージの転送を開始している。そして、その後に転送先であるCANバス3の他ノード6でメッセージの送信を開始する(その開始時刻を“他ノード送信要求時刻”として示している)。この場合に送信するのも、“160”以下のID番号のメッセージであるが、これらのメッセージはID番号が“150”のメッセージよりID番号が大きく、送信の優先度が低い。そのため、ゲートウェイ装置5で“(4)2つ目の転送先バスへの送信処理”がなされた時点ですでに送信を開始しているID番号が“160”のメッセージの送信が終了すると、優先的にID番号が“150”のメッセージの転送を行い、その終了後にID番号が“170”以下の各メッセージの送信を開始している。そのため、ID番号が“150”のメッセージの「転送に要する時間」は短縮されている。   On the other hand, in the case of the present embodiment in FIG. 7, routing processing is performed in the order of the CAN bus having a long time to occupy the transfer destination CAN bus within, for example, the transmission cycle of the message transferred by the message having a higher priority than the message to be transferred. The routing table 14 is set so that the ID number is “150” in the CAN bus 2 immediately after “(3) transmission processing to the first transfer destination bus” is performed in the gateway device 5. The message transfer has started. Then, transmission of the message is started on the other node 6 of the CAN bus 3 as the transfer destination (the start time is indicated as “other node transmission request time”). In this case, messages with ID numbers of “160” or less are also transmitted, but these messages have a larger ID number than messages with an ID number of “150” and have lower transmission priority. For this reason, when the transmission of the message whose ID number is “160” that has already started transmission at the time when “(4) transmission processing to the second transfer destination bus” is performed in the gateway device 5, priority is given. For example, the message having the ID number “150” is transferred, and after completion of the transfer, the transmission of each message having the ID number “170” or less is started. Therefore, the “time required for transfer” of the message whose ID number is “150” is shortened.

一方、ID番号が“300”のメッセージにおいて同様に送信周期の100msec以内に高い優先度のメッセージが占有する時間は次のようになる。CANバス2では、100msec内に10msecの周期のメッセージが10回送信され、ID番号が“300”のメッセージより優先度が高いメッセージはID番号が“100”〜“150”の5つであるため、“250×5×10=12500μsec”が、ID番号“300”のメッセージより高い優先度のメッセージが、100msec内に転送先のCANバスを占有する時間になる。また、CANバス3では、100msec内に10msecの周期のメッセージが10回送信され、ID番号が“300”のメッセージより優先度が高いメッセージはID番号が“100”、“150”〜“190”の6つであるため、“250×6×10=15000μsec”となる。よって、この場合はCANバス3からメッセージの転送を行うのが有利となる。   On the other hand, in the message with the ID number “300”, the time occupied by the high priority message within 100 msec of the transmission cycle is as follows. In the CAN bus 2, a message having a period of 10 msec is transmitted 10 times within 100 msec, and messages having a higher priority than the message having the ID number “300” are five ID numbers “100” to “150”. “250 × 5 × 10 = 12,500 μsec” is the time for a message having a higher priority than the message with ID number “300” to occupy the transfer destination CAN bus within 100 msec. On the CAN bus 3, a message with a period of 10 msec is transmitted 10 times within 100 msec, and a message having a higher priority than a message with an ID number of “300” has an ID number of “100”, “150” to “190”. Therefore, “250 × 6 × 10 = 15000 μsec” is obtained. Therefore, in this case, it is advantageous to transfer a message from the CAN bus 3.

また、ID番号が“100”のメッセージにおいては、ID番号“100”のメッセージより高い優先度のメッセージが、100msec内に転送先のCANバスを占有する時間は、CANバス2と3とで等しくなる。この場合は、CANバスのバス負荷率が高いCANバスの方が他のメッセージの送信中に当たってしまう確率が高くなるので、バス負荷率が高いCANバスを優先して、この例ではCANバス3からメッセージの転送を行う(図2参照)。   In the message with the ID number “100”, the time that the message having the higher priority than the message with the ID number “100” occupies the transfer destination CAN bus within 100 msec is equal in the CAN buses 2 and 3. Become. In this case, the CAN bus having a higher CAN bus load ratio has a higher probability of being hit during the transmission of another message. Therefore, in this example, the CAN bus 3 having a higher bus load ratio is given priority. The message is transferred (see FIG. 2).

1 CANバス
2 CANバス
3 CANバス
5 ゲートウェイ装置
14 ルーティングテーブル
DESCRIPTION OF SYMBOLS 1 CAN bus 2 CAN bus 3 CAN bus 5 Gateway apparatus 14 Routing table

Claims (3)

ネットワーク上で同一メッセージを複数のバスに転送する場合には一バスごとに転送処理を行うゲートウェイ装置において、
前記バスに接続されているいずれかのノードから送信されたメッセージを受信する受信手段と、
前記メッセージの識別表示ごとに当該メッセージの転送先となる前記バス及び複数の前記バスに同一のメッセージを転送する場合の転送の順序を記録している記録手段と、
前記受信手段で受信した前記メッセージの前記識別表示について前記記録手段を参照して当該識別表示に対応する前記転送先のバスを決定する決定手段と、
前記決定手段で決定された前記転送先のバスに転送メッセージを送信する送信手段と、
を備え、
前記記録手段は、前記転送の順序として、当該転送の対象となるメッセージより送信の優先度の高いメッセージが前記転送先となるバスを占有する時間が長いバス順となるように記録している、
ことを特徴とするゲートウェイ装置。
In the gateway device that performs transfer processing for each bus when transferring the same message to multiple buses on the network,
Receiving means for receiving a message transmitted from any node connected to the bus;
Recording means for recording the order of transfer when transferring the same message to the bus and a plurality of the buses to which the message is transferred for each identification display of the message;
Determining means for determining the transfer destination bus corresponding to the identification display with reference to the recording means for the identification display of the message received by the receiving means;
Transmitting means for transmitting a transfer message to the transfer destination bus determined by the determining means;
With
The recording means records, as the transfer order, a message having a transmission priority higher than that of the message to be transferred in a bus order in which the time for occupying the transfer destination bus is long.
A gateway device characterized by that.
前記記録手段は、前記転送の対象となるメッセージより送信の優先度の高いメッセージが前記転送先となるバスを占有する時間が複数のバスで等しい場合は、バス負荷率が高いバスの順に転送するように記録している、ことを特徴とする請求項1に記載のゲートウェイ装置。   When the time for which a message having a higher transmission priority than the message to be transferred occupies the transfer destination bus is the same for a plurality of buses, the recording unit transfers the messages in the order of the buses having the highest bus load ratio. The gateway device according to claim 1, wherein the gateway device is recorded as follows. ゲートウェイ装置と複数のバスとがネットワーク上で接続されているネットワークシステムにおいて、
前記ゲートウェイ装置は、請求項1又は2に記載のゲートウェイ装置である、
ことを特徴とするネットワークシステム。
In a network system in which a gateway device and a plurality of buses are connected on a network,
The gateway device is the gateway device according to claim 1 or 2,
A network system characterized by this.
JP2011274022A 2011-12-15 2011-12-15 Gateway unit and network system Pending JP2013126119A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011274022A JP2013126119A (en) 2011-12-15 2011-12-15 Gateway unit and network system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011274022A JP2013126119A (en) 2011-12-15 2011-12-15 Gateway unit and network system

Publications (1)

Publication Number Publication Date
JP2013126119A true JP2013126119A (en) 2013-06-24

Family

ID=48777129

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011274022A Pending JP2013126119A (en) 2011-12-15 2011-12-15 Gateway unit and network system

Country Status (1)

Country Link
JP (1) JP2013126119A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101505369B1 (en) 2014-04-15 2015-03-24 부산대학교 산학협력단 Control area network method for sensor measuring

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101505369B1 (en) 2014-04-15 2015-03-24 부산대학교 산학협력단 Control area network method for sensor measuring

Similar Documents

Publication Publication Date Title
JP5949417B2 (en) Relay device
US10200290B2 (en) Station and method for serial data transmission using dynamic reprioritizing of data frames
JP5637193B2 (en) Communications system
JP2016032274A (en) Gateway unit
CN101385296A (en) Gateway for the automatic routing of messages between buses
US10602530B2 (en) Access method with access slots and priority resolution
JP2015154185A (en) On-vehicle control device
JP2012080360A (en) Communication system, master node and solve node
JP2011030151A (en) Communication system and communication node
US11398919B2 (en) Method for detecting network subscribers in an automation network and automation network
JP2006191337A (en) Gateway device for transferring message between buses and network system using the device
KR102303424B1 (en) Direct memory access control device for at least one processing unit having a random access memory
JP2006253922A (en) Gateway apparatus and data transfer method for the gateway apparatus
JP2013126119A (en) Gateway unit and network system
JP4754940B2 (en) Relay connection unit
US20050044249A1 (en) Method and apparatus for unifying MAC protocols
CN112398901B (en) Method and system for performing double message arbitration
JP5276461B2 (en) Network system
JP4361540B2 (en) Gateway device, data transfer method, and program
JP7044081B2 (en) In-vehicle communication system
CN114650194B (en) Data communication method, device, electronic equipment and storage medium
US20240039756A1 (en) Can communication controller and method of operating can communication controller
EP3082298B1 (en) Slave device and method for controlling the same
US10713198B2 (en) Direct memory access control unit for a processing unit that includes a working memory
JPH04360259A (en) Transmission control system by polling