JP4361540B2 - Gateway device, data transfer method, and program - Google Patents

Gateway device, data transfer method, and program Download PDF

Info

Publication number
JP4361540B2
JP4361540B2 JP2006059843A JP2006059843A JP4361540B2 JP 4361540 B2 JP4361540 B2 JP 4361540B2 JP 2006059843 A JP2006059843 A JP 2006059843A JP 2006059843 A JP2006059843 A JP 2006059843A JP 4361540 B2 JP4361540 B2 JP 4361540B2
Authority
JP
Japan
Prior art keywords
data
transmission
storage means
bus
stored
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.)
Expired - Fee Related
Application number
JP2006059843A
Other languages
Japanese (ja)
Other versions
JP2007243322A (en
Inventor
誉 前原
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Denso Ten Ltd
Original Assignee
Denso Ten Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Denso Ten Ltd filed Critical Denso Ten Ltd
Priority to JP2006059843A priority Critical patent/JP4361540B2/en
Publication of JP2007243322A publication Critical patent/JP2007243322A/en
Application granted granted Critical
Publication of JP4361540B2 publication Critical patent/JP4361540B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Small-Scale Networks (AREA)

Description

本発明は、複数のバス間のデータを中継するゲートウェイ装置及びそのゲートウェイ装置におけるデータ転送方法に関する。特に、メモリに蓄積されたフレームをバスに出力する送信用コントローラバッファへの転送処理技術に関する。   The present invention relates to a gateway device that relays data between a plurality of buses and a data transfer method in the gateway device. In particular, the present invention relates to a transfer processing technique to a transmission controller buffer that outputs frames stored in a memory to a bus.

従来から、主として自動車の車載ネットワークにCAN(Controller Area Network)と呼ばれる通信プロトコルが採用されている(例えば、以下の非特許文献1及び2参照)。CANはISO(International Organization for Standardization)で国際的に標準化されたシリアル通信プロトコルである。最近では、その高い性能と信頼性から車内LAN以外にも、船舶、医療機器等多方面で採用されている。   Conventionally, a communication protocol called CAN (Controller Area Network) has been mainly employed in an in-vehicle network of an automobile (for example, see Non-Patent Documents 1 and 2 below). CAN is a serial communication protocol internationally standardized by ISO (International Organization for Standardization). Recently, due to its high performance and reliability, it has been adopted in various fields other than in-vehicle LAN such as ships and medical equipment.

このようなCANを利用した車内ネットワークシステムでは、非特許文献1に記載されているように、自動車のハードウェアを制御する複数のECU(Electric Control Unit)がCANバスを介して接続され、更に、各バス間がゲートウェイ装置を介して接続される。例えば、エンジンやトランスミッション等を制御するECUを接続するエンジン系のCANバスと、VICSナビなどを制御するECUを接続する情報系のCANバスとがゲートウェイ装置を介して接続される。かかるゲートウェイ装置は、異なるCANバス間のプロトコル変換を行うとともに、一方のCANバス内のECUから送信されたメッセージを他方のCANバス内のECUに転送する役割を果たす。   In such an in-vehicle network system using CAN, as described in Non-Patent Document 1, a plurality of ECUs (Electric Control Units) for controlling automobile hardware are connected via a CAN bus. Each bus is connected through a gateway device. For example, an engine CAN bus that connects an ECU that controls an engine, a transmission, etc., and an information CAN bus that connects an ECU that controls a VICS navigation system are connected via a gateway device. Such a gateway device performs protocol conversion between different CAN buses and plays a role of transferring a message transmitted from an ECU in one CAN bus to an ECU in the other CAN bus.

CANプロトコルの特徴は、(1)バスが空いているときに、すべてのノード(ECU)がメッセージ(以下、「フレーム」と称す。CANプロトコルにおける通信単位である)の送信を始めることができるマルチマスタ方式が採用され、(2)バスに早くアクセスしたノードがフレーム送信権を得て、(3)同時に複数のノードが送信を始めると、優先順位の高い識別子(ID)のフレームを送信するノードが送信権を得る、等が上げられる。なお、この識別子は、送信フレームに付加されるものであるが、フレームの送り先を示すものではなく、バス上にフレームを出力できる優先順位を示すものである。   The features of the CAN protocol are as follows: (1) When the bus is free, all nodes (ECUs) can start sending messages (hereinafter referred to as “frames”, which are communication units in the CAN protocol). A master system is adopted, (2) a node that has accessed the bus earlier obtains the right to transmit a frame, and (3) a node that transmits a frame of an identifier (ID) having a high priority when a plurality of nodes start transmitting at the same time. Get the transmission right, etc. This identifier is added to the transmission frame, but does not indicate the destination of the frame but indicates the priority in which the frame can be output on the bus.

このようなマルチマスタ通信において、フレームを送信するノードは、バスの通信状態や負荷に関係なくノードを構成するデバイス毎の周期にて送信を行う。また、自動車のスイッチ入力情報やエンジンの回転数などの値の変化に応じてイベント送信を行うノードは、バスの通信状態等に関係なく発生したイベントに応じてフレームの送信を行う。そして、同時にフレームが送信されると、上述したIDにより調停(アービトレーション)が行われ、送信権を獲得したフレームがバス上に送信される。   In such multi-master communication, a node that transmits a frame transmits at a cycle for each device that constitutes the node regardless of the communication state and load of the bus. In addition, a node that transmits an event according to a change in values such as switch input information of an automobile or the number of revolutions of an engine transmits a frame according to an event that occurs regardless of a bus communication state. When a frame is transmitted at the same time, arbitration is performed with the above-described ID, and the frame that has acquired the transmission right is transmitted on the bus.

一方、ゲートウェイ装置は、一般に各デバイスから送信されるフレームを格納するメモリと、フレームの送信を行う送信用コントローラと、受信を行う受信用コントローラとを備える。更に、各コントローラ内には送受信されるフレームを格納するバッファが備えられている。メモリに蓄積されたフレームは、ゲートウェイ装置内のCPUによって、図1に示すように基本周期ごとに送信コントローラ内のバッファに転送され、バッファからバスに出力される。
「CAN入門書」 WWW.renesas.com 「CANとは?」WWW.toyo.co.jp/car/CAN/CAN_General.htm
On the other hand, the gateway device generally includes a memory that stores a frame transmitted from each device, a transmission controller that transmits a frame, and a reception controller that performs reception. Further, each controller is provided with a buffer for storing frames to be transmitted and received. The frames stored in the memory are transferred to the buffer in the transmission controller every basic period by the CPU in the gateway device as shown in FIG. 1, and output from the buffer to the bus.
"CAN primer" WWW. renesas. com “What is CAN?” WWW. toyo. co. jp / car / CAN / CAN_General. htm

上述のようにゲートウェイ装置では、CPUによってメモリに蓄積したフレームを基本周期ごとにコントローラ内のバッファに出力している。このとき、コントローラバッファに未送信のフレームが残っていると、CPUはバッファにフレームを転送することができない。この場合、次の基本周期までメモリにフレームを保持して置かなければならず、送信に遅れが生じる。   As described above, in the gateway device, the frame stored in the memory by the CPU is output to the buffer in the controller every basic period. At this time, if an untransmitted frame remains in the controller buffer, the CPU cannot transfer the frame to the buffer. In this case, the frame must be held in the memory until the next basic period, and transmission is delayed.

本発明は上記事情に鑑みてなされたものであり、送信にかかる処理の遅れを最小限に抑えることができるゲートウェイ装置、データ転送方法及びプログラムを提供することを目的とする。   The present invention has been made in view of the above circumstances, and an object of the present invention is to provide a gateway device, a data transfer method, and a program capable of minimizing a delay in processing related to transmission.

かかる目的を達成するために本発明のゲートウェイ装置は、同時に複数のノードからデータの送信要求があった場合に、データのIDに基づいて、バスへのデータの送信権が与えられるノードが決定する通信プロトコルの複数のバス間のデータ転送を制御するゲートウェイ装置であって、前記バスを介して受信したデータを記憶する第1の記憶手段と、前記データを前記バス上に転送する前に、前記データを記憶しておく第2の記憶手段と、前記第2の記憶手段に記憶されたデータをバス上に出力する送信制御手段と、前記第1の記憶手段に記憶されたデータを前記第2の記憶手段に送信セットする制御手段とを有し、前記第2の記憶手段は複数のデータを記憶することが可能なように複数の領域に分割されており、前記制御手段は、送信セットするデータのIDによって設定された前記第2の記憶手段の領域に当該データの記憶を行うものであり、前記送信制御手段から送信完了通知を受け取る場合、または、送信処理の基本周期ごとに前記送信制御手段に送信完了の問い合わせを行って送信完了の通知を得る場合に、前記第2の記憶手段にデータを記憶する構成を備えている。
第2の記憶手段に記憶したデータの送信が完了していないと第2の記憶手段に次のデータをセットできない場合がある。そのような場合に、送信制御手段がデータ送信を完了すると、送信完了通知を制御手段に出力することで、送信にかかる処理の遅れを最小限に抑えることができる。また、送信制御手段の送信完了通知機能が故障しても、制御手段は第2の記憶手段にデータをセットすることができる。
In order to achieve this object, the gateway device of the present invention determines the node to which the right to transmit data to the bus is given based on the data ID when there are requests for data transmission from a plurality of nodes simultaneously. A gateway device that controls data transfer between a plurality of buses of a communication protocol, the first storage means for storing data received via the bus, and before transferring the data on the bus, Second storage means for storing data, transmission control means for outputting the data stored in the second storage means on the bus, and data stored in the first storage means for the second and control means for transmitting set in storage means, said second storage means is divided into a plurality of regions so as to be capable of storing a plurality of data, said control means transmits Se Are those in the area of the second storage unit set by the ID of the data to be collected by performing the storing of the data, if from the transmission control means that receive the transmission completion notification, or, for each fundamental period of the transmission processing In the case where a transmission completion inquiry is made to the transmission control means and a transmission completion notification is obtained , data is stored in the second storage means.
If transmission of data stored in the second storage means is not completed, the next data may not be set in the second storage means. In such a case, when the transmission control unit completes the data transmission, a transmission completion notification is output to the control unit, thereby minimizing a delay in processing related to transmission. Further, even if the transmission completion notification function of the transmission control unit fails, the control unit can set data in the second storage unit.

上記ゲートウェイ装置において、前記第1の記憶手段は、データを複数のブロックに分類して記憶し、前記制御手段は、データに設定された送信間隔に応じて、各ブロックに格納するデータを振り分けるとよい。
従って、送信間隔の短いデータの送信が、送信間隔の長いデータの送信によって中断されることがない。
In the gateway device, the first storage means classifies and stores data into a plurality of blocks, and the control means distributes data to be stored in each block according to a transmission interval set in the data. Good.
Therefore, transmission of data with a short transmission interval is not interrupted by transmission of data with a long transmission interval.

上記ゲートウェイ装置において、前記第1の記憶手段は、データを複数のブロックに分類して記憶し、前記制御手段は、データに設定された優先度に応じて、各ブロックに格納するデータを振り分けるとよい。
従って、優先度の高いデータを優先的に送信することができる。
In the gateway device, the first storage means classifies and stores data into a plurality of blocks, and the control means distributes data to be stored in each block according to the priority set for the data. Good.
Therefore, high priority data can be transmitted with priority.

本発明のデータ転送方法は、同時に複数のノードからデータの送信要求があった場合に、データのIDに基づいて、バスへのデータの送信権が与えられるノードが決定する通信プロトコルの複数のバス間でのデータ転送を制御するデータ転送方法であって、前記バスを介して受信したデータを第1の記憶手段に格納するステップと、複数のデータを記憶することが可能なように複数の領域に分割されている第2の記憶手段に格納済みのデータのバスへの送信完了通知を待って、または、送信処理の基本周期ごとに送信完了の問い合わせを行うことにより得られる送信完了通知を待って、前記第1の記憶手段から、送信セットするデータのIDによって設定された前記第2の記憶手段の領域にデータを格納するステップと、前記第2の記憶手段に格納されたデータをバス上に出力するステップとを有している。 According to the data transfer method of the present invention, when there is a data transmission request from a plurality of nodes at the same time, a plurality of buses of a communication protocol determined by a node to which a right to transmit data to the bus is given based on the data ID A data transfer method for controlling data transfer between a plurality of areas in which data received via the bus is stored in a first storage means and a plurality of areas can be stored Waiting for a transmission completion notification to the bus of data stored in the second storage means divided into two, or waiting for a transmission completion notification obtained by inquiring transmission completion every basic cycle of transmission processing Te, wherein the first storage means, and storing the data in the area of the second storage unit set by the ID of the data to be transmitted set, the second storage means The stored data and a step of outputting onto the bus.

本発明のデータ転送プログラムは、同時に複数のノードからデータの送信要求があった場合に、データのIDに基づいて、バスへのデータの送信権が与えられるノードが決定する通信プロトコルの複数のバス間でのデータ転送を制御するデータ転送プログラムであって、前記バスを介して受信したデータを第1の記憶手段に格納する処理と、複数のデータを記憶することが可能なように複数の領域に分割されている第2の記憶手段に格納したデータのバスへの送信完了通知を待って、または、送信処理の基本周期ごとに送信完了の問い合わせを行うことにより得られる送信完了通知を待って、前記第1の記憶手段から、送信セットするデータのIDによって設定された前記第2の記憶手段の領域にデータを格納する処理と、前記第2の記憶手段に格納済みのデータをバス上に出力する処理とをコンピュータに実行させる。 The data transfer program according to the present invention includes a plurality of communication protocol buses determined by a node to which a right to transmit data to the bus is given based on the data ID when there is a data transmission request from a plurality of nodes simultaneously. A data transfer program for controlling data transfer between a plurality of areas so that data received via the bus is stored in a first storage means and a plurality of areas can be stored Waiting for a transmission completion notification to the bus of data stored in the second storage means divided into two, or waiting for a transmission completion notification obtained by inquiring transmission completion at each basic cycle of transmission processing , from said first storage means, a process of storing data in the area of the second storage unit set by the ID of the data to be transmitted set, the second storage hand The stored data to execute a process of outputting onto the bus to the computer.

本発明によれば、送信にかかる処理の遅れを最小限に抑えることができる。   According to the present invention, it is possible to minimize the processing delay related to transmission.

添付図面を参照しながら本実施例の最良の実施例を説明する。   The best embodiment of the present embodiment will be described with reference to the accompanying drawings.

まず、図2を参照しながら本実施例の構成を説明する。図2には、本発明が適用される車載ネットワークシステムの一例が示されている。
車載ネットワークシステム1は、図2に示すように、バスA20に接続されたノードA21からノードF26と、バスB30に接続されたノードG31からノードL36との間でフレームの送受信を行うものである。ゲートウェイ装置10は、異なるバス間でのフレームの転送を実現するためにこれらバス間でのフレームを中継する役割を担う。なお、本実施例では、バスA20及びバスB30に接続されたノードは、CANのプロトコルに従って通信を行うものとする。但し、通信に使用するプロトコルはCANに限定されるものではなく、LIN(local interconnect netwokr)やFlexRayなどのプロコトルも用いることができる。図3には、本実施例を車両に搭載した場合の構成を示す。車両に搭載した場合のノードとして、エンジンECU、トランスミッションECU、電源制御ECU、エアコンECU、セキュリティECU、メーターECUなどが挙げられ、これらのノード間でゲートウェイ装置10を介して通信を行う。
First, the configuration of the present embodiment will be described with reference to FIG. FIG. 2 shows an example of an in-vehicle network system to which the present invention is applied.
As shown in FIG. 2, the in-vehicle network system 1 transmits and receives frames between the node A21 to the node F26 connected to the bus A20 and the node G31 to the node L36 connected to the bus B30. The gateway device 10 plays a role of relaying frames between these buses in order to realize frame transfer between different buses. In the present embodiment, the nodes connected to the bus A20 and the bus B30 perform communication according to the CAN protocol. However, the protocol used for communication is not limited to CAN, and protocols such as LIN (local interconnect network) and FlexRay can also be used. In FIG. 3, the structure at the time of mounting a present Example in a vehicle is shown. Nodes when mounted on a vehicle include an engine ECU, a transmission ECU, a power supply control ECU, an air conditioner ECU, a security ECU, a meter ECU, and the like, and perform communication between these nodes via the gateway device 10.

図4に、ゲートウェイ制御装置10の構成を示す。ゲートウェイ制御装置10は、受信用のコントローラA11と、送信用のコントローラB12と、主としてフレームを蓄積するためのメモリ13(本発明の第1の記憶手段に該当する)と、CPU14と、ROM15とから構成され、それぞれ内部バスを介して接続される。なお、以下では、説明を簡略化するため、バスA20に接続されたノードからバスB30に接続されたノードにフレームを送信する場合だけを例に説明する。バスB30に接続されたノードからバスA20に接続したノードへのフレーム送信も同様の手順で実行される。   FIG. 4 shows the configuration of the gateway control device 10. The gateway control apparatus 10 includes a reception controller A11, a transmission controller B12, a memory 13 for mainly storing frames (corresponding to the first storage means of the present invention), a CPU 14, and a ROM 15. Each of them is connected via an internal bus. In the following, in order to simplify the description, only the case where a frame is transmitted from a node connected to the bus A20 to a node connected to the bus B30 will be described. Frame transmission from the node connected to the bus B30 to the node connected to the bus A20 is executed in the same procedure.

コントローラA11は、バス20Aを介してノードA21〜ノードF26から送信されたフレームの受信制御を行う。またコントローラA11は、内部に受信用のコントローラバッファ111を備え、受信したフレームを蓄積する。   The controller A11 performs reception control of frames transmitted from the node A21 to the node F26 via the bus 20A. The controller A11 includes a controller buffer 111 for reception therein, and accumulates received frames.

コントローラB12(本発明の送信制御手段に該当する)は、受信したフレームを、バスB30を介してノードG31〜ノードL36に送信する送信制御を行う。また、コントローラB12は、内部に送信用のコントローラバッファ112(本発明の第2の記憶手段に該当する)を備え、送信すべきフレームを蓄積する。   The controller B12 (corresponding to the transmission control means of the present invention) performs transmission control for transmitting the received frame to the nodes G31 to L36 via the bus B30. The controller B12 includes a controller buffer 112 for transmission (corresponding to the second storage means of the present invention), and accumulates frames to be transmitted.

また、コントローラバッファ111、112内は、図5に示すように複数のメッセージボックス(以下、MBと略記する)に分割されている。各メッセージボックスには、ボックス番号が付与され、メッセージボックス内にはメッセージの種類や調停時の優先度を表すIDコードを格納するためのIDコードレジスタ、メッセージボックスの使用方法(送信用/受信用)を指定するための用途指定レジスタなどが設けられている。各メッセージボックスにセットされたフレームがバスB30上に出力され、送信先のノードに送信される。また、バスA20から受信したメッセージをメッセージボックスに取り込み、通信制御部18にフレーム受信の割り込みを行う。   The controller buffers 111 and 112 are divided into a plurality of message boxes (hereinafter abbreviated as MB) as shown in FIG. Each message box is given a box number. In the message box, an ID code register for storing an ID code indicating a message type and priority at the time of arbitration, and a method for using the message box (for transmission / reception) ) Is specified for use. The frame set in each message box is output on the bus B30 and transmitted to the destination node. Further, the message received from the bus A20 is taken into the message box, and the communication control unit 18 is interrupted for frame reception.

