JP5717240B2 - Communication system and communication apparatus - Google Patents

Communication system and communication apparatus Download PDF

Info

Publication number
JP5717240B2
JP5717240B2 JP2010178681A JP2010178681A JP5717240B2 JP 5717240 B2 JP5717240 B2 JP 5717240B2 JP 2010178681 A JP2010178681 A JP 2010178681A JP 2010178681 A JP2010178681 A JP 2010178681A JP 5717240 B2 JP5717240 B2 JP 5717240B2
Authority
JP
Japan
Prior art keywords
message
communication
ecu
transmission
slot
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2010178681A
Other languages
Japanese (ja)
Other versions
JP2012039446A (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.)
Nagoya University NUC
Sumitomo Wiring Systems Ltd
AutoNetworks Technologies Ltd
Sumitomo Electric Industries Ltd
Tokai National Higher Education and Research System NUC
Original Assignee
Nagoya University NUC
Sumitomo Wiring Systems Ltd
AutoNetworks Technologies Ltd
Sumitomo Electric Industries Ltd
Tokai National Higher Education and Research System NUC
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 Nagoya University NUC, Sumitomo Wiring Systems Ltd, AutoNetworks Technologies Ltd, Sumitomo Electric Industries Ltd, Tokai National Higher Education and Research System NUC filed Critical Nagoya University NUC
Priority to JP2010178681A priority Critical patent/JP5717240B2/en
Priority to DE112011102688T priority patent/DE112011102688T5/en
Priority to PCT/JP2011/068168 priority patent/WO2012020761A1/en
Priority to US13/813,749 priority patent/US9209942B2/en
Priority to CN201180039441.7A priority patent/CN103155492B/en
Publication of JP2012039446A publication Critical patent/JP2012039446A/en
Application granted granted Critical
Publication of JP5717240B2 publication Critical patent/JP5717240B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/08Arrangements for detecting or preventing errors in the information received by repeating transmission, e.g. Verdan system
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/12Arrangements for detecting or preventing errors in the information received by using return channel
    • H04L1/16Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
    • H04L1/1607Details of the supervisory signal
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L12/407Bus networks with decentralised control
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L12/407Bus networks with decentralised control
    • H04L12/417Bus networks with decentralised control with deterministic access, e.g. token passing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/004Arrangements for detecting or preventing errors in the information received by using forward error control
    • H04L1/0056Systems characterized by the type of code used
    • H04L1/0061Error detection codes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/12Arrangements for detecting or preventing errors in the information received by using return channel
    • H04L1/16Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
    • H04L1/18Automatic repetition systems, e.g. Van Duuren systems
    • H04L1/1867Arrangements specially adapted for the transmitter end
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L2001/0092Error control systems characterised by the topology of the transmission link
    • H04L2001/0094Bus

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Small-Scale Networks (AREA)

Description

本発明は、車輌に搭載されたECU(Electronic Control Unit)などの複数の通信装置が、共通の通信線(バス)を介してデータの送受信を行う通信システム及び通信装置に関する。   The present invention relates to a communication system and a communication device in which a plurality of communication devices such as an ECU (Electronic Control Unit) mounted on a vehicle transmit and receive data via a common communication line (bus).

従来、車輌には複数の電子機器が搭載されて種々の処理を行っている。これらの電子機器の動作を制御するために車輌には複数のECUが搭載されている。また、複数のECUを協調して動作させるために、各ECUをネットワークを介して相互に接続し、データの送受信を行って複数のECUが情報を共有することが行われており、この場合に通信規約としてCAN(Controller Area Network)(非特許文献1、非特許文献2参照)が広く採用されている。   Conventionally, a vehicle is equipped with a plurality of electronic devices to perform various processes. A plurality of ECUs are mounted on the vehicle to control the operation of these electronic devices. In order to operate a plurality of ECUs in a coordinated manner, each ECU is connected to each other via a network, and data is transmitted and received so that the plurality of ECUs share information. CAN (Controller Area Network) (see Non-Patent Document 1 and Non-Patent Document 2) is widely adopted as a communication protocol.

CANの規約では、作動信号を伝送するツイストペアケーブルからなるバスに複数のECUが接続され、各ECUは作動信号によって表されるデジタルデータを送受信する。また、CANはシリアル通信のプロトコルであり、CANバスに接続されている複数のECUのうちの一のECUのみがデータを送信することができ、他のECUは一のECUがデータの送信を終了するまで待機するように制御される。また、複数のECUが同時的にデータの送信を行った場合には、データに付されたIDを基に調停が行われ、優先度の高いデータの送信を行うように制御される。   Under the CAN convention, a plurality of ECUs are connected to a bus composed of a twisted pair cable that transmits an operation signal, and each ECU transmits and receives digital data represented by the operation signal. CAN is a protocol for serial communication, and only one ECU of a plurality of ECUs connected to the CAN bus can transmit data, and the other ECU terminates data transmission by one ECU. It is controlled to wait until it does. Further, when a plurality of ECUs transmit data simultaneously, arbitration is performed based on the ID attached to the data, and control is performed to transmit data with high priority.

ISO 11898−1:2003 Road vehicles--Controller area network(CAN)--Part1:Data link layer and physical signalingISO 11898-1: 2003 Road vehicles--Controller area network (CAN)-Part 1: Data link layer and physical signaling ISO 11519−1:1994 Road vehicles--Low-speed serial data communication--Part1:General and definitionsISO 11519-1: 1994 Road vehicles--Low-speed serial data communication--Part1: General and definitions

近年では、車輌にて行われる電子制御の高機能化に伴って、車輌に搭載されるECUが高機能化されると共に、搭載数が増加しており、ECU間で送受信されるデータ量及び送受信の発生頻度が増大している。このため従来のCANのプロトコルに従う通信システムの通信速度(1Mbps程度)では、送受信できるデータ量が十分とはいえず、現状の車載の通信システムは通信容量の限界に達しつつある。   In recent years, along with the enhancement of electronic control performed in vehicles, the number of ECUs mounted on vehicles has increased, and the number of mounted ECUs has increased. The frequency of occurrence is increasing. For this reason, at the communication speed (about 1 Mbps) of the communication system according to the conventional CAN protocol, the amount of data that can be transmitted and received is not sufficient, and the current in-vehicle communication system is reaching the limit of the communication capacity.

これに対して、通信速度の高速化を実現する通信プロトコルとしてFlexRayなどのプロトコルが提案されている。このような別のプロトコルを採用することで通信速度の高速化が実現できるが、既存の通信システム全体をCANプロトコルから別のプロトコルへ変更することは、装置の開発コスト及びシステムの信頼性等の面で負担が大きい。   On the other hand, a protocol such as FlexRay has been proposed as a communication protocol for realizing an increase in communication speed. By adopting such another protocol, it is possible to increase the communication speed. However, changing the entire existing communication system from the CAN protocol to another protocol can reduce the development cost of the device and the reliability of the system. The burden is large.

そこで、従来のCANによる通信システムに対して、高速通信が要求される箇所から徐々にCANと互換性のある高速な上位プロトコルへ変更していくことができる仕組みを作ることが求められ、これにより上記の開発コスト及び信頼性等に係る問題をできるだけ取り除くことが可能となる。   Therefore, it is required to create a mechanism that allows a conventional CAN communication system to be gradually changed from a place where high-speed communication is required to a high-order protocol compatible with CAN. It becomes possible to eliminate the problems related to the development cost and reliability as much as possible.

従来のCANプロトコルにおいて通信速度の向上を制限していた要因には、複数のECUが同時的にデータを送信した場合に行われる調停処理(アービトレーション)に必要な処理時間が挙げられる。例えばアービトレーションを行うためには、各通信装置は、バスに対して自らの送信データに係る信号を出力した後、他の通信装置が出力する信号との衝突によるバス上の信号の変化の有無を検出するが、他の通信装置が出力する信号の伝搬遅延などを考慮して、ある程度の待機時間後に信号検出を行う必要ある。このときの待機時間が通信速度向上の妨げとなる。   Factors that limit the improvement in communication speed in the conventional CAN protocol include a processing time required for arbitration performed when a plurality of ECUs transmit data simultaneously. For example, in order to perform arbitration, each communication device outputs a signal related to its transmission data to the bus and then checks whether there is a change in the signal on the bus due to a collision with a signal output by another communication device. Although it is detected, it is necessary to detect the signal after a certain waiting time in consideration of a propagation delay of a signal output from another communication apparatus. The waiting time at this time hinders improvement in communication speed.

本発明は、斯かる事情に鑑みてなされたものであって、その目的とするところは、CANのプロトコルをベースに、アービトレーションの処理時間などの速度向上に係る制限要因を解消して、バスに接続された複数の通信装置が行うデータの送受信を高速化することができる通信システム及び通信装置を提供することにある。   The present invention has been made in view of such circumstances, and the object of the present invention is to eliminate the limiting factors related to speed improvement such as arbitration processing time based on the CAN protocol, and to the bus. An object of the present invention is to provide a communication system and a communication device that can speed up data transmission / reception performed by a plurality of connected communication devices.

本発明に係る通信システムは、3つ以上の通信装置が共通の通信線で接続され、一の通信装置が送信したメッセージを他の複数の通信装置が受信する通信システムにおいて、各通信装置に対して一又は複数の送信権利が予め割り当てられ、該送信権利毎に定められた順序で前記3つ以上の通信装置が巡回的にメッセージの送信を行うようにしてあり、前記通信装置は、各送信権利に係るメッセージ受信の成否をそれぞれ示す複数の受信成否情報、及び、他の通信装置へ送信すべきデータを含むメッセージを生成して送信するメッセージ送信手段と、他の通信装置から受信したメッセージに含まれる受信成否情報に応じてメッセージの再送信を行うメッセージ再送信手段と、起動後の所定サイクルに亘ってメッセージの送信を行わず、前記所定サイクルの間に他の通信装置からメッセージを受信した場合には該メッセージに同期して以降のメッセージ送信を行い、前記所定サイクルの間に他の通信装置からメッセージを受信しない場合にはメッセージ送信を行って、他の通信装置とのメッセージ送受信を開始する通信開始手段とを有することを特徴とする。 The communication system according to the present invention is a communication system in which three or more communication devices are connected by a common communication line, and a plurality of communication devices receive a message transmitted by one communication device. One or a plurality of transmission rights are pre-assigned, and the three or more communication devices cyclically transmit messages in the order determined for each transmission right. A message transmission means for generating and transmitting a message including a plurality of reception success / failure information each indicating success / failure of message reception related to the right and data to be transmitted to another communication device; and a message received from the other communication device. and message retransmission means for re-transmitting the message according to the reception success or failure information included, without sending the message over a predetermined cycle after startup, the predetermined If a message is received from another communication device during the cycle, the subsequent message transmission is performed in synchronization with the message. If no message is received from the other communication device during the predetermined cycle, message transmission is performed. And communication start means for starting message transmission / reception with another communication device .

また、本発明に係る通信システムは、前記通信装置が、メッセージ送信までの待機時間を計時する計時手段を有し、前記通信装置の通信開始手段は、メッセージ送信を行った場合又は前記所定サイクルの間に他の通信装置から異常なメッセージを受信した場合に、割
り当てられた送信権利に応じた待機時間を前記計時手段にて計時した後、メッセージの送信を行うようにしてあり、複数の前記通信装置が、前記計時手段にてそれぞれ異なる待機時間を計時するようにしてあることを特徴とする。
In the communication system according to the present invention, the communication device has time measuring means for measuring a waiting time until message transmission, and the communication start means of the communication device performs the message transmission or the predetermined cycle. If an abnormal message is received from another communication device during
After the waiting time corresponding to the assigned transmission right is timed by the time measuring means, the message is transmitted, and the plurality of communication devices time different waiting times by the time measuring means. It is characterized by the above.

また、本発明に係る通信システムは、3つ以上の通信装置が共通の通信線で接続され、一の通信装置が送信したメッセージを他の複数の通信装置が受信する通信システムにおいて、各通信装置に対して一又は複数の送信権利が予め割り当てられ、該送信権利毎に定められた順序で前記3つ以上の通信装置が巡回的にメッセージの送信を行うようにしてあり、前記通信装置は、各送信権利に係るメッセージ受信の成否をそれぞれ示す複数の受信成否情報、及び、他の通信装置へ送信すべきデータを含むメッセージを生成して送信するメッセージ送信手段と、他の通信装置から受信したメッセージに含まれる受信成否情報に応じてメッセージの再送信を行うメッセージ再送信手段と、メッセージ送信までの待機時間を計時する計時手段と、所定サイクルの間に他の通信装置からメッセージを受信しない場合に、割り当てられた送信権利に応じた待機時間を前記計時手段にて計時した後、メッセージ送信を再開する通信再開手段とを有し、複数の前記通信装置が、前記計時手段にてそれぞれ異なる待機時間を計時するようにしてあることを特徴とする。 The communication system according to the present invention includes a communication system in which three or more communication devices are connected by a common communication line, and a plurality of communication devices receive a message transmitted by one communication device. One or a plurality of transmission rights are pre-assigned to the three, the three or more communication devices cyclically transmit messages in the order determined for each transmission right, A plurality of reception success / failure information indicating success / failure of message reception related to each transmission right, and message transmission means for generating and transmitting a message including data to be transmitted to another communication device, received from another communication device A message resending means for resending the message in accordance with the reception success / failure information included in the message; a timing means for timing a waiting time until the message is sent; A communication resumption means for resuming message transmission after measuring the waiting time according to the assigned transmission right when the message is not received from another communication device during the cycle, The communication device is configured to time different waiting times by the time measuring means.

また、本発明に係る通信システムは、3つ以上の通信装置が共通の通信線で接続され、一の通信装置が送信したメッセージを他の複数の通信装置が受信する通信システムにおいて、各通信装置に対して一又は複数の送信権利が予め割り当てられ、該送信権利毎に定められた順序で前記3つ以上の通信装置が巡回的にメッセージの送信を行うようにしてあり、前記通信装置は、各送信権利に係るメッセージ受信の成否をそれぞれ示す複数の受信成否情報、及び、他の通信装置へ送信すべきデータを含むメッセージを生成して送信するメッセージ送信手段と、他の通信装置から受信したメッセージに含まれる受信成否情報に応じてメッセージの再送信を行うメッセージ再送信手段と、メッセージ送信の停止を要求するメッセージを送信する通信停止要求送信手段と、他の通信装置から通信処理の停止を要求するメッセージを受信する通信停止要求受信手段と、所定サイクルに亘って、複数の他の通信装置から前記通信停止要求受信手段が通信処理の停止を要求するメッセージを受信した場合に、メッセージ送信を停止する通信停止制御手段とを有することを特徴とする。 The communication system according to the present invention includes a communication system in which three or more communication devices are connected by a common communication line, and a plurality of communication devices receive a message transmitted by one communication device. One or a plurality of transmission rights are pre-assigned to the three, the three or more communication devices cyclically transmit messages in the order determined for each transmission right, A plurality of reception success / failure information indicating success / failure of message reception related to each transmission right, and message transmission means for generating and transmitting a message including data to be transmitted to another communication device, received from another communication device Message resending means for resending the message according to the reception success / failure information included in the message, and a communication stop for sending the message requesting to stop the message transmission. Stop request transmitting means, communication stop request receiving means for receiving a message requesting stop of communication processing from another communication device, and communication stop request receiving means from a plurality of other communication devices over a predetermined cycle. And a communication stop control means for stopping message transmission when a message requesting to stop processing is received.

また、本発明に係る通信システムは、前記通信装置のメッセージ送信手段が、自らの一の送信権利に係る前回のメッセージ送信から今回のメッセージ送信までの1サイクル間に送信される他の送信権利に係るメッセージの受信の成否を、前記受信成否情報として送信するメッセージに含ませるようにしてあることを特徴とする。 Further, in the communication system according to the present invention, the message transmission means of the communication device may set other transmission right to be transmitted in one cycle from the previous message transmission related to the one transmission right to the current message transmission. The success or failure of receiving the message is included in the message to be transmitted as the reception success / failure information.

また、本発明に係る通信システムは、各通信装置が、一の通信権利に係るメッセージの送信が所定時間に亘って行われない場合、次の通信権利に係るメッセージの送信又は受信を行うようにしてあることを特徴とする。 In addition, the communication system according to the present invention is configured so that each communication device transmits or receives a message related to the next communication right when the message related to one communication right is not transmitted for a predetermined time. It is characterized by being.

また、本発明に係る通信システムは、前記通信装置のメッセージ送信手段は、送信権利を識別するための識別情報を含むメッセージを生成して送信するようにしてあり、各通信装置は、受信したメッセージの前記識別情報に基づいて、メッセージ送受信の同期を行うようにしてあることを特徴とする。 In the communication system according to the present invention, the message transmission unit of the communication device generates and transmits a message including identification information for identifying the transmission right, and each communication device receives the received message. The message transmission / reception synchronization is performed based on the identification information.

また、本発明に係る通信システムは、前記通信装置のメッセージ送信手段は、前記識別情報の誤りを検出又は訂正するための情報を含むメッセージを生成して送信するようにしてあることを特徴とする。 In the communication system according to the present invention, the message transmission means of the communication device generates and transmits a message including information for detecting or correcting an error in the identification information. .

また、本発明に係る通信システムは、前記通信装置は、メッセージの送受信に係るエラーの発生数を計数するエラーカウンタを有し、前記通信装置のメッセージ送信手段は、前記エラーカウンタが計数したエラー発生数が所定値を超えた場合に、メッセージ送信の頻度を低減するようにしてあることを特徴とする。 In the communication system according to the present invention, the communication device includes an error counter that counts the number of error occurrences related to message transmission / reception, and the message transmission unit of the communication device generates an error occurrence counted by the error counter. When the number exceeds a predetermined value, the frequency of message transmission is reduced.

また、本発明に係る通信装置は、共通の通信線を介して2つ以上の他の装置との間でメッセージの送受信を行う通信装置において、一又は複数の送信権利が予め割り当てられており、他の装置に割り当てられた送信権利を含む各送信権利に係るメッセージ受信の成否をそれぞれ示す複数の受信成否情報、及び、他の装置へ送信すべきデータを含むメッセージを生成して送信するメッセージ送信手段と、他の装置から受信したメッセージに含まれる受信成否情報に応じてメッセージの再送信を行うメッセージ再送信手段と、起動後の所定サイクルに亘ってメッセージの送信を行わず、前記所定サイクルの間に他の装置からメ
ッセージを受信した場合には該メッセージに同期して以降のメッセージ送信を行い、前記所定サイクルの間に他の装置からメッセージを受信しない場合にはメッセージ送信を行って、他の装置とのメッセージ送受信を開始する通信開始手段とを備え、前記メッセージ送信手段及び前記メッセージ再送信手段は、割り当てられた送信権利に定められた順序で、前記他の装置との間で巡回的にメッセージの送信を行うようにしてあることを特徴とする。
In the communication device according to the present invention , one or a plurality of transmission rights are assigned in advance in a communication device that transmits and receives messages to and from two or more other devices via a common communication line. Message transmission for generating and transmitting a message including a plurality of pieces of reception success / failure information indicating success / failure of message reception related to each transmission right including transmission right assigned to another device and data to be transmitted to the other device Means, a message retransmission means for retransmitting a message in accordance with reception success / failure information included in a message received from another device, and no message transmission over a predetermined cycle after activation. Between other devices
When a message is received, subsequent message transmission is performed in synchronization with the message, and when no message is received from another device during the predetermined cycle, message transmission is performed and message transmission / reception with the other device is performed. The message transmission means and the message retransmission means cyclically transmit messages to and from the other devices in the order determined by the assigned transmission right. It is characterized by the above.

また、本発明に係る通信装置は、共通の通信線を介して2つ以上の他の装置との間でメッセージの送受信を行う通信装置において、一又は複数の送信権利が予め割り当てられており、他の装置に割り当てられた送信権利を含む各送信権利に係るメッセージ受信の成否をそれぞれ示す複数の受信成否情報、及び、他の装置へ送信すべきデータを含むメッセージを生成して送信するメッセージ送信手段と、他の装置から受信したメッセージに含まれる受信成否情報に応じてメッセージの再送信を行うメッセージ再送信手段と、メッセージ送信の停止を要求するメッセージを送信する通信停止要求送信手段と、他の装置から通信処理の停止を要求するメッセージを受信する通信停止要求受信手段と、所定サイクルに亘って、複数の他の装置から前記通信停止要求受信手段が通信処理の停止を要求するメッセージを受信した場合に、メッセージ送信を停止する通信停止制御手段とを備え、前記メッセージ送信手段及び前記メッセージ再送信手段は、割り当てられた送信権利に定められた順序で、前記他の装置との間で巡回的にメッセージの送信を行うようにしてあることを特徴とする。 In the communication device according to the present invention, one or a plurality of transmission rights are assigned in advance in a communication device that transmits and receives messages to and from two or more other devices via a common communication line. Message transmission for generating and transmitting a message including a plurality of pieces of reception success / failure information indicating success / failure of message reception related to each transmission right including transmission right assigned to another device and data to be transmitted to the other device Means, a message resending means for resending a message according to reception success / failure information included in a message received from another device, a communication stop request sending means for sending a message requesting to stop the message sending, and others Communication stop request receiving means for receiving a message for requesting stop of communication processing from the device, and a plurality of other devices over a predetermined cycle If the signal stop request receiving means receives a message requesting the stop of the communication processing, and a communication stop control means for stopping message transmission, the message transmission means and said message retransmission means, allocated transmission rights The messages are transmitted cyclically with the other devices in the order determined in (1).

本発明においては、複数の通信装置が共通の通信線(バス)で接続されたネットワーク構成において、各通信装置に予め一又は複数の送信権利(以下、スロットという)を割り当て、各通信装置が自らのスロットにて予め定められた順序で巡回的にメッセージの送信を行う構成とする。これにより、複数の通信装置が予め定められた順序でバスを時分割に利用してデータの送信を行う構成となるため、従来のCANプロトコルのように複数の通信装置が同時的にデータ送信を行うことがなく、アービトレーションを行う必要がない。よって、アービトレーションに要する時間の制約がなくなり、通信速度を高速化することが可能となる。
また各通信装置は、一のスロットに係るメッセージ送信を行う場合に、他のスロットに係るメッセージ受信の成否をそれぞれ示す複数の受信成否情報と、他の通信装置へ送信すべきデータとを含むメッセージを作成して送信する。なお他の通信装置へ送信すべきデータがない場合には、受信成否情報を含んでデータを含まないメッセージを作成して送信してもよい。受信成否情報及びデータを含むメッセージを送信する構成とすることによって、各通信装置は、自らに与えられたスロットを有効に活用して他の通信装置へメッセージ受信の成否を知らせることができ、且つ、自らが有するデータを他の通信装置へ与えることができる。
一の通信装置が送信したメッセージは、バスに接続された他の全ての通信装置にて受信される。メッセージを受信した各通信装置は、メッセージに含まれるデータを取得することができると共に、メッセージに含まれる受信成否情報から以前に自らが送信したメッセージが正しく受信されたか否かを判断することができる。よって各通信装置は、一のスロットに係る前回のメッセージ送信からこのスロットに係る次のメッセージ送信までの間の1サイクル間に受信したメッセージに含まれる受信成否情報を調べ、前回に送信したメッセージが正しく受信されていない場合には、同一スロットに係る次の送信の機会が与えられた際にメッセージの再送信を行うことができる。
これにより、従来のCANプロトコルのようなアービトレーションを行うことなく、メッセージ送信を衝突させることなく複数の通信装置が効率よくメッセージ送信を巡回的に行うことができ、何らかの不具合によってメッセージが正しく受信されなかった場合であっても確実にメッセージを再送信することができる。
In the present invention, in a network configuration in which a plurality of communication devices are connected by a common communication line (bus), one or more transmission rights (hereinafter referred to as slots) are assigned in advance to each communication device, and each communication device itself In this slot, messages are transmitted cyclically in a predetermined order. As a result, a plurality of communication devices use a bus in a time-sharing manner in a predetermined order to transmit data, so that a plurality of communication devices can transmit data simultaneously as in the conventional CAN protocol. There is no need to do arbitration. Therefore, there is no restriction on the time required for arbitration, and the communication speed can be increased.
In addition, when each communication device performs message transmission related to one slot, the message includes a plurality of reception success / failure information indicating success / failure of message reception related to other slots and data to be transmitted to other communication devices. Create and send. If there is no data to be transmitted to another communication device, a message including reception success / failure information and no data may be created and transmitted. By adopting a configuration for transmitting a message including reception success / failure information and data, each communication device can effectively utilize the slot given to itself to notify other communication devices of the success or failure of message reception, and , It is possible to give the data it has to other communication devices.
A message transmitted by one communication device is received by all other communication devices connected to the bus. Each communication device that has received the message can acquire the data included in the message, and can determine whether or not the message transmitted by itself has been correctly received from the reception success / failure information included in the message. . Therefore, each communication device checks the reception success / failure information included in the message received during one cycle from the previous message transmission related to one slot to the next message transmission related to this slot, and the message transmitted last time is If not correctly received, the message can be retransmitted when the next transmission opportunity for the same slot is given.
As a result, a plurality of communication devices can efficiently and efficiently perform message transmission without performing arbitration as in the conventional CAN protocol, and without causing message transmission to collide. Even if it is a case, the message can be reliably retransmitted.

また、本発明においては、各通信装置が作成するメッセージには、一の送信権利に係る前回のメッセージ送信から今回のメッセージ送信までの1サイクル間に送受信される他のスロットに係るメッセージ受信の成否を受信成否情報として含ませる。即ち、通信システム中のスロット総数分の受信成否情報が1サイクル分の情報としてメッセージに含まれる(ただし、自らのスロットについての受信成否情報については省略することもでき、この場合にはスロットの総数−1の情報がメッセージに含まれる)。このように1サイクル分の受信成否情報を各通信装置が送信し、他の通信装置から送信された受信成否情報を1サイクル間受信することによって、各通信装置は、バスを共有する他の全ての通信装置にて自らの送信メッセージが正しく受信されたか否かを知ることができる。   In the present invention, the message created by each communication device includes success / failure of message reception related to other slots transmitted / received in one cycle from the previous message transmission related to one transmission right to the current message transmission. Is included as reception success / failure information. That is, reception success / failure information for the total number of slots in the communication system is included in the message as information for one cycle (however, reception success / failure information for its own slot can be omitted. In this case, the total number of slots -1 information is included in the message). In this way, each communication device transmits the reception success / failure information for one cycle and receives the reception success / failure information transmitted from the other communication devices for one cycle. It is possible to know whether or not the own transmission message is correctly received by the communication device.

また、本発明においては、一のスロットに係るメッセージの送信順に至った後、このスロットに係るメッセージ送信がなされない場合、このスロットが割り当てられた通信装置の処理が何らかの理由(例えば故障などの不具合又はスリープモード等)によって停止していることが推定される。そこで各通信装置は、一のスロットに係るメッセージ送信が所定時間に亘って行われない場合、このスロットに係るメッセージ送受信の処理を省略して、次のスロットに係るメッセージ送受信の処理を行う。これにより、メッセージの送受信が行われない期間を可能な限り短くすることができ、通信速度の高速化に寄与することができる。また通信システムにオプション装備を追加するためなどで予備のスロットを設けた場合であっても、オプション装備が追加されていない状態では予備のスロットに係る処理を省略することができる。   Further, in the present invention, if the message transmission related to this slot is not performed after reaching the transmission order of the message related to one slot, the processing of the communication device to which this slot is allocated is for some reason (for example, trouble such as failure) Alternatively, it is estimated that the operation is stopped by a sleep mode or the like. Therefore, when message transmission related to one slot is not performed for a predetermined time, each communication apparatus omits message transmission / reception processing related to this slot and performs message transmission / reception processing related to the next slot. As a result, the period during which no message is transmitted / received can be shortened as much as possible, which contributes to an increase in communication speed. Even when a spare slot is provided to add optional equipment to the communication system, the processing related to the spare slot can be omitted when the optional equipment is not added.

また、本発明においては、各通信装置が作成するメッセージには、スロットを識別するための識別情報(例えばスロット番号)を含める。本通信システムに参加する複数の通信装置は、バスを時分割で共用するために、バスを使用中のスロットがいずれであるかを把握し、同期してメッセージ送信を行う必要がある。そこで各通信装置は、受信したメッセージに含まれるスロット番号の受信タイミングに合わせて、メッセージ送受信に係る処理の同期を行う。これにより複数の通信装置が同期して処理を行うことができ、確実にメッセージ送受信を行うことができる。   In the present invention, identification information (for example, slot number) for identifying a slot is included in a message created by each communication device. In order to share the bus in a time-sharing manner, a plurality of communication devices participating in the communication system need to grasp which slot is using the bus and perform message transmission in synchronization. Therefore, each communication device synchronizes processing related to message transmission / reception in accordance with the reception timing of the slot number included in the received message. As a result, a plurality of communication devices can perform processing synchronously, and message transmission / reception can be reliably performed.

