KR101135117B1 - METHOD AND APPARATUS OF COMPENSATING DELAY OF MESSAGE TRANSMISSION USING PROCESS PRIORITY ADJUSTMENT IN heterogeneous COMMUNICATION - Google Patents

METHOD AND APPARATUS OF COMPENSATING DELAY OF MESSAGE TRANSMISSION USING PROCESS PRIORITY ADJUSTMENT IN heterogeneous COMMUNICATION Download PDF

Info

Publication number
KR101135117B1
KR101135117B1 KR1020100067690A KR20100067690A KR101135117B1 KR 101135117 B1 KR101135117 B1 KR 101135117B1 KR 1020100067690 A KR1020100067690 A KR 1020100067690A KR 20100067690 A KR20100067690 A KR 20100067690A KR 101135117 B1 KR101135117 B1 KR 101135117B1
Authority
KR
South Korea
Prior art keywords
message
protocol
priority
node
dispatcher
Prior art date
Application number
KR1020100067690A
Other languages
Korean (ko)
Other versions
KR20120007118A (en
Inventor
조희섭
김정면
Original Assignee
재단법인대구경북과학기술원
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 재단법인대구경북과학기술원 filed Critical 재단법인대구경북과학기술원
Priority to KR1020100067690A priority Critical patent/KR101135117B1/en
Publication of KR20120007118A publication Critical patent/KR20120007118A/en
Application granted granted Critical
Publication of KR101135117B1 publication Critical patent/KR101135117B1/en

Links

Images

Classifications

    • 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/40143Bus networks involving priority mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/24Traffic characterised by specific attributes, e.g. priority or QoS
    • H04L47/2458Modification of priorities while in transit
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/28Flow control; Congestion control in relation to timing considerations
    • H04L47/283Flow control; Congestion control in relation to timing considerations in response to processing delays, e.g. caused by jitter or round trip time [RTT]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/50Queue scheduling
    • H04L47/56Queue scheduling implementing delay-aware scheduling
    • 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
    • H04L2012/40208Bus networks characterized by the use of a particular bus standard
    • H04L2012/40215Controller Area Network CAN
    • 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
    • H04L2012/40208Bus networks characterized by the use of a particular bus standard
    • H04L2012/40241Flexray

Abstract

본 발명은 이종 프로토콜 통신에서 프로세스의 우선 순위를 조절하여 지연을 보상하는 방법 및 장치를 개시하고 있다.
본 발명의 일 실시 예에 따른 이종 프로토콜 통신에서 프로세스의 우선 순위를 조절하여 지연을 보상하는 방법은 이종의 프로토콜을 사용하는 노드들 간에 메시지를 교환함에 있어서, 제 1 프로토콜을 사용하는 제 1 노드로부터 제 1 메시지를 수신하여 상기 메시지 수신 시간을 저장하는 단계, 제 2 프로토콜의 제 2 노드로 메시지 송신을 담당하는 메시지 디스패처에게 상기 제 1 메시지 및 상기 메시지 수신 시간을 제공하는 단계, 및 상기 메시지 디스패처는 우선 순위에 따라 상기 제 1 메시지를 송신하는 단계를 포함하며, 상기 우선 순위는 상기 메시지 디스패처가 처리하게 되는 노드의 메시지 전송 지연 발생에 따라 산출되는 것을 특징으로 한다.
The present invention discloses a method and apparatus for compensating for delay by adjusting the priority of a process in heterogeneous protocol communication.
In the heterogeneous protocol communication according to an embodiment of the present invention, a method for compensating delay by adjusting a priority of a process may be performed by exchanging a message between nodes using heterogeneous protocols, from a first node using a first protocol. Receiving the first message and storing the message reception time, providing the first message and the message reception time to a message dispatcher in charge of sending a message to a second node of a second protocol, and the message dispatcher And transmitting the first message according to a priority, wherein the priority is calculated according to a message transmission delay of a node to be processed by the message dispatcher.

Figure R1020100067690
Figure R1020100067690

Description

이종 프로토콜 통신에서 프로세스의 우선 순위를 조절하여 지연을 보상하는 방법 및 장치{METHOD AND APPARATUS OF COMPENSATING DELAY OF MESSAGE TRANSMISSION USING PROCESS PRIORITY ADJUSTMENT IN heterogeneous COMMUNICATION}METHOD AND APPARATUS OF COMPENSATING DELAY OF MESSAGE TRANSMISSION USING PROCESS PRIORITY ADJUSTMENT IN heterogeneous COMMUNICATION}

본 발명은 이종 프로토콜 통신에서 프로세스의 우선 순위를 조절하여 지연을 보상하는 방법 및 장치를 개시하고 있다. The present invention discloses a method and apparatus for compensating for delay by adjusting the priority of a process in heterogeneous protocol communication.

현대의 차량 내에는 마이크로프로세서, 센서, 그리고 엑추에이터 등의 다양한 전자기기들이 사용되고 있으며 이들은 차량의 안전한 주행과 운전자의 편의를 위해 상호 간의 신뢰성 있는 정보 교환을 필요로 한다. In modern vehicles, various electronic devices such as microprocessors, sensors, and actuators are used, and they require reliable information exchange between each other for safe driving and driver's convenience.

차량 내부의 통신 방식으로 가장 널리 사용되고 있는 것은 CAN (Control Area Network)으로서 최고 1 Mbps의 전송률로 데이터를 전송할 수 있다. 그러나 이벤트 기반 (Event- triggered) 통신 방식의 한계와 비교적 낮은 전송률로 인해 x-by-wire 시스템과 같이 고도의 신뢰성과 안전성이 요구되는 시스템에 적용하기에는 적합하지 않은 방식이다. 이의 대안으로 확정적 통신 (deterministic communication)의 속성을 지니며 적은 지터(jitter)로 주기적인 데이터 교환이 가능한 FlexRay가 개발되었다. FlexRay는 시간 동기 (Time-triggered)에 의해 확정성을 제공하는 TDMA 방식과 이벤트 기반 통신 방식을 혼용하여 적용할 수 있는 유연성을 제공하도록 설계되었다. 그러나, 시간 동기에 의해 운용되는 FlexRay는 데이터를 전송하는 과정에서 시간상의 지연이 발생할 경우, 수신측이 지연된 데이터를 수신하게 되며, 이러한 지연이 다른 데이터를 전송하는 데 있어 영향을 미칠 수 있다는 문제가 있다. The most widely used in-vehicle communication is the Control Area Network (CAN), which can transmit data at data rates up to 1 Mbps. However, due to the limitations of event-triggered communication methods and relatively low data rates, they are not suitable for applications requiring high reliability and safety, such as x-by-wire systems. As an alternative, FlexRay has been developed, which has the property of deterministic communication and allows periodic data exchange with little jitter. FlexRay is designed to provide the flexibility of applying TDMA and event-based communication methods that provide determinism by time-triggered. However, in case of a time delay in the process of transmitting data, FlexRay operates due to time synchronization, and the receiving side receives the delayed data, and this delay may affect the transmission of other data. have.

'차량 내 네트워크'는 증가하는 네트워크 도메인의 수와 여기에서 기인하게 되는 도메인 간 통신에 있어서의 복잡도의 증가, 그리고 전송 지연의 문제점에 직면하게 되었다. 특히, 이종 도메인 간 (CAN ? LIN, CAN ? FlexRay 등)의 통신을 위해서는 '게이트웨이 (Gateway) 기능'이 필요한데, 이 게이트웨이 기능을 제공함에 있어서는 해당 데이터가 적절한 시점에 전송이 완료될 수 있는 신뢰성 있는 통신을 보장하는 것이 필요하다.
'In-vehicle networks' faced a growing number of network domains, increased complexity in inter-domain communications and resulting transmission delays. In particular, 'Gateway function' is required for communication between heterogeneous domains (CAN, LIN, CAN, FlexRay, etc.). In providing this gateway function, reliable data transfer can be completed in a timely manner. It is necessary to ensure communication.

본 발명은 FlexRay 통신에서 메시지를 송수신하는 과정에서 발생하는 지연을 해결하기 위해 메시지 전송을 제어하는 프로세스의 우선 순위를 조절하는 기술을 제시하고자 한다.The present invention is to propose a technique for adjusting the priority of the process of controlling the message transmission to solve the delay in the process of transmitting and receiving messages in FlexRay communication.

본 발명은 게이트웨이 내에서의 전송 지연을 정량적으로 측정하여, 전송 지연 시간이 시스템의 허용 한계를 넘어서는 경우에 이를 극복할 수 있는 방법을 제시하고자 한다.The present invention intends to quantitatively measure the transmission delay in the gateway, and to propose a method that can overcome this when the transmission delay time exceeds the allowable limit of the system.

특히, 본 발명은 CAN - FlexRay 이종의 메시지 전송에서 발생하는 지연을 메시지 전송을 제어하는 메시지 디스패처의 처리 우선 순위를 제어하여, 메시지 자체의 우선 순위를 변경시키지 않도록 하여, 복합적인 전송 지연을 정량화하고 이를 보상할 수 있으며, 차량 내 게이트웨이에 적용될 경우 차량 내 네트워크의 신뢰성을 극대화 시킬 수 있다.
In particular, the present invention controls the processing priority of the message dispatcher that controls message transmission for the delay occurring in the CAN-FlexRay heterogeneous message transmission, thereby quantifying the complex transmission delay so as not to change the priority of the message itself. This can be compensated for, and when applied to the in-vehicle gateway, the reliability of the in-vehicle network can be maximized.

전술한 과제를 달성하기 위해, 본 발명의 일 실시 예에 따른 이종 프로토콜 통신에서 프로세스의 우선 순위를 조절하여 지연을 보상하는 방법은 이종의 프로토콜을 사용하는 노드들 간에 메시지를 교환함에 있어서, 제 1 프로토콜을 사용하는 제 1 노드로부터 제 1 메시지를 수신하여 상기 메시지 수신 시간을 저장하는 단계, 제 2 프로토콜의 제 2 노드로 메시지 송신을 담당하는 메시지 디스패처에게 상기 제 1 메시지 및 상기 메시지 수신 시간을 제공하는 단계, 및 상기 메시지 디스패처는 우선 순위에 따라 상기 제 1 메시지를 송신하는 단계를 포함하며, 상기 우선 순위는 상기 메시지 디스패처가 처리하게 되는 노드의 메시지 전송 지연 발생에 따라 산출되는 것을 특징으로 한다.
In order to achieve the above object, a method of compensating delay by adjusting a priority of a process in heterogeneous protocol communication according to an embodiment of the present invention may include a first method of exchanging messages between nodes using heterogeneous protocols. Receiving a first message from a first node using a protocol and storing the message reception time; providing the first message and the message reception time to a message dispatcher in charge of sending a message to a second node of a second protocol And the message dispatcher transmits the first message according to a priority, wherein the priority is calculated according to a message transmission delay of a node to be processed by the message dispatcher.