CPU14は、ゲートウェイ制御装置10全体を制御すると共に、図4に示すように、通信ドライバ16、17、通信制御部18、アプリケーション19の各プログラム(又はモジュール)を実行する。これらのプログラム等はROM15に記憶される。   The CPU 14 controls the entire gateway control apparatus 10 and executes each program (or module) of the communication drivers 16 and 17, the communication control unit 18, and the application 19 as shown in FIG. These programs are stored in the ROM 15.

次に、図6を参照しながらノード間で送受信されるフレームの構成について説明する。フレームは、CANプロトコルにおける通信の1単位である。主として、フレームの開始を示すスタートオブフレーム(SOF)と、当該フレームの優先順位を示す識別子(ID)が格納されるID領域と、データが格納されるデータ領域と、フレームの伝送誤りをチェックするCRCチェック符号とが格納される領域と、フレームの終了を示すエンドオブフレーム(EOF)とから構成される。   Next, the configuration of frames transmitted and received between nodes will be described with reference to FIG. A frame is a unit of communication in the CAN protocol. Mainly, a start of frame (SOF) indicating the start of a frame, an ID area storing an identifier (ID) indicating the priority order of the frame, a data area storing data, and a frame transmission error are checked. An area for storing a CRC check code and an end-of-frame (EOF) indicating the end of the frame are configured.