また、本発明においては、各通信装置が作成するメッセージには、スロット番号などの識別情報と共に、この識別情報の誤り検出又は訂正を行うための情報を含む。従来のCANプロトコルにおいても、メッセージ全体の誤り検出のための情報(CRC(Cyclic Redundancy Check)シーケンス)がメッセージに含まれていたが、これとは別にスロット番号などのみの誤り検出又は訂正のための情報をメッセージに含める。本通信システムでは、バスを時分割で利用して複数の通信装置が巡回的にメッセージ送信を行うために、送信されたメッセージがいずれのスロットに係るものであるかを判断することは重要な処理であり、この判断に用いることができるスロット番号などの識別情報に誤りが発生すると、メッセージの送信順序などに破綻をきたす虞がある。よって、識別情報の誤り検出又は訂正のための情報をメッセージに含むことで、巡回的なメッセージの送受信を確実に行うことが可能となる。またメッセージ全体で誤りを検出した場合であっても、誤りが識別情報にて生じたか否かを判断できるため、その後のメッセージ再送信に係る処理などを容易に行うことができる。   In the present invention, the message created by each communication device includes identification information such as a slot number and information for performing error detection or correction of the identification information. In the conventional CAN protocol, information (CRC (Cyclic Redundancy Check) sequence) for error detection of the entire message is included in the message, but apart from this, error detection or correction only for the slot number or the like is included. Include information in the message. In this communication system, since a plurality of communication devices perform message transmission cyclically using the bus in time division, it is important to determine which slot the transmitted message belongs to. If an error occurs in identification information such as a slot number that can be used for this determination, there is a risk that the message transmission order may be broken. Therefore, by including information for error detection or correction of identification information in a message, it is possible to reliably perform cyclic message transmission / reception. Even when an error is detected in the entire message, it can be determined whether or not the error has occurred in the identification information, so that the processing related to the subsequent message retransmission can be easily performed.

また、本発明においては、メッセージ送受信の際に発生したエラーの数を各通信装置がエラーカウンタにてカウントする。エラーの発生数が多い場合には、通信装置の故障などが生じている虞があるため、カウントしたエラーの発生数が所定値を超えた場合に、通信装置はメッセージ送信の頻度を低減する。メッセージ送信の頻度低減は、例えば巡回的に与えられる自らの送信順に至った場合であっても、数サイクルに1度のみメッセージの送信を行うなどの方法で実現できる。更に、メッセージ送信の頻度を低減した後にもエラーが発生し、エラーカウンタの値が上限値を超えた場合には、通信装置のメッセージ送信を停止してもよい。
このように、エラー発生数に応じたメッセージ送信の制御を行うことによって、故障などが生じた通信装置が送信するメッセージが他の通信装置の処理に悪影響を与えることを防止することができ、通信システムの信頼性を向上できる。
Also, in the present invention, each communication device counts the number of errors that occurred during message transmission / reception with an error counter. If the number of error occurrences is large, there may be a failure of the communication device. Therefore, when the counted number of error occurrences exceeds a predetermined value, the communication device reduces the frequency of message transmission. The reduction in the frequency of message transmission can be realized by a method of transmitting a message only once every several cycles, for example, even when the transmission order is given cyclically. Further, if an error occurs even after the frequency of message transmission is reduced and the value of the error counter exceeds the upper limit value, the message transmission of the communication device may be stopped.
In this way, by controlling the message transmission according to the number of error occurrences, it is possible to prevent a message transmitted by a communication device in which a failure or the like has occurred from adversely affecting the processing of other communication devices. The reliability of the system can be improved.

また、本発明においては、バスを共有する複数の通信装置は処理(特に、スロットに係る処理)を同期させて行う必要がある。電源投入又はスリープ状態からの復帰等によって通信システムが起動された直後は、複数の通信装置は同期がとれていない状態であるため、各通信装置は、まず起動後に他の通信装置との同期を確立した後、通信処理を開始する。
このときに各通信装置は、起動直後の所定サイクルの間は他の通信装置からのメッセージ受信に徹し、所定サイクルの間にメッセージを受信した場合には、既に通信を開始した他の通信装置が存在すると判断できるため、この通信装置に同期すべく、受信メッセージに同期して以降のメッセージ送信を行い、通信処理を開始する。所定サイクルの間にメッセージを受信しない場合には、既に通信を開始した他の通信装置が存在しないと判断できるため、自らがメッセージ送信を行って通信処理を開始する。
これにより、通信システムの起動後に複数の通信装置が同期して通信処理を開始することができる。
In the present invention, a plurality of communication devices sharing a bus need to synchronize processing (particularly processing related to slots). Immediately after the communication system is activated by turning on the power or returning from the sleep state, etc., the plurality of communication devices are not synchronized, so each communication device first synchronizes with other communication devices after activation. After establishment, communication processing is started.
At this time, each communication device is devoted to receiving messages from other communication devices during a predetermined cycle immediately after activation, and when a message is received during a predetermined cycle, other communication devices that have already started communication Since it can be determined that the message exists, the subsequent message transmission is performed in synchronization with the received message in order to synchronize with the communication device, and the communication process is started. If a message is not received during a predetermined cycle, it can be determined that there is no other communication device that has already started communication, so that it sends a message and starts communication processing.
As a result, a plurality of communication devices can start communication processing synchronously after the communication system is activated.

ただし、所定サイクルの間にメッセージを受信していないと判断して複数の通信装置が同時的にメッセージ送信を開始する可能性があり、このような場合にはバス上で複数のメッセージが衝突し、他の通信装置は正常なメッセージを受信することができない。そこで本発明においては、各通信装置が計時手段を有し、メッセージ送信を行った場合又は異常なメッセージを受信した場合に、自らに割り当てられたスロットに応じた待機時間を計時手段によって計時した後、メッセージの送信を行う。
各通信装置に割り当てられたスロットに応じた待機時間とすることにより、通信システムの複数の通信装置はそれぞれ異なる時間を計時手段により計時することとなる。よって、メッセージの衝突が発生した後、最も短い待機時間が設定された通信装置が次のメッセージ送信を単独で行うこととなり、他の通信装置はこのメッセージを正常に受信して同期することができる。
However, it may be determined that a message has not been received during a predetermined cycle, and a plurality of communication devices may start message transmission simultaneously. In such a case, a plurality of messages collide on the bus. Other communication devices cannot receive normal messages. Therefore, in the present invention, after each communication device has a time measuring means, and when a message is transmitted or an abnormal message is received, the time waiting means according to the slot assigned to itself is timed by the time measuring means. , Send a message.
By setting the standby time according to the slot assigned to each communication device, the plurality of communication devices of the communication system time each different time by the time measuring means. Therefore, after a message collision occurs, the communication device set with the shortest standby time performs the next message transmission alone, and other communication devices can normally receive and synchronize with this message. .

また、通信システムが起動されて通信装置間の同期が確立した後、通信の不具合などによって一又は複数の通信装置に同期のズレが生じる可能性がある。そこで本発明においては、各通信装置が計時手段を有し、2サイクルなどの所定サイクルに亘って他の通信装置からメッセージを受信しない場合に、自らに割り当てられたスロットに応じた待機時間を計時手段によって計時した後、メッセージの送信を行う。
各通信装置に割り当てられたスロットに応じた待機時間とすることにより、通信システムの複数の通信装置はそれぞれ異なる時間を計時手段により計時することとなる。よって、同期にズレが生じることによって複数の通信装置が送信するメッセージが衝突し、各通信装置が他の通信装置からのメッセージを受信しない状態となった場合であっても、最も短い待機時間が設定された通信装置が次のメッセージ送信を単独で行うこととなり、他の通信装置はこのメッセージを正常に受信して同期することができる。
In addition, after the communication system is activated and synchronization between communication apparatuses is established, there is a possibility that a synchronization shift may occur in one or a plurality of communication apparatuses due to a communication failure or the like. Therefore, in the present invention, when each communication device has a time measuring unit and does not receive a message from another communication device over a predetermined cycle such as two cycles, the standby time corresponding to the slot assigned to itself is counted. After timing by means, the message is transmitted.
By setting the standby time according to the slot assigned to each communication device, the plurality of communication devices of the communication system time each different time by the time measuring means. Therefore, even when the messages transmitted by a plurality of communication devices collide due to a shift in synchronization and each communication device does not receive a message from another communication device, the shortest waiting time is reached. The set communication device performs the next message transmission alone, and other communication devices can normally receive and synchronize with this message.

また、本発明においては、通信システムがスリープモードなどの省電力動作状態へ移行する場合、各通信装置は、メッセージ送信を停止する要求(スリープ要求)を他の通信装置へ送信すると共に、他の通信装置からのスリープ要求を受信する。その後、所定サイクルに亘って、通信システム内の複数の通信装置からスリープ要求を受信した場合に、各通信装置はメッセージの送信を停止してスリープモードへ遷移する。これにより、通信システム中の複数の通信装置がスリープモードへの移行準備を整えた後、これら複数の通信装置が揃ってスリープモードへ移行することができる。   Further, in the present invention, when the communication system shifts to a power saving operation state such as a sleep mode, each communication apparatus transmits a request to stop message transmission (sleep request) to another communication apparatus, A sleep request is received from the communication device. Thereafter, when a sleep request is received from a plurality of communication devices in the communication system over a predetermined cycle, each communication device stops message transmission and transitions to the sleep mode. As a result, after a plurality of communication devices in the communication system are prepared for the transition to the sleep mode, the plurality of communication devices can be aligned and shift to the sleep mode.

本発明による場合は、バスに接続された複数の通信装置にスロットを割り当て、各通信装置が予め定められた順序で巡回的にメッセージ送信を行い、一のスロットに係るメッセージ送信を行う場合には、他のスロットに係るメッセージ受信の成否を示す受信成否情報、及び、他の通信装置へ送信すべきデータを含むメッセージを作成して送信し、メッセージを受信した場合には、このメッセージに含まれる受信成否情報に応じた再送信処理を行う構成とすることにより、従来のCANプロトコルのアービトレーションを行う必要がなくなるため、バス接続された複数の通信機器間の通信速度を高速化することができる。   In the case of the present invention, when a slot is allocated to a plurality of communication devices connected to the bus, each communication device cyclically transmits a message in a predetermined order, and the message transmission related to one slot is performed. When a message including reception success / failure information indicating success / failure of message reception related to another slot and data to be transmitted to another communication device is created and transmitted, and the message is received, it is included in this message By adopting a configuration in which retransmission processing is performed according to reception success / failure information, it is not necessary to perform arbitration of the conventional CAN protocol, so that the communication speed between a plurality of bus-connected communication devices can be increased.

本発明に係る通信システム及び通信装置のハードウェア構成を示すブロック図である。It is a block diagram which shows the hardware constitutions of the communication system and communication apparatus which concern on this invention. 本発明に係る通信装置の機能構成を示すブロック図である。It is a block diagram which shows the function structure of the communication apparatus which concerns on this invention. 本発明に係る通信システムの通信プロトコルの概要を説明するための模式図である。It is a schematic diagram for demonstrating the outline | summary of the communication protocol of the communication system which concerns on this invention. 本発明に係る通信システムの通信プロトコルで用いるメッセージの構成を示す模式図である。It is a schematic diagram which shows the structure of the message used with the communication protocol of the communication system which concerns on this invention. 本発明に係る通信システムが行う応答処理を説明するための模式図である。It is a schematic diagram for demonstrating the response process which the communication system which concerns on this invention performs. 本発明に係る通信システムが行う応答処理を説明するための模式図である。It is a schematic diagram for demonstrating the response process which the communication system which concerns on this invention performs. アクションポイントオフセット時間、アイドルスロット時間及び最大送信スロット時間を説明するための模式図である。It is a schematic diagram for demonstrating action point offset time, idle slot time, and maximum transmission slot time. スロット管理手段によるスロット管理の基本動作を説明するための模式図である。It is a schematic diagram for explaining the basic operation of slot management by the slot management means. スロット管理手段によるスロット管理の基本動作を説明するための模式図である。It is a schematic diagram for explaining the basic operation of slot management by the slot management means. スロット管理手段によるスロットカウンタの同期処理を説明するためのタイミングチャートである。It is a timing chart for explaining the synchronization processing of the slot counter by the slot management means. プロトコル制御手段によるメッセージ送信の成否判定を説明するための模式図である。It is a schematic diagram for demonstrating the success or failure determination of the message transmission by a protocol control means. プロトコル制御手段によるメッセージ再送信処理を説明するための模式図である。It is a schematic diagram for demonstrating the message retransmission process by a protocol control means. プロトコル制御手段によるメッセージ再送信処理を説明するための模式図である。It is a schematic diagram for demonstrating the message retransmission process by a protocol control means. 本発明に係る通信システムにて検出される通信エラーの一覧を示す図表である。6 is a chart showing a list of communication errors detected in the communication system according to the present invention. エラーカウンタの変動条件を示す図表である。It is a graph which shows the fluctuation conditions of an error counter. エラー制御手段の動作を説明するための状態遷移図である。It is a state transition diagram for demonstrating operation | movement of an error control means. ECUの通信制御処理に係る動作を説明するための状態遷移図である。It is a state transition diagram for demonstrating the operation | movement which concerns on the communication control process of ECU. 初期状態におけるECUの処理手順を示すフローチャートである。It is a flowchart which shows the process sequence of ECU in an initial state. 同期準備状態におけるECUの処理手順を示すフローチャートである。It is a flowchart which shows the process sequence of ECU in a synchronous preparation state. 同期準備状態におけるECUの処理手順を示すフローチャートである。It is a flowchart which shows the process sequence of ECU in a synchronous preparation state. 同期待ち状態におけるECUの処理手順を示すフローチャートである。It is a flowchart which shows the process sequence of ECU in a synchronization waiting state. 同期状態におけるECUの処理手順を示すフローチャートである。It is a flowchart which shows the process sequence of ECU in a synchronous state. 同期状態におけるECUの処理手順を示すフローチャートである。It is a flowchart which shows the process sequence of ECU in a synchronous state. スリープ準備状態におけるECUの処理手順を示すフローチャートである。It is a flowchart which shows the process sequence of ECU in a sleep preparation state. バスオフ状態におけるECUの処理手順を示すフローチャートである。It is a flowchart which shows the process sequence of ECU in a bus-off state. バススリープ状態におけるECUの処理手順を示すフローチャートである。It is a flowchart which shows the process sequence of ECU in a bus sleep state. スタートアップシーケンスの処理例を示すタイミングチャートである。It is a timing chart which shows the example of a process of a startup sequence. スタートアップシーケンスの処理例を示すタイミングチャートである。It is a timing chart which shows the example of a process of a startup sequence. スタートアップシーケンスの処理例を示すタイミングチャートである。It is a timing chart which shows the example of a process of a startup sequence. 再同期シーケンスの処理例を示すタイミングチャートである。It is a timing chart which shows the example of a process of a resynchronization sequence. 再同期シーケンスの処理例を示すタイミングチャートである。It is a timing chart which shows the example of a process of a resynchronization sequence. 変形例に係る通信システムのメッセージ構成を示す模式図である。It is a schematic diagram which shows the message structure of the communication system which concerns on a modification.

以下、本発明をその実施の形態を示す図面に基づき具体的に説明する。
<通信システムの構成>
図1は、本発明に係る通信システム及び通信装置のハードウェア構成を示すブロック図である。図において1はECU(通信装置)であり、図示しない車輌の適所に複数のECU1が配設され、各ECU1は、車輌に搭載された種々の電子機器の制御又はセンサによる車輌の走行状態の検知等の処理をそれぞれ行っている。また複数のECU1は、車輌内に敷設された共通の通信線(バス)5に接続され、バス5を介してメッセージの送受信を行うことができる。
Hereinafter, the present invention will be specifically described with reference to the drawings showing embodiments thereof.
<Configuration of communication system>
FIG. 1 is a block diagram showing a hardware configuration of a communication system and a communication apparatus according to the present invention. In the figure, reference numeral 1 denotes an ECU (communication device), and a plurality of ECUs 1 are arranged at appropriate positions of a vehicle (not shown). Each ECU 1 controls various electronic devices mounted on the vehicle or detects the running state of the vehicle by sensors. Etc. are performed respectively. The plurality of ECUs 1 are connected to a common communication line (bus) 5 laid in the vehicle and can send and receive messages via the bus 5.

バス5は、従来のCANプロトコルにて用いられるバスと同様の構成であり、作動信号を伝送するツイストペアケーブルで構成されている。バス5上にて伝送される信号は、論理ビットの”0”に対応する優性値の”ドミナント”と、論理ビットの”1”に対応する劣性値の”レセシブ”で表される。ただし本発明に係る通信システムにおいては、ドミナント及びレセシブの信号値は必ずしも優性値及び劣性値として扱われるわけではないが、従来のCANプロトコルとの互換性を保つために同じ信号値が用いられる。   The bus 5 has the same configuration as that of the bus used in the conventional CAN protocol, and is configured by a twisted pair cable that transmits an operation signal. A signal transmitted on the bus 5 is represented by a dominant value “dominant” corresponding to the logical bit “0” and a recessive value “recessive” corresponding to the logical bit “1”. However, in the communication system according to the present invention, dominant and recessive signal values are not necessarily treated as dominant values and inferior values, but the same signal values are used in order to maintain compatibility with the conventional CAN protocol.

通信システムの構成要素である各ECU1は、車輌の走行状態などを検出するセンサに接続されてこのセンサから入力される信号を取得する入力部12、車輌に搭載された制御対象となる電子機器(図示は省略する)に接続されて制御信号などを出力する出力部13、制御に必要なプログラム及びデータ等を記憶する記憶部14、ECU1内の各部へ電力を供給する電源回路15、及びバス5に接続されてデータの送受信を行う通信部16等と、ECU1内の各部の動作を制御する制御部11とを備えている。なお、図1においては1つのECU1のみ詳細な内部構成を示し、他のECU1は同様の構成であるため詳細な内部構成の図示を省略してある。   Each ECU 1 that is a component of the communication system is connected to a sensor that detects a traveling state of the vehicle and the like, an input unit 12 that acquires a signal input from the sensor, and an electronic device (a control target mounted on the vehicle) An output unit 13 connected to (not shown) and outputting a control signal, a storage unit 14 for storing programs and data necessary for control, a power supply circuit 15 for supplying power to each unit in the ECU 1, and a bus 5 And a communication unit 16 that transmits and receives data, and a control unit 11 that controls the operation of each unit in the ECU 1. In FIG. 1, only one ECU 1 shows a detailed internal configuration, and the other ECUs 1 have the same configuration, and therefore the detailed internal configuration is not shown.

ECU1の入力部12は、例えば車輌の車速、加速度、エンジンの温度又はハンドルの操舵角等を検出する各種のセンサが接続され、センサからの検出値が信号として入力されている。入力部12は、センサが検出した検出値を取得して記憶部14に記憶すると共に、制御部11へセンサからの検出値の取得完了を通知する。出力部13には、車輌のエンジン又はブレーキ等の各種装置を電子的に制御するための電子機器に接続され、制御部11の制御に応じて出力部13は各種装置の動作を制御する制御信号を出力する。なお、ECU1によっては入力部12又は出力部13のいずれか一方のみを備える構成であってもよい。 The input unit 12 of the ECU 1 is connected to various sensors that detect, for example, the vehicle speed, acceleration, engine temperature, steering angle of the steering wheel, and the like of the vehicle, and detection values from the sensors are input as signals. The input unit 12 acquires the detection value detected by the sensor, stores it in the storage unit 14, and notifies the control unit 11 of the completion of acquisition of the detection value from the sensor. The output unit 13 is connected to an electronic device for electronically controlling various devices such as a vehicle engine or a brake, and the output unit 13 controls the operation of the various devices according to the control of the control unit 11. Is output. The ECU 1 may be configured to include only one of the input unit 12 and the output unit 13.

記憶部14は、EEPROM(Electrically Erasable Programmable Read Only Memory)又はフラッシュメモリ等のデータ書き換え可能な不揮発性のメモリ素子により構成されている。記憶部14には、制御部11にて実行されるプログラム及びデータ等が予め記憶されており、ECU1の電源投入時にECU1が記憶部14からこれらのプログラム及びデータ等を読み出して処理を開始する。また記憶部14は、制御部11の処理過程で発生する各種のデータ、センサが検出した検出値、通信により他のECU1へ送信するデータ、及び他のECU1から受信したデータ等を記憶する。なお、記憶部14は、所謂ROMとRAM(Random Access Memory)とが別に設けられる構成であってもよい。   The storage unit 14 is composed of a nonvolatile memory element that can rewrite data such as an EEPROM (Electrically Erasable Programmable Read Only Memory) or a flash memory. The storage unit 14 stores in advance programs, data, and the like that are executed by the control unit 11, and when the ECU 1 is turned on, the ECU 1 reads these programs, data, and the like from the storage unit 14 and starts processing. The storage unit 14 stores various data generated in the process of the control unit 11, detection values detected by the sensors, data transmitted to other ECUs 1 through communication, data received from other ECUs 1, and the like. The storage unit 14 may have a configuration in which a so-called ROM and RAM (Random Access Memory) are provided separately.

電源回路15は、車輌のオルタネータ又はバッテリ等の電力供給源(図示は省略する)に接続され、電力供給源からの電力を各部に適した電圧又は電流に調整した後に、各部へ供給する。   The power supply circuit 15 is connected to a power supply source (not shown) such as an alternator or a battery of the vehicle, adjusts the power from the power supply source to a voltage or current suitable for each part, and then supplies the power to each part.

通信部16は、バス5に接続されており、制御部11の制御に従って記憶部14から送信用のデータを読み出し、このデータに所定の情報を付与したメッセージを作成してバス5へ出力することによって、メッセージの送信を行う。通信部16は、他のECU1から送信されたメッセージを受信し、受信したメッセージから必要なデータを抽出して記憶部14に記憶し、受信完了を制御部11へ通知する。また通信部16は、通信に係る種々の制御処理を行っており、例えば他のECU1と同期してバス5を時分割で利用してメッセージ送受信を行うための制御処理、他のECU1からのメッセージ受信の成否を判断する処理、他のECU1からのメッセージ受信に対する応答を行う処理、又は、他のECU1から受信したメッセージの内容に応じて自らのメッセージの再送信を行う処理等の種々の処理を行っている。ECU1が行うメッセージの送受信処理の詳細は後述する。   The communication unit 16 is connected to the bus 5, reads data for transmission from the storage unit 14 under the control of the control unit 11, creates a message with predetermined information added to the data, and outputs the message to the bus 5. To send a message. The communication unit 16 receives a message transmitted from another ECU 1, extracts necessary data from the received message, stores it in the storage unit 14, and notifies the control unit 11 of completion of reception. In addition, the communication unit 16 performs various control processes related to communication. For example, a control process for transmitting and receiving messages in a time-sharing manner in synchronization with other ECUs 1 and messages from other ECUs 1. Various processes such as a process of determining success or failure of reception, a process of performing a response to the reception of a message from another ECU 1, or a process of retransmitting its own message according to the content of the message received from the other ECU 1 Is going. Details of message transmission / reception processing performed by the ECU 1 will be described later.

制御部11は、入力部12に入力された信号などに基づく情報及びバス5を介して他のECU1から受信した情報等を取得し、取得した情報を基に演算を行って制御信号を生成し、出力部13から制御信号を出力することによって、車輌に搭載された電子機器の制御を行う。このとき制御部11は、入力部12に入力されるセンサなどからの情報又は演算結果等を他のECU1と共有する必要がある場合、これらの情報をデータとして含むメッセージを生成し、通信部16にて他のECU1へ送信する。   The control unit 11 acquires information based on the signal input to the input unit 12 and the information received from the other ECU 1 via the bus 5 and performs a calculation based on the acquired information to generate a control signal. The electronic device mounted on the vehicle is controlled by outputting a control signal from the output unit 13. At this time, when the control unit 11 needs to share information from the sensor or the like input to the input unit 12 or a calculation result with other ECUs 1, the control unit 11 generates a message including the information as data, and the communication unit 16. To other ECU1.

<通信装置の機能構成>
図2は、本発明に係る通信装置の機能構成を示すブロック図であり、ECU1の制御部11及び通信部16にて実現される通信機能に係る構成を示したものである。ECU1の機能は、アプリケーション層、プロトコル制御層及び物理層の3つに分けることができる。アプリケーション層は、一又は複数のアプリケーションソフトウェア(以下、アプリケーションという)101で構成される。プロトコル制御層は、プロトコル制御手段102、エラー制御手段103、メッセージ生成手段104、スロット管理手段105及びビットサンプリング手段106等を含んでいる。また物理層は、バスドライバ107などで構成される。
<Functional configuration of communication device>
FIG. 2 is a block diagram illustrating a functional configuration of the communication apparatus according to the present invention, and illustrates a configuration related to a communication function realized by the control unit 11 and the communication unit 16 of the ECU 1. The function of the ECU 1 can be divided into an application layer, a protocol control layer, and a physical layer. The application layer includes one or a plurality of application software (hereinafter referred to as applications) 101. The protocol control layer includes protocol control means 102, error control means 103, message generation means 104, slot management means 105, bit sampling means 106, and the like. The physical layer is composed of a bus driver 107 and the like.

物理層は、バス5との物理的な接続及びバス5に対する電気信号の授受に係る層であり、OSI(Open Systems Interconnection)参照モデルの物理層に相当する。物理層のバスドライバ107は、プロトコル制御層から与えられる送信メッセージの値(ドミナント/レセシブ)に対応した信号をバス5に対して出力すると共に、バス5の信号レベルを検出してドミナント/レセシブの値に変換し、プロトコル制御層へ与える。バスドライバ107は、通信部16に設けられている。   The physical layer is a layer related to physical connection with the bus 5 and transmission / reception of electric signals to / from the bus 5, and corresponds to a physical layer of an OSI (Open Systems Interconnection) reference model. The physical layer bus driver 107 outputs a signal corresponding to the value (dominant / recessive) of the transmission message given from the protocol control layer to the bus 5 and detects the signal level of the bus 5 to detect the dominant / recessive level. Convert to value and give to protocol control layer. The bus driver 107 is provided in the communication unit 16.

アプリケーション層は、車輌に搭載された電子機器の制御に係る具体的なサービスを提供する層であり、OSI参照モデルのアプリケーション層に相当する。アプリケーション層の各アプリケーション101は、予め定められたAPI(Application Programming Interface)を利用してプロトコル制御層との情報交換を行う。アプリケーション101は、記憶部14に記憶されたプログラム及びデータを制御部11が実行することによって実現するものである。   The application layer is a layer that provides a specific service related to the control of the electronic device mounted on the vehicle, and corresponds to the application layer of the OSI reference model. Each application 101 in the application layer exchanges information with the protocol control layer using a predetermined API (Application Programming Interface). The application 101 is realized by the control unit 11 executing the program and data stored in the storage unit 14.

本実施の形態に係るECU1の物理層のバスドライバ107及びアプリケーション層のアプリケーション101は、従来のCANプロトコルが備えるものと略同じ構成とすることができる。本発明に係る通信装置と、従来のCANプロトコルの通信装置とは、プロトコル制御層の構成が異なり、通信プロトコルが異なる。ただし本発明に係る通信装置の通信プロトコルは、従来のCANプロトコルをベースとして改良を加えたものである。   The bus driver 107 in the physical layer and the application 101 in the application layer of the ECU 1 according to the present embodiment can have substantially the same configuration as that provided in the conventional CAN protocol. The communication device according to the present invention and the conventional CAN protocol communication device have different protocol control layer configurations and different communication protocols. However, the communication protocol of the communication apparatus according to the present invention is an improvement based on the conventional CAN protocol.

本発明に係る通信システムの通信プロトコルは、図1に示すような複数の通信装置が共通の通信線に接続されるバス接続のネットワークで用いることが好適である。ただしその他の構成のネットワークで用いることも可能であり、例えばゲートウェイを中心に複数の通信装置がスター接続された構成のネットワークであっても、ゲートウェイ及び通信装置の間で行う通信処理を本発明の通信プロトコルにて行うことができる。また本発明の通信プロトコルでは、通信を行う複数の通信装置にマスター/スレーブなどの上下関係はなく、全ての通信装置が対等の関係で通信を行う。   The communication protocol of the communication system according to the present invention is preferably used in a bus connection network in which a plurality of communication devices as shown in FIG. 1 are connected to a common communication line. However, it can also be used in networks having other configurations. For example, even in a network having a configuration in which a plurality of communication devices are star-connected mainly around a gateway, communication processing performed between the gateway and the communication device is performed according to the present invention. This can be done with a communication protocol. Further, in the communication protocol of the present invention, there is no hierarchical relationship such as master / slave among a plurality of communication devices that perform communication, and all communication devices communicate in an equal relationship.

従来のCANプロトコルでは、バスに対して複数の通信装置が同時的にメッセージ送信を行った場合、メッセージに含まれるID(IDentifier)の優先度に応じた調停処理(アービトレーション)が各通信装置にて行われ、最も優先度が高いメッセージの送信が行われる。これに対して本発明の通信プロトコルでは、上記のアービトレーションは行わない。本発明の通信プロトコルでは、バス5に接続された複数のECU1が巡回的にメッセージ送信を行う(即ち、予め定められた順序で周期的にメッセージ送信を行う)ことによって、バス5を時分割で利用し、メッセージ送信が衝突することを回避する。   In the conventional CAN protocol, when a plurality of communication devices simultaneously transmit messages to the bus, arbitration processing (arbitration) according to the priority of an ID (IDentifier) included in the message is performed in each communication device. The message with the highest priority is sent. In contrast, the arbitration is not performed in the communication protocol of the present invention. In the communication protocol of the present invention, the plurality of ECUs 1 connected to the bus 5 cyclically transmit messages (that is, periodically transmit messages in a predetermined order), so that the bus 5 is time-shared. Use it to avoid collision of message transmissions.