본 발명의 일 실시 예에 따른 이종 프로토콜 통신에서 프로세스의 우선 순위를 조절하여 지연을 보상하는 장치는 이종의 프로토콜을 사용하는 노드들 간에 메시지를 교환함에 있어서, 제 1 프로토콜을 사용하는 노드의 메시지 송수신을 제어하는 제 1 컨트롤러, 제 2 프로토콜을 사용하는 노드의 메시지 송수신을 제어하는 제 2 컨트롤러, 상기 제 1 프로토콜을 사용하는 제 1 노드로부터 제 1 메시지를 수신하여 상기 메시지 수신 시간을 저장하며, 메시지 디스패처를 선택하는 작업 스케쥴러, 및 상기 제 1 메시지를 상기 제 2 컨트롤러가 제어하는 메모리 버퍼에 저장하는 메시지 디스패처를 포함하며, 상기 메시지 디스패처는 우선 순위에 따라 상기 제 1 메시지를 송신하고, 상기 우선 순위는 상기 메시지 디스패처가 처리하게 되는 노드의 메시지 전송 지연 발생에 따라 산출되는 것을 특징으로 한다.
An apparatus for compensating for delay by adjusting a priority of a process in heterogeneous protocol communication according to an embodiment of the present invention may be used to exchange messages between nodes using heterogeneous protocols. A first controller for controlling the second, a second controller for controlling the transmission and reception of messages using a second protocol, receives a first message from the first node using the first protocol to store the message reception time, message A task scheduler for selecting a dispatcher, and a message dispatcher for storing the first message in a memory buffer controlled by the second controller, wherein the message dispatcher transmits the first message according to a priority and the priority. Is the message transmission destination of the node that will be processed by the message dispatcher. It characterized in that the calculation according to occur.

본 발명은 게이트웨이 내에서의 전송 지연을 정량적으로 측정하여, 메시지 전송의 지연을 막고, 전체 네트워크의 메시지 흐름의 변화에 탄력적으로 적응할 수 있다. 특히, 본 발명은 메시지 전송을 담당하는 프로세스의 우선 순위를 조절하여, 메시지 지연에 효과적으로 대응할 수 있도록 한다.The present invention can quantitatively measure the transmission delay in the gateway to prevent delays in message transmission and to flexibly adapt to changes in the message flow of the entire network. In particular, the present invention adjusts the priority of a process in charge of message transmission, thereby effectively responding to message delay.

도 1은 본 명세서의 일 실시예가 적용되는 CAN-FlexRay 게이트웨이의 구조를 보여주는 도면이다.
도 2는 본 명세서에서 언급되는 게이트웨이의 일반적인 구조를 보여주는 도면이다.
도 3은 본 명세서의 일 실시에에 의한 게이트웨이의 소프트웨어적, 또는 기능적 구조를 보여주는 도면이다.
도 4는 본 명세서의 일 실시예에 의한 게이트웨이의 구성 및 각각의 구성에서 이루어지는 메시지 전달 과정을 보여주는 도면이다.
도 5는 본 명세서의 일 실시예에 의한 CAN 메시지가 FlexRay 노드에 전송되는 과정에서 발생하는 메시지 지연을 처리하는 과정을 보여주는 도면이다.
1 is a diagram illustrating a structure of a CAN-FlexRay gateway to which an embodiment of the present specification is applied.
2 is a view showing a general structure of a gateway referred to herein.
3 is a diagram illustrating a software or functional structure of a gateway according to one embodiment of the present specification.
4 is a diagram illustrating a configuration of a gateway and a message transfer process performed in each configuration according to an embodiment of the present specification.
FIG. 5 is a diagram illustrating a process of processing a message delay occurring while a CAN message is transmitted to a FlexRay node according to one embodiment of the present specification.

이하, 본 발명의 일부 실시 예들을 예시적인 도면을 통해 상세하게 설명한다. 각 도면의 구성요소들에 참조부호를 부가함에 있어서, 동일한 구성요소들에 대해서는 비록 다른 도면상에 표시되더라도 가능한 한 동일한 부호를 가지도록 하고 있음에 유의해야 한다. 또한, 본 발명을 설명함에 있어, 관련된 공지 구성 또는 기능에 대한 구체적인 설명이 본 발명의 요지를 흐릴 수 있다고 판단되는 경우에는 그 상세한 설명은 생략한다.Hereinafter, some embodiments of the present invention will be described in detail with reference to the accompanying drawings. In adding reference numerals to the components of each drawing, it should be noted that the same reference numerals are assigned to the same components as much as possible even though they are shown in different drawings. In the following description of the present invention, a detailed description of known functions and configurations incorporated herein will be omitted when it may make the subject matter of the present invention rather unclear.

또한, 본 발명의 구성 요소를 설명하는 데 있어서, 제 1, 제 2, A, B, (a), (b) 등의 용어를 사용할 수 있다. 이러한 용어는 그 구성 요소를 다른 구성 요소와 구별하기 위한 것일 뿐, 그 용어에 의해 해당 구성 요소의 본질이나 차례 또는 순서 등이 한정되지 않는다. 어떤 구성 요소가 다른 구성요소에 "연결", "결합" 또는 "접속"된다고 기재된 경우, 그 구성 요소는 그 다른 구성요소에 직접적으로 연결되거나 접속될 수 있지만, 각 구성 요소 사이에 또 다른 구성 요소가 "연결", "결합" 또는 "접속"될 수도 있다고 이해되어야 할 것이다.In addition, in describing the component of this invention, terms, such as 1st, 2nd, A, B, (a), (b), can be used. These terms are intended to distinguish the constituent elements from other constituent elements, and the terms do not limit the nature, order or order of the constituent elements. If a component is described as being "connected", "coupled" or "connected" to another component, that component may be directly connected or connected to that other component, but between components It will be understood that may be "connected", "coupled" or "connected".

CAN과 FlexRay 버스 간에 메시지를 교환할 수 있는 방법으로 제안된 내용은 CAN 메시지의 ID와 FlexRay 슬롯을 매칭하는 방법 또는 메시지를 변환 방법이 있다. 한편, CAN과 FlexRay 버스 간에 메시지를 교환하기 위한 매핑 테이블을 제안하고 이에 필요한 필터링 기법과 메시지를 저장하기 위한 메시지 큐를 적용할 수 있다. 그러나 이러한 방법을 적용할 경우, CAN과 FlexRay와 같이 서로 다른(이종의) 버스 사이에 위치한 게이트웨이 내의 메시지 전달 과정에서 전송 지연이 발생할 수 있다. 특히, 한쪽 버스의 노드에서 전송한 메시지가 상대 측 버스에 접속된 노드에 도달할 때까지의 시간에 더해진 전송 지연을 정량적으로 측정하지 않아, 이러한 전송 지연이 전체 네트워크 시스템의 허용 한계를 넘어설 경우, 네트워크의 효율이 급격히 저하될 수 있다. 이하, 게이트웨이 내에서의 전송 지연을 측정하여 전송 지연에 의한 네트워크 효율의 저하를 방지하는 방법 및 장치에 대해 살펴보고자 한다. Proposed methods for exchanging messages between CAN and FlexRay buses include matching the ID of the CAN message with the FlexRay slot or converting the message. On the other hand, we can propose a mapping table for exchanging messages between CAN and FlexRay buses, and apply filtering techniques and message queues for storing messages. However, with this approach, transmission delays can occur during message delivery within gateways located between different (heterogeneous) buses, such as CAN and FlexRay. In particular, if a message transmitted from a node on one bus does not quantitatively measure the transmission delay added to the time to reach a node connected to the other bus, the transmission delay exceeds the allowable limit of the entire network system. As a result, the efficiency of the network can be drastically reduced. Hereinafter, a method and apparatus for measuring a transmission delay in a gateway to prevent a decrease in network efficiency due to the transmission delay will be described.

또한, 본 명세서에서는 게이트웨이 내에서의 전송 지연을 정량적으로 측정하고, 전송 지연 시간이 시스템의 허용 한계를 넘어서는 경우에 이를 극복할 수 있는 과정 및 장치를 살펴보고자 한다.
In addition, the present specification will quantitatively measure the transmission delay in the gateway, and look at the process and apparatus that can overcome this when the transmission delay time exceeds the allowable limit of the system.

도 1은 본 명세서의 일 실시예가 적용되는 CAN-FlexRay 게이트웨이의 구조를 보여주는 도면이다. 도 1의 CAN-FlexRay 게이트웨이(150)는 다수의 CAN 버스(1, ..., N)과 한 개 이상의 FlexRay 버스가 접속된다. 다수의 CAN 버스(1, ..., N)는 다수의 CAN 노드들(111, 112, 113, 114)로부터 수신한 다수의 메시지를 전달하며, 동시에 전달되는 수많은 CAN 메시지들이 전송 지연되며 FlexRay 버스로 전달될 수도 있다. 즉, CAN 버스는 다수이므로 동시에 메시지를 송신할 수 있으나 게이트웨이의 기능은 이들을 동시에 처리할 수 없기 때문에 CAN 노드들(111, 112, 113, 114)이 모두 메시지들을 생성하여 송신할 경우, FlexRay 노드들(121, 122, 123, 124)에게 지연되어 전송될 수 있다.
1 is a diagram illustrating a structure of a CAN-FlexRay gateway to which an embodiment of the present specification is applied. The CAN-FlexRay gateway 150 of FIG. 1 is connected to a plurality of CAN buses (1, ..., N) and one or more FlexRay buses. Multiple CAN buses (1, ..., N) carry a number of messages received from multiple CAN nodes (111, 112, 113, 114), and many CAN messages simultaneously delivered are delayed and the FlexRay bus May be delivered. In other words, since there are a large number of CAN buses, messages can be sent at the same time, but the gateway function cannot process them at the same time, so when the CAN nodes 111, 112, 113, and 114 all generate and transmit messages, FlexRay nodes It may be delayed and transmitted to (121, 122, 123, 124).

도 2는 본 명세서에서 언급되는 게이트웨이의 일반적인 구조를 보여주는 도면이다. 2 is a view showing a general structure of a gateway referred to herein.

CAN-FlexRay 게이트웨이(200)는 다수의 CAN 버스(221, 229)와 한 개 이상의 FlexRay 버스(231)가 접속되는 경우가 일반적이다. 이러한 구성 하에서는 다수의 CAN 메시지가 복수의 CAN 버스를 통해 게이트웨이에 전달되는 상황이 발생할 수 있으며, 극단적인 경우에는 거의 동시에 전달된 수많은 CAN 메시지들을 최소한의 전송지연을 부가하여 FlexRay 버스로 전달하는 것이 요구될 수 있다. The CAN-FlexRay gateway 200 is generally connected to a plurality of CAN buses 221 and 229 and one or more FlexRay buses 231. Under this configuration, a situation where a large number of CAN messages may be delivered to a gateway through a plurality of CAN buses, and in extreme cases, it is required to deliver a large number of CAN messages that are delivered almost simultaneously to the FlexRay bus with minimal transmission delay. Can be.

게이트웨이에 접속된 각각의 CAN 버스마다 이를 통해 수신된 CAN 메시지를 임시로 저장할 수 있는 'CAN 메시지 수신 큐 (Queue)' 가 할당되어 있으며 또한, CAN 버스를 통해 전송될 메시지를 임시로 저장할 수 있는 'CAN 메시지 송신 큐'가 할당된다. 두 가지 큐를 'CAN 메시지 큐'로 통칭하기로 한다. FlexRay 메시지 버퍼(235)는 FlexRay 데이터를 송, 수신 할 때 임시로 데이터를 저장하는 데에 사용되며 다수의 메시지 버퍼들은 전송용과 수신용으로 미리 구분되어 사용된다. 도 2에서 CAN 버스 1의 메시지 'c_A'가 CAN 메시지 수신큐에 데이터인 A만 추출되어 수신된다. 이는 FlexRay 버퍼(235)에 A로 저장된 후, FlexRay 버스(231)에 'F_A'로 변환되어 프레임에 포함되어 전송되는 것을 알 수 있다. 이러한 이종의 버스들 간의 메시지 교환은 메인 CPU 코어(210)에서 각각의 CAN 컨트롤러(220)와 FlexRay 컨트롤러(230)를 제어하는 것을 통해 이루어진다. Each CAN bus connected to the gateway is assigned a 'CAN Message Receive Queue' to temporarily store CAN messages received through it. CAN message transmission queue 'is assigned. The two queues will be referred to collectively as the 'CAN message queue'. The FlexRay message buffer 235 is used to temporarily store data when transmitting and receiving FlexRay data, and a plurality of message buffers are used in advance for transmission and reception. In FIG. 2, only message A, which is the data of the message 'c_A' of the CAN bus 1 in the CAN message receiving queue, is received. This is stored in the FlexRay buffer 235 as A, it can be seen that is converted to 'F_A' in the FlexRay bus 231 is included in the frame and transmitted. Message exchange between these heterogeneous buses is achieved by controlling each CAN controller 220 and FlexRay controller 230 in the main CPU core 210.