CANプロトコルでは、バスA20の送信権は、第1にアイドル中のバスにフレームを先に出力したノードに与えられ、第2に同時に複数のノードからフレームを出力したときは上述した識別子(ID)により優先順位の高いフレームを出力したノードに与えられる。つまり、すべての識別子は異なる優先順位を有し、ノードF26とノードA21とが同時にフレームをバスA20に出力すると、その識別子の優先順位により送信権が決定され、例えば、優先順位の高いノードF26からのフレームにバスA20の送信権が与えられ、優先順位の低いノードA21からのフレームの送信は停止する。もちろん、ノードA21が先にフレームの出力を開始したときは、他のノードB22等はフレームの出力はできない。   In the CAN protocol, the right to transmit the bus A20 is given to the node that first outputs the frame to the idle bus, and secondly, the identifier (ID) described above when the frame is simultaneously output from a plurality of nodes. Is given to a node that outputs a frame having a high priority. That is, all the identifiers have different priorities, and when the node F26 and the node A21 simultaneously output a frame to the bus A20, the transmission right is determined based on the priorities of the identifiers. The transmission right of the bus A20 is given to this frame, and the frame transmission from the node A21 having a low priority is stopped. Of course, when the node A21 starts outputting the frame first, the other nodes B22 and the like cannot output the frame.