<通信プロトコル概要>
図3は、本発明に係る通信システムの通信プロトコルの概要を説明するための模式図である。なお以下の説明においては、バス5に4つのECU1が接続された構成を想定し、4つのECU1をそれぞれ1a〜1dの符号にて区別する。本発明の通信プロトコルでは、通信に参加するECU1a〜1dに対して予め(静的に)一又は複数のスロット(スロット番号)が割り当てられている。スロットは、巡回的にメッセージ送信を行う際の送信権利を示すものであり、スロット番号が小さいほど送信順が先となる。なおスロット番号の重複は認められず、1つのスロット番号につき1つのECU1a〜1dのみが送信を行うことができる。
<Outline of communication protocol>
FIG. 3 is a schematic diagram for explaining the outline of the communication protocol of the communication system according to the present invention. In the following description, a configuration in which four ECUs 1 are connected to the bus 5 is assumed, and the four ECUs 1 are distinguished by reference numerals 1a to 1d, respectively. In the communication protocol of the present invention, one or a plurality of slots (slot numbers) are assigned in advance (statically) to the ECUs 1a to 1d participating in the communication. The slot indicates a transmission right when the message is transmitted cyclically. The smaller the slot number, the earlier the transmission order. In addition, duplication of slot numbers is not recognized, and only one ECU 1a to 1d can perform transmission for one slot number.

例えば図3(a)に示すように、ECU1aにはスロット1及びスロット5が割り当てられ、ECU1bにはスロット2が割り当てられ、ECU1cにはスロット3及びスロット6が割り当てられ、ECU1dにはスロット4が割り当てられている。また各ECU1a〜1dには、ネットワーク中の総スロット数、及び、1のスロットに係る1回のメッセージ送信にてバス5を利用できる最大時間(1スロット時間という)等の共通情報が予め与えられている。   For example, as shown in FIG. 3A, slot 1 and slot 5 are assigned to ECU 1a, slot 2 is assigned to ECU 1b, slot 3 and slot 6 are assigned to ECU 1c, and slot 4 is assigned to ECU 1d. Assigned. Each ECU 1a to 1d is preliminarily given common information such as the total number of slots in the network and the maximum time (one slot time) that the bus 5 can be used for one message transmission related to one slot. ing.

各ECU1a〜1dは、総スロット数×1スロット時間を1サイクルとして、番号の小さいスロットが割り当てられたECU1a〜1dから順にメッセージ送信を行う。例えば図3(b)に示すように、スロット1が割り当てられたECU1aがメッセージ(図中ではMsgと略記する)Aを1番目に送信し、スロット2が割り当てられたECU1bがメッセージBを2番目に送信し、スロット3が割り当てられたECU1cがメッセージCを3番目に送信し、スロット4が割り当てられたECU1dがメッセージDを4番目に送信する。その後、スロット5が割り当てられたECU1aがメッセージEを5番目に送信し、スロット6が割り当てられたECU1cがメッセージFを6番目に送信する。番号が最大のスロットに係るメッセージ送信の終了により1サイクルが終了し、次のサイクルにてスロット1が割り当てられたECU1aがメッセージGを送信する。   Each of the ECUs 1a to 1d transmits a message in order from the ECUs 1a to 1d to which slots having a smaller number are assigned, with the total number of slots × 1 slot time as one cycle. For example, as shown in FIG. 3B, the ECU 1a to which the slot 1 is assigned transmits the message A (abbreviated as Msg in the figure) A first, and the ECU 1b to which the slot 2 is assigned sends the message B second. ECU 1c to which slot 3 is assigned transmits message C third, and ECU 1d to which slot 4 is assigned transmits message D fourth. Thereafter, the ECU 1a assigned the slot 5 transmits the message E fifth, and the ECU 1c assigned the slot 6 transmits the message F sixth. One cycle is completed when the message transmission related to the slot with the largest number is completed, and the ECU 1a to which the slot 1 is assigned transmits the message G in the next cycle.

このように、バス5に接続された複数のECU1a〜1dが同期してスロット番号に応じた巡回的なメッセージ送信を行うことによって、バス5上にて複数のメッセージが衝突することがないため、従来のCANプロトコルのアービトレーションを各ECU1a〜1dが行う必要はない。このため、従来のCANプロトコルではメッセージを送信する際、通信装置はメッセージをバスに出力した後に、バス上の信号変化の有無をビット毎に検出する必要があるが、本発明の通信プロトコルではこのようなビット毎の検出処理を行う必要がなく、通信速度を高速化することができる。上記のようなスロットによるメッセージ送受信の制御は、各ECU1a〜1dのプロトコル制御手段102及びスロット管理手段105等によって行われる。   As described above, since the plurality of ECUs 1a to 1d connected to the bus 5 perform the cyclic message transmission according to the slot number, the plurality of messages do not collide on the bus 5. It is not necessary for each ECU 1a to 1d to perform arbitration of the conventional CAN protocol. For this reason, when transmitting a message in the conventional CAN protocol, the communication device needs to detect the presence or absence of a signal change on the bus for each bit after outputting the message to the bus. There is no need to perform such detection processing for each bit, and the communication speed can be increased. The control of message transmission / reception by the slots as described above is performed by the protocol control means 102 and the slot management means 105 of each ECU 1a to 1d.

いずれかのECU1a〜1dから送信されたメッセージは、バス5に接続された他の全てのECU1a〜1dにて受信可能である。メッセージを受信した他のECU1a〜1dは、メッセージの送信元のECU1a〜1dに対してメッセージを正しく受信したか否かの応答(いわゆる、ACK(ACKnowledgement)/NAK(Negative AcKnowledgement)の送信)を行う必要がある。従来のCANプロトコルではメッセージに含まれる1ビットのACKスロットを利用して応答を行っており、メッセージ送信元の通信装置はACKスロット期間に信号変化の有無を検出することで、メッセージが正しく受信されたか否かを判断することができる。   Messages transmitted from any of the ECUs 1 a to 1 d can be received by all the other ECUs 1 a to 1 d connected to the bus 5. The other ECUs 1a to 1d that have received the message perform a response (so-called ACK (ACKnowledgement) / NAK (Negative AcKnowledgement) transmission) as to whether or not the message has been correctly received, to the ECUs 1a to 1d that have transmitted the message. There is a need. In the conventional CAN protocol, a response is made by using a 1-bit ACK slot included in the message, and the communication device that sent the message detects the signal change during the ACK slot period, so that the message is received correctly. It can be determined whether or not.

本発明の通信プロトコルでは、上述のようにメッセージ送信の際にビット毎の信号変化を検出しないため、従来のCANプロトコルとは異なる方法でメッセージ受信の応答を行う。このため本発明の通信プロトコルでは、ECU1a〜1dの間で送受信するメッセージの構成を、従来のCANプロトコルのメッセージ構成に対していくつかの点で拡張したものとしている。   Since the communication protocol of the present invention does not detect a signal change for each bit at the time of message transmission as described above, the message reception response is performed by a method different from the conventional CAN protocol. For this reason, in the communication protocol of this invention, the structure of the message transmitted / received between ECU1a-1d shall be extended in several points with respect to the message structure of the conventional CAN protocol.

<メッセージ生成>
次に、ECU1のプロトコル制御層に含まれるメッセージ生成手段104の動作を説明する。図4は、本発明に係る通信システムの通信プロトコルで用いるメッセージの構成を示す模式図であり、ECU1のメッセージ生成手段104にて生成されるものである。本発明の通信プロトコルでは、データフレーム及びACKフレームの2種のメッセージを用いる。本発明の通信プロトコルのデータフレームは、従来のCANプロトコルのデータフレームに相当し、本プロトコルのACKフレームは、従来のCANプロトコルにおいて相当するものはない。データフレームは、他のECU1へのデータの送信と、データ受信の成否に係る応答とを行うためのものである。ACKフレームは、他のECU1へ送信すべきデータが存在しない場合に用いられるほか、通信システムのスタートアップ及びスリープを行う際に用いられる。
<Message generation>
Next, the operation of the message generation unit 104 included in the protocol control layer of the ECU 1 will be described. FIG. 4 is a schematic diagram showing the structure of a message used in the communication protocol of the communication system according to the present invention, which is generated by the message generation means 104 of the ECU 1. In the communication protocol of the present invention, two types of messages, a data frame and an ACK frame, are used. The data frame of the communication protocol of the present invention corresponds to the data frame of the conventional CAN protocol, and the ACK frame of this protocol does not correspond to the conventional CAN protocol. The data frame is for performing transmission of data to other ECUs 1 and a response related to success or failure of data reception. The ACK frame is used when there is no data to be transmitted to the other ECU 1, and is used when starting up the communication system and performing sleep.

本通信プロトコルのデータフレームは、SOF(Start Of Frame)、IDフィールド、コントロールフィールド、スリープビット、エラーアクティブビット(図4においてはEAと略記する)、ACKフィールド、スロット番号フィールド(図4においてはスロットと略記する)、データフィールド、CRC(Cyclic Redundancy Check)フィールド、及びEOF(End Of Frame)で構成されている。またACKフレームは、データフレームからデータフィールドを除いた構成である。なお、SOF、コントロールフィールド、データフィールド、EOF及びIFSについては、従来のCANプロトコルのものと同じものである。   The data frame of this communication protocol includes an SOF (Start Of Frame), an ID field, a control field, a sleep bit, an error active bit (abbreviated as EA in FIG. 4), an ACK field, and a slot number field (slot in FIG. 4). ), A data field, a CRC (Cyclic Redundancy Check) field, and an EOF (End Of Frame). The ACK frame has a configuration in which the data field is removed from the data frame. The SOF, control field, data field, EOF, and IFS are the same as those of the conventional CAN protocol.

SOFは、従来のCANプロトコルのデータフレームに設けられたSOFと同じものである。メッセージの開始を表すビットであり、1ビットのドミナントである。通信システムの各ECU1は、バス5上のSOFを検出することによって、メッセージ受信を同期して行う。   The SOF is the same as the SOF provided in the data frame of the conventional CAN protocol. This bit represents the start of the message and is a 1-bit dominant. Each ECU 1 of the communication system performs message reception in synchronization by detecting the SOF on the bus 5.

IDフィールドは、従来のCANプロトコルのデータフレームに設けられたアービトレーションフィールドと同じ構成であるが、上述のように本発明の通信プロトコルではアービトレーションを行わないため、このフィールドの値は単にメッセージのIDとして用いられる。IDフィールドは、IDデータ及びRTR(Remote Transmission Request)ビットを含んでいる。IDデータは、メッセージの種類を示し、標準フォーマットでは11ビットであり、拡張フォーマットでは29ビットである。RTRは、1ビットのデータであり、従来のCANプロトコルと同様のものである。   The ID field has the same configuration as the arbitration field provided in the data frame of the conventional CAN protocol. However, since the arbitration is not performed in the communication protocol of the present invention as described above, the value of this field is simply used as the message ID. Used. The ID field includes ID data and RTR (Remote Transmission Request) bits. ID data indicates the type of message, which is 11 bits in the standard format and 29 bits in the extended format. The RTR is 1-bit data and is the same as the conventional CAN protocol.

コントロールフィールドは、従来のCANプロトコルのコントロールフィールドと同じものであり、標準フォーマット又は拡張フォーマットを区別するためのIDE(IDentifier Extension)ビット、及びデータフレームのデータ長を示す4ビットのDLC(データ長コード)等の情報が含まれている。なお各ECU1a〜1dによるデータフレームとACKフレームとの識別には、IDフィールドのIDデータを用いており、IDデータ=1として正常受信するフレームをACKフレームとする(ただしこのIDデータの値は一例であって、その他の値を用いてもよい)。また各ECU1a〜1dは、ACKフレームにおいてDLC=0に設定して送信を行い、ACKフレームを受信したECU1a〜1dは、IDデータ=1のフレームを受信した場合には、受信フレームがDLC≠0であっても、DLC=0とみなして受信処理を行う。   The control field is the same as the control field of the conventional CAN protocol, and is an IDE (IDentifier Extension) bit for distinguishing a standard format or an extended format, and a 4-bit DLC (data length code indicating the data length of the data frame) ) Etc. are included. Note that the ID data in the ID field is used to identify the data frame and the ACK frame by each of the ECUs 1a to 1d, and a frame that is normally received with ID data = 1 is an ACK frame (however, the value of this ID data is an example) And other values may be used). The ECUs 1a to 1d perform transmission by setting DLC = 0 in the ACK frame. When the ECUs 1a to 1d receiving the ACK frame receive the frame of ID data = 1, the received frame is DLC ≠ 0. Even so, the reception process is performed assuming that DLC = 0.

スリープビットは、通信システムのスリープに係る処理に用いられる1ビットの情報であり、ACKフレームのみで利用される。スリープビットがドミナントに設定されている場合は通常の動作が行われ、スリープビットがレセシブに設定された場合はACKフレームがスリープ要求として受信され、スリープに係る処理が開始される。なおデータフレームにおいては、スリープビットは常にドミナントに設定される。   The sleep bit is 1-bit information used for processing related to sleep in the communication system, and is used only in the ACK frame. When the sleep bit is set to dominant, a normal operation is performed, and when the sleep bit is set to recessive, an ACK frame is received as a sleep request, and processing related to sleep is started. In the data frame, the sleep bit is always set to dominant.

エラーアクティブビットは、1ビットの情報であり、通信処理に係るエラーが発生した場合にエラーの状態を通知するためのものである。エラーアクティブビットがドミナントに設定された場合、エラーの状態はエラーアクティブであり、エラーアクティブビットがレセシブに設定された場合、エラーの状態はエラーパッシブである(エラーアクティブ及びエラーパッシブ等の詳細は後述する)。   The error active bit is 1-bit information, and is used to notify an error state when an error relating to communication processing occurs. When the error active bit is set to dominant, the error state is error active, and when the error active bit is set to recessive, the error state is error passive (details such as error active and error passive are described later). To do).

ACKフィールドは、通信システムにおける総スロット数に等しいビット数の情報であり、各ビットに1つのスロットが対応付けられ、1サイクル分のメッセージ受信の成否情報が設定される。例えば総スロット数が16の場合、ACKフィールドは16ビットの情報であり、1ビット目にスロット1の受信成否情報が設定され、2ビット目にスロット2の受信成否情報が設定され、…、16ビット目にスロット16の受信成否情報が設定される。なおACKフィールドの各ビットの値は、レセシブが受信成功(ACK)に対応し、ドミナントが受信失敗(NAK)に対応する。   The ACK field is information of the number of bits equal to the total number of slots in the communication system, and one slot is associated with each bit, and success / failure information of message reception for one cycle is set. For example, when the total number of slots is 16, the ACK field is 16-bit information, slot 1 reception success / failure information is set in the first bit, slot 2 reception success / failure information is set in the second bit,. Reception success / failure information of slot 16 is set in the bit. As for the value of each bit in the ACK field, recessive corresponds to reception success (ACK), and dominant corresponds to reception failure (NAK).

ただし、本発明の通信システムは、従来のCANプロトコルのアービトレーション及びACKビット等の機能が必要ないため、ドミナントがACKに対応し、レセシブがNAKに対応する構成とすることもできる。即ち、ACKフィールドのACK及びNAKと、レセシブ及びドミナントとの組み合わせは、通信システム内で統一されていれば、特に限定されるものではなく、いずれの組み合わせであってもよい。   However, since the communication system of the present invention does not require functions such as arbitration and ACK bit of the conventional CAN protocol, the dominant can correspond to ACK and the recessive can correspond to NAK. That is, the combination of ACK and NAK in the ACK field, recessive and dominant is not particularly limited as long as it is unified within the communication system, and any combination may be used.

スロット番号は、このメッセージ送信が行われたスロットの番号が設定され、通信システムの各ECU1が同期補正(詳細は後述する)を行うために用いられる。スロット番号のデータサイズは、総スロット数により規定され、例えば総スロット数が16であればスロット番号は4ビットの情報となる。   The slot number is set to the number of the slot in which this message transmission is performed, and is used for each ECU 1 of the communication system to perform synchronization correction (details will be described later). The data size of the slot number is defined by the total number of slots. For example, if the total number of slots is 16, the slot number is 4-bit information.

データフィールドは、従来のCANプロトコルのデータフレームに設けられたデータフィールドと同じである。データフィールドは0〜8バイトのデータで構成されており、MSB(Most Significant Bit)ファーストで送信される。各ECU1は、他のECU1へ送信すべき任意のデータをこのデータフィールドに収めて送信する。   The data field is the same as the data field provided in the data frame of the conventional CAN protocol. The data field is composed of 0 to 8 bytes of data and is transmitted MSB (Most Significant Bit) first. Each ECU 1 transmits arbitrary data to be transmitted to other ECUs 1 in this data field.

CRCフィールドは、15ビットのCRCシーケンスと、1ビットのCRCデリミタ(区切り用のビット)とで構成されており、受信したメッセージの誤り検出を行うためのものである。CRCシーケンスは、SOFからデータフィールドまでの値について予め定められた生成多項式を用いた演算を行うことにより取得することができる。なお、演算に用いる生成多項式は、従来のCANプロトコルで用いられるものと同じであってよい。メッセージを受信したECU1は、受信したメッセージについて生成多項式により算出される値と、受信したメッセージのCRCシーケンスの値とを比較することによって誤り検出を行うことができ、2つの値が一致しない場合は誤りが生じていると判断する。CRCデリミタは、従来のCANプロトコルにおいては1ビットのレセシブであったが、本発明の通信プロトコルにおいては1ビットのレセシブ及び1ビットのドミナントの計2ビットとする。なお、CRCシーケンスの長さを15ビットとしたが、これに限るものではなく、14ビット以下又は16ビット以上としてもよい。   The CRC field is composed of a 15-bit CRC sequence and a 1-bit CRC delimiter (delimiter bit), and is used for error detection of the received message. The CRC sequence can be acquired by performing an operation using a predetermined generator polynomial for values from the SOF to the data field. The generator polynomial used for the calculation may be the same as that used in the conventional CAN protocol. The ECU 1 that has received the message can perform error detection by comparing the value calculated by the generator polynomial for the received message with the value of the CRC sequence of the received message, and if the two values do not match Judge that an error has occurred. The CRC delimiter is 1 bit recessive in the conventional CAN protocol, but in the communication protocol of the present invention, the CRC delimiter is 2 bits in total: 1 bit recessive and 1 bit dominant. Although the length of the CRC sequence is 15 bits, the length is not limited to this, and may be 14 bits or less or 16 bits or more.

EOFは、従来のCANプロトコルのデータフレームに設けられたEOFと同じである。データフレームの終了を表すビットであり、7ビットのレセシブである。   The EOF is the same as the EOF provided in the data frame of the conventional CAN protocol. This bit represents the end of the data frame and is 7 bits recessive.

以上に説明したデータフレーム及びACKフレームは、ECU1のメッセージ生成手段104が、プロトコル制御手段102の制御に応じて生成する。メッセージ生成手段104は、生成したメッセージをビットサンプリング手段106を介してバスドライバ107へ与えることによって、バス5へメッセージを出力し、バス5に接続された他の全てのECU1に対するメッセージ送信を行う。また、メッセージ生成手段104は、ビットサンプリング手段106から与えられるサンプリング結果、即ち受信メッセージから、図4に示した各フィールドのデータを抽出してプロトコル制御手段102へ与える。   The data frame and the ACK frame described above are generated by the message generation unit 104 of the ECU 1 according to the control of the protocol control unit 102. The message generation unit 104 outputs the message to the bus 5 by giving the generated message to the bus driver 107 via the bit sampling unit 106, and transmits the message to all other ECUs 1 connected to the bus 5. Further, the message generation means 104 extracts the data of each field shown in FIG. 4 from the sampling result given from the bit sampling means 106, that is, the received message, and gives it to the protocol control means 102.

図5及び図6は、本発明に係る通信システムが行う応答処理を説明するための模式図である。図5には通信システム内のメッセージ送信の一例を示し、図6には各メッセージに含まれるACKフィールドの内容を示してある。なお、図5及び図6に示す例は、図3(a)に示した通信システムの構成(4つのECU1a〜1dが6つのスロットを利用してメッセージ送信を行う構成)を前提としたものである。   5 and 6 are schematic diagrams for explaining response processing performed by the communication system according to the present invention. FIG. 5 shows an example of message transmission in the communication system, and FIG. 6 shows the contents of the ACK field included in each message. The examples shown in FIGS. 5 and 6 are based on the configuration of the communication system shown in FIG. 3A (a configuration in which four ECUs 1a to 1d transmit messages using six slots). is there.

図5に示すように、通信システムの各ECU1a〜1dが起動して通信が開始されると、スロット1が割り当てられたECU1aからメッセージの送信が開始され、スロットの番号順に複数のECU1a〜1dがメッセージ送信を行う。図示の例では、スロット1が割り当てられたECU1aがメッセージAを送信し、スロット2が割り当てられたECU1bがメッセージBを送信し、スロット3が割り当てられたECU1cがメッセージCを送信し、スロット4が割り当てられたECU1dがメッセージDを送信し、スロット5が割り当てられたECU1aがメッセージEを送信し、スロット6が割り当てられたECU1cがメッセージFを送信して、1サイクルが終了する。次のサイクルでは、スロット1が割り当てられたECU1aがメッセージGを送信し、スロット2が割り当てられたECU1bがメッセージHを送信し、スロット3が割り当てられたECU1cがメッセージIを送信し、同様の処理が繰り返される。   As shown in FIG. 5, when each of the ECUs 1a to 1d of the communication system is activated and communication is started, transmission of a message is started from the ECU 1a to which slot 1 is assigned, and a plurality of ECUs 1a to 1d are arranged in the slot number order. Send a message. In the illustrated example, the ECU 1a to which the slot 1 is assigned transmits the message A, the ECU 1b to which the slot 2 is assigned transmits the message B, the ECU 1c to which the slot 3 is assigned transmits the message C, and the slot 4 The assigned ECU 1d transmits the message D, the ECU 1a to which the slot 5 is assigned transmits the message E, the ECU 1c to which the slot 6 is assigned transmits the message F, and one cycle is completed. In the next cycle, ECU 1a to which slot 1 is assigned transmits message G, ECU 1b to which slot 2 is assigned sends message H, ECU 1c to which slot 3 is assigned sends message I, and the same processing Is repeated.

図6に示すように、各ECU1a〜1dが送信するメッセージには、ACKフィールドとして6ビット(=スロット数)の情報(ACK1〜ACK6)が含まれており、スロット1〜スロット6に対するメッセージ受信の成否がそれぞれACK1〜ACK6に1ビットのレセシブ(ACK)又はドミナント(NAK)として設定される。また各ECU1a〜1dは、自らに割り当てられたスロットに対するACKフィールドのビットには、ACKを設定してメッセージ送信を行う。   As shown in FIG. 6, the messages transmitted by the ECUs 1a to 1d include 6-bit (= slot number) information (ACK1 to ACK6) as ACK fields. Success or failure is set as 1-bit recessive (ACK) or dominant (NAK) in ACK1 to ACK6, respectively. Each of the ECUs 1a to 1d transmits a message by setting ACK to the bit of the ACK field for the slot allocated to itself.

通信システムが通信を開始した直後は、各ECU1a〜1dによるメッセージの送受信が未だ行われておらず、各ECU1a〜1dはメッセージを受信していない。このように、通信開始直後の1サイクルにおいて、各ECU1a〜1dは、メッセージ送受信が行われていないスロットに係るACKフィールドのビットには、ACKを設定してメッセージ送信を行う。   Immediately after the communication system starts communication, the ECUs 1a to 1d have not yet sent and received messages, and the ECUs 1a to 1d have not received messages. As described above, in one cycle immediately after the start of communication, each ECU 1a to 1d transmits a message by setting ACK to the bit of the ACK field related to the slot where the message transmission / reception is not performed.

通信開始後の1サイクル目のスロット1に係る通信において、ECU1aは、自らに割り当てられたスロット1及びスロット5に対応するACK1及びACK5にACKを設定すると共に、メッセージの送受信が行われていないスロット2〜4、6に対応するACK2〜4、6にACKを設定したメッセージAを作成して送信する。   In communication related to slot 1 in the first cycle after the start of communication, ECU 1a sets ACK in ACK1 and ACK5 corresponding to slot 1 and slot 5 allocated to itself, and does not transmit / receive messages. A message A in which ACK is set in ACKs 2 to 4 and 6 corresponding to 2 to 4 and 6 is created and transmitted.

次いで、1サイクル目のスロット2に係る通信において、ECU1bは、スロット1に係る通信にて送信されたメッセージAに関する受信の成否(ACK/NAK)をACK1に設定し、自らに割り当てられたスロット2に対応するACK2にACKを設定し、メッセージの送受信が行われていないスロット3〜スロット6に対応するACK3〜ACK6にACKを設定したメッセージBを生成して送信する。   Next, in the communication related to slot 2 in the first cycle, the ECU 1b sets the success / failure (ACK / NAK) of the reception related to the message A transmitted in the communication related to slot 1 to ACK1, and the slot 2 assigned to itself. ACK2 is set in ACK2 corresponding to, and message B in which ACK is set in ACK3 to ACK6 corresponding to slots 3 to 6 in which no message is transmitted / received is generated and transmitted.

次いで、1サイクル目のスロット3に係る通信において、ECU1cは、スロット1及びスロット2に係る通信にて送信されたメッセージA及びBに関する受信の成否をACK1及びACK2に設定し、自らに割り当てられたスロット3及びスロット6に対応するACK3及びACK6にACKを設定し、メッセージの送受信が行われていないスロット4及びスロット5にACKを設定したメッセージCを生成して送信する。   Next, in the communication related to the slot 3 in the first cycle, the ECU 1c sets the success / failure of the reception of the messages A and B transmitted in the communication related to the slot 1 and the slot 2 to ACK1 and ACK2, and is assigned to itself. ACK is set in ACK3 and ACK6 corresponding to slot 3 and slot 6, and message C in which ACK is set in slot 4 and slot 5 in which no message is transmitted and received is generated and transmitted.

同様にして、1サイクル目のスロット4に係るECU1dのメッセージDの送信、スロット5に係るECU1aのメッセージEの送信、及びスロット6に係るECU1cのメッセージFの送信が行われる。1サイクルのメッセージ送受信が終了した場合、各ECU1a〜1dは少なくとも1回のメッセージ送信を行っており、ECU1aは、1サイクル目のスロット1にて送信したメッセージAが他のECU1b〜1dにて正しく受信されたか否かを、他のECU1b〜1dからのメッセージB、C、D、FのACKフィールドを調べ、全てメッセージのACK1にACKが設定されているか否かで判断することができる。   Similarly, transmission of the message D of the ECU 1d related to the slot 4 in the first cycle, transmission of the message E of the ECU 1a related to the slot 5, and transmission of the message F of the ECU 1c related to the slot 6 are performed. When message transmission / reception for one cycle is completed, each ECU 1a to 1d transmits at least one message, and the ECU 1a correctly transmits the message A transmitted in slot 1 of the first cycle to the other ECUs 1b to 1d. Whether or not the message has been received can be determined by examining the ACK fields of the messages B, C, D, and F from the other ECUs 1b to 1d and determining whether or not ACK is set for ACK1 of the message.

ECU1aは、全てのメッセージのACK1がACKに設定されている場合、スロット1にて送信したメッセージAが全てのECU1b〜1dにて正常に受信されていると判断し、次のサイクルのスロット1では別データのメッセージGを送信する。これに対してECU1aは、いずれかのACK1がNAKに設定されている場合、スロット1にて送信したメッセージAが正常に受信されていないと判断し、次のサイクルのスロット1ではメッセージAを再送信する。図6に示す例では、メッセージAが他の全てのECU1b〜1dにて正常に受信されたものとしてある。   When the ACK1 of all messages is set to ACK, the ECU 1a determines that the message A transmitted in the slot 1 is normally received by all the ECUs 1b to 1d, and in the slot 1 of the next cycle. A message G of other data is transmitted. On the other hand, if any ACK1 is set to NAK, the ECU 1a determines that the message A transmitted in the slot 1 is not normally received, and re-sends the message A in the slot 1 of the next cycle. Send. In the example illustrated in FIG. 6, the message A is normally received by all the other ECUs 1 b to 1 d.

2サイクル目のスロット1に係る通信において、ECU1aは、1サイクル目のスロット2〜4、6に係るメッセージB〜D、Fに関する受信の成否をACK2〜4、6に設定し、自らに割り当てられたスロット1及びスロット5に対応するACK1及びACK5にACKを設定したメッセージGを生成して送信する。   In communication related to slot 1 in the second cycle, the ECU 1a sets ACKs 2 to 4 and 6 as success or failure of reception of messages B to D and F related to slots 2 to 4 and 6 in the first cycle, and is assigned to itself. A message G in which ACK is set in ACK1 and ACK5 corresponding to the slots 1 and 5 is generated and transmitted.

同様にして、ECU1bは、1サイクル目のスロット3から2サイクル目のスロット1までの1サイクルの間に受信したメッセージのACKフィールドを調べることによって、1サイクル目のスロット2にて自らが送信したメッセージBが他のECU1a、1c、1dにて正しく受信されたか否かを判断することができる。2サイクル目のスロット2に係る通信において、ECU1bは、メッセージBが正しく受信されている場合、図6に示すように新たなメッセージHを作成して送信し、メッセージBが正しく受信されていない場合にはメッセージBの再送信を行う。   Similarly, the ECU 1b transmits itself in slot 2 of the first cycle by examining the ACK field of the message received during one cycle from slot 3 of the first cycle to slot 1 of the second cycle. It can be determined whether or not the message B is correctly received by the other ECUs 1a, 1c, and 1d. In communication related to slot 2 in the second cycle, when message B is correctly received, ECU 1b creates and transmits a new message H as shown in FIG. 6, and message B is not correctly received. Message B is retransmitted.