본 명세서에서 제안한 방법은 다양한 버스 접속 상황에 적용 가능하지만 도 1에서와 같은 일반적인 상황을 상정하여 기술하도록 한다.Although the method proposed in this specification is applicable to various bus connection situations, it will be described assuming a general situation as shown in FIG.

도 3은 본 명세서의 일 실시에에 의한 게이트웨이의 소프트웨어적, 또는 기능적 구조를 보여주는 도면이다. 3 is a diagram illustrating a software or functional structure of a gateway according to one embodiment of the present specification.

CAN 컨트롤러(320)는 CAN 버스(321)를 통해 메시지(A)를 수신하게 되면 인터럽트를 발생시키고 이에 대한 인터럽트 서비스 루틴(Interrupt Service Routine, ISR)을 통해 CAN 메시지에서 데이터(Payload를 지칭)를 추출하여 CAN 메시지 수신 큐(325)에 저장하게 된다. CAN 메시지 수신 큐(325)에 새로운 데이터가 저장되면 인터럽트가 발생되며 이의 인터럽트 서비스 루틴에서 작업스케쥴러(Job Scheduler, 작업 관리자, 350)를 호출하며 제어권을 넘겨주게 된다. 또는 도 2에서 살펴보았던 메인 CPU 코어(210)에 의해 동작하는 주기적 태스크가 CAN 컨트롤러(320)를 통해 CAN 버스(321)를 주기적으로 체크 (Polling)하며 메시지의 수신을 확인 할 수도 있으며 이때에는 수신을 확인한 태스크가 CAN 메시지에서 데이터를 추출하여 CAN 메시지 수신 큐에 저장하게 되며 이후에 작업 스케쥴러(350)를 호출하여 제어권을 넘겨주게 된다. When the CAN controller 320 receives the message A through the CAN bus 321, it generates an interrupt and extracts data (referred to as payload) from the CAN message through an interrupt service routine (ISR). To be stored in the CAN message reception queue 325. When the new data is stored in the CAN message receiving queue 325, an interrupt is generated, and the interrupt service routine calls the job scheduler (Job Scheduler, Job Manager, 350) and hands over control. Alternatively, the periodic task operated by the main CPU core 210 illustrated in FIG. 2 may periodically check the CAN bus 321 through the CAN controller 320 and confirm receipt of a message. The task confirms that the data is extracted from the CAN message and stored in the CAN message receiving queue, and then the job scheduler 350 is called to transfer control.

이와는 반대로, FlexRay 측에서 전달된 데이터가 CAN 메시지 송신 큐(328)에 저장되면 인터럽트가 발생하게 되고 이에 대한 인터럽트 서비스 루틴에서는 CAN 컨트롤러(320)로 하여금 큐(328)에 저장된 메시지를 CAN 버스(321)를 통해 전송하도록 요청하게 된다. 또는 도 2에서 살펴보았던 메인 CPU 코어(210)에 의해 동작하는 주기적 태스크가 CAN 메시지 송신 큐(328)를 주기적으로 체크하며 메시지의 도착을 확인할 수도 있는데, 이 경우, 주기적 태스크가 CAN 컨트롤러(320)에게 큐에 저장된 메시지를 CAN 버스를 통해 전송하도록 요청하게 된다.On the contrary, when data transmitted from the FlexRay side is stored in the CAN message transmission queue 328, an interrupt occurs, and the interrupt service routine causes the CAN controller 320 to transmit a message stored in the queue 328 to the CAN bus 321. Will be sent via). Alternatively, the periodic task operated by the main CPU core 210 illustrated in FIG. 2 may periodically check the CAN message transmission queue 328 and check the arrival of the message. In this case, the periodic task may include the CAN controller 320. You will be asked to send the messages stored in the queue over the CAN bus.

본 명세서의 일 실시예에서 제공하는 게이트웨이의 기능 중에서 이종 버스 간에 메시지 전달을 담당하는 것은 메시지 디스패처(Message Dispatcher)(351, 355)로서 CAN 메시지 큐와 FlexRay 메시지 버퍼 간에 데이터를 전송하는 역할을 담당하는 태스크이다. 메시지 디스패처는 CAN 메시지의 ID, CAN 메시지 큐의 주소, FlexRay 메시지 버퍼의 주소, FlexRay 슬롯의 번호 간의 관계가 정의된 참고 테이블(Look-up Table, LUT)(340)을 참고하여 데이터의 송, 수신 방향과 목적지를 정확하게 파악할 수 있게 된다. 복수의 메시지가 게이트웨이 내에서 다양한 버스 쪽으로 전달되므로 메시지 디스패처(351, 355)는 다수 개가 구동될 수 있다. 이들 태스크들은 작업 스케쥴러(Job Scheduler, 350)에 의해 우선순위를 부여 받고 실행 순서가 결정된다. 작업 스케쥴러(350)는 메시지 디스패처(351, 355) 외에도 인터럽트 서비스 루틴이나 주기적 태스크의 우선순위를 조절할 수 있는 자격을 가지고 있다.Among the functions of the gateway provided by one embodiment of the present specification, the message dispatcher (351, 355) is responsible for transferring data between the CAN message queue and the FlexRay message buffer as a message dispatcher (351, 355). This is a task. The message dispatcher sends and receives data by referring to a look-up table (LUT) 340 in which the relationship between the ID of the CAN message, the address of the CAN message queue, the address of the FlexRay message buffer, and the number of the FlexRay slot is defined. You can pinpoint directions and destinations. Since a plurality of messages are delivered to various buses in the gateway, a plurality of message dispatchers 351 and 355 may be driven. These tasks are prioritized by the job scheduler 350 and the execution order is determined. The job scheduler 350 is entitled to adjust the priority of the interrupt service routine or periodic task in addition to the message dispatchers 351 and 355.

게이트웨이의 메시지 디스패처(351, 355)를 통해 CAN 버스 측의 데이터가 FlexRay 메시지 버퍼(335)에 저장되면 인터럽트가 발생되며, 발생한 인터럽트에 대한 서비스 루틴(ISR)에서는 FlexRay 컨트롤러(330)로 하여금 메시지 버퍼(335)에 저장된 데이터를 FlexRay 버스(331)를 통해 전송하도록 요청하게 된다. 또한 도 2에서 살펴보았던 메인 CPU 코어(210)에 의해 동작하는 주기적 태스크가 FlexRay 컨트롤러(330)를 통해 FlexRay 메시지 버퍼(335)를 주기적으로 체크하며 메시지의 도착을 확인할 수도 있으며 이때에는 도착을 확인한 태스크가 FlexRay 컨트롤러(330)에게 메시지 버퍼에 저장된 메시지를 FlexRay 버스(331)를 통해 전송하도록 요청하게 된다.When the data on the CAN bus side is stored in the FlexRay message buffer 335 through the message dispatchers 351 and 355 of the gateway, an interrupt is generated. In the service routine (ISR) for the interrupt, the FlexRay controller 330 causes the message buffer. The data stored in 335 is requested to be transmitted through the FlexRay bus 331. In addition, the periodic task operated by the main CPU core 210 described in FIG. 2 may periodically check the FlexRay message buffer 335 through the FlexRay controller 330 and check the arrival of the message. Requests the FlexRay controller 330 to send a message stored in the message buffer through the FlexRay bus 331.

역으로, FlexRay 컨트롤러(330)는 FlexRay 버스(331)를 통해 메시지를 수신하게 되면 인터럽트를 발생시키고 발생한 인터럽트를 처리하는 ISR을 통해 FlexRay 프레임(F_C)에서 데이터(C)를 추출하여 FlexRay 메시지 버퍼에 저장하게 된다. 메시지 버퍼에 데이터가 저장되면 인터럽트가 발생하게 되고 이의 인터럽트 서비스 루틴에서는 작업 스케쥴러를 호출하며 제어권을 넘겨주게 된다. 또는 메인 CPU 코어에 의해 동작하는 주기적 태스크가 FlexRay 컨트롤러를 통해 FlexRay 버스를 주기적으로 체크하며 메시지의 수신을 확인 할 수도 있으며 이때에는 수신을 확인한 태스크가 FlexRay 프레임에서 데이터를 추출하여 FlexRay 메시지 버퍼(335)에 저장하게 되며 이후에 작업 스케쥴러(350)를 호출하여 제어권을 넘겨주게 된다.
Conversely, FlexRay controller 330 and when it receives a message via the FlexRay bus 331, extracts data (C) in the FlexRay frame (F_ C) through the ISR to generate an interrupt and processes the interrupt occurred FlexRay message buffers Will be stored in. When data is stored in the message buffer, an interrupt is generated, and its interrupt service routine calls the task scheduler and transfers control. Alternatively, the periodic task operated by the main CPU core periodically checks the FlexRay bus through the FlexRay controller and confirms receipt of the message. In this case, the confirmed task extracts data from the FlexRay frame and extracts data from the FlexRay message buffer 335. It will be stored in the job scheduler 350 will be called later to give control.

도 4는 본 명세서의 일 실시예에 의한 게이트웨이의 구성 및 각각의 구성에서 이루어지는 메시지 전달 과정을 보여주는 도면이다. 4 is a diagram illustrating a configuration of a gateway and a message transfer process performed in each configuration according to an embodiment of the present specification.

전체 구성은 앞서 도 2, 3에서 살펴본 구조에, 작업 스케쥴러(작업 관리자, 450)이 추가되며, 이들 작업 스케쥴러(450)가 메시지 디스패처(451, 452, 453, 454)를 이용하여 CAN 컨트롤러와 FlexRay 컨트롤러 사이에 메시지를 교환하는 작업을 수행한다. 또한 작업 스케쥴러(450)는 메시지가 지연되는 경우, 메시지 디스패처(451, 452, 453, 454)의 태스크 우선 순위를 조절하여 메시지 지연을 보상한다. 보다 상세히 살펴보면 다음과 같다. 설명의 편의를 위하여 메시지 및 작업의 흐름을 (S1, S2, ..., S12)로 표시하며 각각의 단계에 대해 S1, S2와 같이 설명하고자 하며, 이들 흐름 및 순서는 발명을 적용함에 있어 일부 그 우선 순위가 바뀔 수 있으며, 새로운 과정이 추가되거나, 또는 일부 과정이 생략하여 진행될 수도 있다. 작업 스케쥴러는 작업 관리 기능을 포함할 수 있다. The overall configuration is added to the structure shown in Figures 2 and 3, the task scheduler (task manager, 450) is added, these task scheduler 450 using the message dispatcher (451, 452, 453, 454) CAN controller and FlexRay It performs the task of exchanging messages between controllers. In addition, when the message is delayed, the task scheduler 450 adjusts the task priority of the message dispatchers 451, 452, 453, and 454 to compensate for the message delay. Looking in more detail as follows. For the convenience of explanation, the flow of messages and tasks is indicated as (S1, S2, ..., S12), and each step will be described as S1, S2, and these flows and order are partially used in applying the invention. The priority may be changed, a new process may be added, or some processes may be omitted. The task scheduler may include a task management function.