次に、全体動作を説明する。上述のようにして、ノードF26から送信されたフレームにバスA20の送信権が与えられると、当該フレームは、ゲートウェイ制御装置10に出力される。そして、このフレームは、コントローラA11内のコントローラバッファ111に一旦蓄積される。その後、通信ドライバ16の管理するメモリ13の領域に格納される。   Next, the overall operation will be described. As described above, when the transmission right of the bus A20 is given to the frame transmitted from the node F26, the frame is output to the gateway control apparatus 10. This frame is temporarily stored in the controller buffer 111 in the controller A11. Thereafter, it is stored in the area of the memory 13 managed by the communication driver 16.

その後、通信制御部18が、メモリ13に格納したフレームを読み出して、コントローラB12内のバッファ112に送信セットする。更に、通信ドライバ17によってコントローラB12が制御され、コントローラB12は、コントローラバッファ112に蓄積されたフレームをバスB30に出力する。その後、ゲートウェイ制御装置10から出力されたフレームは、バスB30を介してノードL36に送信される。   Thereafter, the communication control unit 18 reads out the frame stored in the memory 13 and transmits and sets it to the buffer 112 in the controller B12. Further, the controller B12 is controlled by the communication driver 17, and the controller B12 outputs the frame stored in the controller buffer 112 to the bus B30. Thereafter, the frame output from the gateway control apparatus 10 is transmitted to the node L36 via the bus B30.