同様にして、ECU1cは、1サイクル目のスロット4から2サイクル目のスロット2までの1サイクルの間に受信したメッセージのACKフィールドを調べることによって、1サイクル目のスロット3にて自らが送信したメッセージCが他のECU1a、1b、1dにて正しく受信されたか否かを判断することができる。2サイクル目のスロット3に係る通信において、ECU1cは、メッセージCが正しく受信されている場合、図6に示すように新たなメッセージIを作成して送信し、メッセージCが正しく受信されていない場合にはメッセージCの再送信を行う。   Similarly, the ECU 1c transmits itself in slot 3 of the first cycle by examining the ACK field of the message received during one cycle from slot 4 of the first cycle to slot 2 of the second cycle. It can be determined whether or not the message C is correctly received by the other ECUs 1a, 1b, and 1d. In communication related to slot 3 in the second cycle, when the message C is correctly received, the ECU 1c creates and transmits a new message I as shown in FIG. 6, and the message C is not correctly received. Message C is retransmitted.

このように、各ECU1a〜1dは、他のECU1a〜1dへ送信すべきデータ(データフィールド)と、他のECU1a〜1dからのメッセージ受信の成否を示す情報(ACKフィールド)とを含むメッセージを作成し、自らに割り当てられたスロットにてこのメッセージを全てのECU1a〜1dへ送信する。これにより、各ECU1a〜1dは、1サイクルの間に全てのECU1a〜1dからのメッセージを受信することができ、各メッセージに含まれるACKフィールドを調べることによって、前回に送信したメッセージが他の全てのECU1a〜1dにて正しく受信されたか否かを判断でき、このメッセージを再送信すべきか否かを判断することができる。なお各ECU1a〜1dは、自らに割り当てられたスロットにて、他のECU1a〜1dへ送信すべきデータがない場合には、ACKフレームを送信すればよい。   As described above, each ECU 1a to 1d creates a message including data (data field) to be transmitted to the other ECUs 1a to 1d and information (ACK field) indicating success or failure of message reception from the other ECUs 1a to 1d. Then, this message is transmitted to all the ECUs 1a to 1d in the slot assigned to itself. Thereby, each ECU1a-1d can receive the message from all ECU1a-1d in 1 cycle, By checking the ACK field contained in each message, the message transmitted last time is all others. The ECUs 1a to 1d can determine whether or not the messages have been correctly received, and can determine whether or not to retransmit this message. Each of the ECUs 1a to 1d may transmit an ACK frame when there is no data to be transmitted to the other ECUs 1a to 1d in the slot assigned to itself.

従来のCANプロトコルでは、通信システムに含まれる各通信装置が、バス上に出力されたメッセージに含まれるACKスロットに対する書き込み(レセシブからドミナントへ変化させる処理)を行うことによって、メッセージ送信元の通信装置がメッセージ受信の成否を判断することができる。本発明は、上述のようなメッセージ受信に対する応答を各ECU1a〜1dのプロトコル制御層にて行うことによって、従来のCANプロトコルと同等のエラー検出を通信システムが行うことを可能としたものである。アプリケーション層の各アプリケーション101は、従来のCANプロトコルであるか本発明の通信プロトコルであるかにかかわらず、同様の方法で通信に係る処理を行うことができ、アプリケーション101の開発者はいずれのプロトコルであるかを意識することなく開発を行うことができる。   In the conventional CAN protocol, each communication device included in the communication system performs writing to the ACK slot included in the message output on the bus (processing to change from recessive to dominant), whereby the communication device that is the message transmission source Can determine the success or failure of message reception. The present invention enables the communication system to perform error detection equivalent to the conventional CAN protocol by performing a response to the message reception as described above in the protocol control layer of each ECU 1a to 1d. Regardless of whether the application 101 in the application layer is the conventional CAN protocol or the communication protocol of the present invention, the application 101 can perform processing related to communication in the same way. Development can be done without being conscious of whether

<ビットサンプリング>
次に、ECU1のプロトコル制御層に含まれるビットサンプリング手段106の動作を説明する。本発明の通信システムでは、従来のCANプロトコルと同様に、バス5上の信号はドミナント又はレセシブの論理値で表される2値信号として扱われる。ビットサンプリング手段106は、バス5上の信号を周期的にサンプリングして得られた2値のデータ(即ちメッセージ)をメッセージ生成手段104及びスロット生成手段105へ与え、これらの手段を介してプロトコル制御手段102へ与える。
<Bit sampling>
Next, the operation of the bit sampling means 106 included in the protocol control layer of the ECU 1 will be described. In the communication system of the present invention, the signal on the bus 5 is treated as a binary signal represented by a dominant or recessive logic value, as in the conventional CAN protocol. The bit sampling means 106 provides binary data (that is, a message) obtained by periodically sampling the signal on the bus 5 to the message generating means 104 and the slot generating means 105, and protocol control is performed via these means. To the means 102.

また共通のバス5に接続された複数のECU1がメッセージ受信を行う場合、全てのECU1が同期して受信処理を行う必要がある。ビットサンプリング手段106は、バス5上の信号変化に応じて他のECU1との同期を取る処理も行っている。ビットサンプリング手段106による同期の方法は、ハード同期及び再同期の2種がある。   When a plurality of ECUs 1 connected to the common bus 5 perform message reception, it is necessary for all the ECUs 1 to perform reception processing in synchronization. The bit sampling means 106 also performs processing to synchronize with other ECUs 1 in response to signal changes on the bus 5. There are two types of synchronization by the bit sampling means 106: hard synchronization and resynchronization.

ハード同期では、バス5上の信号が所定期間以上に亘ってレセシブの場合にメッセージの送受信が行われていない状態であるとビットサンプリング手段106が判断した後、バス5上の信号がレセシブからドミナントへ変化したタイミング(メッセージのSOFのタイミング)に対して同期が行われる。ビットサンプリング手段106は、SOFの信号変化のエッジを同期点としてバス5上の信号値のサンプリングを行う。ビットサンプリング手段106によるハード同期は、従来のCANプロトコルにて行われるものと同様の処理である。   In hard synchronization, when the signal on the bus 5 is in a recessive state for a predetermined period or longer, the bit sampling means 106 determines that the message is not being transmitted / received, and then the signal on the bus 5 changes from recessive to dominant. Synchronization is performed with respect to the timing of the change to (the SOF timing of the message). The bit sampling means 106 samples the signal value on the bus 5 using the edge of the SOF signal change as a synchronization point. The hardware synchronization by the bit sampling means 106 is the same processing as that performed by the conventional CAN protocol.

再同期では、ハード同期を行うビット以外のビットの変化に応じて、ビットサンプリング手段106が同期の補正を行う。ビットサンプリング手段106は、自らが想定する信号変化の位置と、実際にバス5上にて検出した信号変化の位置とを比較して誤差を算出し、この誤差を打ち消すべくサンプリングのタイミングを補正する。なお従来のCANプロトコルにおいては再同期をメッセージの送信及び受信の両方で行っていたが、本発明の通信プロトコルでは、メッセージ送信時にバス5の信号レベルの検出を行わないため、再同期の処理はメッセージの受信時にのみ行う。   In resynchronization, the bit sampling means 106 corrects synchronization in accordance with changes in bits other than those for which hardware synchronization is performed. The bit sampling means 106 compares the position of the signal change assumed by itself with the position of the signal change actually detected on the bus 5 to calculate an error, and corrects the sampling timing to cancel this error. . In the conventional CAN protocol, resynchronization is performed by both transmission and reception of a message. However, in the communication protocol of the present invention, the signal level of the bus 5 is not detected at the time of message transmission. Only when a message is received.

<スロット管理>
次に、ECU1のプロトコル制御層に含まれるスロット管理手段105の動作を説明する。ECU1のスロット管理手段105は、上述のように複数のECU1が巡回的にメッセージの送信を行うために、予め各ECU1に割り当てられるスロットの管理を行っている。本発明の通信プロトコルでは、ある時点においてメッセージ送信が許可されているのがいずれのスロットであるかを複数のECU1が共通して知る必要があり、スロット管理手段105は、メッセージ送信に係るスロットを共通して知るための管理処理、即ちスロットの同期処理を行っている。またスロット管理手段105は、あるスロットについてメッセージ送信が全く行われていない場合などに、このスロットを飛ばして次のスロットに係るメッセージの送受信を行うなどのスロット管理を行っている。
<Slot management>
Next, the operation of the slot management means 105 included in the protocol control layer of the ECU 1 will be described. The slot management means 105 of the ECU 1 manages slots assigned to each ECU 1 in advance so that the plurality of ECUs 1 can cyclically transmit messages as described above. In the communication protocol of the present invention, it is necessary for a plurality of ECUs 1 to know in common which slot is permitted to transmit a message at a certain point in time, and the slot management means 105 determines a slot for message transmission. Management processing for common knowledge, that is, slot synchronization processing is performed. Further, the slot management unit 105 performs slot management such as skipping this slot and transmitting / receiving a message related to the next slot when no message transmission is performed for a certain slot.

本発明の通信プロトコルでは、あるスロットについてメッセージ送信が行われていないことを検出した場合に、各ECU1は、このスロットのメッセージ受信処理を行うことなく、次のスロットの処理へ移行することによって、不具合などによってメッセージ送信を行っていないECU1に係るメッセージ送受信処理を省略し、メッセージ送信を行うことができるECU1のみで通信を行う。   In the communication protocol of the present invention, when it is detected that message transmission is not performed for a certain slot, each ECU 1 does not perform message reception processing for this slot, and moves to processing for the next slot, The message transmission / reception process related to the ECU 1 that has not transmitted a message due to a problem or the like is omitted, and communication is performed only by the ECU 1 that can perform message transmission.

これにより、通信システム中に故障などが生じたECU1が含まれ、このECU1がメッセージ送信を行うことができない状態であっても、このECU1に係るスロットの処理を省略することで通信システム中の他のECU1は相互にメッセージの送受信を行うことができる。また通信システムにオプションのECU1を追加するために予備のスロットを設け、オプション装備が追加されていない状態であっても、予備のスロットに係る処理を省略することができる。   As a result, even if the ECU 1 in which a failure or the like has occurred in the communication system and the ECU 1 cannot transmit a message, the processing of the slot related to the ECU 1 can be omitted to avoid other problems in the communication system. The ECUs 1 can exchange messages with each other. In addition, a spare slot is provided to add the optional ECU 1 to the communication system, and the processing related to the spare slot can be omitted even when the optional equipment is not added.

上記の処理を実現するために、各ECU1のスロット管理手段105は、メッセージ送信可能な1スロット時間に対して、アクションポイントオフセット時間、アイドルスロット時間及び最大送信スロット時間が予め設定されており、これら所定時間を基準として他のECU1に割り当てられたスロットに係るメッセージ送信が行われていないことを判定し、このスロットに係るメッセージ受信処理を省略する処理を行う。図7は、アクションポイントオフセット時間、アイドルスロット時間及び最大送信スロット時間を説明するための模式図である。   In order to realize the above processing, the slot management means 105 of each ECU 1 is preset with an action point offset time, an idle slot time, and a maximum transmission slot time for one slot time during which a message can be transmitted. It is determined that message transmission related to a slot assigned to another ECU 1 is not performed with a predetermined time as a reference, and processing for omitting message reception processing related to this slot is performed. FIG. 7 is a schematic diagram for explaining the action point offset time, the idle slot time, and the maximum transmission slot time.

各ECU1は、自らに割り当てられたスロットの開始時点に達した場合、予め定められたアクションポイントオフセット時間を待機した後で、メッセージの送信を開始する。スロット中におけるメッセージ送信の開始時点をアクションポイントといい、スロットの開始時点からアクションポイントまでの時間がアクションポイントオフセット時間である。   When each ECU 1 reaches the start time of the slot assigned to itself, it waits for a predetermined action point offset time, and then starts sending a message. The start point of message transmission in the slot is called an action point, and the time from the start point of the slot to the action point is the action point offset time.

各ECU1は、他のECU1に割り当てられたスロットの開始時点に達した後、アイドルスロット時間が経過してもこのスロットに係るメッセージ送信がなされなかった場合に、このスロットが割り当てられたECU1は何らかの要因でメッセージ送信を行わない状態であるとみなし、次のスロットに係る通信処理に遷移する。   When each of the ECUs 1 has reached the start time of a slot assigned to another ECU 1 and the idle slot time has not elapsed and the message transmission related to this slot has not been made, the ECU 1 to which this slot is assigned is It is assumed that the message transmission is not performed due to the cause, and the communication processing related to the next slot is transitioned to.

また各ECU1は、自らに割り当てられたスロットの開始時点から最大送信スロット時間が経過するまでの間にメッセージの送信を行う。各ECU1が送信するメッセージは可変長であってよいが、最大送信スロット時間を超えてメッセージ送信を行うことはできない。これにより、ECU1が故障などによって異常なメッセージ送信を行い続ける状態となった場合であっても、最大送信スロット時間に達した後はメッセージ送信が停止され、次のスロットに係る通信処理に遷移する。   Each ECU 1 transmits a message from the start of the slot assigned to the ECU 1 until the maximum transmission slot time elapses. The message transmitted by each ECU 1 may have a variable length, but the message cannot be transmitted beyond the maximum transmission slot time. As a result, even when the ECU 1 continues to perform abnormal message transmission due to a failure or the like, the message transmission is stopped after the maximum transmission slot time is reached, and a transition is made to communication processing related to the next slot. .

これら所定時間は、下記の条件を満たすように、通信システムの設計段階などにおいて予め設定する。
アイドルスロット時間>アクションポイントオフセット時間+フレーム検出確認時間+RTT±α
最大送信スロット時間>1フレームの最大送信時間+アクションポイントオフセット時間±α
These predetermined times are set in advance at the design stage of the communication system so as to satisfy the following conditions.
Idle slot time> Action point offset time + Frame detection confirmation time + RTT ± α
Maximum transmission slot time> Maximum transmission time of 1 frame + Action point offset time ± α

なお上記の条件において、RTT(Round Trip Time)とは2つのECU間をメッセージが往復するのに要する時間である。またフレーム検出確認時間とは、一のECU1から送信されたメッセージが他のECU1に到達した後、他のECU1がメッセージの受信を認識するまでに要する時間であり、ECU1の通信部16の内部遅延時間及び信号変化の検出に要する時間等を含むものである。またαは、複数のECU1間におけるクロック誤差の累積分を許容するマージンである。   In the above conditions, RTT (Round Trip Time) is the time required for a message to reciprocate between two ECUs. The frame detection confirmation time is a time required for another ECU 1 to recognize reception of a message after a message transmitted from one ECU 1 arrives at the other ECU 1, and is an internal delay of the communication unit 16 of the ECU 1. This includes the time and the time required to detect the signal change. Further, α is a margin that allows a cumulative amount of clock error between the plurality of ECUs 1.

図8及び図9は、スロット管理手段105によるスロット管理の基本動作を説明するための模式図であり、図8にはスロット管理に用いられる信号のタイミングチャートを示し、図9には各信号の定義を図表として示す。各ECU1は、内部に発振器を備え、この発振器が出力する内部の動作クロックがSample_clockであり(図8においては動作クロックの立ち上がり(又は立ち下がりであってもよい)エッジのみを図示してある)、ECU1内の各部(各手段)はこの動作クロックに基づいて処理を行っている。なお、共通のバス5に接続された複数のECU1は、略同じ周波数の動作クロックで動作している。またビットサンプリング手段106による受信メッセージのサンプリングポイントを示す信号がSample_pointである。   8 and 9 are schematic diagrams for explaining the basic operation of slot management by the slot management means 105. FIG. 8 shows a timing chart of signals used for slot management, and FIG. The definition is shown as a chart. Each ECU 1 includes an internal oscillator, and the internal operation clock output from the oscillator is Sample_clock (in FIG. 8, only the rising (or falling) edge of the operation clock is shown). Each part (each means) in the ECU 1 performs processing based on this operation clock. The plurality of ECUs 1 connected to the common bus 5 operate with operation clocks having substantially the same frequency. A signal indicating the sampling point of the received message by the bit sampling means 106 is Sample_point.

スロット管理手段105は、ビットカウンタ(Slot_bit_cnt)及びスロットカウンタ(Slot_cnt)の2つのカウンタを有している。ビットカウンタは、送受信するメッセージの何ビット目を処理中であるかを示すカウンタである。ビットカウンタは、ビットサンプリング手段106のサンプリングポイント毎にカウントアップされる(Sample_pointの値が1(ハイレベル)に変化したことを検出してカウントアップされる。図中の矢印(1)参照。)。   The slot management means 105 has two counters, a bit counter (Slot_bit_cnt) and a slot counter (Slot_cnt). The bit counter is a counter indicating how many bits of a message to be transmitted / received are being processed. The bit counter is counted up for each sampling point of the bit sampling means 106 (detected when the value of Sample_point has changed to 1 (high level), see arrow (1) in the figure). .

スロット管理手段105のスロットカウンタは、現時点にてメッセージ送信を行う権利を有するスロットを示すカウンタである。スロットカウンタは、Slot_cnt_enaがハイレベルであり、且つ、ビットカウンタが所定値(図8において所定値は2)を超えた場合に、カウントアップされる(図中の矢印(2)参照)。またスロットカウンタは、Slot_cnt_enaがハイレベルであり、且つ、1サイクルあたりのスロット数を超えた場合に、値が初期化される。   The slot counter of the slot management means 105 is a counter indicating a slot that has a right to transmit a message at the present time. The slot counter is counted up when Slot_cnt_ena is at a high level and the bit counter exceeds a predetermined value (the predetermined value is 2 in FIG. 8) (see arrow (2) in the figure). The value of the slot counter is initialized when Slot_cnt_ena is at a high level and the number of slots per cycle is exceeded.

スロットカウンタの値が変化した場合に、信号Slot_cnt_pointが1クロック間のハイレベルとなり(図中の(3)参照)、この信号によってスロットの変化がECU1内の各手段に通知される。また、信号Slot_acpointはスロットにおけるアクションポイントを示しており、スロット開始から予め定められたアクションポイントオフセット時間(Slot_acpoint_bit)が経過した場合(図8の例では、アクションポイントオフセット時間は1であり、ビットカウンタの値が1に変化したタイミング)に、信号Slot_acpointが1クロック間のハイレベルとなる(図中の矢印(4)参照)。   When the value of the slot counter changes, the signal Slot_cnt_point becomes a high level for one clock (see (3) in the figure), and the change of the slot is notified to each means in the ECU 1 by this signal. Further, the signal Slot_acpoint indicates an action point in the slot, and when a predetermined action point offset time (Slot_acpoint_bit) has elapsed from the start of the slot (in the example of FIG. 8, the action point offset time is 1 and the bit counter The signal Slot_acpoint becomes a high level for one clock (see the arrow (4) in the figure).

信号Slot_wrcnt及び信号Slot_wrcnt_cmdは、スロット管理手段105の外部から入力される信号であり、後述の同期処理などに利用される。信号Slot_wrcntは、正常に受信したメッセージに含まれるスロット番号などをプロトコル制御手段102がスロット管理手段105へ与えるためのものである。また信号Slot_wrcnt_cmdは、信号Slot_wrcntにて指定したスロット番号をスロット管理手段105が書き込む(内部へ取り込む)タイミングを指示するためのものである。   The signal Slot_wrcnt and the signal Slot_wrcnt_cmd are signals input from the outside of the slot management unit 105 and are used for synchronization processing described later. The signal Slot_wrcnt is for the protocol control means 102 to give the slot management means 105 the slot number included in the normally received message. The signal Slot_wrcnt_cmd is used to instruct the timing at which the slot management means 105 writes (takes in) the slot number designated by the signal Slot_wrcnt.

スロット管理手段105は、上記の複数の信号及びビットカウンタの値に応じてスロットカウンタの値をカウントアップ又は初期化することによって、現時点でメッセージ送信を行うことができるスロット番号を管理している。また共通のバス5に接続された複数のECU1では、各スロット管理手段105がスロット番号を共有する必要があり、スロット管理手段105はメッセージ受信の際にスロットカウンタの同期処理を行っている。   The slot management means 105 manages the slot number at which a message can be transmitted at the present time by counting up or initializing the value of the slot counter according to the values of the plurality of signals and the bit counter. In the plurality of ECUs 1 connected to the common bus 5, each slot management means 105 needs to share a slot number, and the slot management means 105 performs a synchronization process of the slot counter when receiving a message.

図10は、スロット管理手段105によるスロットカウンタの同期処理を説明するためのタイミングチャートである。なお、図10に示す信号は、図8及び図9に示したものと同じものであり、信号Slot_cnt_ena_qは信号Slot_cnt_enaを1クロック分遅らせた信号である。図中の破線(1)で示すタイミングにてビットカウントが所定値に達したため、スロット管理手段105は、スロットカウンタをスロット1からスロット2へインクリメントする。その後、他のECU1からのメッセージ受信が開始され、スロット管理手段105は、このタイミングで信号Slot_cnt_enaをハイレベルからローレベルに変化させ、スロットカウンタの値が固定される(図中の矢印(2)参照)。   FIG. 10 is a timing chart for explaining the slot counter synchronization processing by the slot management means 105. The signals shown in FIG. 10 are the same as those shown in FIGS. 8 and 9, and the signal Slot_cnt_ena_q is a signal obtained by delaying the signal Slot_cnt_ena by one clock. Since the bit count reaches a predetermined value at the timing indicated by the broken line (1) in the figure, the slot management means 105 increments the slot counter from slot 1 to slot 2. Thereafter, message reception from the other ECU 1 is started, and the slot management means 105 changes the signal Slot_cnt_ena from the high level to the low level at this timing, and the value of the slot counter is fixed (arrow (2) in the figure). reference).

メッセージの受信処理が正常に終了した場合、プロトコル制御手段102から信号Slot_wrcnt_cmdにより受信終了が通知される。このとき正常に受信したメッセージに含まれるスロット番号がプロトコル制御手段102からスロット管理手段105に信号Slot_wrcntとして与えられており、信号Slot_wrcnt_cmdによる受信終了の通知のタイミングに応じて、スロット管理手段105は、与えられたスロット番号を取り込んでスロットカウンタに設定する(図中の矢印(3)参照)。これにより、スロットカウンタの同期が行われる。   When the message reception process ends normally, the protocol control unit 102 notifies the reception end by the signal Slot_wrcnt_cmd. At this time, the slot number included in the normally received message is given as the signal Slot_wrcnt from the protocol control means 102 to the slot management means 105, and according to the timing of the reception end notification by the signal Slot_wrcnt_cmd, the slot management means 105 The given slot number is taken in and set in the slot counter (see arrow (3) in the figure). As a result, the slot counter is synchronized.

またスロット管理手段105は、信号Slot_wrcnt_cmdによる受信終了の通知が与えられた後、信号Slot_cnt_enaをハイレベルに変化させ、スロットカウンタの更新を許可する。信号Slot_cnt_ena_qがローレベルからハイレベルへ変化することによって、ビットカウントの値が初期化され(図中の矢印(4)参照)、次のサンプリングポイントにてスロットカウンタの値がインクリメントされる(図中の矢印(5)参照)。   In addition, the slot management unit 105 changes the signal Slot_cnt_ena to a high level after the notification of the reception end by the signal Slot_wrcnt_cmd is given, and permits the slot counter to be updated. When the signal Slot_cnt_ena_q changes from the low level to the high level, the value of the bit count is initialized (see the arrow (4) in the figure), and the value of the slot counter is incremented at the next sampling point (in the figure). Arrow (5)).

なお、各ECU1のスロット管理手段105は、メッセージの受信を行う都度、上記のような同期処理を行っている。ただし、メッセージ送信を行うECU1のスロット管理手段105では同期処理は行われない。   Note that the slot management means 105 of each ECU 1 performs the synchronization process as described above each time a message is received. However, the synchronization process is not performed in the slot management means 105 of the ECU 1 that performs message transmission.

<プロトコル制御>
次に、ECU1のプロトコル制御層に含まれるプロトコル制御手段102の動作を説明する。上述のように、本発明の通信プロトコルでは、共通のバス5に接続された複数のECU1がスロット番号及びスロット時間を同期させて、各ECU1が自らに割り当てられたスロット番号の送信順に至った場合にメッセージ送信を行うことで、メッセージの衝突を回避する構成である。プロトコル制御手段102は、図3、図5及び図6等に示したようなスロット番号に応じたメッセージの送受信処理、送信メッセージ中のACKフィールドにACK又はNAKを設定する処理、及び受信したメッセージ中のACKフィールドの値に応じてメッセージを再送信する処理等を行っている。更にプロトコル制御手段102は、通信システムの起動時などに複数のECU1が同期をとって通信を開始するための処理(スタートアップシーケンス)、何らかの通信障害などによって複数のECU1間の同期にずれが生じた場合の再同期処理(再同期シーケンス)、及び、通信システムの動作を停止する場合の処理(スリープシーケンス)等を行っている。
<Protocol control>
Next, the operation of the protocol control means 102 included in the protocol control layer of the ECU 1 will be described. As described above, in the communication protocol of the present invention, when a plurality of ECUs 1 connected to the common bus 5 synchronize slot numbers and slot times, each ECU 1 arrives at the transmission order of slot numbers assigned to itself. In this configuration, message collision is avoided by sending a message. The protocol control unit 102 performs message transmission / reception processing according to the slot number as shown in FIGS. 3, 5, 6 and the like, processing for setting ACK or NAK in the ACK field in the transmission message, and in the received message. The message is retransmitted according to the value of the ACK field. Further, the protocol control unit 102 has a synchronization shift between the plurality of ECUs 1 due to a process (startup sequence) in which the plurality of ECUs 1 synchronize with each other when starting the communication system or the like, and some communication failure. Resynchronization processing (resynchronization sequence) in this case, processing (sleep sequence) in the case of stopping the operation of the communication system, and the like.

本通信システムの各ECU1は、電源投入などによって起動された後、バス5を共有する他のECU1との間でスロットを同期させるための処理を、スタートアップシーケンスとしてプロトコル制御手段102が実行する。スタートアップシーケンスでは、まず、バス5上の信号の有無を調べることによって、既に他のECU1による通信が開始されているか否かを判断し、通信が開始されていないと判断した場合、プロトコル制御手段102は自らのメッセージ送信を開始することによって、他のECU1の起動を促す。また既に通信が開始されていると判断した場合には、プロトコル制御手段102は、他のECU1からのメッセージ受信を行って、受信したメッセージに含まれるスロット番号に同期して以降の通信処理を行う。   After each ECU 1 of the communication system is activated by power-on or the like, the protocol control means 102 executes a process for synchronizing the slot with another ECU 1 sharing the bus 5 as a startup sequence. In the start-up sequence, first, it is determined whether or not communication by another ECU 1 has already been started by checking the presence or absence of a signal on the bus 5, and if it is determined that communication has not started, the protocol control means 102 Prompts activation of another ECU 1 by starting its own message transmission. If it is determined that communication has already started, the protocol control unit 102 receives a message from another ECU 1 and performs subsequent communication processing in synchronization with the slot number included in the received message. .

ただし、通信が開始されていないと複数のECU1が判断した場合には、これら複数のECU1によるメッセージ送信が衝突する可能性がある。このような場合、衝突したメッセージを受信した他のECU1は、このメッセージをスロット1のものとみなして次のスロット以降の通信処理を行い、以降の通信処理において異常を検出したECU1が処理を補正することによって更なるメッセージ衝突の発生を抑制する。   However, if a plurality of ECUs 1 determines that communication has not started, message transmissions by these plurality of ECUs 1 may collide. In such a case, the other ECU 1 that has received the collided message regards this message as being in slot 1 and performs communication processing for the next and subsequent slots, and the ECU 1 that has detected an abnormality in the subsequent communication processing corrects the processing. This suppresses the occurrence of further message collisions.

また、通信システムにおいてメッセージの送受信が正常に開始された後は、上述のようにメッセージ受信の際にスロットの同期を各ECU1が行うことによって、通信システム中の複数のECU1によるメッセージ送受信の同期は保たれるが、何らかの通信障害などによってスロット番号にズレが生じる可能性がある。本通信システムの各ECU1は、このようなズレが生じた場合であっても通信処理を継続し、以降の通信処理において異常を検出したECU1が再同期の処理を行う。各ECU1のプロトコル制御手段102は、自らが送信したスロットから2サイクル後のスロットまでの間に正常に受信したメッセージが存在しない場合に、通信異常が発生していると判断し、再同期シーケンスを実行する。   In addition, after the message transmission / reception is normally started in the communication system, the synchronization of the message transmission / reception by the plurality of ECUs 1 in the communication system is performed by each ECU 1 performing the slot synchronization at the time of message reception as described above. However, there is a possibility that the slot number may be shifted due to some kind of communication failure. Each ECU 1 of the communication system continues the communication process even when such a deviation occurs, and the ECU 1 that detects an abnormality in the subsequent communication process performs the resynchronization process. The protocol control means 102 of each ECU 1 determines that a communication error has occurred when there is no normally received message between the slot transmitted by itself and the slot two cycles later, and the resynchronization sequence is determined. Run.