CAN 버스(421)를 통해 수신되는 메시지(c_A)에 대해 CAN 컨트롤러(420)가 인터럽트를 발생시킨다(S1). 또는 인터럽트 기능 대신에 도면에 미도시 되었으나, 특정 태스크 (수신 처리 태스크)에 의한 주기적인 폴링을 수행하여 CAN 메시지가 수신되었는지 확인할 수 있다. 해당 인터럽트 서비스 루틴(429)이나 수신 처리 태스크에서 알리는 CAN 메시지의 도착시간을 별도로 저장한 후에 수신된 메시지에서 데이터(A)를 추출해 CAN 메시지 수신큐(425)에 CAN 노드의 식별자 정보(ID)와 함께 저장한 후 작업 스케쥴러에게 제어권을 넘긴다(S2). 이후, 작업 스케쥴러는 작업 관리 기능을 이용하여 도착시간과 제어권을 넘길 메시지 디스패처를 선택한다(S3). 즉, 작업 스케쥴러(450)는 해당 데이터의 전송을 위해 메시지 디스패처 #1(451)에게 작업을 할당하고 우선 순위를 부여하고, 메시지의 도착시간을 해당 메시지 디스패처 #1(451)에게 전달한다. 이를 수신한 메시지 디스패처 #1(451)는 CAN 메시지 수신큐(425)의 메시지 ID를 추출하여(S4), 추출한 메시지 ID를 참고 테이블(LUT, 440)와 대조한다(S5). 그리고, 대응되는 FlexRay 사이클(Cycle) 내의 슬롯 번호와 이와 연관된 FlexRay 메시지 버퍼(435)의 주소를 찾아내어 데이터와 도착시간을 FlexRay 메시지 버퍼에 써 넣게 된다(S6).The CAN controller 420 generates an interrupt for the message c_A received through the CAN bus 421 (S1). Alternatively, although not shown in the figure instead of the interrupt function, it is possible to check whether a CAN message is received by performing periodic polling by a specific task (receive processing task). After storing the arrival time of the CAN message notified by the corresponding interrupt service routine 429 or the reception processing task, data (A) is extracted from the received message and the identifier information (ID) of the CAN node is stored in the CAN message reception queue 425. After storing it together, it transfers control to the task scheduler (S2). After that, the task scheduler The message dispatcher selects a message dispatcher to transfer the arrival time and the control right using the work management function (S3). That is, the task scheduler 450 allocates and prioritizes a task to the message dispatcher # 1 451 to transmit the corresponding data, and transmits the arrival time of the message to the message dispatcher # 1 451. The message dispatcher # 1 451 receiving the message extracts the message ID of the CAN message receiving queue 425 (S4), and compares the extracted message ID with the reference table (LUT) 440 (S5). The slot number and the address of the FlexRay message buffer 435 associated with the slot number in the corresponding FlexRay cycle are found, and data and arrival time are written in the FlexRay message buffer (S6).

FlexRay 메시지 버퍼에 새로운 데이터가 기록될 때 인터럽트가 발생될 수 있다(S7). 이후, 메시지 도착에 대한 인터럽트의 서비스 루틴 (439)이 발생하여 FlexRay 컨트롤러에 메시지 도착에 대한 작업 처리를 요청할 수 있다. 또한, 앞서 CAN 메시지 수신 과정에서 상펴본 바와 같이, 특정 태스크에 의한 주기적인 폴링에 의해 메시지 버퍼(435)에 데이터의 도착했음을 확인할 수 있다. 즉, 해당 인터럽트 서비스 루틴(439) 또는 특정 태스크에서 메시지 버퍼 내의 데이터를 전송하기 위해 FlexRay 컨트롤러에 전송 요청하게 된다(S8). An interrupt may be generated when new data is written to the FlexRay message buffer (S7). Thereafter, an interrupt service routine 439 may be generated to request the FlexRay controller to process the message arrival. In addition, as described above in the CAN message receiving process, it may be confirmed that data has arrived in the message buffer 435 by periodic polling by a specific task. That is, the transfer request is requested to the FlexRay controller in order to transfer the data in the message buffer in the interrupt service routine 439 or a specific task (S8).

FlexRay 컨트롤러는 메시지 버퍼(435)에 저장된 메시지 내의 데이터(A)와 CAN 버스 측에서 보내온 메시지 도착시간(타임스탬프의 의미를 부여)을 FlexRay 프레임의 형태(F_A)로 가공하여 해당 슬롯에 넣어서 FlexRay 버스(431)를 이용하여 전송을 수행한다(S9).The FlexRay controller processes the data (A) in the message stored in the message buffer 435 and the message arrival time (giving the meaning of the timestamp) sent from the CAN bus side into a FlexRay frame (F_A) and inserts it into the corresponding slot. Transmission is performed by using 431 (S9).