このノードL36に対する送信もバスA20と同様にバスの送信権獲得のための調停が行われる。すなわち、バスB30に接続された各ノードL36等は、どの識別子のフレームを受信すべきか予め設定されており、その設定された識別子のフレームを、バスB30上に出力されるメッセージから判断して、該当する場合に受信することになる。   As for the transmission to the node L36, arbitration for acquiring the transmission right of the bus is performed similarly to the bus A20. That is, each of the nodes L36 and the like connected to the bus B30 is set in advance as to which identifier frame should be received, and the frame of the set identifier is determined from the message output on the bus B30, It will be received if applicable.

本発明の特徴は、コントローラA,Bからの送信完了通知を受信して、通信制御部18がコントローラバッファ111、112へフレームを格納するようにしたことにある。   A feature of the present invention is that the communication control unit 18 receives the transmission completion notification from the controllers A and B and stores the frames in the controller buffers 111 and 112.

例えば、図7に示すようにコントローラバッファからバスB30に1基本周期(例えば、1ms)で送信可能なフレーム数を「4」とし、コントローラバッファ112に記憶可能なフレーム数も「4」とした場合を考える。1基本周期内において、メモリ13に記憶されたフレーム1からフレーム4がコントローラバッファ112に転送されて送信セットが完了した状態で、さらにフレーム5に対してもCPU14が送信セットしようとしても、コントローラバッファ112が空き状態とならない限り、送信セットの処理待ちとなってしまう。   For example, as shown in FIG. 7, when the number of frames that can be transmitted from the controller buffer to bus B30 in one basic cycle (for example, 1 ms) is “4” and the number of frames that can be stored in the controller buffer 112 is also “4”. think of. Even if the CPU 14 attempts to set transmission for the frame 5 in a state where the frames 1 to 4 stored in the memory 13 are transferred to the controller buffer 112 and the transmission set is completed within one basic period, the controller buffer As long as 112 is not in an empty state, the process waits for a transmission set.

そこで、本実施例では、送信の遅れを最小限に抑えるために、コントローラバッファ112に格納したフレームの送信を完了すると、図8に示すようにコントローラB12は、通信制御部18に対して送信完了の割込み通知を送る。この割込み通知を受信した通信制御部18は、次に送信するフレームをコントローラバッファ112に送って格納する。   Therefore, in this embodiment, when transmission of the frame stored in the controller buffer 112 is completed in order to minimize transmission delay, the controller B12 completes transmission to the communication control unit 18 as shown in FIG. Send an interrupt notification. Upon receiving this interrupt notification, the communication control unit 18 sends the next frame to be transmitted to the controller buffer 112 for storage.

また、コントローラB12の備える送信完了の通知機能に故障が生じた場合、コントローラバッファ112へのフレームのセットに遅れが生じてしまう。そこで、通信制御部18は、従来通り予め設定された基本周期ごとに、コントローラB12にコントローラバッファ112に空きがあるかを問い合わせる。コントローラB12からコントローラバッファ112に空きがあるとの通知を得ると、通信制御部18は、フレームをコントローラバッファ112にセットする。   In addition, when a failure occurs in the transmission completion notification function of the controller B12, a delay occurs in setting the frame in the controller buffer 112. Therefore, the communication control unit 18 inquires of the controller B12 whether or not the controller buffer 112 has an empty space at every preset basic cycle as before. When receiving a notification from the controller B12 that the controller buffer 112 is empty, the communication control unit 18 sets the frame in the controller buffer 112.

通信制御部18の処理手順を図9に示すフローチャートを参照しながら説明する。
送信側となるノードからフレームが送信され、コントローラA11からフレーム受信の割り込みが入力されると(ステップS1)、通信制御部18は、コントローラA11のバッファ111に蓄積されたフレームを通信ドライバ16を制御してメモリ13内に取り込む(ステップS2)。フレームを取得した通信制御部18は、コントローラB12に対して、コントローラバッファ112に空きがあるか否かを問い合わせる(ステップS3)。コントローラB12からコントローラバッファ112に空きがあるとの応答を得ると(ステップS3/YES)、通信制御部18は通信ドライバ17を制御して、フレームをコントーラバッファ112の該当メッセージボックスにセットする(ステップS6)。
The processing procedure of the communication control unit 18 will be described with reference to the flowchart shown in FIG.
When a frame is transmitted from the node on the transmission side and a frame reception interrupt is input from the controller A11 (step S1), the communication control unit 18 controls the communication driver 16 with the frame stored in the buffer 111 of the controller A11. Then, it is taken into the memory 13 (step S2). The communication control unit 18 that has acquired the frame inquires of the controller B12 whether or not there is a free space in the controller buffer 112 (step S3). When a response is received from the controller B12 that the controller buffer 112 is free (step S3 / YES), the communication control unit 18 controls the communication driver 17 to set the frame in the corresponding message box of the controller buffer 112 (step S3 / YES). S6).