また、通信システムの動作を停止して低消費電力状態(スリープモード)とする場合、通信システムの各ECU1は他のECU1との間でスリープモードへ移行することに対する合意を得た後に、スリープモードへの移行を行う必要がある。各ECU1がスリープモードへ移行するか否かの判断はアプリケーション層のアプリケーション101が行い、アプリケーション101からプロトコル制御層のプロトコル制御手段102へスリープ要求が与えられた際に、プロトコル制御手段102がスリープモード移行の合意を得るための処理を行う。具体的には、スリープ要求が与えられたプロトコル制御手段102は、スリープビットにレセシブを設定したACKフレームの送信を行うことで他のECU1に対してスリープモードへ移行することを通知する。その後、プロトコル制御手段102は、他のECU1に係る全てのスロットについてスリープビットがレセシブに設定されたACKフレームを所定サイクル分受信した場合に、スリープモード移行の合意が得られたと判断して、スリープモードへ移行する。即ち、本通信システムでは、全てのECU1がスリープモードに移行すると判断し、各ECU1が送信するACKフレームの全てにてスリープビットがレセシブに設定された場合に、全てのECU1がスリープモードへ移行する。これに対して、少なくとも1つのECU1がスリープモードに移行しないと判断し、このECU1がスリープビットをレセシブに設定したACKフレームを送信しない場合には、通信システム中のECU1がスリープモードへ移行することはない。スリープモードへ移行したECU1は、ビットサンプリング手段106によるビットサンプリングのサンプリング周波数を低減するなどの方法によって、消費電力を低減し、他のECU1が送信したメッセージがバス5上に検出された場合に起動(ウェイクアップ)する。   Further, when the operation of the communication system is stopped to enter the low power consumption state (sleep mode), each ECU 1 of the communication system obtains an agreement with other ECUs 1 to enter the sleep mode, and then the sleep mode It is necessary to make a transition to Whether each ECU 1 shifts to the sleep mode is determined by the application 101 of the application layer. When the sleep request is given from the application 101 to the protocol control unit 102 of the protocol control layer, the protocol control unit 102 Process to obtain a consensus on migration. Specifically, the protocol control unit 102 to which the sleep request is given notifies the other ECU 1 of shifting to the sleep mode by transmitting an ACK frame in which the sleep bit is set to recessive. After that, the protocol control means 102 determines that an agreement to shift to the sleep mode has been obtained when the ACK frame having the sleep bit set to recessive is received for a predetermined cycle for all slots related to the other ECU 1, Transition to mode. That is, in this communication system, when all ECUs 1 are determined to shift to the sleep mode and the sleep bit is set to recessive in all the ACK frames transmitted by each ECU 1, all the ECUs 1 shift to the sleep mode. . On the other hand, if at least one ECU 1 determines not to shift to the sleep mode and the ECU 1 does not transmit an ACK frame with the sleep bit set to recessive, the ECU 1 in the communication system shifts to the sleep mode. There is no. The ECU 1 that has shifted to the sleep mode reduces power consumption by a method such as reducing the sampling frequency of the bit sampling by the bit sampling means 106 and is activated when a message transmitted from another ECU 1 is detected on the bus 5. (Wake up).

各ECU1のプロトコル制御手段102は、上記のスタートアップシーケンス、再同期シーケンス及びスリープシーケンス等の例外的な処理を行う以外は、図3、図5及び図6等に示すように、スロット番号に応じたメッセージの送受信処理、送信メッセージ中のACKフィールドにACK又はNAKを設定する処理、及び受信したメッセージ中のACKフィールドの値に応じてメッセージを再送信する処理等を行っている。各ECU1のプロトコル制御手段102は、自らのメッセージ送信の完了後から1サイクルの間に、他のECU1からNAKの応答を含むメッセージを受信せず、且つ、少なくとも他の1つのECU1からACKの応答を含むメッセージを受信した場合に、自ら送信したメッセージが正常に受信されたと判断し、新たなメッセージ送信を行う。これに対してプロトコル制御手段102は、他のECU1からNAKの応答を含むメッセージを1つ以上受信するか、又は、ACKの応答を含むメッセージを全く受信しない場合に、自ら送信したメッセージが正常に受信されなかったと判断し、メッセージの再送信を行う。またプロトコル制御手段102は、他のECU1からACK/NAKを判別できないような異常なメッセージを受信した場合にも、自ら送信したメッセージが正常に受信されなかったと判断し、メッセージの再送信を行う。   The protocol control means 102 of each ECU 1 corresponds to the slot number as shown in FIG. 3, FIG. 5, FIG. 6, etc., except for performing exceptional processing such as the above startup sequence, resynchronization sequence and sleep sequence A message transmission / reception process, a process of setting ACK or NAK in the ACK field in the transmission message, a process of retransmitting the message according to the value of the ACK field in the received message, and the like are performed. The protocol control means 102 of each ECU 1 does not receive a message including a NAK response from another ECU 1 within one cycle after completion of its own message transmission, and receives an ACK response from at least one other ECU 1. When a message including “” is received, it is determined that the message transmitted by itself is normally received, and a new message is transmitted. On the other hand, when the protocol control means 102 receives one or more messages including a NAK response from another ECU 1 or does not receive any message including an ACK response, the protocol control means 102 normally transmits the message. Judge that it was not received and resend the message. Also, the protocol control unit 102 determines that the message transmitted by itself is not normally received even when an abnormal message that cannot determine ACK / NAK is received from another ECU 1, and retransmits the message.

図11は、プロトコル制御手段102によるメッセージ送信の成否判定を説明するための模式図である。なお、図11においては、6つのECU1に1つずつのスロットが割り当てられた通信システムにて、スロット1が割り当てられたECU1がメッセージ送信の成否判定を行う場合を示してあり、スロット2〜スロット6の期間に受信したメッセージのACKフィールドに含まれるスロット1に係るACK/NAKの応答結果を示してある。   FIG. 11 is a schematic diagram for explaining the success / failure determination of message transmission by the protocol control means 102. FIG. 11 shows a case where the ECU 1 to which the slot 1 is assigned makes a message transmission success / failure determination in the communication system in which one slot is assigned to each of the six ECUs 1. 6 shows an ACK / NAK response result related to slot 1 included in the ACK field of the message received during the period 6.

スロット1が割り当てられたECU1のプロトコル制御手段102は、自送信後のスロット2〜スロット6の期間に受信したメッセージに含まれるACKフィールドのACK1の値をそれぞれ調べ、全てのメッセージについてACKが設定されていた場合には、自らのメッセージ送信が成功したと判断する(図11のケース1参照)。また少なくとも1つのECU1から受信したメッセージにACKが設定され、その他のECU1からのメッセージを受信しない場合についても、プロトコル制御手段102は、自らのメッセージ送信が成功したと判断する(図11のケース2参照)。   The protocol control means 102 of the ECU 1 to which slot 1 is assigned checks the value of ACK 1 in the ACK field included in the message received during the period from slot 2 to slot 6 after its own transmission, and ACK is set for all messages. If so, it is determined that the message transmission was successful (see case 1 in FIG. 11). Further, even when an ACK is set in a message received from at least one ECU 1 and no message is received from any other ECU 1, the protocol control means 102 determines that its own message transmission has succeeded (case 2 in FIG. 11). reference).

これに対して、スロット2〜スロット6の期間に受信したメッセージにNAKが設定されているものが1つでも存在する場合には、プロトコル制御手段102は、自らのメッセージ送信が失敗したと判断し(図11のケース3参照)、メッセージの再送信を行う。またスロット2〜スロット6の期間にメッセージを全く受信しない場合にも、プロトコル制御手段102は、自らのメッセージ送信が失敗したと判断し(図11のケース4参照)、メッセージの再送信を行う。また、スロット2〜スロット6の期間に、ACK/NAKを判断できない異常なメッセージを受信した場合、プロトコル制御手段102は、自らのメッセージ送信が失敗したと判断し(図11のケース5参照)、メッセージの再送信を行う。   On the other hand, if there is at least one message set with NAK in the message received during the period from slot 2 to slot 6, the protocol control means 102 determines that its message transmission has failed. (Refer to case 3 in FIG. 11), the message is retransmitted. Even when no message is received during the period from slot 2 to slot 6, the protocol control means 102 determines that its own message transmission has failed (see case 4 in FIG. 11) and retransmits the message. Further, when an abnormal message in which ACK / NAK cannot be determined is received during the period from slot 2 to slot 6, the protocol control means 102 determines that its message transmission has failed (see case 5 in FIG. 11). Resend the message.

図12及び図13は、プロトコル制御手段102によるメッセージ再送信処理を説明するための模式図である。なお、図12及び図13においては、通信の1サイクルが6スロットで構成される通信システムにおいて、バス5上にて送受信される3サイクル分のメッセージを時系列で示してある。   12 and 13 are schematic diagrams for explaining message retransmission processing by the protocol control unit 102. FIG. In FIGS. 12 and 13, messages for three cycles transmitted and received on the bus 5 are shown in time series in a communication system in which one cycle of communication is composed of six slots.

まず、図12に示す例では、1番目のサイクル(サイクル1)のスロット1〜スロット6と、2番目のサイクル(サイクル2)のスロット1〜スロット2とにおいて、メッセージA〜メッセージHが正しく送受信され、メッセージB〜メッセージIのACKフィールドは全てのビットにACKが設定されている。サイクル2のスロット3にて送信されたメッセージIが受信側の(全ての)ECU1にて正しく受信されなかった場合、その後のサイクル2のスロット4〜スロット6と、3番目のサイクル(サイクル3)のスロット1〜スロット2とにおいて送信されるメッセージJ〜メッセージNのACKフィールドには、スロット3に対応するビットにNAKが設定される。スロット3が割り当てられたECU1は、メッセージJ〜メッセージNに設定されたNAKに対応して、サイクル3のスロット3にてメッセージIの再送信を行う。   First, in the example shown in FIG. 12, message A to message H are correctly transmitted and received in slot 1 to slot 6 of the first cycle (cycle 1) and slot 1 to slot 2 of the second cycle (cycle 2). In the ACK field of message B to message I, ACK is set in all bits. When the message I transmitted in the slot 3 of the cycle 2 is not correctly received by the (all) ECUs 1 on the receiving side, the slot 4 to the slot 6 of the subsequent cycle 2 and the third cycle (cycle 3) NAK is set to the bit corresponding to slot 3 in the ACK field of message J to message N transmitted in slots 1 to 2. The ECU 1 to which the slot 3 is assigned retransmits the message I in the slot 3 of the cycle 3 in response to the NAK set in the messages J to N.

次に、図13に示す例では、サイクル1のスロット1〜スロット6と、サイクル2のスロット1〜スロット2とにおいて、メッセージA〜メッセージHが正しく送受信され、メッセージB〜メッセージIのACKフィールドは全てのビットにACKが設定されている。サイクル2のスロット3にて送信されたメッセージIが、ACKフィールドの各ビットがACKであるかNAKであるか判別不可能な異常メッセージとして受信側の(全ての)ECU1にて受信された場合、その後のサイクル2のスロット4〜スロット6と、サイクル3のスロット1〜スロット3とにおいて、各ECU1はメッセージIのACKフィールドによる受信成否の判断が行えなかったため、メッセージD〜メッセージIの再送信を行う。   Next, in the example shown in FIG. 13, message A to message H are correctly transmitted and received in slot 1 to slot 6 of cycle 1 and slot 1 to slot 2 of cycle 2, and the ACK field of message B to message I is ACK is set for all bits. When the message I transmitted in the slot 3 of the cycle 2 is received by the (all) ECUs 1 on the receiving side as an abnormal message in which it is impossible to determine whether each bit of the ACK field is ACK or NAK, In subsequent slots 2 to 6 of cycle 2 and slots 1 to 3 of cycle 3, each ECU 1 could not determine the success or failure of reception according to the ACK field of message I, and therefore retransmits message D to message I. Do.

このように、通信システムの各ECU1が、送信するメッセージのACKフィールドに他のECU1からのメッセージ受信の成否を設定すると共に、受信したメッセージのACKフィールドに設定されたACK/NAKに応じてメッセージの再送信を行う構成とすることによって、通信システムの全てのECU1が確実にメッセージを受信できる。   In this way, each ECU 1 of the communication system sets success / failure of message reception from other ECUs 1 in the ACK field of the message to be transmitted, and the message of the message according to the ACK / NAK set in the ACK field of the received message. By adopting a configuration for performing retransmission, all the ECUs 1 of the communication system can reliably receive the message.

<エラー制御>
図14は、本発明に係る通信システムにて検出される通信エラーの一覧を示す図表である。本発明の通信プロトコルでは、従来のCANプロトコルと同様のスタッフエラー、CRCエラー、フォームエラー及びACKエラーを検出するが、従来のCANプロトコルで検出されたビットエラーの検出は行わない。なお本発明の通信プロトコルのACKエラーは、従来のCANプロトコルのACKエラーとは検出方法などが異なるものである。
<Error control>
FIG. 14 is a chart showing a list of communication errors detected in the communication system according to the present invention. The communication protocol of the present invention detects stuff errors, CRC errors, form errors and ACK errors similar to those of the conventional CAN protocol, but does not detect bit errors detected by the conventional CAN protocol. Note that the ACK error of the communication protocol of the present invention is different in detection method from the ACK error of the conventional CAN protocol.

本発明の通信プロトコルでは、従来のCANプロトコルと同様に、メッセージのSOFからCRCフィールドのCRCシーケンスまでを送信する際に、同一の信号レベルが5ビット連続する場合には次のビットに1ビットの反転データを付加する処理を行う。この処理をビットスタッフといい、スタッフエラーは、受信したメッセージのSOFからCRCシーケンスまでに同一の信号レベルが6ビット連続している場合に検出されるエラーである。   In the communication protocol of the present invention, when transmitting from the SOF of the message to the CRC sequence of the CRC field in the same manner as the conventional CAN protocol, if the same signal level is 5 bits continuous, 1 bit is added to the next bit. Performs processing to add inverted data. This process is called bit stuffing. The stuffing error is an error detected when the same signal level continues for 6 bits from the SOF to the CRC sequence of the received message.

CRCエラーは、受信したメッセージに含まれるCRCシーケンスの値と、受信したメッセージから算出したCRCの値とが異なる場合に検出されるエラーである。フォームエラーは、ドミナント又はレセシブのいずれかに値が固定されたビット(CRCデリミタ及びEOF)について、受信メッセージのこのビットの値が定められた固定値と異なる場合に検出されるエラーである。   The CRC error is an error detected when the CRC sequence value included in the received message is different from the CRC value calculated from the received message. A form error is an error that is detected for a bit whose value is fixed to either dominant or recessive (CRC delimiter and EOF) when the value of this bit in the received message differs from a fixed value.

ACKエラーは、受信したメッセージのACKフィールドに含まれるいずれかのビットがNAKに設定されていた場合に検出されるエラーである。従来のCANプロトコルでは、メッセージ中の1ビットのACKスロットがレセシブの場合にACKエラーを検出しており、通信システム中の少なくとも1つの通信装置にてメッセージが受信されればACKスロットがドミナントに設定されるため、送信側の通信装置は受信側のいずれの通信装置がメッセージを正常に受信し、いずれの通信装置がメッセージを正常に受信していないかを確認することはできない。これに対して本発明の通信プロトコルでは、メッセージ中のACKフィールドには各ECU1に割り当てられるスロット毎にACKビットが設けられているため、送信側のECU1は、自らのメッセージ送信後の1サイクルにて受信したメッセージのACKフィールドを調べることによって、他のECU1がメッセージを正常に受信したか否かを個別に判断することができる。   The ACK error is an error detected when any bit included in the ACK field of the received message is set to NAK. In the conventional CAN protocol, an ACK error is detected when a 1-bit ACK slot in a message is recessive, and if a message is received by at least one communication device in the communication system, the ACK slot is set to be dominant. Therefore, the communication device on the transmission side cannot confirm which communication device on the reception side normally receives the message and which communication device does not normally receive the message. On the other hand, in the communication protocol of the present invention, the ACK field in the message is provided with an ACK bit for each slot assigned to each ECU 1, so that the ECU 1 on the transmission side is in one cycle after transmitting its own message. By examining the ACK field of the received message, it can be individually determined whether or not the other ECU 1 has received the message normally.

また、従来のCANプロトコルでは、各通信装置はバスに信号を送信した後にバスの信号レベルを検出する処理を行っており、このときに送信した信号の信号レベルと検出した信号レベルとが一致しない場合にビットエラーを検出していた。本発明の通信プロトコルでは、各ECU1は信号送信後にバス5の信号レベルを検出しないため、このビットエラーについては検出しない。   In the conventional CAN protocol, each communication device performs processing for detecting the signal level of the bus after transmitting a signal to the bus, and the signal level of the signal transmitted at this time does not match the detected signal level. If a bit error was detected. In the communication protocol of the present invention, each ECU 1 does not detect the signal level of the bus 5 after signal transmission, and therefore does not detect this bit error.

通信システムの各ECU1は、他のECU1からのメッセージを受信した際に上記のエラー検出を行い、いずれかのエラーを検出した場合には、エラー検出後の1サイクル期間内に自らが送信するメッセージに含まれるACKフィールドの対応するビットにNAKを設定して送信を行う。   Each ECU 1 of the communication system performs the above error detection when receiving a message from another ECU 1, and when any error is detected, a message transmitted by itself within one cycle period after the error is detected. The NACK is set to the corresponding bit of the ACK field included in the transmission and transmission is performed.

次に、ECU1のプロトコル制御層に含まれるエラー制御手段103の動作を説明する。従来のCANプロトコルでは、エラーが多発して故障などの疑いがある通信装置は、メッセージ送受信の処理を停止して通信システム全体に悪影響を与えることを防止する機能が備えられており、本発明の通信プロトコルについても同様の機能を備えている。このようなエラーに関する制御処理は、各ECU1のエラー制御手段103にて行われる。   Next, the operation of the error control means 103 included in the protocol control layer of the ECU 1 will be described. In the conventional CAN protocol, a communication device that frequently has errors and is suspected of having a failure or the like is provided with a function of stopping the message transmission / reception process and preventing the communication system from being adversely affected. The communication protocol has the same function. Such error-related control processing is performed by the error control means 103 of each ECU 1.

エラー制御手段103は、エラーの発生数をカウントするために2つのカウンタ、TEC(Transmit Error Counter、送信エラーカウンタ)及びREC(Receive Error Counter、受信エラーカウンタ)を有している。図15は、エラーカウンタの変動条件を示す図表である。各ECU1は、自らのメッセージ送信後の1サイクル間に、受信メッセージ中のACKフィールドに含まれる自送信に係るビットの値を調べることによって、他の全てのECU1から自送信のメッセージに対するNAKが与えられていた場合に、TECの値に8を加算する。反対に、各ECU1は、他の全てのECU1から自送信のメッセージに対するACKが与えられ、メッセージ送信に成功した場合には、TECの値から1を減算する(ただしTEC=0の場合は変動なし)。   The error control means 103 has two counters, a TEC (Transmit Error Counter) and a REC (Receive Error Counter) in order to count the number of occurrences of errors. FIG. 15 is a chart showing variation conditions of the error counter. Each ECU 1 gives the NAK for the self-transmitted message from all other ECUs 1 by checking the value of the bit related to the self-transmission included in the ACK field in the received message during one cycle after the transmission of its own message. If so, 8 is added to the TEC value. On the other hand, each ECU 1 is given an ACK for its own message from all other ECUs 1 and subtracts 1 from the TEC value if the message transmission is successful (however, no change occurs when TEC = 0). ).

各ECU1は、受信したメッセージにてフォームエラー、CRCエラー又はスタッフエラーを検出した場合に、RECの値に1を加算する。また各ECU1は、受信したメッセージに何らかのエラーを検出し、このメッセージに対する応答としてNAKを設定する判定をしたが、その後に他のECU1から受信したメッセージから、自らがNAKと判定したメッセージが他のECU1でACKと判定されていた場合、RECの値に8を加算する。   Each ECU 1 adds 1 to the value of REC when a form error, CRC error or stuff error is detected in the received message. Each ECU 1 detects some error in the received message, and determines to set NAK as a response to this message. However, the message that it has determined as NAK from other messages received from other ECUs 1 If the ECU 1 determines ACK, 8 is added to the value of REC.

反対に、各ECU1は、一のメッセージを受信した後の1サイクルにおいて更に受信した他のメッセージに含まれるACKフィールドを調べることによって、当該一のメッセージが他のECU1によっても正常に受信されたか否かを調べ、他の全てのECU1にて正常受信されていた場合に、RECの値を減算する。このとき各ECU1は、1≦REC≦127であればRECの値から1を減算し、REC>127であればRECの値を119〜127に設定する(ただしREC=0の場合は変動なし)。   On the other hand, each ECU 1 checks whether or not the one message has been normally received by other ECUs 1 by checking the ACK field included in another message further received in one cycle after receiving the one message. If all other ECUs 1 have received normally, the value of REC is subtracted. At this time, each ECU 1 subtracts 1 from the value of REC if 1 ≦ REC ≦ 127, and sets the value of REC to 119 to 127 if REC> 127 (but no change when REC = 0). .

また各ECU1は、所定数以上のエラーが検出されてメッセージの送信を停止した状態(バスオフ状態、後述する)から復帰した場合に、TEC及びRECの値を0にクリアする。   Each ECU 1 clears the values of TEC and REC to 0 when a predetermined number of errors or more are detected and the message transmission is stopped (bus off state, which will be described later).

図16は、エラー制御手段103の動作を説明するための状態遷移図である。エラー制御手段103は、TEC及びRECの2つのカウンタの値に応じて、ECU1のエラー制御に係る状態を管理している。エラー制御手段103がこれらの状態をプロトコル制御手段102へ通知することによって、プロトコル制御手段102はエラーの状態に適したメッセージ送受信の処理を行うことができる。エラー制御に係る状態は、エラーアクティブ状態、エラーパッシブ状態及びバスオフ状態の3状態であり、ECU1の起動直後の状態(即ち初期状態)はエラーアクティブ状態である。またTEC及びRECの値は、ECU1の起動時に0にクリアされている。   FIG. 16 is a state transition diagram for explaining the operation of the error control means 103. The error control means 103 manages the state relating to error control of the ECU 1 according to the values of the two counters TEC and REC. The error control unit 103 notifies the protocol control unit 102 of these states, so that the protocol control unit 102 can perform message transmission / reception processing suitable for the error state. The states relating to error control are three states of an error active state, an error passive state, and a bus off state, and a state immediately after the ECU 1 is started (that is, an initial state) is an error active state. The values of TEC and REC are cleared to 0 when the ECU 1 is started.

エラーアクティブ状態は、ECU1の通常動作状態であり、ECU1がメッセージの送受信を制限なく行うことができる状態である。エラーアクティブ状態のECU1が送信するメッセージは、エラーアクティブビットがドミナントに設定される。エラーアクティブ状態にて、TECの値が127を超えるか、又は、RECの値が127を超えた場合、エラー制御手段103は、エラーアクティブ状態からエラーパッシブ状態への遷移を行う。   The error active state is a normal operation state of the ECU 1 and is a state in which the ECU 1 can send and receive messages without restriction. In the message transmitted by the ECU 1 in the error active state, the error active bit is set to dominant. When the TEC value exceeds 127 or the REC value exceeds 127 in the error active state, the error control means 103 makes a transition from the error active state to the error passive state.

エラーパッシブ状態は、エラーカウンタの値が一定値を超えたため、メッセージ送信が制限された状態である。エラーアクティブ状態のECU1は、割り当てられた1つのスロットに関するメッセージ送信を2サイクルに1回のみ行うように、メッセージ送信が制限される。これにより、故障などの疑いがあるECU1のメッセージ送信が、他のECU1のメッセージ送受信の妨げとなることが抑制される。   The error passive state is a state in which message transmission is restricted because the value of the error counter exceeds a certain value. The ECU 1 in the error active state is limited in message transmission so that message transmission related to one assigned slot is performed only once every two cycles. Thereby, the message transmission of the ECU 1 suspected of being out of order is prevented from interfering with the message transmission / reception of other ECUs 1.

またエラーパッシブ状態のECU1が送信するメッセージは、エラーアクティブビットがレセシブに設定される。エラーアクティブビットがレセシブに設定されたメッセージを受信したECU1は、このメッセージのACKフィールドにNAKが設定されていた場合であっても、このNAKの応答を無視して(メッセージの受信失敗とみなさずに)処理を行う。エラーアクティブフラグがレセシブに設定されたメッセージであっても、ACKフィールドにACKが設定されたメッセージであれば、このメッセージを受信したECU1は、通常のACKが設定されたメッセージを受信した場合と同様の処理を行えばよい。即ち、本発明の通信プロトコルでは、メッセージ中のエラーアクティブビットをレセシブに設定し、ACKフィールドをNAKに設定することによって、このメッセージを従来のCANプロトコルのエラーフレーム(パッシブエラーフラグ)の代替として利用している。   Further, the error active bit is set to recessive in the message transmitted by the ECU 1 in the error passive state. The ECU 1 that has received the message in which the error active bit is set to recessive ignores the response of this NAK even if NAK is set in the ACK field of this message (not regarded as message reception failure). To process). Even if the error active flag is set to recessive, as long as the ACK field is set to ACK, the ECU 1 receiving this message is the same as when receiving a message with normal ACK set May be performed. That is, in the communication protocol of the present invention, the error active bit in the message is set to recessive and the ACK field is set to NAK, so that this message can be used as an alternative to the error frame (passive error flag) of the conventional CAN protocol. doing.

エラーパッシブ状態にて、TEC及びRECの値が共に127以下となった場合、エラー制御手段103は、エラーパッシブ状態からエラーアクティブ状態への遷移を行う。またエラーパッシブ状態にて、TECの値が255を超えた場合、エラー制御手段103は、エラーパッシブ状態からバスオフ状態への遷移を行う。   When both the TEC and REC values are 127 or less in the error passive state, the error control means 103 makes a transition from the error passive state to the error active state. When the TEC value exceeds 255 in the error passive state, the error control means 103 makes a transition from the error passive state to the bus off state.

バスオフ状態は、エラーカウンタの値が更に増加して一定値を超えたため、ECU1が故障などの異常状態に至ったものとみなして、メッセージの送受信が禁じられた状態である。このためバスオフ状態のECU1は、バスオフ状態が解除される所定の条件が満たされるまで、一切のメッセージ送受信を行うことができない。バスオフ状態のECU1は、アプリケーション101からプロトコル制御手段102に対するバスオフクリアの要求が与えられた場合(バスオフクリア条件が成立した場合)、エラー制御手段103は、バスオフ状態からエラーアクティブ状態への遷移を行うと共に、TEC及びRECの値をクリアする。   In the bus-off state, the value of the error counter further increases and exceeds a certain value, so that it is considered that the ECU 1 has reached an abnormal state such as a failure, and message transmission / reception is prohibited. For this reason, the ECU 1 in the bus-off state cannot perform any message transmission / reception until a predetermined condition for releasing the bus-off state is satisfied. When the bus-off state ECU 1 receives a request for clearing the bus-off from the application 101 to the protocol control unit 102 (when the bus-off clear condition is satisfied), the error control unit 103 makes a transition from the bus-off state to the error-active state. And clear the TEC and REC values.

本発明の各ECU1が上述のエラー制御処理を行うことによって、従来のCANプロトコルと同等のエラー制御が実現できる。   When each ECU 1 of the present invention performs the above-described error control processing, error control equivalent to the conventional CAN protocol can be realized.

<プロトコル制御詳細>
次に、本発明の通信プロトコルによる制御処理の詳細を状態遷移図に従って説明する。図17は、ECU1の通信制御処理に係る動作を説明するための状態遷移図である。なお、以下の説明において、”X”は通信処理のスタートアップに用いるカウンタの値を示し、スロットカウンタの更新に伴ってカウンタXの値を減じ、カウンタXの値が0になった場合にECU1がメッセージの再送信を行う。なおカウンタXは、メッセージ送信までの待機時間を計時する計時手段に相当する。また、”N”は1サイクルのスロット数を示し、”i”は各ECU1に割り当てられたスロット番号のうちの最小番号を示す。
<Protocol control details>
Next, details of the control processing according to the communication protocol of the present invention will be described with reference to a state transition diagram. FIG. 17 is a state transition diagram for explaining an operation related to the communication control process of the ECU 1. In the following description, “X” indicates a counter value used for start-up of communication processing. When the counter X value is reduced to 0 with the update of the slot counter, the ECU 1 Resend the message. The counter X corresponds to time measuring means for measuring the waiting time until message transmission. “N” indicates the number of slots in one cycle, and “i” indicates the minimum number among the slot numbers assigned to each ECU 1.

本発明の通信プロトコルにおいて、各ECU1は、初期状態、初期異常状態、同期準備状態、同期待ち状態、同期状態、スリープ準備状態、バススリープ状態及びバスオフ状態の8つの動作状態を遷移して、通信制御処理を行っている。初期状態は、ECU1が通信を開始する前の状態であり、機器の電源投入後(パワーオンリセット後)又はリセット信号入力後等にECU1はこの状態となる。初期状態においてECU1は、外部の機器からの入力によって又は予め記憶したデータを読み出すことによって、通信を行うために必要な情報(スロット数及びスロット番号等)を取得して初期設定を完了した後、他のECU1との通信の同期を行うべく同期準備状態へ遷移する。ただしECU1は、初期状態において異常が発生した場合又は初期設定に失敗した場合等には、初期状態から初期異常状態へ遷移し、初期異常状態で待機する。   In the communication protocol of the present invention, each ECU 1 makes a transition between eight operating states of an initial state, an initial abnormal state, a synchronization preparation state, a synchronization waiting state, a synchronization state, a sleep preparation state, a bus sleep state, and a bus off state, Control processing is performed. The initial state is a state before the ECU 1 starts communication, and the ECU 1 is in this state after the device is turned on (after a power-on reset) or after a reset signal is input. In the initial state, the ECU 1 acquires information (such as the number of slots and the slot number) necessary for communication by input from an external device or by reading data stored in advance and completes initial setting. Transition is made to a synchronization preparation state in order to synchronize communication with other ECUs 1. However, when an abnormality occurs in the initial state or when the initial setting fails, the ECU 1 transitions from the initial state to the initial abnormal state and stands by in the initial abnormal state.