FlexRay 버스(431) 상에 CAN 버스 측에서 보내온 메시지를 수신하는 노드(480)에서 FlexRay 프레임으로부터 데이터와 타임스탬프를 추출하며(S10), 수신 FlexRay 노드(480)에서 FlexRay 프레임 도착시간과 타임스탬프의 차이를 계산하고 만일 시간 차이가 허용 한계치를 넘어선 경우 게이트웨이에 항의 메시지를 전송한다(S11). FlexRay 노드(480)로부터 항의 메시지를 수신한 게이트웨이(400)는 작업 스케쥴러(450)에게 이를 통보하며, 작업 스케쥴러(450)는 항의 메시지를 전달 받은 후에 메시지 지연을 평가하는 작업(메시지 우선순위 상승 인자, Message Priority Raising Factor, MPRF)를 계산하며, MPRF의 계산 결과가 사전에 미리 결정된 허용 한계를 넘어선다고 판단될 경우 작업 스케쥴러(450)는 해당 메시지를 전송한 CAN 버스의 특정 노드가 현 시점 이 후에 보내는 메시지를 처리하게 될 메시지 디스패처에 대해 태스크 우선순위를 한 단계 상향 조정할 것을 지시한다(S12). 이후, 태스크 우선 순위가 상향 조정된 메시지 디스패처(예를 들어 메시지 디스패처 #1, 451)는 작업 스케쥴러(450)가 지시한 사항에 따라, CAN 버스의 특정 노드가 이후 보내는 메시지를 처리함에 있어, 상향 조정된 태스크 우선 순위에 따라 작업을 진행할 수 있다. 그 결과, 작업 스케쥴러(450)는 해당 메시지 디스패처 #1(451)를 우선 처리할 수 있다. The node 480 receiving the message sent from the CAN bus side on the FlexRay bus 431 extracts data and time stamps from the FlexRay frame (S10), and the arrival time and timestamp of the FlexRay frame are received from the receiving FlexRay node 480. The difference is calculated and if the time difference exceeds the allowable threshold, a protest message is transmitted to the gateway (S11). The gateway 400 receiving the protest message from the FlexRay node 480 notifies the task scheduler 450, and the task scheduler 450 evaluates the message delay after receiving the protest message (message priority escalation factor). , The Message Priority Raising Factor (MPRF) It is instructed to raise the task priority by one step to the message dispatcher that will process the outgoing message (S12). Thereafter, the message dispatcher whose task priority is increased is increased (for example, message dispatchers # 1 and 451) in accordance with the instructions of the job scheduler 450, in order to process a message that a specific node of the CAN bus subsequently sends. Work can be done according to the adjusted task priority. As a result, the job scheduler 450 may first process the message dispatcher # 1 451.

한편, 작업 스케쥴러(450)는 앞서 S1~S12의 과정을 반복하며 MPRF를 계산하여 허용 한계치 이하가 되는지 관찰하며 만일 허용 한계치 이하로 내려가면 메시지 디스패처의 태스크 우선순위를 현 상태로 고정하도록 하며 그렇지 않을 경우에는 태스크 우선순위를 단계적으로 상향 조정하며 추이를 관찰할 수 있다. 또한, 본 명세서의 다른 실시예에 의하여, MPRF가 일정 수준보다 낮게 내려갈 경우, 해당 메시지 디스패처의 태스크 우선 순위를 최초의 상태로 낮추도록 할 수도 있다. On the other hand, the job scheduler 450 repeats the process of S1 ~ S12 and observes the MPRF to see if it is below the allowable limit. If it falls below the allowable limit, the task scheduler 450 fixes the task dispatcher's task priority to the current state. In this case, you can increase the task priority step by step and observe the trend. In addition, according to another embodiment of the present disclosure, when the MPRF is lowered below a certain level, the task priority of the corresponding message dispatcher may be lowered to the initial state.

한편, 메시지 디스패처의 우선순위를 최대한 높였음에도 불구하고 해당 메시지의 MPRF가 허용치 아래로 내려가지 않을 경우에는 차량 진단 모듈에 이러한 사실을 통보하여 추후에 게이트웨이 운용 정책을 수정할 수 있는 확인 자료를 저장할 수 있는 기회를 제공한다. On the other hand, if the priority of the message dispatcher is maximized, but the MPRF of the message does not fall below the allowable value, the vehicle diagnostic module can be notified of this fact and can store confirmation data that can be modified later. Provide an opportunity.

도 4에서는 CAN 버스 측에서 FlexRay 버스 측으로의 메시지 전송에 관한 것만을 나타내고 있으나 역방향으로의 메시지 전송에서도 유사한 기능을 하게 된다. 즉, 역방향으로의 메시지 전송에서도 유사한 순서로 동작하게 되는데, 작업 스케쥴러는 메시지 디스패처를 제어함에 있어서, FlexRay 메시지 버퍼(435)에 저장된 메시지를 CAN 메시지 송신 큐(426, 428)에 송신하여 이를 CAN 노드에 전달하는 과정에서 FlexRay 컨트롤러(430)가 기록한 메시지 도착 시간 또는 FlexRay 메시지 버퍼(435)에 메시지가 기록된 도착 시간과 CAN 노드들로부터 발생한 항의 메시지를 이용하여 MPRF를 계산하고, 특정 FlexRay 노드를 통해 송신되는 메시지가 허용 기준 이상 지연되는 경우, 이를 해결하기 위해 메시지 디스패처의 우선 순위를 상향 조정시킬 수 있다.
In FIG. 4, only the message transmission from the CAN bus side to the FlexRay bus side is shown, but a similar function is performed in the message transmission in the reverse direction. In other words, in the reverse direction of message transmission, the task scheduler transmits a message stored in the FlexRay message buffer 435 to the CAN message transmission queues 426 and 428 in controlling the message dispatcher. The MPRF is calculated using the message arrival time recorded by the FlexRay controller 430 or the arrival time when the message is recorded in the FlexRay message buffer 435, and the protest message generated from the CAN nodes. If the transmitted message is delayed beyond the acceptance criteria, the priority of the message dispatcher may be increased to solve this problem.

도 4에서 제시된 구성에 의하여, 게이트웨이 내에서의 전송 지연을 정량적으로 측정할 수 있으며, 전송 지연 시간이 시스템의 허용 한계를 넘어서는 경우에 이를 극복할 수 있다. 도 4에서는 CAN-FlexRay 게이트웨이에서 특히 전송 지연이 문제가 되는 CAN 버스에서 FlexRay 버스로 메시지가 전달될 경우의 구성에 대해 설명하고 있으며, 그 결과, CAN 버스에서 FlexRay 버스로의 메시지 전달 과정에 중점을 두고 있으나, 이는 역방향으로의 메시지 전달과정에도 도 4의 구성을 그대로 활용할 수 있다.By the configuration shown in Figure 4, it is possible to quantitatively measure the transmission delay in the gateway, it can be overcome when the transmission delay time exceeds the allowable limit of the system. Fig. 4 illustrates the configuration of the CAN-FlexRay gateway when a message is transferred from the CAN bus to the FlexRay bus, in which transmission delay is a problem. However, this can also be used as the configuration of Figure 4 in the message forwarding process in the reverse direction.

즉, 도 4의 구성에서 작업 스케쥴러(450) 또는 메시지 디스패처(451, 452, 453, 454) 등은 게이트웨이 내에서 메시지 변환과 전달 과정에 발생하는 전송지연을 정량적으로 측정하기 위해 CAN 메시지가 게이트웨이에 도착할 때의 시간을 파악해 두었다가 FlexRay 프레임을 생성할 때 이를 타임스탬프 (Time Stamp)로 삽입하여 전송하도록 한다. 이러한 프레임을 수신한 FlexRay 노드(480)에서는 타임스탬프 값과 현재의 시간을 비교하여 허용 한계 내에 도착하였는지를 판단하도록 한다. 만일 허용 한계를 넘어설 경우에는 해당 노드(480)에서 게이트웨이에 항의 메시지(Complaint Message)를 전송하도록 한다.That is, in the configuration of FIG. 4, the job scheduler 450 or the message dispatchers 451, 452, 453, and 454 may transmit a CAN message to the gateway to quantitatively measure the transmission delay occurring during the message conversion and delivery process in the gateway. Keep track of when it arrives, and insert it as a time stamp when sending a FlexRay frame to send. The FlexRay node 480 receiving such a frame compares the timestamp value with the current time to determine whether the frame arrives within an allowable limit. If the allowable limit is exceeded, the node 480 transmits a complaint message to the gateway.

항의 메시지를 전달 받은 게이트웨이는 지연되어 전송된 CAN 메시지를 전송하는 CAN 버스의 노드가 전송하는 메시지를 처리할 때에 높은 우선순위를 부여하여 다른 메시지들 보다 우선적으로 처리되도록 한다. 게이트웨이 내에서 특정 메시지를 우선적으로 처리하는 방법은 해당 메시지를 처리하는 특정 태스크와 인터럽트 서비스 루틴 (ISR)에 더 높은 우선순위를 부여하는 것을 통해 구현될 수 있다. 즉, 앞서 살펴본 바와 같이 지연되어 전송된 CAN 메시지를 전송하는 CAN 버스의 노드에서 이후 전송하게 되는 메시지를 처리할 메시지 디스패처의 우선 순위를 높게 하여, 다른 메시지 디스패처 보다 우선적으로 작업을 진행할 수 있도록 할 수 있다. The gateway receiving the protest message gives a higher priority when processing a message transmitted by a node of a CAN bus that transmits a delayed CAN message so that it is processed before other messages. The method of prioritizing a particular message within the gateway can be implemented by giving higher priority to the specific task and interrupt service routine (ISR) that processes the message. That is, as described above, the node of the CAN bus that transmits the delayed CAN message can raise the priority of the message dispatcher to process the message to be transmitted later, so that the operation can be prioritized over other message dispatchers. have.

도 4에 미도시 되었으나, 인터럽트 서비스 루틴에서도 해당 CAN 버스의 노드에서 메시지를 전송할 경우, 인터럽트의 우선순위를 상향 조정하여 보다 빨리 처리되도록 할 수 있다. Although not shown in FIG. 4, in the interrupt service routine, when a message is transmitted from a node of the corresponding CAN bus, the priority of the interrupt may be increased to allow faster processing.

메시지의 전송과 관련하여 메시지 전송이 지연되었는지 확인하는 기준인 허용 한계치에 대해 살펴보면 다음과 같다. Regarding the transmission of the message, the allowable threshold which is a criterion for checking whether the message transmission is delayed is as follows.

게이트웨이의 기본적인 기능에 따라 타임스탬프를 포함하는 FlexRay 프레임이 목적지 노드에 도착하게 되고, 목적지 노드에서는 타임스탬프와 현재 시각을 비교하여 시간차를 계산하게 되며 이를 허용 한계치와 비교하게 된다. 허용 한계치는 시스템 설계 단계에서 미리 결정되어야 하며 수학식 1과 같은 범위를 가진다.
According to the basic function of the gateway, a FlexRay frame containing a timestamp arrives at the destination node, and the destination node compares the timestamp with the current time to calculate the time difference and compares it with the tolerance. The allowable threshold must be determined at the system design stage in advance and has a range as in Equation 1.

[수학식 1][Equation 1]

Figure 112010045280116-pat00001
Figure 112010045280116-pat00001

허용 한계치는 게이트웨이 통과에 의해 발생하는 지연 시간(게이트웨이 Latency)과 FlexRay Cycle의 주기(FlexRay Cycle Time)를 합한 시간 보다 적어야 하며 이를 넘어서게 될 경우 항의 메시지를 게이트웨이 측으로 전송하게 된다.The allowable threshold must be less than the sum of the delay caused by the gateway (gateway latency) and the FlexRay Cycle cycle (FlexRay Cycle Time), and if exceeded, the protest message is sent to the gateway.

항의 메시지를 수신한 게이트웨이는 작업 스케쥴러(450)에게 이를 통보하며 작업 스케쥴러(450)는 자신이 관리하고 있는 메시지 디스패처 태스크(451, 452, 453, 454)들과 인터럽트 서비스 루틴(429)의 실행 우선순위를 조절하기 위해 메시지 우선순위 상승 인자 (Message Priority Raising Factor, MPRF)를 계산하게 된다. The gateway receiving the protest message notifies the task scheduler 450, and the task scheduler 450 executes the execution of the message dispatcher tasks 451, 452, 453, and 454 and the interrupt service routine 429 which it manages. The Message Priority Raising Factor (MPRF) is calculated to adjust the priority.

MPRF는 CAN 메시지의 ID에 의해 결정되는 CAN 메시지 고유의 메시지 우선순위를 포함하고 이를 처리하는 태스크의 우선순위를 의미하며 다음의 수학식 2에 의해 계산된다.
The MPRF includes the message priority of the CAN message, which is determined by the ID of the CAN message, and indicates the priority of a task that processes the message. The MPRF is calculated by Equation 2 below.

[수학식 2][Equation 2]

Figure 112010045280116-pat00002
Figure 112010045280116-pat00002

위의 수식에서 Complaints Counter 는 작업 스케쥴러가 받은 항의 메시지의 수를 의미하며 이것이 하나 이상일 때 CAN 메시지의 우선순위를 더하여 MPRF를 산출하게 된다.In the above formula, Complaints Counter is the number of protest messages received by the task scheduler. When this is more than one, the MPRF is calculated by adding the priority of CAN messages.

CAN 버스에서 보내온 메시지의 우선순위는 자신이 가지고 있는 ID에 따라 결정 되지만, 이들이 게이트웨이의 동작에 의해 지연되어 전달될 경우에 우선순위가 높은 메시지의 지연이 우선순위가 낮은 메시지의 지연보다 시스템에 보다 큰 영향을 끼치게 되므로 이를 반영하기 위해 MPRF의 계산에서 CAN 메시지 본연의 우선순위를 더하게 된다. Priority of messages sent from the CAN bus is determined by their own IDs, but if they are delivered delayed by the operation of the gateway, the delay of higher priority messages is higher than that of lower priority messages. This will have a significant impact, and to reflect this, the priority of the CAN message is added to the calculation of the MPRF.

MPRF의 한계치는 시스템 설계 단계에서 미리 결정되어야 하며 항의 메시지가 없으면 0으로 처리된다. 메시지 디스패처 태스크(451, 452, 453, 454)들과 주기적 태스크, 인터럽트 서비스 루틴(429)의 우선순위가 가변될 수 있는 범위 역시 시스템 설계 단계에서 결정되어야 하며 MPRF에 영향을 받지 않고 최고의 우선순위를 유지해야 하는 ISR과 메시지 디스패처도 미리 결정해야 한다.
The MPRF threshold must be determined at the system design stage and treated as zero if there is no protest message. The range in which the priority of the message dispatcher tasks 451, 452, 453, 454 and the periodic task and interrupt service routines 429 can be varied must also be determined at the system design stage and is the highest priority without being affected by the MPRF. You must also decide in advance which ISRs and message dispatchers you need to maintain.

게이트웨이 내에서는 한 쪽 버스에서 수신된 다수의 메시지들을 상대측 버스에 전달하기 위해 메시지를 변환하는 과정과 이를 메시지 저장소 간에 이동시키는 과정들이 다수의 메시지 디스패처 태스크(451, 452, 453, 454)들과 인터럽트 서비스 루틴(429) 또는 주기적 태스크의 실행에 의해 구현되고 있다. 이들 메시지 디스패처 태스크(451, 452, 453, 454)들과 인터럽트 서비스 루틴(429) 또는 주기적 태스크들은 운영체제와 작업 스케쥴러(450)에서 부여하는 우선순위에 의해 상호간에 순서가 정해져서 실행되며 우선순위가 높은 메시지 디스패처 태스크나 인터럽트 서비스 루틴 또는 주기적 태스크는 다른 메시지 디스패처 태스크나 인터럽트 서비스 루틴 또는 주기적 태스크 보다 먼저 실행됨으로써 이를 통해 전달되는 메시지가 다른 메시지들 보다 빨리 전송되는 효과를 발생시킨다. 작업 스케쥴러의 관점에서 본다면, 작업 스케쥴러는 메인 코어 CPU 상에서 실행되며 CAN 컨트롤러나 FlexRay 컨트롤러가 단독으로 제어하는 기능을 제외한 모든 메시지 디스패처 태스크나 인터럽트 서비스 루틴 또는 주기적 태스크의 우선순위를 변경할 수 있는 자격을 가지고 있으며 이것은 프로세서 내에서 구동되고 있는 운영체제에 우선순위 변경을 요청함으로써 구현된다.Within a gateway, the process of translating messages and moving them between message repositories to deliver multiple messages received on one bus to the other bus is interrupted by multiple message dispatcher tasks 451, 452, 453, and 454. Implemented by the execution of service routines 429 or periodic tasks. These message dispatcher tasks 451, 452, 453, and 454 and the interrupt service routines 429 or periodic tasks are executed in a high order of priority by the priority given by the operating system and the task scheduler 450. Message dispatcher tasks, interrupt service routines, or periodic tasks are executed before other message dispatcher tasks, interrupt service routines, or periodic tasks, resulting in the effect that messages delivered through them are transmitted faster than other messages. From the task scheduler's point of view, the task scheduler runs on the main core CPU and is entitled to change the priority of all message dispatcher tasks, interrupt service routines, or periodic tasks except those controlled solely by the CAN controller or FlexRay controller. This is implemented by requesting a priority change from an operating system running in the processor.

본 명세서의 일 실시예에 의한 작업 스케쥴러(450)는 CAN-FlexRay 간의 메시지 전송에서 지연이 발생할 경우, 메시지를 전송하는 태스크의 우선순위를 변경할 수 있으며, 이 과정에서 CAN 메시지 자체의 우선순위를 바꾸지는 않는다. 또한, 앞서 도 2, 3, 4에서 본 바와 같이 복수개의 CAN 버스가 게이트웨이에 접속되어 있고 각각의 CAN 버스에 수많은 CAN 노드들이 접속된 상황에서는 각 CAN 버스의 우선순위 체계를 따르는 다수의 CAN 메시지들이 동시에 게이트웨이에 입력될 수 있기 때문에 CAN 메시지의 우선순위에 따라 이를 처리하는 태스크의 우선순위를 바꾸는 것은 먼저 도착한 메시지가 먼저 처리되어야 전송 지연이 최소화 된다는 원칙에 위배될 수 있다. The task scheduler 450 according to an embodiment of the present disclosure may change the priority of a task transmitting a message when a delay occurs in message transmission between CAN and FlexRay, and in this process, may not change the priority of the CAN message itself. Does not. In addition, as shown in FIGS. 2, 3, and 4, when a plurality of CAN buses are connected to a gateway and numerous CAN nodes are connected to each CAN bus, a plurality of CAN messages that follow the priority scheme of each CAN bus are generated. Changing the priority of a task that handles it according to the priority of a CAN message can be violated by the principle that the message that arrives first must be processed first, thus minimizing transmission delay.

그러므로 본 명세서의 일 실시예에서는 각각의 메시지들의 도착 순서에 따라 우선적으로 처리해야 한다는 원칙을 따르며 다만, 지나치게 지연되어 도착하는 메시지들에 대해 제한적으로 이를 처리하는 메시지 디스패처 태스크나 인터럽트 서비스 루틴 또는 주기적 태스크의 우선순위를 상향 조정함으로써 시스템의 동작에 최소한의 영향을 끼치면서 메시지 전송 지연을 보상하고자 한다. 즉, 작업 스케쥴러는 기본적으로 CAN 버스를 통해 메시지가 수신되는 순서대로 인터럽트 서비스 루틴이나 주기적 태스크 또는 메시지 디스패처가 실행되도록 내버려 두지만 MPRF가 허용 한계치를 넘어서는 메시지를 보내는 CAN 노드에 대해서는 실행 우선순위를 바꿔주게 된다. FlexRay 버스 측에서 CAN 버스 측으로의 메시지 전달에서도 동일한 동작을 하게 된다.
Therefore, in the exemplary embodiment of the present specification, the message should be processed first according to the order of arrival of each message, except that a message dispatcher task, an interrupt service routine, or a periodic task that handles a limited amount of messages that arrive excessively delayed. By increasing the priority of, we try to compensate for the delay in message transmission with minimal impact on system operation. That is, the task scheduler allows the interrupt service routine, periodic task, or message dispatcher to run in the order in which the messages are received over the CAN bus by default, but changes the execution priority for CAN nodes that send messages beyond the MPRF threshold. Given. The same behavior occurs for message transfer from the FlexRay bus side to the CAN bus side.

작업 스케쥴러는 MPRF가 허용 한계치를 넘어서는 메시지를 보내고 있는 CAN 노드가 현 시점 이후에 보내는 메시지에 대해 이것을 처리할 메시지 디스패처 및 인터럽트 서비스 루틴 또는 주기적 태스크의 실행 우선순위를 다른 태스크나 인터럽트 서비스 루틴보다 한 단계 높여주게 되며 그 결과를 MPRF를 재계산하며 확인하게 된다. The task scheduler sets the priority of the message dispatcher and interrupt service routine or periodic task to process this for messages sent by the CAN node after the MPRF is sending a message that exceeds the acceptable threshold, one step above other tasks or interrupt service routines. The results will be confirmed by recalculating the MPRF.

실행 우선순위를 높여주는 과정은 아래의 a), b)를 반복하여 진행할 수 있다. The process of increasing the execution priority can be repeated by repeating a) and b) below.