また、コントローラB12からコントローラバッファ112には空きがないとの応答を得ると(ステップS3/NO)、コントローラB12へのフレームのセットを保留し、コントローラB12からの送信完了通知があるまで待機する(ステップS4)。その後、コントローラB12から送信完了通知を受け取ると(ステップS4/YES)、送信するフレームをコントーラバッファ112の該当メッセージボックスにセットする(ステップS6)。また、送信完了通知の待機中に、予め設定された周期となると(ステップS5)、通信制御部18はコントローラB12に対して問い合わせを行う。通信制御部18は、例えば1msecごとに、コントローラB12に対して、コントローラバッファ112に空きがあるか否かを問い合わせる(ステップS3)。コントローラB12からコントローラバッファ112に空きがあるとの応答を得ると(ステップS3/YES)、送信するフレームをコントローラバッファ112の該当メッセージボックスにセットして(ステップS6)、フレームの送信を行う。   When the controller B12 obtains a response that there is no space in the controller buffer 112 (step S3 / NO), the controller B12 holds the frame set to the controller B12 and waits for a transmission completion notification from the controller B12 ( Step S4). Thereafter, when a transmission completion notification is received from the controller B12 (step S4 / YES), the frame to be transmitted is set in the corresponding message box of the controller buffer 112 (step S6). Further, when the preset period is reached while waiting for the transmission completion notification (step S5), the communication control unit 18 makes an inquiry to the controller B12. The communication control unit 18 inquires, for example, every 1 msec whether or not the controller buffer 112 has a vacancy in the controller B12 (step S3). When a response is received from the controller B12 that the controller buffer 112 is empty (step S3 / YES), the frame to be transmitted is set in the corresponding message box of the controller buffer 112 (step S6), and the frame is transmitted.

このように本実施例は、コントローラからの送信完了通知を受け取って、通信制御部18が、コントローラA11、B12のコントローラバッファにフレームを格納するので、送信にかかる処理の遅れを最小限に抑えることができる。   As described above, in this embodiment, since the communication control unit 18 receives the transmission completion notification from the controller and stores the frame in the controller buffer of the controllers A11 and B12, the transmission processing delay is minimized. Can do.

また、予め設定された基本周期ごとに、通信制御部18がコントローラA11,B12に対して問い合わせを行うので、コントローラA11,B12の送信完了通知機能がダウンしても、フレームをコントローラバッファ111,112に格納して送信することができる。   In addition, since the communication control unit 18 makes an inquiry to the controllers A11 and B12 every preset basic period, even if the transmission completion notification function of the controllers A11 and B12 is down, the frames are transferred to the controller buffers 111 and 112. Can be stored and transmitted.

次に、添付図面を参照しながら本発明の第2実施例を説明する。本実施例は、図10に示すようにコントローラB12に転送するフレームを格納しておくメモリ13の領域を複数のクラスに分割しておく。そして、送信側のノードからフレームを受信すると、これを優先度や送信タイミングに応じて分類して、クラスごとにフレームを格納する。   Next, a second embodiment of the present invention will be described with reference to the accompanying drawings. In this embodiment, as shown in FIG. 10, the area of the memory 13 for storing the frame to be transferred to the controller B12 is divided into a plurality of classes. When a frame is received from the node on the transmission side, it is classified according to priority and transmission timing, and the frame is stored for each class.

優先度とは、ノードごとに設定されたものであり、図6に示すようにフレーム内に優先度を表すIDが埋め込まれている。通信制御部18は、このIDを読み出し、IDに設定された優先順位のメッセージボックスに格納する。例えば、図10では、クラスaが最も優先度の高いクラスで、クラスbが次に優先度の高いクラスで、クラスnが優先度の最も低いクラスに設定している。   The priority is set for each node, and an ID indicating the priority is embedded in the frame as shown in FIG. The communication control unit 18 reads this ID and stores it in the message box having the priority set in the ID. For example, in FIG. 10, class a is the highest priority class, class b is the next highest priority class, and class n is the lowest priority class.

またコントローラバッファ112のメッセージボックスにフレームを格納するときには、優先度の高いクラスのフレームを優先的にメッセージボックスに格納する。このようにして、優先度順にフレームの送信を行うことができる。   When frames are stored in the message box of the controller buffer 112, high-priority class frames are preferentially stored in the message box. In this way, frames can be transmitted in order of priority.

さらに、送信間隔によってメモリ13内をクラス分けしてもよい。送信側となるノードは、所定間隔ごとにフレームの送信を行っている。この送信間隔に応じてメモリ13内をクラス分けする。
送信間隔が短いノードからのフレームと、送信間隔が長いノードからのフレームとが同じクラス内に混在すると、送信間隔の長いフレームによって、送信間隔が短いフレームが待機させられることになる。
このような不具合を防止するために、メモリ13内を送信間隔でクラス分けしておく。例えば、図10に示すクラスaには送信間隔の短いノードからのフレームだけを格納し、クラスnには、送信間隔の長いノードからのフレームを格納するようにする。
Further, the memory 13 may be classified according to the transmission interval. The node on the transmission side transmits frames at predetermined intervals. The memory 13 is classified according to this transmission interval.
When a frame from a node with a short transmission interval and a frame from a node with a long transmission interval are mixed in the same class, a frame with a short transmission interval is made to wait by a frame with a long transmission interval.
In order to prevent such a problem, the memory 13 is classified according to the transmission interval. For example, class a shown in FIG. 10 stores only frames from nodes with short transmission intervals, and class n stores frames from nodes with long transmission intervals.