図18は、初期状態におけるECU1の処理手順を示すフローチャートである。なお、図18〜図26に示すフローチャートにおいては、リセット信号が入力された場合に初期状態へ遷移する処理、及び、バスオフ条件が成立した場合にバスオフ状態へ遷移する処理等の例外的な処理は図示を省略してある。また図18〜図26のフローチャートに示す処理は、ECU1のプロトコル制御層のプロトコル制御手段102にて行われる処理である。   FIG. 18 is a flowchart showing the processing procedure of the ECU 1 in the initial state. In the flowcharts shown in FIGS. 18 to 26, exceptional processes such as a process of transitioning to an initial state when a reset signal is input and a process of transitioning to a bus off state when a bus off condition is satisfied are performed. The illustration is omitted. The processing shown in the flowcharts of FIGS. 18 to 26 is processing performed by the protocol control means 102 in the protocol control layer of the ECU 1.

初期状態に遷移したECU1は、まず、スロット数及びスロット番号等の情報を取得して初期設定を行う(ステップS1)。次いでECU1は、初期設定にて異常が発生したか否かを判定し(ステップS2)、異常が発生した場合には(S2:YES)、初期異常状態へ遷移指定(ステップS3)、処理を終了する。異常が発生せずに初期設定を完了した場合(S2:NO)、ECU1は、カウンタXの値を(3N)に設定し(ステップS4)、スロットカウントの動作を開始して(ステップS5)、同期準備状態へ遷移し(ステップS6)、初期状態の処理を終了する。   The ECU 1 that has transitioned to the initial state first obtains information such as the number of slots and the slot number and performs initial setting (step S1). Next, the ECU 1 determines whether or not an abnormality has occurred in the initial setting (step S2). If an abnormality has occurred (S2: YES), the transition designation to the initial abnormality state is designated (step S3), and the process is terminated. To do. When the initial setting is completed without any abnormality (S2: NO), the ECU 1 sets the value of the counter X to (3N) (step S4) and starts the slot count operation (step S5). A transition is made to the synchronization preparation state (step S6), and the processing in the initial state is terminated.

同期準備状態は、他のECU1が既にメッセージの送信を行っているか否かを確認するための状態であり、最大で2サイクルの間、メッセージの受信に徹する。ECU1は、バス5上にメッセージが送信されているか否かを調べ、他のECU1が送信したメッセージを検出した場合には、このメッセージに同期すべく受信処理を行う。即ち、ECU1は、メッセージを正常に受信した場合には、同期状態へ遷移して、このメッセージに同期して以降の処理を行う。またECU1は、メッセージを正常に受信できなかった場合(異常なメッセージを受信した場合)には、同期待ち状態へ遷移して、正常なメッセージの受信を待つべくカウンタ”X”の再設定を行う。また他のECU1がメッセージ送信を開始しておらず、2サイクルの間にバス5上のメッセージが検出されなかった場合(カウンタ”X”が0になった場合)、ECU1は自らがメッセージ送信を開始すべく、同期待ち状態へ遷移し、同期待ち状態にてACKフレームの送信を行う。   The synchronization preparation state is a state for confirming whether or not another ECU 1 has already transmitted a message, and is devoted to receiving a message for a maximum of two cycles. The ECU 1 checks whether or not a message is transmitted on the bus 5, and when a message transmitted by another ECU 1 is detected, the ECU 1 performs reception processing to synchronize with this message. That is, when the message is normally received, the ECU 1 transitions to a synchronous state and performs the subsequent processing in synchronization with this message. Further, when the message cannot be normally received (when an abnormal message is received), the ECU 1 shifts to the synchronization waiting state and resets the counter “X” to wait for the reception of the normal message. . If another ECU 1 has not started sending a message and no message on the bus 5 is detected during two cycles (when the counter “X” becomes 0), the ECU 1 itself sends a message. In order to start, a transition is made to the synchronization wait state, and an ACK frame is transmitted in the synchronization wait state.

図19及び図20は、同期準備状態におけるECU1の処理手順を示すフローチャートであり、同期準備状態においてECU1は図19及び図20に示す処理を繰り返し行っている。同期準備状態のECU1は、スロットカウンタの値を調べることによって、スロットが更新されたか否か(スロット番号が変化したか否か)を判定し(ステップS11)、スロットが更新されていない場合には(S11:NO)、スロットが更新されるまで待機する。スロットが更新された場合(S11:YES)、ECU1は、カウンタXの値から1を減算し(ステップS12)、カウンタXの値が0であるか否かを更に判定する(ステップS13)。カウンタXの値が0の場合(S13:YES)、即ちメッセージを受信することなくカウンタXの値が0に達した場合、ECU1は、同期待ち状態へ遷移し(ステップS14)、同期準備状態の処理を終了する。(ECU1は、同期待ち状態へ遷移後にACKフレームの送信を行う。)   19 and 20 are flowcharts showing the processing procedure of the ECU 1 in the synchronization preparation state. In the synchronization preparation state, the ECU 1 repeatedly performs the processing shown in FIGS. 19 and 20. The ECU 1 in the synchronization preparation state determines whether the slot has been updated (whether the slot number has changed) by checking the value of the slot counter (step S11). If the slot has not been updated, (S11: NO), waiting until the slot is updated. When the slot is updated (S11: YES), the ECU 1 subtracts 1 from the value of the counter X (step S12), and further determines whether or not the value of the counter X is 0 (step S13). When the value of the counter X is 0 (S13: YES), that is, when the value of the counter X reaches 0 without receiving a message, the ECU 1 shifts to a synchronization waiting state (step S14), and is in a synchronization ready state. The process ends. (ECU 1 transmits an ACK frame after transitioning to the synchronization wait state.)

また、カウンタXの値が0でない場合(S13:NO)、ECU1は、正常なメッセージを受信したか否かを判定する(ステップS17)。正常なメッセージを受信していない場合(S17:NO)、ECU1は、異常なメッセージを受信したか否かを更に判定する(ステップS20)。異常なメッセージを受信していない場合(S20:NO)、即ち他のECU1からのメッセージを全く受信していない場合には、ECU1は、処理を終了する(ただし図示の処理は同期準備状態において繰り返し行われており、ステップS11へECU1の処理が戻る)。   If the value of the counter X is not 0 (S13: NO), the ECU 1 determines whether a normal message has been received (step S17). If a normal message has not been received (S17: NO), the ECU 1 further determines whether or not an abnormal message has been received (step S20). If an abnormal message has not been received (S20: NO), that is, if no message has been received from another ECU 1, the ECU 1 ends the process (however, the illustrated process is repeated in the synchronization preparation state). The processing of the ECU 1 is returned to step S11).

正常なメッセージを受信した場合(S17:YES)、ECU1は、カウンタXの値を(2N)に設定し(ステップS18)、同期状態へ遷移して(ステップS19)、同期準備状態の処理を終了する。また異常なメッセージを受信した場合(S20:YES)、ECU1は、カウンタXの値が(N+i−2)より大きいか否かを更に判定する(ステップS21)。カウンタXの値が(N+iー2)より大きい場合(S21:YES)、ECU1は、カウンタXの値に(2N+i−2)を設定し(ステップS22)、同期待ち状態へ遷移して(ステップS23)、同期準備状態の処理を終了する。またカウンタXの値が(N+i−2)以下の場合(S21:NO)、ECU1は、カウンタXの値に(N+i−2)を設定し(ステップS24)、同期待ち状態へ遷移して(ステップS23)、処理を終了する。   When a normal message is received (S17: YES), the ECU 1 sets the value of the counter X to (2N) (step S18), transitions to the synchronization state (step S19), and ends the process of the synchronization preparation state To do. When an abnormal message is received (S20: YES), the ECU 1 further determines whether or not the value of the counter X is larger than (N + i−2) (step S21). When the value of the counter X is larger than (N + i−2) (S21: YES), the ECU 1 sets (2N + i−2) as the value of the counter X (step S22), and transitions to a synchronization waiting state (step S23). ), And finishes the processing of the synchronization preparation state. If the value of the counter X is equal to or less than (N + i−2) (S21: NO), the ECU 1 sets the value of the counter X to (N + i−2) (step S24), and transitions to a synchronization wait state (step S24). S23), the process is terminated.

同期待ち状態は、他のECU1からのメッセージ受信を待つ状態であり、他のECU1からのメッセージを正常に受信した場合に、ECU1は受信したメッセージに同期して処理を開始し、同期状態へ遷移する。同期待ち状態において、異常なメッセージを受信した場合、ECU1は、このメッセージの再送信を待つ。また同期待ち状態において、他のECU1からのメッセージを全く受信しなかった場合(カウンタ”X”が0になった場合)、ECU1は、ACKフレームを送信する。また同期準備状態にてカウンタXの値が0となって同期待ち状態へ遷移した場合、ECU1は、まずACKフレームの送信を行う。   The state of waiting for synchronization is a state of waiting for reception of a message from another ECU 1. When a message from another ECU 1 is normally received, the ECU 1 starts processing in synchronization with the received message and transitions to the synchronization state. To do. When an abnormal message is received in the synchronization waiting state, the ECU 1 waits for retransmission of this message. Further, when no message is received from another ECU 1 in the synchronization waiting state (when the counter “X” becomes 0), the ECU 1 transmits an ACK frame. Further, when the value of the counter X becomes 0 in the synchronization preparation state and the state transitions to the synchronization waiting state, the ECU 1 first transmits an ACK frame.

図21は、同期待ち状態におけるECU1の処理手順を示すフローチャートである。同期待ち状態に遷移したECU1は、まず、カウンタXの値が0であるか否かを調べ(ステップS30)、これにより同期準備状態にてカウンタXの値が0となって同期待ち状態へ遷移したか否かを判断する。カウンタXの値が0の場合(S30:YES)、ECU1は、カウンタXの値に(2N+i−2)を設定し(ステップS34)、ACKフレームを送信して(ステップS35)、ステップS31へ処理を進める。またカウンタXの値が0でない場合(S30:NO)、ECU1は、ステップS31へ処理を進める。   FIG. 21 is a flowchart showing a processing procedure of the ECU 1 in the synchronization waiting state. The ECU 1 that has transitioned to the synchronization waiting state first checks whether or not the value of the counter X is 0 (step S30), and thereby the value of the counter X becomes 0 in the synchronization preparation state and transitions to the synchronization waiting state. Determine whether or not. When the value of the counter X is 0 (S30: YES), the ECU 1 sets (2N + i−2) as the value of the counter X (step S34), transmits an ACK frame (step S35), and proceeds to step S31. To proceed. If the value of the counter X is not 0 (S30: NO), the ECU 1 advances the process to step S31.

ステップS31にて、同期待ち状態のECU1は、スロットカウンタの値を調べることによって、スロットが更新されたか否かを判定し(ステップS31)、スロットが更新されていない場合には(S31:NO)、スロットが更新されるまで待機する。スロットが更新された場合(S31:YES)、ECU1は、カウンタXの値から1を減算し(ステップS32)、カウンタXの値が0であるか否かを更に判定する(ステップS33)。カウンタXの値が0の場合(S33:YES)、ECU1は、カウンタXの値に(2N+i−2)を設定し(ステップS34)、ACKフレームを送信して(ステップ35)、ステップS31へ処理を戻す。   In step S31, the ECU 1 waiting for synchronization determines whether or not the slot has been updated by checking the value of the slot counter (step S31). If the slot has not been updated (S31: NO). Wait until the slot is updated. When the slot is updated (S31: YES), the ECU 1 subtracts 1 from the value of the counter X (step S32), and further determines whether or not the value of the counter X is 0 (step S33). When the value of the counter X is 0 (S33: YES), the ECU 1 sets (2N + i−2) as the value of the counter X (step S34), transmits an ACK frame (step 35), and proceeds to step S31. To return.

また、カウンタXの値が0でない場合(S33:NO)、ECU1は、正常なメッセージを受信したか否かを判定する(ステップS36)。正常なメッセージを受信していない場合(S36:NO)、ECU1は、異常なメッセージを受信したか否かを更に判定する(ステップS39)。異常なメッセージを受信していない場合(S39:NO)、ECU1は、ステップS31へ処理を戻す。   If the value of the counter X is not 0 (S33: NO), the ECU 1 determines whether or not a normal message has been received (step S36). If a normal message has not been received (S36: NO), the ECU 1 further determines whether or not an abnormal message has been received (step S39). If an abnormal message has not been received (S39: NO), the ECU 1 returns the process to step S31.

正常なメッセージを受信した場合(S36:YES)、ECU1は、カウンタXの値を(2N)に設定し(ステップS37)、同期状態へ遷移して(ステップS38)、同期待ち状態の処理を終了する。また異常なメッセージを受信した場合(S39:YES)、ECU1は、カウンタXの値に(N+i−2)を設定し(ステップS40)、ステップS31へ処理を戻す。   When a normal message is received (S36: YES), the ECU 1 sets the value of the counter X to (2N) (step S37), transitions to the synchronization state (step S38), and finishes the process of waiting for synchronization. To do. When an abnormal message is received (S39: YES), the ECU 1 sets (N + i−2) as the value of the counter X (step S40), and returns the process to step S31.

同期状態は、少なくとも1つの他のECU1と同期がとれた状態であり、ECU1は、自らに割り当てられたスロットにてメッセージ(データフレーム又はACKフレーム)の送信を行う。また同期状態は、TEC及びRECの値に応じてエラーアクティブ状態又はエラーパッシブ状態の2つの内部状態を持ち、エラーパッシブ状態ではメッセージ送信が2サイクルに1度に制限される。ECU1は、通常動作状態においてはこの同期状態で動作している。またECU1は、2サイクルの間に他の全てのECU1から全くメッセージを受信しなかった場合には、ACKフレームを送信して、同期待ち状態へ遷移する。アプリケーション層のアプリケーション101からスリープ要求が与えられた場合には、ECU1は、スリープ遷移状態へ遷移する。その他、ECU1は、リセット信号の入力に応じて初期状態へ遷移し、バスオフ条件の成立に応じてバスオフ状態へ遷移する。   The synchronization state is a state in which the synchronization is established with at least one other ECU 1, and the ECU 1 transmits a message (data frame or ACK frame) in a slot assigned to itself. The synchronization state has two internal states, an error active state and an error passive state, depending on the values of TEC and REC. In the error passive state, message transmission is limited to once every two cycles. The ECU 1 operates in this synchronized state in the normal operation state. Further, when no message is received from all other ECUs 1 during two cycles, the ECU 1 transmits an ACK frame and transitions to a synchronization waiting state. When a sleep request is given from the application 101 of the application layer, the ECU 1 transitions to a sleep transition state. In addition, the ECU 1 transits to the initial state in response to the input of the reset signal, and transits to the bus off state in response to the establishment of the bus off condition.

図22及び図23は、同期状態におけるECU1の処理手順を示すフローチャートであり、同期状態においてECU1は図22及び図23に示す処理を繰り返し行っている。同期状態のECU1は、アプリケーション101からのスリープ指示が与えられたか否かを判定し(ステップS51)、スリープ指示が与えられた場合には(S51:YES)、スリープ準備状態へ遷移して(ステップS52)、同期状態の処理を終了する。   22 and 23 are flowcharts showing a processing procedure of the ECU 1 in the synchronized state. In the synchronized state, the ECU 1 repeatedly performs the processes shown in FIGS. 22 and 23. The synchronized ECU 1 determines whether or not a sleep instruction is given from the application 101 (step S51). If a sleep instruction is given (S51: YES), the ECU 1 transitions to the sleep preparation state (step S51). S52), the synchronization state process is terminated.

アプリケーション101からのスリープ指示が与えられていない場合(S51:NO)、ECU1は、自らに割り当てられたスロットのアクションポイントに達したか否かを判定する(ステップS53)。アクションポイントに達した場合(S53:YES)、ECU1は、自らのエラー状態がエラーパッシブ状態であるか否かを更に判定する(ステップS54)。エラー状態がエラーパッシブ状態の場合(S54:YES)、メッセージの送信が2サイクルに1度に制限されるため、ECU1は、自らがメッセージを送信できるサイクルであるか否かを更に判定する(ステップS55)。メッセージ送信できるサイクルでないと判定した場合(S55:NO)、ECU1は、処理を終了する(ただし図示の処理は同期状態において繰り返し行われており、ステップS51へECU1の処理が戻る)。   When the sleep instruction from the application 101 is not given (S51: NO), the ECU 1 determines whether or not the action point of the slot assigned to itself has been reached (step S53). When the action point is reached (S53: YES), the ECU 1 further determines whether or not its own error state is an error passive state (step S54). When the error state is the error passive state (S54: YES), the transmission of the message is limited to once every two cycles, so the ECU 1 further determines whether or not it is a cycle in which the message itself can be transmitted (step) S55). When it is determined that the cycle is not capable of transmitting a message (S55: NO), the ECU 1 ends the process (however, the illustrated process is repeatedly performed in a synchronized state, and the process of the ECU 1 returns to step S51).

エラー状態がエラーパッシブ状態でない場合(S54:NO)、即ちエラー状態がエラーアクティブの場合、又は、エラー状態がエラーパッシブ状態であってもメッセージ送信できるサイクルの場合(S55:YES)、ECU1は、他のECU1へ送信すべきデータが存在するか否かを調べる(ステップS56)。ECU1は、他のECU1へ送信すべきデータが存在する場合(S56:YES)、このデータを含むデータフレームを生成して送信し(ステップS57)、処理を終了する。またECU1は、他のECU1へ送信すべきデータが存在しない場合(S56:NO)、ACKフレームを生成して送信し(ステップS58)、処理を終了する。   If the error state is not an error passive state (S54: NO), that is, if the error state is error active, or if the error state is a cycle in which a message can be transmitted even if the error state is an error passive state (S55: YES), the ECU 1 It is checked whether there is data to be transmitted to another ECU 1 (step S56). When there is data to be transmitted to another ECU 1 (S56: YES), the ECU 1 generates and transmits a data frame including this data (step S57), and ends the process. If there is no data to be transmitted to another ECU 1 (S56: NO), the ECU 1 generates and transmits an ACK frame (step S58), and ends the process.

また自らに割り当てられたスロットのアクションポイントに達していない場合(S53:NO)、ECU1は、スロットカウンタの値を調べることによって、スロットが更新されたか否かを判定する(ステップS59)。スロットが更新されていない場合(S59:NO)、ECU1は、ステップS51へ処理を戻し、スリープ指示が与えられるか、アクションポイントに達するか、又は、スロットが更新されるまで、ステップS51、S53及びS59の判定を繰り返し行う。   If the action point of the slot assigned to itself has not been reached (S53: NO), the ECU 1 determines whether or not the slot has been updated by checking the value of the slot counter (step S59). If the slot has not been updated (S59: NO), the ECU 1 returns the process to step S51 and continues to steps S51, S53 and until the sleep instruction is given, the action point is reached, or the slot is updated. The determination of S59 is repeated.

スロットが更新された場合(S59:YES)、ECU1は、カウンタXの値から1を減算し(ステップS60)、カウンタXの値が0であるか否かを更に判定する(ステップS61)。カウンタXの値が0の場合(S61:YES)、ECU1は、カウンタXの値に(2N+i−2)を設定し(ステップS62)、ACKフレームを送信して(ステップ63)、同期待ち状態へ遷移し(ステップS64)、同期状態の処理を終了する。また、カウンタXの値が0でない場合(S61:NO)、ECU1は、正常なメッセージを受信したか否かを判定する(ステップS65)。正常なメッセージを受信した場合(S65:YES)、ECU1は、カウンタXの値に(2N)を設定し(ステップS66)、処理を終了する。また正常なメッセージを受信しない場合(S65:NO)、即ち異常なメッセージを受信した場合又はメッセージを受信しない場合には、ECU1は、処理を終了する。   When the slot is updated (S59: YES), the ECU 1 subtracts 1 from the value of the counter X (step S60), and further determines whether or not the value of the counter X is 0 (step S61). When the value of the counter X is 0 (S61: YES), the ECU 1 sets (2N + i−2) as the value of the counter X (step S62), transmits an ACK frame (step 63), and enters the synchronization waiting state. A transition is made (step S64), and the processing of the synchronization state is terminated. If the value of the counter X is not 0 (S61: NO), the ECU 1 determines whether a normal message has been received (step S65). When a normal message is received (S65: YES), the ECU 1 sets (2N) as the value of the counter X (step S66) and ends the process. When a normal message is not received (S65: NO), that is, when an abnormal message is received or when no message is received, the ECU 1 ends the process.

スリープ準備状態では、アプリケーション101からのスリープ要求が与えられて、他のECU1との間でスリープの合意が得られた場合、又は、アプリケーション101からスリープ要求がキャンセルされた場合、ECU1は他の状態への遷移を行う。スリープ準備状態において、ECU1は、データフレームの送信を行うことはできず、スリープビットをレセシブに設定したACKフレームの送信のみを行う。ECU1は、他のECU1からスリープビットがレセシブに設定されたACKフレームをM(予め定められた定数)サイクルに亘って受信した場合に、バススリープ状態へ遷移する。またECU1は、アプリケーション101からスリープ要求のキャンセルが与えられた場合に、同期状態へ遷移する。   In the sleep preparation state, when a sleep request is given from the application 101 and an agreement of sleep is obtained with another ECU 1, or when the sleep request is canceled from the application 101, the ECU 1 is in another state. Transition to. In the sleep preparation state, the ECU 1 cannot transmit a data frame, but only transmits an ACK frame with the sleep bit set to recessive. When the ECU 1 receives an ACK frame in which the sleep bit is set to recessive from another ECU 1 over M (predetermined constant) cycles, the ECU 1 transits to the bus sleep state. Further, when the sleep request is canceled from the application 101, the ECU 1 shifts to a synchronous state.

図24は、スリープ準備状態におけるECU1の処理手順を示すフローチャートである。なお、図示の処理では、ECU1がスリープ準備カウンタを用いて処理を行うが、このカウンタは初期設定などの際に値が0に初期化される。スリープ準備状態へ遷移したECU1は、まず、アプリケーション101からのスリープ要求がキャンセルされたか否かを判定し(ステップS71)、スリープ要求がキャンセルされていない場合には(S71:NO)、他のECUからACKフレームを1サイクル受信したか否かを更に判定する(ステップS74)。ACKフレームを1サイクル受信していない場合(S74:NO)、ECU1は、ステップS71へ処理を戻し、スリープ要求がキャンセルされるか、又は、ACKフレームを1サイクル受信するまで、ステップS71及びS74の判定を繰り返し行う。   FIG. 24 is a flowchart illustrating a processing procedure of the ECU 1 in the sleep preparation state. In the illustrated process, the ECU 1 performs a process using a sleep preparation counter, and this counter is initialized to 0 at the time of initial setting or the like. The ECU 1 that has transitioned to the sleep ready state first determines whether or not the sleep request from the application 101 has been canceled (step S71). If the sleep request has not been canceled (S71: NO), another ECU It is further determined whether or not one cycle of the ACK frame has been received (step S74). When one cycle of the ACK frame has not been received (S74: NO), the ECU 1 returns the process to step S71, and the process of steps S71 and S74 is continued until the sleep request is canceled or one cycle of the ACK frame is received. Repeat the determination.

アプリケーション101によってスリープ要求がキャンセルされた場合(S71:YES)、ECU1は、スリープ準備カウンタの値に0を設定し(ステップS72)、同期状態へ遷移して(ステップS73)、スリープ準備状態の処理を終了する。   When the sleep request is canceled by the application 101 (S71: YES), the ECU 1 sets the value of the sleep preparation counter to 0 (step S72), transitions to a synchronous state (step S73), and processing of the sleep preparation state Exit.

またACKフレームを1サイクル受信した場合(S74:YES)、ECU1は、スリープ準備カウンタの値をインクリメントし(ステップS75)、スリープ準備カウンタの値が予め設定されたMに達したか否かを判定する(ステップS76)。スリープ準備カウンタの値がMに達していない場合(S76:NO)、ECU1は、ステップS71へ処理を戻し、上述の処理を繰り返し行う。スリープ準備カウンタの値がMに達した場合(S76:YES)、ECU1は、スリープ準備カウンタの値に0を設定する(ステップS77)。次いでECU1は、ビットサンプリング手段106による通常のサンプリングを禁止し(ステップS78)、即ちビットサンプリング手段106によるサンプリングの周波数を低減するなどの省電力化設定をおこない、バススリープ状態へ遷移し(ステップS79)、スリープ準備状態の処理を終了する。   When one cycle of the ACK frame is received (S74: YES), the ECU 1 increments the value of the sleep preparation counter (step S75) and determines whether or not the value of the sleep preparation counter has reached a preset value M. (Step S76). If the value of the sleep preparation counter has not reached M (S76: NO), the ECU 1 returns the process to step S71 and repeats the above process. When the value of the sleep preparation counter reaches M (S76: YES), the ECU 1 sets 0 as the value of the sleep preparation counter (step S77). Next, the ECU 1 prohibits normal sampling by the bit sampling means 106 (step S78), that is, performs power saving settings such as reducing the sampling frequency by the bit sampling means 106, and transitions to the bus sleep state (step S79). ), The sleep ready state process is terminated.

バスオフ状態は、他の全ての状態においてTEC>255のバスオフ条件が成立した場合に遷移する状態であり、バスオフ条件がクリアされるまで待機する。バスオフ条件がクリアされた場合、ECU1は、初期状態へ遷移する。   The bus-off state is a state in which a transition is made when a bus-off condition of TEC> 255 is satisfied in all other states, and waits until the bus-off condition is cleared. When the bus-off condition is cleared, the ECU 1 transitions to the initial state.

図25は、バスオフ状態におけるECU1の処理手順を示すフローチャートである。TEC>255のバスオフ条件が成立することによって、他の状態からバスオフ状態へ遷移したECU1は、バスオフ条件がクリアされたか(バスオフ条件が不成立の状態となったか)否かを判定し(ステップS81)、バスオフ条件がクリアされていない場合には(S81:NO)、バスオフ条件がクリアされるまで待機する。バスオフ条件がクリアされた場合(S81:YES)、ECU1は、初期状態へ遷移し(ステップS82)、バスオフ状態の処理を終了する。   FIG. 25 is a flowchart showing a processing procedure of the ECU 1 in the bus-off state. When the bus-off condition of TEC> 255 is satisfied, the ECU 1 that has transitioned from another state to the bus-off state determines whether the bus-off condition is cleared (whether the bus-off condition is not satisfied) (step S81). If the bus-off condition is not cleared (S81: NO), the process waits until the bus-off condition is cleared. When the bus-off condition is cleared (S81: YES), the ECU 1 transitions to an initial state (step S82) and ends the bus-off state process.

バススリープ状態は、通信システム内で他のECU1とのスリープに関する合意が成立し、サンプリングの周波数を低減するなどの低消費電力状態でECU1がバス5の監視を行う状態である。バススリープ状態において、ECU1は、メッセージの送信は行わず、バス5上のドミナント(ウェイクアップ要求)を検出した場合、又は、アプリケーション101からスリープ要求のキャンセルが与えられた場合に、サンプリングの周波数を通常のものへ戻すなどの低消費電力状態からの復帰処理を行い、初期状態へ遷移する。   The bus sleep state is a state in which the ECU 1 monitors the bus 5 in a low power consumption state such as when an agreement regarding sleep with another ECU 1 is established in the communication system and the sampling frequency is reduced. In the bus sleep state, the ECU 1 does not transmit a message, and when the dominant (wake-up request) on the bus 5 is detected, or when cancellation of the sleep request is given from the application 101, the sampling frequency is set. A return process from a low power consumption state such as returning to a normal state is performed, and a transition is made to the initial state.

図26は、バススリープ状態におけるECU1の処理手順を示すフローチャートである。バススリープ状態へ遷移したECU1は、アプリケーション101からのウェイクアップ要求が与えられたか否かを判定し(ステップS91)、ウェイクアップ要求が与えられていない場合には(S91:NO)、バス5上にドミナントの信号が検出されたか否かを更に判定する(ステップS92)。ドミナントの信号が検出されない場合(S92:NO)、ECU1は、ステップS91へ処理を戻し、ウェイクアップ要求が与えられるか又はドミナントの信号が検出されるまで判定処理を繰り返す。   FIG. 26 is a flowchart showing the processing procedure of the ECU 1 in the bus sleep state. The ECU 1 that has transitioned to the bus sleep state determines whether or not a wake-up request from the application 101 has been given (step S91), and when no wake-up request has been given (S91: NO), on the bus 5 It is further determined whether or not a dominant signal is detected (step S92). When the dominant signal is not detected (S92: NO), the ECU 1 returns the process to step S91, and repeats the determination process until a wake-up request is given or a dominant signal is detected.

アプリケーション101からウェイクアップ要求が与えられた場合(S91:YES)、又は、バス5上にドミナントの信号が検出された場合(S92:YES)、ECU1は、初期状態へ遷移して(ステップS93)、バススリープ状態の処理を終了する。   When a wake-up request is given from the application 101 (S91: YES), or when a dominant signal is detected on the bus 5 (S92: YES), the ECU 1 transits to an initial state (step S93). The bus sleep state process is terminated.