a) 태스크의 우선순위를 높이며 MPRF를 계산a) increase the priority of the task and calculate the MPRF;

b) a)에 의해 MPRF의 값이 허용 한계치보다 작아지지 않을 경우 관련된 인터럽트와 이의 인터럽트 서비스 루틴에 대한 우선순위를 높이며 MPRF를 계산
b) If the value of MPRF does not fall below the permissible limit under a), the MPRF is calculated by raising the priority for the associated interrupt and its interrupt service routine.

a), b)의 순서를 지정하는 이유는 인터럽트와 인터럽트 서비스 루틴의 우선순위를 변경하는 것보다 일반 태스크의 우선순위를 변경하는 것이 전체 시스템의 운용에 미치는 영향이 작다는 것에 기인한다.The ordering of a) and b) is due to the fact that changing the priority of general tasks has less impact on the overall system operation than changing the priority of interrupts and interrupt service routines.

만일 태스크와 인터럽트 서비스 루틴의 우선순위를 한 단계 높였을 때 MPRF 허용 한계치 이하로 떨어지면 현 상태에서 우선순위를 고정하게 되지만 그렇지 않을 경우에는 허용 한계치 이하로 떨어질 때까지 우선순위를 반복적으로 높여주게 된다. If the priority of the task and interrupt service routine is lowered below the MPRF tolerance limit, the priority is fixed at the current state. Otherwise, the priority is increased repeatedly until it falls below the tolerance limit.

태스크와 인터럽트 서비스 루틴의 우선순위가 이들이 가질 수 있는 최고 우선순위에 이르도록 MPRF가 개선되지 않으면 메시지의 전달에 있어서 메시지 디스패처를 거치지 않도록 하여 전송 시간을 단축시키도록 한다.If the MPRF is not improved so that the priority of the task and interrupt service routines reaches the highest priority they can have, the delivery of the message is avoided by passing the message dispatcher to shorten the transmission time.

앞서 수차례 CAN 메시지 큐와 FlexRay 메시지 버퍼 간에 데이터 교환이 있었으므로 그 동안에 메시지 디스패처는 인터럽트 서비스 루틴에서 활용할 수 있는 전역 변수나 포인터에 상대 측 메시지 버퍼의 주소를 미리 저장해 둠으로써 메시지 디스패처가 개입하지 않더라도 직접적인 데이터 전송이 가능하도록 한다. 그러나, 인터럽트 서비스 루틴에 의한 데이터의 직접 전송은 이러한 비상 상황에서만 활성화 되도록 하며 일상적인 상황에서는 비활성화 됨으로써 인터럽트 처리가 빠르게 진행되도록 한다. 이를 위해 작업 스케쥴러가 인터럽트 서비스 루틴으로 하여금 비상 상황임을 알아챌 수 있도록 특정 플랙(플래그, Flag)을 설정하도록 하며, 인터럽트 서비스 루틴에서는 해당 플랙이 설정되었음을 확인한 후에 이에 따라 직접 전송 루틴을 실행시키도록 한다. 이상에서 기술한 내용이 실행되는 순서는 다음과 같다.
There have been several data exchanges between CAN message queues and FlexRay message buffers several times in the meantime, so that the message dispatcher can store the address of the other message buffer in advance in a global variable or pointer that can be used by the interrupt service routine, even if the message dispatcher does not intervene. Enable direct data transfer. However, the direct transfer of data by the interrupt service routine is only enabled in these emergency situations and is disabled in everyday situations, allowing for faster interrupt processing. To do this, the task scheduler sets a specific flag (flag, flag) to let the interrupt service routine know that it is an emergency. The interrupt service routine checks that the flag is set and executes the transfer routine accordingly. The order in which the contents described above are executed is as follows.

i) 작업 스케쥴러가 비상 상황임을 알리는 플랙을 설정i) Set a flag to indicate that the task scheduler is in an emergency

ii) CAN 메시지가 수신되면 인터럽트가 발생하고 이의 ISR에서 데이터를 메시지 큐에 저장ii) an interrupt occurs when a CAN message is received and its data is stored in the message queue by its ISR

iii) ii)의 결과로 인터럽트가 발생함. iii) An interrupt occurs as a result of ii).

iv) iii)에서 발생한 인터럽트의 ISR에서 플랙을 확인iv) Check the flag in the ISR of the interrupt that occurred in iii).

v) 만일 플랙이 설정되어 있다면 상대측 메시지 버퍼의 주소가 저장된 전역 변수를 확인한 후에 메시지 큐에 저장된 데이터를 직접적으로 목적지 메시지 버퍼에 전달v) If the flag is set, check the global variable that stores the address of the other side of the message buffer and then transfer the data stored in the message queue directly to the destination message buffer.

vi) v)의 결과로 메시지 버퍼에서 인터럽트가 발생vi) an interrupt occurs in the message buffer as a result of v)

vii) 메시지 버퍼 ISR에서는 FlexRay 컨트롤러로 하여금 즉시 프레임을 전송할 수 있도록 요청
vii) The message buffer ISR requests the FlexRay controller to send a frame immediately.

상기 i)~vii) 과정을 거치는 동안 MPRF 값이 허용 한계치 이하로 내려가지 않으면 진단 모듈에 이러한 상황을 통보하여 추후에 개발자가 이를 개선할 수 있는 여지를 마련해주도록 한다. 반대로, MPRF가 허용 한계치 이하로 내려가면 태스크의 우선순위를 한 단계씩 내리며 MPRF를 측정하고 MPRF가 허용 한계치를 넘지 않는 제일 낮은 우선순위를 태스크에 부여하도록 한다. If the MPRF value does not fall below the acceptable limit during the above steps i) to vii), the diagnosis module is notified of such a situation so that the developer can make room for improvement later. Conversely, if the MPRF falls below the allowable threshold, the task is prioritized by one step, the MPRF is measured, and the task is given the lowest priority that the MPRF does not exceed the allowed threshold.

실행 우선순위를 낮추는 과정은 a-i) 먼저 ISR의 우선순위를 낮추며 MPRF를 계산한 후, a-ii)계산된 MPRF의 값이 허용 한계치보다 작아질 경우 관련된 메시지 디스패처에 대한 우선순위를 낮추며 MPRF를 계산한다. 그리고 이 과정(a-i, a-ii)을 반복하여 진행할 수 있다. 이러한 순서를 지정하는 이유는 인터럽트와 ISR의 우선순위를 변경하는 것이 일반 태스크의 우선순위를 변경하는 것보다 전체 시스템의 운용에 미치는 영향이 크다는 것에 기인한다.
The process of lowering the execution priority ai) first calculates the MPRF by lowering the priority of the ISR, and then a-ii) calculates the MPRF by lowering the priority for the associated message dispatcher when the value of the calculated MPRF becomes less than the allowable limit. do. And this process (ai, a-ii) can be repeated repeatedly. The reason for specifying this order is that changing the priority of interrupts and ISRs has a greater impact on overall system operation than changing the priority of general tasks.