このようにして、送信間隔の短いフレームが、送信間隔の長いフレームによって待機させられるような不具合を防止することができる。   In this way, it is possible to prevent a problem that a frame with a short transmission interval is made to wait by a frame with a long transmission interval.

上述した実施例は本発明の好適な実施例である。但し、これに限定されるものではなく、本発明の要旨を逸脱しない範囲内において種々変形実施可能である。   The embodiment described above is a preferred embodiment of the present invention. However, the present invention is not limited to this, and various modifications can be made without departing from the scope of the present invention.

従来のフレームのコントローラバッファへのセットタイミングを示す図である。It is a figure which shows the set timing to the controller buffer of the conventional frame. ゲートウェイ制御装置の接続構成を示す図である。It is a figure which shows the connection structure of a gateway control apparatus. ゲートウェイ制御装置を車両に搭載した際の接続構成を示す図である。It is a figure which shows the connection structure at the time of mounting a gateway control apparatus in a vehicle. ゲートウェイ制御装置の構成を示すブロック図である。It is a block diagram which shows the structure of a gateway control apparatus. コントローラバッファ内のメッセージボックスの構成を示す図である。It is a figure which shows the structure of the message box in a controller buffer. フレームの構成を示す図である。It is a figure which shows the structure of a flame | frame. 従来技術の問題点を示す図である。It is a figure which shows the problem of a prior art. 送信が完了した際にコントローラから通知される完了通知信号を示す図である。It is a figure which shows the completion notification signal notified from a controller, when transmission is completed. 通信制御部の制御手順を示すフローチャートである。It is a flowchart which shows the control procedure of a communication control part. クラス分けされたメモリ13を示す図である。It is a figure which shows the memory 13 classified.

符号の説明Explanation of symbols

10 ゲートウェイ制御装置
11 コントローラA
12 コントローラB
13 メモリ
14 CPU
15 ROM
16、17 通信ドライバ
18 通信制御部
19 アプリケーション
20 バスA
21〜26 ノード
30 バスB
31〜36 ノード
10 Gateway controller 11 Controller A
12 Controller B
13 Memory 14 CPU
15 ROM
16, 17 Communication driver 18 Communication control unit 19 Application 20 Bus A
21-26 Node 30 Bus B
31-36 nodes

Claims (6)