<スタートアップシーケンス>
次に、本発明に係る通信システムの各ECU1が行うスタートアップシーケンスについて、いくつかの例を示して説明する。本発明の通信システムの各ECU1は、起動して初期状態から同期準備状態へ遷移した後で、既にメッセージの送信を開始した他のECU1が存在するか否かを判断するために、3サイクル期間に亘ってメッセージ受信のみを行う。この期間中に他のECU1から正常なメッセージを受信した場合、ECU1は受信したメッセージに含まれるスロット番号に同期し、同期状態へ遷移して通常のメッセージ送受信を行う。この期間中に異常なメッセージを受信した場合、ECU1は、異常なメッセージを受信したスロットをサイクルにおける1番目のスロット(スロット1)とし、同期待ち状態へ遷移し、タイマとして用いるカウンタXに値を設定して、以降のサイクルでのメッセージ再送信を待つ。この期間中に他のECU1からのメッセージを受信しなかった場合、ECU1は、ACKフレームを送信してカウンタXに値を設定すると共に、自らがメッセージ送信を行ったスロットをスロット1として同期待ち状態へ遷移し、他のECU1からの応答を待つ。
<Startup sequence>
Next, the startup sequence performed by each ECU 1 of the communication system according to the present invention will be described with reference to some examples. Each ECU 1 of the communication system according to the present invention has a three-cycle period in order to determine whether there is another ECU 1 that has already started transmitting a message after being activated and transitioned from the initial state to the synchronization preparation state. Only receive messages. When a normal message is received from another ECU 1 during this period, the ECU 1 synchronizes with the slot number included in the received message, transitions to a synchronous state, and performs normal message transmission / reception. If an abnormal message is received during this period, the ECU 1 sets the slot that received the abnormal message as the first slot (slot 1) in the cycle, transitions to the synchronization wait state, and sets a value in the counter X used as a timer. Set and wait for message resend in subsequent cycles. If a message from another ECU 1 is not received during this period, the ECU 1 transmits an ACK frame to set a value in the counter X, and waits for synchronization with the slot that has transmitted the message as the slot 1 To wait for a response from another ECU 1.

図27〜図29は、スタートアップシーケンスの処理例を示すタイミングチャートである。なお、図示の例は、1サイクルが4スロットであり、スロット1〜4がECU1a〜1dにそれぞれ1つずつ割り当てられた通信システムにおけるスタートアップシーケンスである。また各図においては、送信メッセージ(Msgの文字列が記載された長方形)、動作状態(破線の長円形)、スロットカウンタの値(SC=)及びカウンタXの値(X=)をECU1a〜1d毎に図示してある。   27 to 29 are timing charts showing an example of processing of the startup sequence. The illustrated example is a start-up sequence in a communication system in which one cycle is 4 slots, and slots 1 to 4 are assigned to the ECUs 1a to 1d, respectively. In each figure, a transmission message (a rectangle in which a character string of Msg is written), an operation state (dashed oval), a slot counter value (SC =), and a counter X value (X =) are represented by ECUs 1a to 1d. Each is illustrated.

図27に示す例は、スタートアップシーケンスが正常に行われた例である。スロット2が割り当てられたECU1bは、同期待ち状態において、カウンタX=0のタイミングでメッセージAを送信する。このメッセージAは他のECU1a、1c及び1dにて正常に受信され、ECU1a、1c及び1dのスロットカウンタはメッセージAに含まれるスロット番号(スロット2)に同期して更新されると共に、ECU1a、1c及び1dは同期状態へ遷移する。   The example shown in FIG. 27 is an example in which the startup sequence is normally performed. The ECU 1b to which the slot 2 is assigned transmits the message A at the timing of the counter X = 0 in the synchronization waiting state. This message A is normally received by the other ECUs 1a, 1c and 1d, and the slot counters of the ECUs 1a, 1c and 1d are updated in synchronization with the slot number (slot 2) included in the message A, and the ECUs 1a, 1c And 1d transition to a synchronous state.

次のスロット(スロット3)にてECU1cがメッセージBを送信し、このメッセージBを正常に受信したECU1bは、メッセージBに含まれるスロット番号(スロット3)に同期してスロットカウンタを更新し、同期待ち状態から同期状態へ遷移する。これにより全てのECU1a〜1dは、スロットカウンタの値が同期した状態で、以降のメッセージC〜Kの送信を巡回的に行うことができる。   The ECU 1c transmits the message B in the next slot (slot 3), and the ECU 1b that has received the message B normally updates the slot counter in synchronization with the slot number (slot 3) included in the message B. Transition from wait state to synchronous state. Thereby, all the ECUs 1a to 1d can cyclically transmit the subsequent messages C to K in a state in which the values of the slot counters are synchronized.

図28に示す例は、スタートアップシーケンスにおいてECU1a及び1bが同時的にメッセージを送信し、2つのメッセージがバス5上で衝突した場合の例である。同期待ち状態の2つのECU1a及び1bにてカウンタXの値が共に0となってメッセージA及びBが同時的に送信された場合、メッセージを送信したECU1a及び1bは、送信メッセージのチェックを行わないため、メッセージA及びBが衝突したことを知ることはなく、それぞれカウンタXの値を(2N+i−2)に設定する(即ち、ECU1aはカウンタXの値を7に設定し、ECU1bはカウンタXの値を8に設定する)。またメッセージの送信を行ったECU1a及び1bは、メッセージを送信のタイミングをスロット1とみなしてスロットカウンタを設定するため、次のスロットは共にスロット2となる。   The example shown in FIG. 28 is an example when the ECUs 1 a and 1 b transmit messages simultaneously in the startup sequence, and two messages collide on the bus 5. When the two ECUs 1a and 1b in the synchronization waiting state have the counter X value of 0 and the messages A and B are transmitted simultaneously, the ECUs 1a and 1b that have transmitted the messages do not check the transmitted message. Therefore, it does not know that the messages A and B have collided, and sets the value of the counter X to (2N + i−2) (that is, the ECU 1a sets the value of the counter X to 7 and the ECU 1b sets the value of the counter X to Set the value to 8). Further, since the ECUs 1a and 1b that have transmitted the message regard the timing of transmitting the message as slot 1 and set the slot counter, the next slot is both slot 2.

また、衝突したメッセージA及びBを受信した同期準備状態のECU1c及び1dでは、受信したメッセージが異常なメッセージであると判断し、メッセージを受信したサイクルをサイクル1とみなしてスロットカウンタの値を設定すると共に、それぞれカウンタXの値を(2N+i−2)に設定して(即ち、ECU1cはカウンタXの値を9に設定し、ECU1dはカウンタXの値を10に設定して)、同期待ち状態へ遷移する。   Further, the ECUs 1c and 1d in the synchronization preparation state that have received the collision messages A and B determine that the received message is an abnormal message, and consider the cycle in which the message is received as cycle 1 to set the value of the slot counter. At the same time, the value of the counter X is set to (2N + i−2) (that is, the ECU 1c sets the value of the counter X to 9 and the ECU 1d sets the value of the counter X to 10) and waits for synchronization. Transition to.

このように、4つのECU1a〜1dが、割り当てられたスロット番号に応じて異なる値をカウンタXに設定することによって、その後に最も早くカウンタXの値が0となったECU1aのみがメッセージCの送信を行うことができる。メッセージCは他のECU1b〜1dに正常に受信され、ECU1b〜1dは、それぞれが有するスロットカウンタの値を、メッセージCに含まれるスロット番号(スロット1)に同期させ、同期状態へ遷移する。その後、次のスロット2にてECU1bがメッセージDを送信し、他のECU1a、1c及び1dにてメッセージDが正常に受信され、同期待ち状態のECU1aはメッセージDに含まれるスロット番号(スロット2)にスロットカウンタを同期させて、同期状態へ遷移する。   In this way, when the four ECUs 1a to 1d set different values in the counter X according to the assigned slot numbers, only the ECU 1a having the counter X value of 0 first thereafter transmits the message C. It can be performed. The message C is normally received by the other ECUs 1b to 1d, and the ECUs 1b to 1d synchronize their slot counter values with the slot number (slot 1) included in the message C, and transition to the synchronized state. Thereafter, the ECU 1b transmits the message D in the next slot 2, the message D is normally received by the other ECUs 1a, 1c and 1d, and the ECU 1a in the synchronization waiting state has the slot number (slot 2) included in the message D. The slot counter is synchronized with the transition to the synchronized state.

図29に示す例は、スタートアップシーケンスにおいてECU1a及び1bが同時的にメッセージを送信し、2つのメッセージがバス5上で衝突した場合の別の例である。上述の図28に示す例と同様に、同時的にメッセージを送信したECU1a及び1bは、それぞれカウンタXの値を(2N+i−2)に設定し(即ち、ECU1aはカウンタXの値を7に設定し、ECU1bはカウンタXの値を8に設定し)、メッセージを送信のタイミングをスロット1とみなしてスロットカウンタを設定する。   The example shown in FIG. 29 is another example in the case where the ECUs 1 a and 1 b transmit messages simultaneously in the startup sequence and two messages collide on the bus 5. Similarly to the example shown in FIG. 28 described above, the ECUs 1a and 1b that simultaneously transmitted messages set the value of the counter X to (2N + i−2) (that is, the ECU 1a sets the value of the counter X to 7). Then, the ECU 1b sets the value of the counter X to 8), sets the slot counter by regarding the transmission timing of the message as the slot 1.

また、衝突したメッセージA及びBを同期待ち状態のECU1c及び1dが受信した場合、ECU1c及び1dは受信メッセージが異常なメッセージであると判断し、メッセージを受信したサイクルをサイクル1とみなしてスロットカウンタの値を設定すると共に、それぞれカウンタXの値を(N+i−2)に設定する(即ち、ECU1cはカウンタXの値を5に設定し、ECU1dはカウンタXの値を6に設定する)。   Further, when the ECUs 1c and 1d waiting for synchronization receive the colliding messages A and B, the ECUs 1c and 1d determine that the received message is an abnormal message, and regard the cycle in which the message is received as cycle 1 and the slot counter And the counter X is set to (N + i−2) (ie, the ECU 1c sets the counter X to 5 and the ECU 1d sets the counter X to 6).

このように、異常なメッセージを受信したECU1c及び1dでは、同期準備状態であるか又は同期待ち状態であるかに応じてカウンタXが(2N+i−2)又は(N+i−2)に設定される。即ち、同期待ち状態で異常なメッセージを受信した場合には、同期準備状態で異常なメッセージを受信した場合より、カウンタXが小さな値に設定される。このため、その後にはECU1cのカウンタXの値が先に0となり、ECU1cがメッセージCを送信する。メッセージCは他のECU1a、1b及び1dに正常に受信され、ECU1a、1b及び1dは、それぞれが有するスロットカウンタの値を、メッセージCに含まれるスロット番号(スロット3)に同期させ、同期状態へ遷移する。その後、次のスロット2にてECU1dがメッセージDを送信し、他のECU1a〜1cにてメッセージDが正常に受信され、同期待ち状態のECU1cはメッセージDに含まれるスロット番号(スロット4)にスロットカウンタを同期させて、同期状態へ遷移する。   Thus, in the ECUs 1c and 1d that have received the abnormal message, the counter X is set to (2N + i−2) or (N + i−2) depending on whether it is in the synchronization preparation state or the synchronization wait state. That is, when an abnormal message is received in the synchronization waiting state, the counter X is set to a smaller value than when an abnormal message is received in the synchronization preparation state. Therefore, after that, the value of the counter X of the ECU 1c becomes 0 first, and the ECU 1c transmits the message C. The message C is normally received by the other ECUs 1a, 1b, and 1d, and the ECUs 1a, 1b, and 1d synchronize the values of the respective slot counters with the slot number (slot 3) included in the message C, and enter the synchronized state. Transition. Thereafter, the ECU 1d transmits the message D in the next slot 2, the message D is normally received by the other ECUs 1a to 1c, and the ECU 1c in the synchronization waiting state has a slot number (slot 4) included in the message D. Synchronize the counter and transition to the synchronized state.

以上のように、スタートアップシーケンスにてメッセージの衝突が生じた場合であっても、通信システム中の各ECU1a〜1dにてカウンタXがそれぞれ異なる値に設定され、最も小さい値が設定されたECU1a〜1dから次のメッセージ送信を開始することによって、全てのECU1a〜1dが同期して通信を開始することができる。   As described above, even when a message collision occurs in the startup sequence, the counters X are set to different values in the ECUs 1a to 1d in the communication system, and the ECU 1a to which the smallest value is set. By starting the next message transmission from 1d, all ECUs 1a to 1d can start communication synchronously.

<再同期シーケンス>
次に、本発明に係る通信システムの各ECU1が行う再同期シーケンスについて、いくつかの例を示して説明する。再同期シーケンスは、通信システムの各ECU1がスタートアップシーケンスを終えて同期した通信を開始した後、何らかの通信不具合などによってECU1間の同期がとれない状態となった場合に、各ECU1の判断によってスタートアップシーケンスを再度行うものである。各ECU1は、自らがメッセージ送信を行ったスロットから2サイクル後の同スロットまでの間に、他のECU1から正常に受信するメッセージがなかった場合、同期待ち状態へ遷移して再同期を行う。
<Resynchronization sequence>
Next, the resynchronization sequence performed by each ECU 1 of the communication system according to the present invention will be described with reference to some examples. The re-synchronization sequence is determined based on the judgment of each ECU 1 when each ECU 1 of the communication system has started the synchronized communication after completing the startup sequence, and the ECU 1 is not synchronized due to some communication failure or the like. Is to be performed again. Each ECU 1 transitions to a synchronization waiting state and performs resynchronization when there is no message normally received from another ECU 1 between the slot where the message is transmitted and the same slot after two cycles.

図30〜図31は、再同期シーケンスの処理例を示すタイミングチャートである。なお、図示の例は、図27〜図29と同様に、1サイクルが4スロットであり、スロット1〜4がECU1a〜1dにそれぞれ1つずつ割り当てられた通信システムにおける再同期シーケンスである。また各図においては、送信メッセージ(Msgの文字列が記載された長方形)、動作状態(破線の長円形)、スロットカウンタの値(SC=)及びカウンタXの値(X=)をECU1a〜1d毎に図示してある。ただし、ECU1a〜1dが同期状態の場合のカウンタXの値は図示を省略する。   30 to 31 are timing charts showing an example of processing of the resynchronization sequence. The example shown in the figure is a resynchronization sequence in a communication system in which one cycle has four slots and slots 1 to 4 are assigned to the ECUs 1a to 1d, one by one, as in FIGS. In each figure, a transmission message (a rectangle in which a character string of Msg is written), an operation state (dashed oval), a slot counter value (SC =), and a counter X value (X =) are represented by ECUs 1a to 1d. Each is illustrated. However, illustration of the value of the counter X when the ECUs 1a to 1d are in a synchronized state is omitted.

図30に示す例は、1つのECU1bにて他のECU1a、1c及び1dとの同期ズレが生じ、ECU1a及びECU1bが同時的にメッセージA及びBを送信した場合である。ECU1a、1c及び1dのスロットカウンタがスロット1のタイミングにて、ECU1bのスロットカウンタがスロット2となり、ECU1a及び1bが同時的にメッセージA及びBを送信した場合、他のECU1c及び1dでは異常なメッセージが受信される。次のスロットにおいて、ECU1a、1c及び1dのスロットカウンタはスロット2であるが、ECU1bのスロットカウンタはスロット2であるため、ECU1bのメッセージ送信は行われない。   The example shown in FIG. 30 is a case in which one ECU 1b is out of synchronization with the other ECUs 1a, 1c, and 1d, and the ECUs 1a and 1b transmit messages A and B simultaneously. When the slot counters of the ECUs 1a, 1c and 1d become the slot 1 and the slot counter of the ECU 1b becomes the slot 2, and the ECUs 1a and 1b simultaneously transmit the messages A and B, the other ECUs 1c and 1d have an abnormal message. Is received. In the next slot, the slot counter of the ECUs 1a, 1c and 1d is slot 2, but since the slot counter of the ECU 1b is slot 2, the message transmission of the ECU 1b is not performed.

その後、ECU1a、1c及び1dのスロットカウンタがスロット3のタイミングにて、ECU1cがメッセージCを送信する。これにより、メッセージCを正常に受信したECU1bは、メッセージCに含まれるスロット番号にスロットカウンタを同期させるため、全てのECU1a〜1dが同期した状態へ復帰することができる。   Thereafter, the ECU 1c transmits a message C when the slot counters of the ECUs 1a, 1c, and 1d are at the timing of the slot 3. As a result, the ECU 1b that has received the message C normally synchronizes the slot counter with the slot number included in the message C, so that all the ECUs 1a to 1d can return to the synchronized state.

図31に示す例は、全てのECU1a〜1dの同期にズレが生じ、全てのECU1a〜1dが同時的にメッセージA〜Dを送信した場合である。全てのECU1a〜1dが同時的にメッセージA〜Dを送信した場合、次のサイクルに至るまでの間はメッセージ送信が行われることはなく、1サイクル後に全てのECU1a〜1dが同時的にメッセージE〜Hを送信する。更に1サイクル後には、同様にして全てのECU1a〜1dが同時的にメッセージI〜Lを送信する。   The example shown in FIG. 31 is a case where a shift occurs in the synchronization of all ECUs 1a to 1d and all the ECUs 1a to 1d transmit messages A to D simultaneously. When all the ECUs 1a to 1d transmit the messages A to D at the same time, message transmission is not performed until the next cycle, and all the ECUs 1a to 1d simultaneously receive the message E after one cycle. Send ~ H. Further, after one cycle, all ECUs 1a to 1d transmit messages I to L simultaneously in the same manner.

各ECU1a〜1dは、このように2サイクル期間に亘って他のECU1a〜1dからのメッセージを受信しない場合、カウンタXの値を(2N+i−2)にそれぞれ設定して、同期待ち状態へ遷移する。このとき各ECU1a〜1dのカウンタXは、割り当てられたスロットに応じてそれぞれ異なる値に設定され、カウンタXに最も小さい値が設定されたECU1aからメッセージ送信を行うことによって、全てのECU1a〜1dのスロットカウンタを同期させることができ、巡回的なメッセージ送信を再開することができる。   When each of the ECUs 1a to 1d does not receive a message from the other ECUs 1a to 1d over the two-cycle period in this way, the value of the counter X is set to (2N + i−2) and transitions to a synchronization waiting state. . At this time, the counters X of the ECUs 1a to 1d are set to different values according to the assigned slots, and by sending a message from the ECU 1a having the smallest value in the counter X, all the ECUs 1a to 1d are transmitted. The slot counter can be synchronized and cyclic message transmission can be resumed.

以上の構成の本発明に係る通信システムにおいては、複数のECU1が共通のバス5で接続されたネットワーク構成にて、各ECU1に予め一又は複数のスロット(送信権利)を割り当てておき、スロット毎に定められた順序で複数のECU1が巡回的にメッセージの送信を行う構成とすることにより、複数のECU1が同時的にメッセージ送信を行うことがないため、従来のCANプロトコルのようなアービトレーションを行う必要がなく、通信速度を高速化することが可能となる。   In the communication system according to the present invention having the above-described configuration, one or a plurality of slots (transmission rights) are allocated in advance to each ECU 1 in a network configuration in which a plurality of ECUs 1 are connected by a common bus 5, and Since the plurality of ECUs 1 transmit the messages cyclically in the order determined in the above, the plurality of ECUs 1 do not transmit the messages at the same time. Therefore, arbitration like the conventional CAN protocol is performed. This is unnecessary, and the communication speed can be increased.

また各ECU1は、一のスロットに係るメッセージ送信を行う場合に、他のECU1へ送信すべきデータと共に、他のスロットの係るメッセージ受信の成否をそれぞれ示す情報を含めたメッセージを作成して送信する構成とすることにより、自らに割り当てられたスロットを有効に活用して他のECU1へメッセージ受信の成否を知らせることができ、且つ、自らが有するデータを他のECU1へ与えることができる。   In addition, when transmitting a message related to one slot, each ECU 1 creates and transmits a message including information indicating success or failure of message reception related to another slot together with data to be transmitted to the other ECU 1. By adopting the configuration, it is possible to notify the other ECU 1 of the success or failure of message reception by effectively utilizing the slot assigned to itself, and to provide the other ECU 1 with its own data.

一のECU1が送信したメッセージは、バス5に接続された他の全てのECU1にて受信され、メッセージを受信したECU1は、このメッセージのデータフィールドから必要なデータを取得することができると共に、メッセージのACKフィールドから以前に自らが送信したメッセージが正しく受信されたか否かを判断することができる。よって各ECU1は、一のスロットに係る前回のメッセージ送信から次のメッセージ送信までの1サイクルの間に受信したメッセージに含まれるACKフィールドの情報を調べ、前回のメッセージが他のECU1にて正しく受信されていなかった場合には、次のスロットにてメッセージの再送信を行うことができる。   A message transmitted by one ECU 1 is received by all other ECUs 1 connected to the bus 5, and the ECU 1 that has received the message can obtain necessary data from the data field of this message, From the ACK field, it is possible to determine whether or not the message transmitted by the device itself has been received correctly. Therefore, each ECU 1 checks the information of the ACK field included in the message received during one cycle from the previous message transmission to the next message transmission related to one slot, and the previous message is correctly received by the other ECU 1. If not, the message can be retransmitted in the next slot.

これにより、メッセージ送信の衝突を生じることなく複数のECU1が効率よくメッセージ送信を巡回的に行うことができ、何らかの不具合によってメッセージが正しく受信されなかった場合であっても、確実にメッセージの再送信を行うことができる。   As a result, the plurality of ECUs 1 can efficiently and efficiently perform message transmission without causing a message transmission collision, and even if the message is not correctly received due to some malfunction, the message can be reliably retransmitted. It can be performed.

また、ECU1が作成して送信するメッセージには、1サイクル分のスロットに係るメッセージ受信の成否情報をACKフィールドに含む構成とすることにより、各通信装置は、1サイクルに亘って受信したメッセージのACKフィールドをそれぞれ調べることによって、バス5を共有する他の全ての通信装置にて自らの送信メッセージが正しく受信されたか否かを知ることができる。   In addition, in the message that is created and transmitted by the ECU 1, each communication device includes the ACK field that includes message reception success / failure information related to a slot for one cycle. By examining each of the ACK fields, it is possible to know whether or not the transmission message has been correctly received by all other communication devices sharing the bus 5.

また、一のスロットについて全くメッセージ送信がなされない場合、通信システムの各ECU1は、このスロットに係るメッセージ受信処理を省略して、次のスロットに係る処理を行う構成とすることにより、このスロットが割り当てられたECU1が何らかの理由でメッセージ送信を停止している場合に、サイクル中のメッセージ送受信が行われない時間を可能な限り短くすることができ、通信速度の高速化に寄与することができる。   In addition, when no message transmission is performed for one slot, each ECU 1 of the communication system omits the message reception process related to this slot, and performs the process related to the next slot. When the assigned ECU 1 stops message transmission for some reason, the time during which messages are not transmitted and received during the cycle can be shortened as much as possible, which contributes to an increase in communication speed.

また、各ECU1が作成して送信するメッセージには、いずれのスロットにて送信されたメッセージであるかを識別するためにスロット番号の情報を含め、各ECU1は受信したメッセージのスロット番号により通信処理の同期を行う構成とすることにより、通信システム中の複数のECU1がスロットを同期して確実にメッセージの送受信を行うことができる。   Further, the message created and transmitted by each ECU 1 includes slot number information for identifying which slot the message is transmitted, and each ECU 1 performs communication processing according to the slot number of the received message. With this configuration, the plurality of ECUs 1 in the communication system can reliably transmit and receive messages by synchronizing the slots.

また、各ECU1がTEC及びRECのエラーカウンタを有してメッセージ送受信に係るエラーの発生数をカウントし、エラー発生数が所定数を超えた場合、各ECU1はメッセージ送信を2サイクルに1回に低減する構成とすることにより、故障などが生じた可能性が高いECU1のメッセージ送信が他のECU1の処理に悪影響を与えることを防止でき、通信システムの信頼性を向上できる。   Each ECU 1 has a TEC and REC error counter to count the number of error occurrences related to message transmission / reception. When the number of error occurrences exceeds a predetermined number, each ECU 1 transmits a message once every two cycles. By reducing the configuration, it is possible to prevent the message transmission of the ECU 1 that is likely to have a failure or the like from adversely affecting the processing of the other ECUs 1, and to improve the reliability of the communication system.

また、起動後などに行うスタートアップシーケンスでは、各ECU1は、駆動直後の3サイクルの間は他のECU1からのメッセージ受信に徹し、3サイクルの間にメッセージを受信した場合には、受信メッセージのスロットに同期して処理を開始し、3サイクルの間にメッセージを受信しない場合には、自らがメッセージ(ACKフレーム)の送信を行う構成とすることにより、通信システムの複数のECU1が起動後に確実に同期して通信処理を開始することができる。   Further, in a startup sequence performed after startup, each ECU 1 is devoted to receiving a message from another ECU 1 for 3 cycles immediately after driving, and receives a message for 3 cycles. In the case where the process is started in synchronization with and no message is received within 3 cycles, the configuration is such that a plurality of ECUs 1 of the communication system can be surely activated after starting by transmitting the message (ACK frame). Communication processing can be started synchronously.

またスタートアップシーケンスにおいて、各ECU1は、メッセージ送信後及び異常なメッセージの受信後に、自らに割り当てられたスロット番号に応じてカウンタXの値を設定し、カウンタXをデクリメントして0に達した場合にメッセージ送信を行う構成とすることにより、通信システムの複数のECU1がそれぞれ異なる値をカウンタXに設定することができ、最も小さい値が設定されたECU1が次のメッセージ送信を単独で行うことができるため、このメッセージを他のECU1が受信して同期を行うことができる。   In the start-up sequence, each ECU 1 sets the value of the counter X according to the slot number assigned to itself after sending a message and receiving an abnormal message, and decrements the counter X to reach 0. By adopting a configuration for performing message transmission, a plurality of ECUs 1 in the communication system can set different values in the counter X, and the ECU 1 with the smallest value can independently perform the next message transmission. Therefore, the other ECU 1 can receive this message and perform synchronization.

またスタートアップシーケンスを完了して同期が確立された後の不具合(同期ズレ)に対して、各ECU1は、2サイクルの間に他のECU1からのメッセージを全く受信しなかった場合、自らに割り当てられたスロット番号に応じてカウンタXの値を設定し、スタートアップシーケンスと同様の処理により再同期を行う構成とすることにより、通信の不具合などによって複数の通信装置に同期ズレが生じ、複数の通信装置が同時的にメッセージ送信を行った場合であっても、複数の通信装置の再同期を確実に行うことができる。   In addition, in response to a malfunction (synchronization shift) after the start-up sequence is completed and synchronization is established, each ECU 1 is assigned to itself if no message is received from another ECU 1 during two cycles. By setting the value of the counter X in accordance with the slot number and performing the resynchronization by the same process as the startup sequence, a synchronization shift occurs in a plurality of communication devices due to a communication failure or the like. Even when the message transmission is performed simultaneously, a plurality of communication devices can be resynchronized reliably.

また通信システムをスリープモードへ移行する場合、各ECU1がスリープビットをレセシブに設定したACKフレームをスリープ要求として送受信し、1サイクルの間に全てのスロットについてスリープ要求を受信した場合に各ECU1がそれぞれメッセージ送信を停止してスリープモード(バススリープ状態)へ移行する構成とすることにより、バス5に接続された全てのECU1の間でスリープモードへ移行することに対する合意を取った後に各ECU1がスリープモードへ移行することができる。   When the communication system shifts to the sleep mode, each ECU 1 transmits and receives an ACK frame with the sleep bit set to recessive as a sleep request, and each ECU 1 receives a sleep request for all slots in one cycle. Each ECU 1 sleeps after an agreement is reached between all ECUs 1 connected to the bus 5 to shift to the sleep mode by stopping the message transmission and shifting to the sleep mode (bus sleep state). You can enter mode.

このように、本発明の通信システムは、従来のCANプロトコルが有する機能と略同じ機能を有しており、これらを各ECU1のプロトコル制御層にて実現しているため、従来のCANプロトコルに対応して作られたアプリケーションをそのまま利用する(又は、アプリケーションに対して少ない修正を行って利用する)ことが可能である。加えて、本発明の通信システムは、従来のCANプロトコルのようなアービトレーションを行う必要がなく、メッセージ送信時にビット毎の信号レベル検出を行う必要がないため、従来のCANプロトコルにおける高速化に対する阻害要因がなくなり、従来のCANプロトコルよりも高速なメッセージ送受信を実現することができる。   As described above, the communication system of the present invention has substantially the same function as the function of the conventional CAN protocol, and these are realized by the protocol control layer of each ECU 1, so that it corresponds to the conventional CAN protocol. It is possible to use the application created in this way as it is (or to use the application with minor modifications). In addition, the communication system of the present invention does not need to perform arbitration like the conventional CAN protocol, and does not need to detect the signal level for each bit at the time of message transmission. Thus, message transmission / reception at a higher speed than the conventional CAN protocol can be realized.

なお本実施の形態においては、各ECU1に対するスロットの割り当てを静的に行う構成としたが、これに限るものではなく、通信システムの起動後などの何らかのタイミングにて各ECU1に対するスロットの割り当てを動的に行う構成としてもよい。また、1つのECU1に対して複数のスロットを割り当て可能としたが、これに限るものではなく、1つのECU1に対して1つのスロットのみを割り当てる構成としてもよい。また、本発明の通信システムは、車輌に搭載されるものに限らず、その他の種々のシステムに適用することができる。   In the present embodiment, the slot assignment to each ECU 1 is statically performed. However, the present invention is not limited to this, and the slot assignment to each ECU 1 is activated at some timing such as after the communication system is activated. It is good also as a structure performed automatically. Further, although a plurality of slots can be assigned to one ECU 1, the present invention is not limited to this, and only one slot may be assigned to one ECU 1. The communication system of the present invention is not limited to the one mounted on the vehicle, but can be applied to other various systems.