도 5는 본 명세서의 일 실시예에 의한 CAN 메시지가 FlexRay 노드에 전송되는 과정에서 발생하는 메시지 지연을 처리하는 과정을 보여주는 도면이다. 각각의 과정을 살펴보면 먼저, CAN 버스로부터 메시지를 수신하고, CAN 컨트롤러에 의해 인터럽트가 발생된다(S502). 그리고 발생한 인터럽트를 처리하기 위한 인터럽트 서비스 루틴에서 CAN 메시지에서 데이터를 추출한 후, 이를 CAN 메시지 큐에 저장하고, 메시지 도착 시간을 별도로 저장한다(S510). 저장한 후, 인터럽트 서비스 루틴은 작업 스케쥴러를 호출하고 복귀한다(S512). 이후 인터럽트 서비스 루틴은 다른 인터럽트를 처리하기 위해 대기할 수 있다. 그리고 작업 스케쥴러는 수신한 메시지를 전송하기 위해, 특정 메시지 디스패처에 작업을 할당하고, 메시지의 도착 시간(타임 스탬프)를 전달한다(S520). 메시지 디스패처는 LUT를 참고하여 FlexRay 메시지 버퍼의 주소를 확인한다(S522). 확인한 후, 메시지 디스패처가 해당 주소의 FlexRay 메시지 버퍼에 데이터와 도착 시간을 기입한다(S524). 이후, FlexRay 메시지 버퍼에서 인터럽트를 발생시킨다(S530). 그리고 발생한 인터럽트를 처리하기 위한 인터럽트 서비스 루틴에서 FlexRay 컨트롤러에 버퍼 내 데이터 전송을 요청한다(S532). 요청을 수신한 FlexRay 컨트롤러는 데이터와 도착 시간을 프레임으로 가공한 후, 의도된, 즉 해당 메시지를 FlexRay 노드가 수신할 수 있도록, 데이터와 도착 시간을 프레임으로 가공한 후, 의도된 슬롯을 통해 전송한다(S534). 그리고 수신 노드에서 프레임 도착 시간과 타임 스탬프를 비교하고(S540), 그 결과 시간 차이가 허용 한계보다 큰지 혹은 작은지 확인한다(S550). 만약 허용 한계보다 작다면, 메시지가 지연되지 않았으므로 다음 프로세스를 진행하게 된다. FIG. 5 is a diagram illustrating a process of processing a message delay occurring while a CAN message is transmitted to a FlexRay node according to one embodiment of the present specification. Looking at each process, first, a message is received from the CAN bus, the interrupt is generated by the CAN controller (S502). After extracting data from the CAN message in the interrupt service routine for processing the generated interrupt, the data is stored in the CAN message queue and the message arrival time is stored separately (S510). After saving, the interrupt service routine invokes the job scheduler and returns (S512). The interrupt service routine can then wait to process another interrupt. In order to transmit the received message, the job scheduler allocates a job to a specific message dispatcher and transmits the arrival time (time stamp) of the message (S520). The message dispatcher checks the address of the FlexRay message buffer with reference to the LUT (S522). After checking, the message dispatcher writes data and arrival time in the FlexRay message buffer of the corresponding address (S524). Thereafter, an interrupt is generated in the FlexRay message buffer (S530). The interrupt service routine for processing the generated interrupt requests the FlexRay controller to transmit the data in the buffer (S532). After receiving the request, the FlexRay controller processes the data and arrival time into frames, processes the data and arrival times into frames, and sends them through the intended slots so that the FlexRay node can receive the intended message. (S534). The frame arrival time is compared with the time stamp at the receiving node (S540), and as a result, it is checked whether the time difference is larger or smaller than the allowable limit (S550). If it is less than the allowable limit, the message has not been delayed and the next process proceeds.

한편, 시간 차이가 허용 한계보다 큰 경우에는 수신 노드는 게이트웨이에 항의 메시지를 전송한다(S560). 게이트웨이는 작업 스케쥴러에게 항의 메시지를 전달하고 MPRF를 계산한다(S562). 그리고 MPRF가 허용 한계보다 경우(S570) 메시지 디스패처의 우선 순위를 조절하게 되는데, 해당 메시지의 디스패처의 우선순위가 최상인지 확인한다(S580). 그리고 최상이 아니면, 해당 메시지 디스패처의 우선 순위를 높여준다(S582). 이후 해당 메시지 디스패처는 해당 노드를 통해 메시지를 수신할 경우 보다 빨리 처리할 수 있다. 한편, S570에서 MPRF가 허용 한계보다 작은 경우, 메시지가 지연되었으나, 디스패처의 우선 순위를 상승시킬 수준은 아니므로 다음 프로세스를 진행한다. 이후 지연이 누적될 경우, 다시 S570 단계에서 디스패처의 상승 조정 여부를 확인할 수 있다. 한편, S580에서 메시지 디스패처의 순위가 최상인 경우, 더 이상 조절할 수 없기 때문에, 이를 진단 모듈에 통보한다(S590). 이는 차후, 시스템 설계시 혹은 시스템 변경시 적용할 수 있도록 하기 위함이다.
On the other hand, if the time difference is greater than the allowable limit, the receiving node transmits a protest message to the gateway (S560). The gateway delivers a protest message to the task scheduler and calculates an MPRF (S562). If the MPRF is larger than the allowable limit (S570), the priority of the message dispatcher is adjusted, and the priority of the dispatcher of the corresponding message is checked (S580). If not, the priority of the message dispatcher is increased (S582). Thereafter, the message dispatcher can process the message faster when the message is received through the node. On the other hand, if the MPRF is less than the allowable limit in S570, the message is delayed, but it is not the level to increase the priority of the dispatcher to proceed to the next process. After that, if the delay accumulates, it may be checked again whether the dispatcher is adjusted upward in step S570. On the other hand, if the message dispatcher ranks best in S580, since it can no longer be adjusted, it notifies the diagnosis module (S590). This is to be applied later when designing the system or changing the system.

종래에는 단순히 CAN 메시지의 ID와 FlexRay 슬롯 간의 메시지를 교환하는 과정에서 이종의 버스 사이에 위치한 게이트웨이 내의 메시지 전달 과정에 발생하는 전송 지연을 고려하고 있지 않다. 특히, 한쪽 버스의 노드에서 전송한 메시지가 상대 측 버스에 접속된 노드에 도달할 때까지의 시간에 더해진 전송 지연을 정량적으로 측정하는 방법을 고려하고 있지 않으며 더구나 전송 지연이 전체 네트워크 시스템의 허용 한계를 넘어 서는 경우에 대한 대책을 제시하지 않고 있다.Conventionally, in the process of simply exchanging a message between the ID of the CAN message and the FlexRay slot, the transmission delay occurring in the process of delivering a message in a gateway located between heterogeneous buses is not considered. In particular, it does not consider a method of quantitatively measuring the transmission delay added to the time until a message transmitted from a node on one bus reaches a node connected to the other bus. It does not provide countermeasures for cases beyond.

본 명세서의 일 실시예에 의한 이종 프로토콜 통신에서 프로세스의 우선 순위를 조절하여 지연을 보상하는 방법 및 장치에서는 종래의 방법들이 고려하지 않은 게이트웨이 내에서의 전송 지연을 정량적으로 측정하는 방법과 전송 지연 시간이 시스템의 허용 한계를 넘어서는 경우에 이를 극복할 수 있는 방법을 제시한다. 그러므로 제안한 방법이 차량 내 게이트웨이에 적용될 경우 차량 내 네트워크의 신뢰성을 극대화 시킬 수 있게 된다. In the method and apparatus for adjusting the priority of a process in heterogeneous protocol communication according to an embodiment of the present disclosure to compensate for the delay, a method and a transmission delay time for quantitatively measuring a transmission delay in a gateway that conventional methods do not consider In case of exceeding the allowable limit of the system, it is suggested how to overcome it. Therefore, if the proposed method is applied to in-vehicle gateway, the reliability of in-vehicle network can be maximized.

이상의 설명은 본 발명의 기술 사상을 예시적으로 설명한 것에 불과한 것으로서, 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자라면 본 발명의 본질적인 특성에서 벗어나지 않는 범위에서 다양한 수정 및 변형이 가능할 것이다. 따라서, 본 발명에 개시된 실시 예들은 본 발명의 기술 사상을 한정하기 위한 것이 아니라 설명하기 위한 것이고, 이러한 실시 예에 의하여 본 발명의 기술 사상의 범위가 한정되는 것은 아니다. 본 발명의 보호 범위는 아래의 청구범위에 의하여 해석되어야 하며, 그와 동등한 범위 내에 있는 모든 기술 사상은 본 발명의 권리범위에 포함되는 것으로 해석되어야 할 것이다.
The above description is merely illustrative of the technical idea of the present invention, and those skilled in the art to which the present invention pertains may make various modifications and changes without departing from the essential characteristics of the present invention. Therefore, the embodiments disclosed in the present invention are intended to illustrate rather than limit the scope of the present invention, and the scope of the technical idea of the present invention is not limited by these embodiments. The scope of protection of the present invention should be construed according to the following claims, and all technical ideas falling within the scope of the same shall be construed as falling within the scope of the present invention.

300, 400: CAN-FlexRay 게이트웨이 420: CAN 컨트롤러
430: FlexRay 컨트롤러
300, 400: CAN-FlexRay Gateway 420: CAN Controller
430: FlexRay Controller

Claims (12)