同時に複数のノードからデータの送信要求があった場合に、データのIDに基づいて、バスへのデータの送信権が与えられるノードが決定する通信プロトコルの複数のバス間のデータ転送を制御するゲートウェイ装置であって、
前記バスを介して受信したデータを記憶する第1の記憶手段と、
前記データを前記バス上に転送する前に、前記データを記憶しておく第2の記憶手段と、
前記第2の記憶手段に記憶されたデータをバス上に出力する送信制御手段と、
前記第1の記憶手段に記憶されたデータを前記第2の記憶手段に送信セットする制御手段とを有し、
前記第2の記憶手段は複数のデータを記憶することが可能なように複数の領域に分割されており、
前記制御手段は、送信セットするデータのIDによって設定された前記第2の記憶手段の領域に当該データの記憶を行うものであり、前記送信制御手段から送信完了通知を受け取る場合、または、送信処理の基本周期ごとに前記送信制御手段に送信完了の問い合わせを行って送信完了の通知を得る場合に、前記第2の記憶手段にデータを記憶することを特徴とするゲートウェイ装置。
Gateway that controls data transfer between a plurality of buses of a communication protocol determined by a node to which a right to transmit data to the bus is given based on the data ID when there is a request for data transmission from a plurality of nodes simultaneously A device,
First storage means for storing data received via the bus;
Second storage means for storing the data before transferring the data onto the bus;
Transmission control means for outputting the data stored in the second storage means on the bus;
Control means for transmitting and storing the data stored in the first storage means to the second storage means,
The second storage means is divided into a plurality of areas so that a plurality of data can be stored,
If the control means performs the storage of the data in the area of the second storage unit set by the ID of the data to be transmitted set, that receive the transmission completion notification from the transmission control unit, or the transmission A gateway device , wherein data is stored in the second storage means when a transmission completion inquiry is made to the transmission control means for each basic period of processing to obtain a transmission completion notification .
前記第1の記憶手段は、データを複数のブロックに分類して記憶し、
前記制御手段は、データに設定された送信間隔に応じて、各ブロックに格納するデータを振り分けることを特徴とする請求項1に記載のゲートウェイ装置。
The first storage means classifies and stores data into a plurality of blocks,
The gateway device according to claim 1, wherein the control unit distributes data to be stored in each block according to a transmission interval set in the data.
前記第1の記憶手段は、データを複数のブロックに分類して記憶し、
前記制御手段は、データに設定された優先度に応じて、各ブロックに格納するデータを振り分けることを特徴とする請求項1に記載のゲートウェイ装置。
The first storage means classifies and stores data into a plurality of blocks,
The gateway device according to claim 1, wherein the control unit distributes data to be stored in each block according to a priority set in the data.
前記通信プロトコルはCANプロトコルであることを特徴とする請求項1から3のいずれか一項記載のゲートウェイ装置。The gateway device according to any one of claims 1 to 3, wherein the communication protocol is a CAN protocol. 同時に複数のノードからデータの送信要求があった場合に、データのIDに基づいて、バスへのデータの送信権が与えられるノードが決定する通信プロトコルの複数のバス間でのデータ転送を制御するデータ転送方法であって、
前記バスを介して受信したデータを第1の記憶手段に格納するステップと、
複数のデータを記憶することが可能なように複数の領域に分割されている第2の記憶手段に格納済みのデータのバスへの送信完了通知を待って、または、送信処理の基本周期ごとに送信完了の問い合わせを行うことにより得られる送信完了通知を待って、前記第1の記憶手段から、送信セットするデータのIDによって設定された前記第2の記憶手段の領域にデータを格納するステップと、
前記第2の記憶手段に格納されたデータをバス上に出力するステップと、を有することを特徴とするデータ転送方法。
When there is a data transmission request from a plurality of nodes at the same time , the data transfer between a plurality of buses of a communication protocol determined by a node to which a right to transmit data to the bus is determined is controlled based on the data ID. A data transfer method comprising:
Storing data received via the bus in a first storage means;
Wait for notification of completion of transmission to the bus of data stored in the second storage means divided into a plurality of areas so that a plurality of data can be stored, or for each basic cycle of the transmission process Waiting for a transmission completion notification obtained by inquiring transmission completion, storing data from the first storage means in the area of the second storage means set by the ID of the data to be transmitted and set ; ,
Outputting the data stored in the second storage means onto a bus.
同時に複数のノードからデータの送信要求があった場合に、データのIDに基づいて、バスへのデータの送信権が与えられるノードが決定する通信プロトコルの複数のバス間でのデータ転送を制御するデータ転送プログラムであって、
前記バスを介して受信したデータを第1の記憶手段に格納する処理と、
複数のデータを記憶することが可能なように複数の領域に分割されている第2の記憶手段に格納したデータのバスへの送信完了通知を待って、または、送信処理の基本周期ごとに送信完了の問い合わせを行うことにより得られる送信完了通知を待って、前記第1の記憶手段から、送信セットするデータのIDによって設定された前記第2の記憶手段の領域にデータを格納する処理と、
前記第2の記憶手段に格納済みのデータをバス上に出力する処理とをコンピュータに実行させることを特徴とするデータ転送プログラム。
When there is a data transmission request from a plurality of nodes at the same time , the data transfer between a plurality of buses of a communication protocol determined by a node to which a right to transmit data to the bus is determined is controlled based on the data ID. A data transfer program,
Storing data received via the bus in a first storage means;
Wait for notification of completion of transmission to the bus of data stored in the second storage means divided into a plurality of areas so that a plurality of data can be stored, or at every basic cycle of transmission processing A process of storing data from the first storage means to the area of the second storage means set by the ID of the data to be transmitted and set after waiting for a transmission completion notification obtained by inquiring completion ;
A data transfer program for causing a computer to execute a process of outputting data stored in the second storage means onto a bus.
JP2006059843A 2006-03-06 2006-03-06 Gateway device, data transfer method, and program Expired - Fee Related JP4361540B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006059843A JP4361540B2 (en) 2006-03-06 2006-03-06 Gateway device, data transfer method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006059843A JP4361540B2 (en) 2006-03-06 2006-03-06 Gateway device, data transfer method, and program

Publications (2)

Publication Number Publication Date
JP2007243322A JP2007243322A (en) 2007-09-20
JP4361540B2 true JP4361540B2 (en) 2009-11-11

Family

ID=38588446

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006059843A Expired - Fee Related JP4361540B2 (en) 2006-03-06 2006-03-06 Gateway device, data transfer method, and program

Country Status (1)

Country Link
JP (1) JP4361540B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5569185B2 (en) * 2010-06-29 2014-08-13 富士通株式会社 Semiconductor device and packet receiving method
JP5728043B2 (en) * 2013-04-01 2015-06-03 本田技研工業株式会社 Gateway device
JP5702829B2 (en) 2013-05-23 2015-04-15 本田技研工業株式会社 Relay device

Also Published As

Publication number Publication date
JP2007243322A (en) 2007-09-20

Similar Documents

Publication Publication Date Title
US9224251B2 (en) Gateway device
US8301821B2 (en) Communication module for connecting a serial bus to a plurality of system buses
WO2014057642A1 (en) Relay device
US10153825B2 (en) Vehicle-mounted control device
US10284387B2 (en) Hybrid intra-vehicle communication network
CN105388858B (en) Method of operating a communication node in a network
JP5231400B2 (en) Multiprocessor gateway
JP5672275B2 (en) Network system
JP7133022B2 (en) In-vehicle communication device and in-vehicle system
JP2006191338A (en) Gateway apparatus for diagnosing fault of device in bus
JP2006191337A (en) Gateway device for transferring message between buses and network system using the device
JP2007300331A (en) Onboard database system
JP4361540B2 (en) Gateway device, data transfer method, and program
JP2006253922A (en) Gateway apparatus and data transfer method for the gateway apparatus
JP2006340099A (en) Gateway unit
JP5728043B2 (en) Gateway device
KR101612825B1 (en) Can controller, gateway for internal vehicle communication and control method the same
JP2020022019A (en) Vehicle system
JP4754940B2 (en) Relay connection unit
JP4954832B2 (en) In-vehicle communication system
JP2009089286A (en) Relay connection unit
JP2009017154A (en) On-vehicle gateway device
JP2007036632A (en) Gateway apparatus
US20240089142A1 (en) Vehicle-mounted apparatus and a method for relaying
JP3797049B2 (en) Communication device between control nodes

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20090223

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20090414

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20090605

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

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20090812

R150 Certificate of patent or registration of utility model

Ref document number: 4361540

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20120821

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20130821

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20140821

Year of fee payment: 5

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

LAPS Cancellation because of no payment of annual fees