(変形例)
また、ECU1が送受信するメッセージの構成は、図4に示したものに限らず、例えば以下の変形例に示すような他の構成であってもよい。図32は、変形例に係る通信システムのメッセージ構成を示す模式図である。なお本図においては、データフレームの構成のみを図示し、ACKフレームについては同様の構成(データフレームからデータフィールドを除いた構成)であるため、図示を省略する。
(Modification)
Moreover, the structure of the message which ECU1 transmits / receives is not restricted to what was shown in FIG. 4, For example, the other structure as shown in the following modifications may be sufficient. FIG. 32 is a schematic diagram illustrating a message configuration of a communication system according to a modification. In this figure, only the configuration of the data frame is shown, and the ACK frame has the same configuration (configuration in which the data field is removed from the data frame), and thus illustration is omitted.

変形例のデータフレームは、図4に示したデータフレームに対して、スロット番号とデータフィールドとの間にスロット番号用CRC(図32において単にCRCと記載する)を追加した構成である。図示は省略するがACKフレームは、スロット番号とCRCフィールドとの間にスロット番号用CRCを追加する。スロット番号用CRCは、受信したメッセージに含まれるスロット番号の誤り検出を行うためのものであり、スロット番号の値について予め定められた生成多項式を用いた演算を行うことにより取得する。メッセージを受信したECU1は、受信したメッセージに含まれるスロット番号から生成多項式により算出される値と、受信したメッセージのスロット番号用CRCの値とを比較することによって、誤り検出を行うことができ、2つの値が一致しない場合は誤りが生じていると判断する。   The data frame of the modified example has a configuration in which a slot number CRC (simply described as CRC in FIG. 32) is added between the slot number and the data field with respect to the data frame shown in FIG. Although not shown, the ACK frame adds a slot number CRC between the slot number and the CRC field. The slot number CRC is used to detect an error in the slot number included in the received message, and is obtained by performing an operation using a predetermined generator polynomial on the value of the slot number. The ECU 1 that has received the message can perform error detection by comparing the value calculated by the generator polynomial from the slot number included in the received message with the value of the slot number CRC of the received message. If the two values do not match, it is determined that an error has occurred.

このように、ECU1が送受信するメッセージ中にスロット番号の誤りを検出するためのスロット番号用CRCを設けることによって、CRCフィールドに基づく誤り検出にて誤りが検出された場合に、ECU1は誤りがスロット番号に含まれるか否かを更に調べることができる。これにより各ECU1は、誤りが含まれるメッセージを受信した場合であっても、スロット番号に誤りが含まれていなければ、受信したメッセージのスロット番号による通信の同期処理を行うことができるため、複数のECU1による巡回的なメッセージ送受信をより円滑に行うことが可能となる。   In this way, by providing a slot number CRC for detecting an error in the slot number in a message transmitted and received by the ECU 1, when an error is detected in the error detection based on the CRC field, the ECU 1 It can be further checked whether it is included in the number. As a result, even when each ECU 1 receives a message including an error, if the slot number does not include an error, each ECU 1 can perform communication synchronization processing using the slot number of the received message. It is possible to smoothly perform cyclic message transmission / reception by the ECU 1.

なお、上述の変形例においては、スロット番号の誤りを検出するスロット番号用CRCをメッセージ中に設ける構成としたが、これに限るものではなく、スロット番号の誤りを訂正することができるデータをメッセージ中に設ける構成としてもよい。   In the above-described modification, the slot number CRC for detecting the slot number error is provided in the message. However, the present invention is not limited to this, and data that can correct the slot number error is stored in the message. It is good also as a structure provided in.

1、1a〜1d ECU(通信装置)
5 バス(通信線)
11 制御部
12 入力部
13 出力部
14 記憶部
15 電源回路
16 通信部
101 アプリケーション
102 プロトコル制御手段(メッセージ送信手段、メッセージ再送信手段、通信開始手段、通信再開手段、通信停止要求送信手段、通信停止要求受信手段、通信停止制御手段)
103 エラー制御手段
104 メッセージ生成手段
105 スロット管理手段
106 ビットサンプリング手段
107 バスドライバ
1, 1a-1d ECU (communication device)
5 bus (communication line)
DESCRIPTION OF SYMBOLS 11 Control part 12 Input part 13 Output part 14 Storage part 15 Power supply circuit 16 Communication part 101 Application 102 Protocol control means (Message transmission means, Message re-transmission means, Communication start means, Communication resumption means, Communication stop request transmission means, Communication stop Request receiving means, communication stop control means)
103 Error control means 104 Message generation means 105 Slot management means 106 Bit sampling means 107 Bus driver

Claims (11)

3つ以上の通信装置が共通の通信線で接続され、一の通信装置が送信したメッセージを他の複数の通信装置が受信する通信システムにおいて、
各通信装置に対して一又は複数の送信権利が予め割り当てられ、該送信権利毎に定められた順序で前記3つ以上の通信装置が巡回的にメッセージの送信を行うようにしてあり、
前記通信装置は、
各送信権利に係るメッセージ受信の成否をそれぞれ示す複数の受信成否情報、及び、他の通信装置へ送信すべきデータを含むメッセージを生成して送信するメッセージ送信手段と、
他の通信装置から受信したメッセージに含まれる受信成否情報に応じてメッセージの再送信を行うメッセージ再送信手段と
起動後の所定サイクルに亘ってメッセージの送信を行わず、前記所定サイクルの間に他の通信装置からメッセージを受信した場合には該メッセージに同期して以降のメッセージ送信を行い、前記所定サイクルの間に他の通信装置からメッセージを受信しない場合にはメッセージ送信を行って、他の通信装置とのメッセージ送受信を開始する通信開始手段と
を有すること
を特徴とする通信システム。
In a communication system in which three or more communication devices are connected by a common communication line, and a plurality of other communication devices receive a message transmitted by one communication device.
One or a plurality of transmission rights are pre-assigned to each communication device, and the three or more communication devices transmit messages cyclically in the order determined for each transmission right,
The communication device
A plurality of reception success / failure information respectively indicating success / failure of message reception related to each transmission right, and message transmission means for generating and transmitting a message including data to be transmitted to another communication device;
Message resending means for resending a message according to reception success / failure information included in a message received from another communication device ;
If a message is not transmitted over a predetermined cycle after startup and a message is received from another communication device during the predetermined cycle, the subsequent message transmission is performed in synchronization with the message, and the predetermined cycle A communication system comprising: a communication start unit that transmits a message when no message is received from another communication device in between, and starts message transmission / reception with the other communication device .
前記通信装置は、メッセージ送信までの待機時間を計時する計時手段を有し、
前記通信装置の通信開始手段は、メッセージ送信を行った場合又は前記所定サイクルの間に他の通信装置から異常なメッセージを受信した場合に、割り当てられた送信権利に応じた待機時間を前記計時手段にて計時した後、メッセージの送信を行うようにしてあり、
複数の前記通信装置が、前記計時手段にてそれぞれ異なる待機時間を計時するようにしてあること
を特徴とする請求項に記載の通信システム。
The communication device has time measuring means for measuring a waiting time until message transmission,
The communication start means of the communication device, when performing message transmission or when receiving an abnormal message from another communication device during the predetermined cycle, the time measuring means according to the assigned transmission right After measuring the time, send a message,
Communication system according to claim 1 in which a plurality of said communication device, characterized in that you have to be timing the different waiting times at the clock means.
3つ以上の通信装置が共通の通信線で接続され、一の通信装置が送信したメッセージを他の複数の通信装置が受信する通信システムにおいて、
各通信装置に対して一又は複数の送信権利が予め割り当てられ、該送信権利毎に定められた順序で前記3つ以上の通信装置が巡回的にメッセージの送信を行うようにしてあり、
前記通信装置は、
各送信権利に係るメッセージ受信の成否をそれぞれ示す複数の受信成否情報、及び、他の通信装置へ送信すべきデータを含むメッセージを生成して送信するメッセージ送信手段と、
他の通信装置から受信したメッセージに含まれる受信成否情報に応じてメッセージの再送信を行うメッセージ再送信手段と、
メッセージ送信までの待機時間を計時する計時手段と、
所定サイクルの間に他の通信装置からメッセージを受信しない場合に、割り当てられた送信権利に応じた待機時間を前記計時手段にて計時した後、メッセージ送信を再開する通信再開手段と
を有し、
複数の前記通信装置が、前記計時手段にてそれぞれ異なる待機時間を計時するようにしてあること
を特徴とする通信システム。
In a communication system in which three or more communication devices are connected by a common communication line, and a plurality of other communication devices receive a message transmitted by one communication device.
One or a plurality of transmission rights are pre-assigned to each communication device, and the three or more communication devices transmit messages cyclically in the order determined for each transmission right,
The communication device
A plurality of reception success / failure information respectively indicating success / failure of message reception related to each transmission right, and message transmission means for generating and transmitting a message including data to be transmitted to another communication device;
Message resending means for resending a message according to reception success / failure information included in a message received from another communication device;
A timing means for timing the waiting time until message transmission;
A communication resumption means for resuming message transmission after measuring the waiting time according to the assigned transmission right when not receiving a message from another communication device during a predetermined cycle,
The plurality of communication devices, communication systems that characterized that you have to be timing the different waiting times respectively by the clock means.
3つ以上の通信装置が共通の通信線で接続され、一の通信装置が送信したメッセージを他の複数の通信装置が受信する通信システムにおいて、
各通信装置に対して一又は複数の送信権利が予め割り当てられ、該送信権利毎に定められた順序で前記3つ以上の通信装置が巡回的にメッセージの送信を行うようにしてあり、
前記通信装置は、
各送信権利に係るメッセージ受信の成否をそれぞれ示す複数の受信成否情報、及び、他の通信装置へ送信すべきデータを含むメッセージを生成して送信するメッセージ送信手段と、
他の通信装置から受信したメッセージに含まれる受信成否情報に応じてメッセージの再送信を行うメッセージ再送信手段と、
メッセージ送信の停止を要求するメッセージを送信する通信停止要求送信手段と、
他の通信装置から通信処理の停止を要求するメッセージを受信する通信停止要求受信手段と、
所定サイクルに亘って、複数の他の通信装置から前記通信停止要求受信手段が通信処理の停止を要求するメッセージを受信した場合に、メッセージ送信を停止する通信停止制御手段と
を有すること
を特徴とする通信システム。
In a communication system in which three or more communication devices are connected by a common communication line, and a plurality of other communication devices receive a message transmitted by one communication device.
One or a plurality of transmission rights are pre-assigned to each communication device, and the three or more communication devices transmit messages cyclically in the order determined for each transmission right,
The communication device
A plurality of reception success / failure information respectively indicating success / failure of message reception related to each transmission right, and message transmission means for generating and transmitting a message including data to be transmitted to another communication device;
Message resending means for resending a message according to reception success / failure information included in a message received from another communication device;
A communication stop request transmitting means for transmitting a message requesting to stop message transmission;
A communication stop request receiving means for receiving a message requesting to stop communication processing from another communication device;
Communication stop control means for stopping message transmission when the communication stop request receiving means receives a message requesting to stop communication processing from a plurality of other communication devices over a predetermined cycle. to that communication system.
前記通信装置のメッセージ送信手段は、自らの一の送信権利に係る前回のメッセージ送信から今回のメッセージ送信までの1サイクル間に送信される他の送信権利に係るメッセージの受信の成否を、前記受信成否情報として送信するメッセージに含ませるようにしてあること
を特徴とする請求項1乃至請求項4のいずれか1つに記載の通信システム。
The message transmitting means of the communication device determines whether or not the reception of the message related to another transmission right transmitted during one cycle from the previous message transmission related to the one transmission right to the current message transmission is received. The communication system according to any one of claims 1 to 4, wherein the communication system includes a message to be transmitted as success / failure information.
各通信装置は、一の通信権利に係るメッセージの送信が所定時間に亘って行われない場合、次の通信権利に係るメッセージの送信又は受信を行うようにしてあること
を特徴とする請求項1乃至請求項5のいずれか1つに記載の通信システム。
Each communication device is configured to transmit or receive a message related to a next communication right when a message related to one communication right is not transmitted for a predetermined time. or communication system according to any one of claims 5.
前記通信装置のメッセージ送信手段は、送信権利を識別するための識別情報を含むメッセージを生成して送信するようにしてあり、
各通信装置は、受信したメッセージの前記識別情報に基づいて、メッセージ送受信の同期を行うようにしてあること
を特徴とする請求項1乃至請求項のいずれか1つに記載の通信システム。
The message transmitting means of the communication device generates and transmits a message including identification information for identifying a transmission right,
The communication system according to any one of claims 1 to 6 , wherein each communication device is configured to synchronize message transmission and reception based on the identification information of the received message.
前記通信装置のメッセージ送信手段は、前記識別情報の誤りを検出又は訂正するための情報を含むメッセージを生成して送信するようにしてあること
を特徴とする請求項に記載の通信システム。
The communication system according to claim 7 , wherein the message transmission unit of the communication device generates and transmits a message including information for detecting or correcting an error in the identification information.
前記通信装置は、メッセージの送受信に係るエラーの発生数を計数するエラーカウンタを有し、
前記通信装置のメッセージ送信手段は、前記エラーカウンタが計数したエラー発生数が所定値を超えた場合に、メッセージ送信の頻度を低減するようにしてあること
を特徴とする請求項1乃至請求項のいずれか1つに記載の通信システム。
The communication device has an error counter that counts the number of occurrences of errors related to message transmission and reception,
It said message sending means of the communication device, when the number of errors that the error counter has counted exceeds a predetermined value, according to claim 1 to claim 8, characterized in that you have to reduce the frequency of message transmission The communication system according to any one of the above.
共通の通信線を介して2つ以上の他の装置との間でメッセージの送受信を行う通信装置において、
一又は複数の送信権利が予め割り当てられており、
他の装置に割り当てられた送信権利を含む各送信権利に係るメッセージ受信の成否をそれぞれ示す複数の受信成否情報、及び、他の装置へ送信すべきデータを含むメッセージを生成して送信するメッセージ送信手段と、
他の装置から受信したメッセージに含まれる受信成否情報に応じてメッセージの再送信を行うメッセージ再送信手段と
起動後の所定サイクルに亘ってメッセージの送信を行わず、前記所定サイクルの間に他の装置からメッセージを受信した場合には該メッセージに同期して以降のメッセージ送信を行い、前記所定サイクルの間に他の装置からメッセージを受信しない場合にはメッセージ送信を行って、他の装置とのメッセージ送受信を開始する通信開始手段と
を備え、
前記メッセージ送信手段及び前記メッセージ再送信手段は、割り当てられた送信権利に定められた順序で、前記他の装置との間で巡回的にメッセージの送信を行うようにしてあること
を特徴とする通信装置。
In a communication device that transmits and receives messages to and from two or more other devices via a common communication line,
One or more transmission rights are pre-assigned,
Message transmission for generating and transmitting a message including a plurality of pieces of reception success / failure information indicating success / failure of message reception related to each transmission right including transmission right assigned to another device and data to be transmitted to the other device Means,
Message resending means for resending the message according to the reception success / failure information included in the message received from another device ;
When a message is not transmitted over a predetermined cycle after startup and a message is received from another device during the predetermined cycle, subsequent message transmission is performed in synchronization with the message, and during the predetermined cycle Communication start means for transmitting a message when no message is received from the other device and starting message transmission / reception with the other device ,
The message transmitting means and the message retransmitting means are configured to cyclically transmit messages to and from the other apparatus in the order determined by the assigned transmission right. apparatus.
共通の通信線を介して2つ以上の他の装置との間でメッセージの送受信を行う通信装置において、In a communication device that transmits and receives messages to and from two or more other devices via a common communication line,
一又は複数の送信権利が予め割り当てられており、One or more transmission rights are pre-assigned,
他の装置に割り当てられた送信権利を含む各送信権利に係るメッセージ受信の成否をそれぞれ示す複数の受信成否情報、及び、他の装置へ送信すべきデータを含むメッセージを生成して送信するメッセージ送信手段と、Message transmission for generating and transmitting a message including a plurality of pieces of reception success / failure information indicating success / failure of message reception related to each transmission right including transmission right assigned to another device and data to be transmitted to the other device Means,
他の装置から受信したメッセージに含まれる受信成否情報に応じてメッセージの再送信を行うメッセージ再送信手段と、Message resending means for resending the message according to the reception success / failure information included in the message received from another device;
メッセージ送信の停止を要求するメッセージを送信する通信停止要求送信手段と、A communication stop request transmitting means for transmitting a message requesting to stop message transmission;
他の装置から通信処理の停止を要求するメッセージを受信する通信停止要求受信手段と、Communication stop request receiving means for receiving a message requesting to stop communication processing from another device;
所定サイクルに亘って、複数の他の装置から前記通信停止要求受信手段が通信処理の停止を要求するメッセージを受信した場合に、メッセージ送信を停止する通信停止制御手段とCommunication stop control means for stopping message transmission when the communication stop request receiving means receives a message requesting to stop communication processing from a plurality of other devices over a predetermined cycle;
を備え、With
前記メッセージ送信手段及び前記メッセージ再送信手段は、割り当てられた送信権利に定められた順序で、前記他の装置との間で巡回的にメッセージの送信を行うようにしてあることThe message transmission unit and the message retransmission unit are configured to cyclically transmit messages to and from the other device in the order determined by the assigned transmission right.
を特徴とする通信装置。A communication device characterized by the above.
JP2010178681A 2010-08-09 2010-08-09 Communication system and communication apparatus Active JP5717240B2 (en)

Priority Applications (5)

Application Number Priority Date Filing Date Title
JP2010178681A JP5717240B2 (en) 2010-08-09 2010-08-09 Communication system and communication apparatus
DE112011102688T DE112011102688T5 (en) 2010-08-09 2011-08-09 Communication system and communication device
PCT/JP2011/068168 WO2012020761A1 (en) 2010-08-09 2011-08-09 Communication system and communication apparatus
US13/813,749 US9209942B2 (en) 2010-08-09 2011-08-09 Communication system and communication apparatus
CN201180039441.7A CN103155492B (en) 2010-08-09 2011-08-09 Communication system and communicator

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010178681A JP5717240B2 (en) 2010-08-09 2010-08-09 Communication system and communication apparatus

Publications (2)

Publication Number Publication Date
JP2012039446A JP2012039446A (en) 2012-02-23
JP5717240B2 true JP5717240B2 (en) 2015-05-13

Family

ID=45567723

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010178681A Active JP5717240B2 (en) 2010-08-09 2010-08-09 Communication system and communication apparatus

Country Status (5)

Country Link
US (1) US9209942B2 (en)
JP (1) JP5717240B2 (en)
CN (1) CN103155492B (en)
DE (1) DE112011102688T5 (en)
WO (1) WO2012020761A1 (en)

Families Citing this family (42)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
RU2595962C2 (en) 2011-04-06 2016-08-27 Роберт Бош Гмбх Method and device for adaptation of reliability of data transmission in serial bus system
JP5770924B2 (en) 2011-04-06 2015-08-26 ローベルト ボッシュ ゲゼルシャフト ミット ベシュレンクテル ハフツング Method and apparatus for increasing data transmission capacity in a serial bus system
CN103649933B (en) 2011-04-26 2016-10-19 罗伯特·博世有限公司 The method and apparatus of the serial data transmission for mating with memory size
ES2548409T3 (en) 2011-06-29 2015-10-16 Robert Bosch Gmbh Method and device for serial data transmission with a flexible message size and a variable bit length
JP5626266B2 (en) * 2012-06-05 2014-11-19 株式会社デンソー Communications system
DE102012017386B4 (en) * 2012-09-01 2020-10-15 Volkswagen Aktiengesellschaft Method of monitoring a device connected to a communication channel
KR101438978B1 (en) * 2012-12-31 2014-09-11 현대자동차주식회사 Method and system for reprogramming
US9419737B2 (en) * 2013-03-15 2016-08-16 Concio Holdings LLC High speed embedded protocol for distributed control systems
JP6039522B2 (en) * 2013-09-06 2016-12-07 株式会社東芝 External input / output device and arbitration setting result storage method
DE102013015370A1 (en) * 2013-09-13 2015-03-19 Wabco Gmbh Method for providing and transmitting data, in particular in connection with a vehicle
US20150234767A1 (en) 2013-09-23 2015-08-20 Farmobile, Llc Farming data collection and exchange system
CN104635549A (en) * 2013-11-07 2015-05-20 北汽福田汽车股份有限公司 Can bus error processing method and can controller
CN104717113B (en) * 2013-12-14 2018-09-21 中国航空工业集团公司第六三一研究所 It is a kind of to synchronize how main reciprocity bus communication system
JP2015139093A (en) * 2014-01-22 2015-07-30 株式会社デンソー relay device
JP5958975B2 (en) 2014-03-10 2016-08-02 トヨタ自動車株式会社 COMMUNICATION DEVICE, COMMUNICATION METHOD, AND COMMUNICATION SYSTEM
JPWO2015159520A1 (en) * 2014-04-17 2017-04-13 パナソニック インテレクチュアル プロパティ コーポレーション オブ アメリカPanasonic Intellectual Property Corporation of America In-vehicle network system, gateway device and fraud detection method
JP6336328B2 (en) * 2014-05-02 2018-06-06 キヤノン株式会社 COMMUNICATION DEVICE, ITS CONTROL METHOD, AND PROGRAM
EP3169021B1 (en) * 2014-07-10 2021-06-23 Panasonic Intellectual Property Corporation of America Vehicle-mounted network system, electronic control unit, reception method, and transmission method
JP6323296B2 (en) * 2014-10-23 2018-05-16 株式会社デンソー Control device
JP6282216B2 (en) * 2014-11-20 2018-02-21 国立大学法人名古屋大学 Communication system and communication apparatus
US9843597B2 (en) * 2015-01-05 2017-12-12 International Business Machines Corporation Controller area network bus monitor
JP6497142B2 (en) * 2015-03-13 2019-04-10 富士通株式会社 Communication monitoring device, communication monitoring program, and communication monitoring method
US9768977B2 (en) * 2015-07-01 2017-09-19 QUALCOMM Technologies International, Ltd Low-power can management
JP6836340B2 (en) * 2015-09-29 2021-02-24 パナソニック インテレクチュアル プロパティ コーポレーション オブ アメリカPanasonic Intellectual Property Corporation of America Fraud detection electronic control unit, in-vehicle network system and communication method
CN108476155B (en) * 2015-12-25 2021-05-14 新唐科技日本株式会社 Unauthorized message detection device, unauthorized message detection method, recording medium, and electronic control device
US10963354B2 (en) * 2016-04-01 2021-03-30 Mitsubishi Electric Corporation Control apparatus and recovery processing method for control apparatus
JP6845628B2 (en) 2016-07-07 2021-03-17 任天堂株式会社 Information processing equipment, information processing methods, information processing systems, and control programs
CN106789694A (en) * 2016-11-12 2017-05-31 驭联智能科技发展(上海)有限公司 Novel on-vehicle equipment communication control method and system
KR102592204B1 (en) * 2016-12-29 2023-10-20 현대자동차주식회사 A vehicle and method for controlling communication thereof
CN111953450A (en) 2017-02-16 2020-11-17 华为技术有限公司 Method and equipment for transmitting data in flexible Ethernet
CN110915155B (en) * 2017-05-16 2021-11-30 日立能源瑞士股份公司 High voltage direct current HVDC power system and communication network thereof
JP6543307B2 (en) * 2017-08-08 2019-07-10 東芝エレベータ株式会社 Elevator system
EP3499806B1 (en) * 2017-12-13 2020-08-05 Nxp B.V. Node and method for conducting measurements and signal analyses on a multi-master access bus
JP7010087B2 (en) * 2018-03-16 2022-01-26 トヨタ自動車株式会社 Program update management device, program update management method, and program
KR101988171B1 (en) * 2018-04-27 2019-06-11 벨로넥트 인코퍼레이션 Device for providing speed-enhancement for connected nodes on a bus
JP7018827B2 (en) * 2018-06-13 2022-02-14 本田技研工業株式会社 Communication system and vehicle
US10439840B1 (en) 2018-07-27 2019-10-08 Nxp B.V. Method and device for communicating data frames on a multi-master bus
FR3089729B1 (en) * 2018-12-05 2021-08-06 Renault Sas Frame selection system, communication node and associated implementation method
DE102019205487A1 (en) 2019-04-16 2020-10-22 Robert Bosch Gmbh Subscriber station for a serial bus system and method for communication in a serial bus system
US11843667B2 (en) 2020-08-17 2023-12-12 Toyota Motor North America, Inc. Real time boot for secure distributed systems
CN115733849A (en) * 2021-08-27 2023-03-03 北京车和家信息技术有限公司 Flash method, device, system, equipment and storage medium of electronic control unit
WO2024009633A1 (en) * 2022-07-05 2024-01-11 パナソニックIpマネジメント株式会社 Controller, control method, and program

Family Cites Families (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0677963A (en) * 1992-07-07 1994-03-18 Hitachi Ltd Communication system and terminal equipment
JP2004363761A (en) * 2003-06-03 2004-12-24 Nissan Motor Co Ltd Data communication method
JP4341466B2 (en) * 2004-05-21 2009-10-07 株式会社デンソー Synchronous communication system
JP4852246B2 (en) * 2005-01-04 2012-01-11 パナソニック株式会社 COMMUNICATION DEVICE, INTEGRATED CIRCUIT, AND COMMUNICATION METHOD
JP2007081628A (en) * 2005-09-13 2007-03-29 Nec Electronics Corp Method, program, and device for designing network
DE102005061403A1 (en) 2005-12-22 2007-06-28 Robert Bosch Gmbh Subscriber`s bus-controller for e.g. Flex ray communication system, has comparator provided for determination of variations between provided sending information and actual bus access based on synchronized local time of monitoring unit
EP2056529A4 (en) 2006-08-21 2016-07-20 Panasonic Corp Wireless communication system, communication control method and communication node
JP4781940B2 (en) * 2006-08-21 2011-09-28 パナソニック株式会社 Wireless communication system, communication control method, and communication node
JP4988475B2 (en) * 2007-08-02 2012-08-01 パナソニック株式会社 Congestion control method, radio communication system, and radio communication apparatus
JP4988474B2 (en) 2007-08-02 2012-08-01 パナソニック株式会社 Wireless communication method, wireless communication system, and wireless communication apparatus
JP4988472B2 (en) 2007-08-01 2012-08-01 パナソニック株式会社 Wireless communication method, wireless communication system, and wireless communication apparatus
JP5086725B2 (en) 2007-08-01 2012-11-28 パナソニック株式会社 Wireless communication method, wireless communication system, and wireless communication apparatus
US20100118698A1 (en) 2007-08-01 2010-05-13 Panasonic Corporation Radio communication method, radio communication system, radio communication device, and congestion control method
JP2010081152A (en) * 2008-09-25 2010-04-08 Nec Electronics Corp Communication device, communication system, communication method, and can node

Also Published As

Publication number Publication date
CN103155492B (en) 2015-11-25
CN103155492A (en) 2013-06-12
US9209942B2 (en) 2015-12-08
WO2012020761A1 (en) 2012-02-16
US20130139018A1 (en) 2013-05-30
DE112011102688T5 (en) 2013-05-29
JP2012039446A (en) 2012-02-23

Similar Documents

Publication Publication Date Title
JP5717240B2 (en) Communication system and communication apparatus
JP5563165B2 (en) Method and apparatus for serial data transmission with switchable data rate
JP5798251B2 (en) Method and apparatus for improving data transmission reliability in serial data transmission with flexible message size
JP4824662B2 (en) Method and apparatus for synchronizing cycle times of multiple buses and corresponding bus system
US8448035B2 (en) Communication system adapting for car, communication apparatus adapting for car, and communication method adapting for car
JP4571668B2 (en) Method and communication system for establishing a global time base in a time-controlled communication system
RU2596582C2 (en) Method and device for memory size adapted serial data transfer
JP5539593B2 (en) Method and apparatus for providing global time information in event-controlled bus communication
US11706049B2 (en) Subscriber station for a serial bus system and method for communication in a serial bus system
JP2009521152A (en) Monitoring unit for monitoring or controlling access to data bus by subscriber unit and subscriber unit equipped with the monitoring unit
JP2016005247A (en) Network transmission system, and master node and slave node thereof
JP2020099052A (en) Slave nodes, method of synchronizing communication between master node and slave nodes, and control component of slave nodes
US20210392011A1 (en) User station for a serial bus system and method for communication in a serial bus system
JP2020108144A (en) Master node of distributed acquisition system, method of synchronizing communication between master node and one or more slave nodes, and control component
JP4594124B2 (en) Communication system and communication method
KR101334017B1 (en) Apparatus of checking a validity of message on network for a vehicle and method of thereof
JP2009244991A (en) Data communication method, data communication system, electronic control unit, and circuit board
WO2004100435A2 (en) Mac protocol for centralized wireless network communication management
JP4192627B2 (en) Packet transmission / reception method and apparatus
JP2006319381A (en) Method for transmitting urgent message
US20210250123A1 (en) User station for a serial communication network and method for correcting individual errors in a message of a serial communication network
JP5221292B2 (en) Cyclic transmission system and transmission method thereof
JP5219120B2 (en) COMMUNICATION SYSTEM, COMMUNICATION DEVICE, AND COMMUNICATION METHOD
JPH06252895A (en) Data transmission system
JP3337907B2 (en) Multiplex transmission system

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20130807

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20131205

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20140527

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20140717

RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20140717

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20140807

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20141021

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20141212

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20150313

R150 Certificate of patent or registration of utility model

Ref document number: 5717240

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

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