이종의 프로토콜을 사용하는 노드들 간에 메시지를 교환함에 있어서,
제 1 프로토콜을 사용하는 제 1 노드로부터 제 1 메시지를 수신하여 상기 메시지 수신 시간을 저장하는 단계;
제 2 프로토콜의 제 2 노드로 메시지 송신을 담당하는 메시지 디스패처에게 상기 제 1 메시지 및 상기 메시지 수신 시간을 제공하는 단계; 및
상기 메시지 디스패처는 우선 순위에 따라 상기 제 1 메시지를 송신하는 단계를 포함하되,
상기 우선 순위는 상기 메시지 디스패처 각각의 실행 순서이며,
상기 제2 노드에서 확인되는 메시지 수신 지연 발생에 따라 산출되는 것을 특징으로 하는, 이종 프로토콜 통신에서 프로세스의 우선 순위를 조절하여 지연을 보상하는 방법.
In exchanging messages between nodes using heterogeneous protocols,
Receiving a first message from a first node using a first protocol and storing the message reception time;
Providing the first message and the message reception time to a message dispatcher responsible for sending a message to a second node of a second protocol; And
The message dispatcher includes transmitting the first message according to priority.
The priority is the execution order of each of the message dispatchers,
And calculating the priority of the process in the heterogeneous protocol communication.
제 1항에 있어서,
상기 제 1 메시지를 송신하는 단계 이후에,
상기 제 2 노드로부터 메시지 전송 지연을 알리는 항의 메시지를 수신하는 단계; 및
상기 수신한 항의 메시지를 이용하여 상기 메시지 디스패처의 우선 순위 조절 여부를 판단하는 단계를 더 포함하는, 이종 프로토콜 통신에서 프로세스의 우선 순위를 조절하여 지연을 보상하는 방법.
The method of claim 1,
After transmitting the first message,
Receiving a protest message informing of a message transmission delay from the second node; And
And determining whether to adjust the priority of the message dispatcher using the received protest message. The method of claim 1, further comprising adjusting a priority of a process in heterogeneous protocol communication.
제 1항에 있어서,
상기 제 1 프로토콜을 사용하는 제 1 노드로부터 제 1 메시지를 수신한 후, 상기 제 1 메시지의 수신을 인터럽트를 통하여 작업 스케쥴러에게 알리는 단계; 및
상기 작업 스케쥴러가 상기 메시지 디스패처에게 상기 제 1 메시지의 송신 작업을 할당하는 단계를 더 포함하는, 이종 프로토콜 통신에서 프로세스의 우선 순위를 조절하여 지연을 보상하는 방법.
The method of claim 1,
After receiving the first message from the first node using the first protocol, notifying the task scheduler of the reception of the first message through an interrupt; And
And assigning, by the task scheduler, the task of sending the first message to the message dispatcher, adjusting the priority of the process in the heterogeneous protocol communication to compensate for the delay.
제 1항에 있어서,
상기 제 1 프로토콜을 사용하는 제 1 노드로부터 제 1 메시지를 수신한 후, 메시지 수신을 정기적으로 모니터링 한 프로세스가 상기 제 1 메시지의 수신을 상기 작업 스케쥴러에게 알리는 단계; 및
상기 작업 스케쥴러가 상기 메시지 디스패처에게 상기 제 1 메시지의 송신 작업을 할당하는 단계를 더 포함하는, 이종 프로토콜 통신에서 프로세스의 우선 순위를 조절하여 지연을 보상하는 방법.
The method of claim 1,
After receiving the first message from the first node using the first protocol, a process that regularly monitors receipt of the message notifies the task scheduler of the receipt of the first message; And
And assigning, by the task scheduler, the task of sending the first message to the message dispatcher, adjusting the priority of the process in the heterogeneous protocol communication to compensate for the delay.
제 1항에 있어서,
상기 제 1 프로토콜과 상기 제 2 프로토콜은 CAN 프로토콜 또는 FlexRay 프로토콜 중 하나인 것을 특징으로 하는, 이종 프로토콜 통신에서 프로세스의 우선 순위를 조절하여 지연을 보상하는 방법.
The method of claim 1,
The first protocol and the second protocol is one of the CAN protocol or FlexRay protocol, the method of compensating delay by adjusting the priority of the process in heterogeneous protocol communication.
제 1항에 있어서,
상기 메시지 디스패처가 우선 순위에 따라 상기 제 1 메시지를 송신하는 단계는
상기 제 1 메시지를 상기 제 2 프로토콜의 제 2 노드가 사용하는 메모리 버퍼에 상기 제 1 메시지를 저장하는 단계; 및
상기 제 1 메시지의 저장을 상기 제 2프로토콜을 제어하는 컨트롤러에게 알리는 단계를 더 포함하는, 이종 프로토콜 통신에서 프로세스의 우선 순위를 조절하여 지연을 보상하는 방법.
The method of claim 1,
The message dispatcher transmitting the first message according to priority;
Storing the first message in a memory buffer used by a second node of the second protocol; And
Informing the controller controlling the second protocol of storing the first message. The method of claim 1, further comprising adjusting a priority of a process in heterogeneous protocol communication.
이종의 프로토콜을 사용하는 노드들 간에 메시지를 교환함에 있어서,
제 1 프로토콜을 사용하는 노드의 메시지 송수신을 제어하는 제 1 컨트롤러;
제 2 프로토콜을 사용하는 노드의 메시지 송수신을 제어하는 제 2 컨트롤러;
상기 제 1 프로토콜을 사용하는 제 1 노드로부터 제 1 메시지를 수신하여 상기 메시지 수신 시간을 저장하며, 메시지 디스패처를 선택하는 작업 스케쥴러; 및
상기 제 1 메시지를 상기 제 2 컨트롤러가 제어하는 메모리 버퍼에 저장하는 메시지 디스패처를 포함하며,
상기 메시지 디스패처는 우선 순위에 따라 상기 제 1 메시지를 송신하되,
상기 우선 순위는 상기 메시지 디스패처 각각의 실행 순서이며, 상기 메시지 디스패처에 의해 상기 제 2 프로토콜을 사용하는 노드에서 상기 제1 메시지를 수신 시 확인된 메시지 수신 지연 발생에 따라 산출되는 것을 특징으로 하는 이종 프로토콜 통신에서 프로세스의 우선 순위를 조절하여 지연을 보상하는 장치.
In exchanging messages between nodes using heterogeneous protocols,
A first controller controlling message transmission and reception of a node using a first protocol;
A second controller controlling message transmission and reception of a node using a second protocol;
A task scheduler that receives a first message from a first node using the first protocol, stores the message reception time, and selects a message dispatcher; And
A message dispatcher for storing the first message in a memory buffer controlled by the second controller,
The message dispatcher transmits the first message according to priority,
The priority is an execution order of each of the message dispatchers, and is calculated according to a message reception delay occurring when the first message is received by a node using the second protocol by the message dispatcher. Device that compensates for delay by adjusting the priority of a process in communication.
제 7항에 있어서,
상기 작업 스케쥴러는 상기 제 2 노드로부터 메시지 전송 지연을 알리는 항의 메시지를 수신한 후, 상기 수신한 항의 메시지를 이용하여 상기 메시지 디스패처의 우선 순위 조절 여부를 판단하는, 이종 프로토콜 통신에서 프로세스의 우선 순위를 조절하여 지연을 보상하는 장치.
8. The method of claim 7,
The task scheduler receives a protest message indicating a message transmission delay from the second node, and then determines whether to adjust the priority of the message dispatcher using the received protest message. Device that compensates for delay by adjusting.
제 7항에 있어서,
상기 제 1 프로토콜을 사용하는 제 1 노드로부터 제 1 메시지를 수신한 후, 상기 제 1 메시지의 수신을 작업 스케쥴러에게 알리는 인터럽트를 처리하는 인터럽트 서비스 루틴을 더 포함하며,
상기 작업 스케쥴러는 상기 인터럽트에 의하여 상기 메시지 디스패처에게 상기 제 1 메시지의 송신 작업을 할당하는, 이종 프로토콜 통신에서 프로세스의 우선 순위를 조절하여 지연을 보상하는 장치.
8. The method of claim 7,
An interrupt service routine for processing an interrupt informing a task scheduler of receipt of the first message after receiving a first message from a first node using the first protocol,
And the task scheduler assigns a task to send the first message to the message dispatcher by the interrupt, thereby adjusting the priority of the process in heterogeneous protocol communication to compensate for the delay.
제 7항에 있어서,
메시지 수신을 정기적으로 모니터링 하는 프로세스를 더 포함하며,
상기 프로세스는 상기 제 1 프로토콜을 사용하는 제 1 노드로부터 상기 제 1 메시지의 수신을 작업 스케쥴러에게 알리며,
상기 작업 스케쥴러는 상기 메시지 디스패처에게 상기 제 1 메시지의 송신 작업을 할당하는, 이종 프로토콜 통신에서 프로세스의 우선 순위를 조절하여 지연을 보상하는 장치.
8. The method of claim 7,
It further includes a process for regularly monitoring the reception of messages,
The process informs a job scheduler of the receipt of the first message from a first node using the first protocol,
And the task scheduler assigns a task to send the first message to the message dispatcher to compensate for delay by adjusting the priority of the process in heterogeneous protocol communication.
제 7항에 있어서,
상기 제 1 프로토콜과 상기 제 2 프로토콜은 CAN 프로토콜 또는 FlexRay 프로토콜 중 하나인 것을 특징으로 하는, 이종 프로토콜 통신에서 프로세스의 우선 순위를 조절하여 지연을 보상하는 장치.
8. The method of claim 7,
And the first protocol and the second protocol are one of a CAN protocol or a FlexRay protocol.
제 7항에 있어서,
상기 메시지 디스패처는 상기 제 1 메시지를 상기 제 2 프로토콜의 제 2 노드가 사용하는 메모리 버퍼에 상기 제 1 메시지를 저장하고, 상기 제 1 메시지의 저장을 상기 제 2프로토콜을 제어하는 컨트롤러에게 알리는, 이종 프로토콜 통신에서 프로세스의 우선 순위를 조절하여 지연을 보상하는 장치.
8. The method of claim 7,
The message dispatcher stores the first message in a memory buffer used by a second node of the second protocol and informs a controller controlling the second protocol of storing the first message. Device that compensates for delays by adjusting the priority of processes in protocol communications.
KR1020100067690A 2010-07-14 2010-07-14 METHOD AND APPARATUS OF COMPENSATING DELAY OF MESSAGE TRANSMISSION USING PROCESS PRIORITY ADJUSTMENT IN heterogeneous COMMUNICATION KR101135117B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020100067690A KR101135117B1 (en) 2010-07-14 2010-07-14 METHOD AND APPARATUS OF COMPENSATING DELAY OF MESSAGE TRANSMISSION USING PROCESS PRIORITY ADJUSTMENT IN heterogeneous COMMUNICATION

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020100067690A KR101135117B1 (en) 2010-07-14 2010-07-14 METHOD AND APPARATUS OF COMPENSATING DELAY OF MESSAGE TRANSMISSION USING PROCESS PRIORITY ADJUSTMENT IN heterogeneous COMMUNICATION

Publications (2)

Publication Number Publication Date
KR20120007118A KR20120007118A (en) 2012-01-20
KR101135117B1 true KR101135117B1 (en) 2012-07-11

Family

ID=45612522

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020100067690A KR101135117B1 (en) 2010-07-14 2010-07-14 METHOD AND APPARATUS OF COMPENSATING DELAY OF MESSAGE TRANSMISSION USING PROCESS PRIORITY ADJUSTMENT IN heterogeneous COMMUNICATION

Country Status (1)

Country Link
KR (1) KR101135117B1 (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101417459B1 (en) * 2012-12-10 2014-07-08 성균관대학교산학협력단 An improved data processing method and system on gateway used in real-time communication within vehicle components
KR101514398B1 (en) * 2014-03-31 2015-04-28 서강대학교산학협력단 Gateway in-vehicle based on virtual bus concepet and message transmission method thereof
KR101505369B1 (en) * 2014-04-15 2015-03-24 부산대학교 산학협력단 Control area network method for sensor measuring
KR102592204B1 (en) * 2016-12-29 2023-10-20 현대자동차주식회사 A vehicle and method for controlling communication thereof
CN109186092A (en) * 2018-08-06 2019-01-11 高秀明 Energy saving and environment friendly condensing gas wall hanging stove
JP7059959B2 (en) * 2019-02-12 2022-04-26 トヨタ自動車株式会社 In-vehicle network system

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070076651A1 (en) 2005-01-28 2007-04-05 Ashvin Chheda Optimized scheduling method for delay-sensitive traffic on high speed shared packet data channels

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070076651A1 (en) 2005-01-28 2007-04-05 Ashvin Chheda Optimized scheduling method for delay-sensitive traffic on high speed shared packet data channels

Also Published As

Publication number Publication date
KR20120007118A (en) 2012-01-20

Similar Documents

Publication Publication Date Title
KR101135117B1 (en) METHOD AND APPARATUS OF COMPENSATING DELAY OF MESSAGE TRANSMISSION USING PROCESS PRIORITY ADJUSTMENT IN heterogeneous COMMUNICATION
JP5843020B2 (en) Communication apparatus and communication method
EP3384638B1 (en) Systems and methods for implementing a time-stamped controller area network (can) bus message
US20060101465A1 (en) Distributed control system
US9197576B2 (en) Method and apparatus for allocating and prioritizing data transmission
US8576850B2 (en) Band control apparatus, band control method, and storage medium
JP2009527168A (en) Gateway for automatic routing of messages between buses
US11467566B2 (en) Communication device, communication terminal, communication device and method for operating a communication system for transmitting time-critical data
US20080069138A1 (en) System and method for managing bandwidth
US20160196073A1 (en) Memory Module Access Method and Apparatus
US8670314B2 (en) Message loss prevention by using sender buffer and traffic shaping in event-triggered distributed embedded real-time systems
US20160164784A1 (en) Data transmission method and apparatus
CN113141321B (en) Data transmission method based on edge calculation and electronic equipment
US20120177059A1 (en) Message Loss Prevention By Using Sender and Receiver Buffers in Event-Triggered Distributed Embedded Real-Time Systems
US11522762B2 (en) Coordination device and method for providing control applications via a communication network for transmitting time-critical data
US11442432B2 (en) Communication device and method for data transmission within an industrial communication network
Ueda et al. Parallel implementation of real-time communication and IP communication by using multiple ring buffers
KR20120041990A (en) Data transmission system and method for transmitting data between different type protocols
KR101076410B1 (en) Method and apparatus of compensating delay of message transmission in in heterogeneous communication
JP2000295281A (en) Flow controller and flow controller method for multicast packet
Xie et al. A High-Flexibility CAN-TSN Gateway with a Low-Congestion TSN-to-CAN Scheduler
Nager et al. Real-time multiplexing of mixed-criticality data streams for automotive multi-core test systems
CN112104591A (en) Communication device of controller and communication method thereof
KR101094812B1 (en) Method and apparatus of processing pararell message in heterogeneous communication
JP2009277052A (en) Distributed device control system

Legal Events

Date Code Title Description
A201 Request for examination
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
FPAY Annual fee payment

Payment date: 20150430

Year of fee payment: 4

FPAY Annual fee payment

Payment date: 20160401

Year of fee payment: 5

FPAY Annual fee payment

Payment date: 20170328

Year of fee payment: 6

FPAY Annual fee payment

Payment date: 20180403

Year of fee payment: 7

FPAY Annual fee payment

Payment date: 20190325

Year of fee payment: 8