KR101907438B1 - Method for transmitting and receiving periodic message of gateway device for vehicle - Google Patents

Method for transmitting and receiving periodic message of gateway device for vehicle Download PDF

Info

Publication number
KR101907438B1
KR101907438B1 KR1020160166795A KR20160166795A KR101907438B1 KR 101907438 B1 KR101907438 B1 KR 101907438B1 KR 1020160166795 A KR1020160166795 A KR 1020160166795A KR 20160166795 A KR20160166795 A KR 20160166795A KR 101907438 B1 KR101907438 B1 KR 101907438B1
Authority
KR
South Korea
Prior art keywords
message
gateway
received
reception
sync
Prior art date
Application number
KR1020160166795A
Other languages
Korean (ko)
Other versions
KR20180066372A (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 KR1020160166795A priority Critical patent/KR101907438B1/en
Publication of KR20180066372A publication Critical patent/KR20180066372A/en
Application granted granted Critical
Publication of KR101907438B1 publication Critical patent/KR101907438B1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L7/00Arrangements for synchronising receiver with transmitter
    • H04L7/04Speed or phase control by synchronisation signals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/66Arrangements for connecting between networks having differing types of switching systems, e.g. gateways
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L7/00Arrangements for synchronising receiver with transmitter
    • H04L7/0091Transmitter details

Abstract

본 발명은 차량용 게이트웨이의 주기 메시지 송수신 방법에 관한 것으로, 차량용 게이트웨이가 메시지 수신 인터럽트가 발생하는지 체크하는 단계; 메시지 수신 인터럽트가 발생할 경우, 게이트웨이가 메시지 수신 카운터 값을 증가시키는 단계; 지정된 목표 수신 메시지 개수만큼 메시지를 수신할 경우, 게이트웨이가 메시지 수신 버퍼를 검색하는 단계; 및 상기 게이트웨이가 상기 메시지 수신 버퍼에 수신된 메시지를 복사하여 상위 어플리케이션에 통지하거나 일반 제어기에 송신하는 단계;를 포함한다.The present invention relates to a method of transmitting and receiving a periodic message of a gateway for a vehicle, the method comprising the steps of: checking whether a gateway for a vehicle generates a message reception interrupt; Increasing a message reception counter value when the message reception interrupt occurs; Receiving, by the gateway, a message reception buffer when receiving a message corresponding to a specified number of target reception messages; And a step in which the gateway copies the received message to the message reception buffer and notifies the upper application or transmits the copied message to the general controller.

Description

차량용 게이트웨이의 주기 메시지 송수신 방법{METHOD FOR TRANSMITTING AND RECEIVING PERIODIC MESSAGE OF GATEWAY DEVICE FOR VEHICLE }BACKGROUND OF THE INVENTION 1. Field of the Invention [0001] The present invention relates to a method and apparatus for periodic message transmission /

본 발명은 차량용 게이트웨이의 주기 메시지 송수신 방법에 관한 것으로, 보다 상세하게는 차량용 게이트웨이를 통한 메시지 전송 시작 시점의 동기화 및 메시지의 송신 순서를 정렬할 수 있도록 하는 차량용 게이트웨이의 주기 메시지 송수신 방법에 관한 것이다.BACKGROUND OF THE INVENTION 1. Field of the Invention [0002] The present invention relates to a method of transmitting and receiving a periodic message of a gateway of a vehicle, and more particularly, to a method of transmitting and receiving periodic messages of a gateway of a vehicle,

일반적으로 차량의 통신 시스템에서는 서로 상이한 통신 네트워크나 제어기(예 : ECU, TCU, CPU 등) 간의 메시지 및 신호 전달을 위해 게이트웨이(또는 통신 게이트웨이 모듈)를 이용하고 있다.Generally, in a communication system of a vehicle, a gateway (or a communication gateway module) is used for transmitting messages and signals between different communication networks or controllers (e.g., ECU, TCU, CPU, etc.).

예컨대 도 1에 도시된 바와 같이, 차량의 엔진이나 변속기 등의 기본 기능을 제어하기 위한 제어기, 및 운전자의 편의성 향상을 위한 기능(예 : ADAS, Advanced Driver Assistance System)을 제어하기 위한 각 장치(또는 시스템)의 제어기(예 : ECU, TCU, CPU 등)(120 ~ 140)가 게이트웨이(110)를 통해서 신호나 메시지를 송수신하고 있다.For example, as shown in Fig. 1, a controller for controlling basic functions such as an engine or a transmission of a vehicle, and each device (or a controller for controlling a function (e.g., ADAS, Advanced Driver Assistance System) (E.g., an ECU, a TCU, a CPU, etc.) 120 to 140 of the system send and receive signals or messages through the gateway 110. [

이하 본 실시예에서는 상기 게이트웨이(110)의 내부 제어기(즉, 게이트웨이 제어기)를 제외한 나머지 차량의 다른 기능을 제어하는 제어기를 편의상 일반 제어기(예 : ECU, TCU, CPU 등)(120 ~ 140)라고 기재한다.Hereinafter, a controller for controlling other functions of the vehicles other than the internal controller (i.e., gateway controller) of the gateway 110 will be referred to as a general controller (e.g., ECU, TCU, CPU) 120 to 140 .

이러한 게이트웨이(110)(즉, 게이트웨이 제어기)는 현재 통신 메시지를 분해 및 재조합해서 전송하는 방식의 시그널 라우팅과, 메시지 전체를 전송하는 메시지 라우팅 방식이 사용되고 있다.The gateway 110 (that is, the gateway controller) uses a message routing method in which a communication message is disassembled and reassembled and transmitted, and a message routing method in which an entire message is transmitted.

그런데 최근 카 내비게이션, 도로에서 제공되는 정보와 제휴한 자율 주행 제어, 및 원격에서의 사고나 고장 시의 긴급지원 서비스나 도난 방지 서비스 등의 텔레매틱스 기능 등 다양한 기능이 추가됨에 따라, 상기 게이트웨이(즉, 게이트웨이 제어기)의 통신량이 증가됨으로써, 상기 게이트웨이의 제어기(즉, CPU) 부하가 증가되고 있다. However, since various functions such as car navigation systems, autonomous travel control in cooperation with information provided on the road, and telematics functions such as remote assistance in case of an accident, emergency support service or theft prevention service are added, Gateway controller), the load of the controller (i.e., CPU) of the gateway is increasing.

이에 따라 상기 게이트웨이(즉, 게이트웨이 제어기)를 통해 전송되는 통신 메시지의 증가로 인하여 메시지의 수신 주기 오차(예 : 지정된 주기 내에 메시지가 전달되지 않는 오차)가 증가될 수 있기 때문에 이에 대한 개선이 필요한 상황이다.Accordingly, since an increase in the number of communication messages transmitted through the gateway (i.e., the gateway controller) can increase the reception cycle error of the message (e.g., an error that a message is not transmitted within a predetermined period) to be.

본 발명의 배경기술은 대한민국 등록특허 10-0923618호(2009.10.19. 등록, 차량 탑재 게이트웨이 장치, 그의 제어 방법, 기록 매체, 접속 장치 및 그의 접속 제어 방법)에 개시되어 있다. BACKGROUND ART [0002] The background art of the present invention is disclosed in Korean Registered Patent No. 10-0923618 (registered on Oct. 19, 2009, a gateway device for vehicles, a control method thereof, a recording medium, a connection device and a connection control method thereof).

본 발명의 일 측면에 따르면, 본 발명은 상기와 같은 문제점을 해결하기 위해 창작된 것으로서, 차량용 게이트웨이를 통한 메시지 전송 시작 시점의 동기화 및 메시지의 송신 순서를 정렬할 수 있도록 하는 차량용 게이트웨이의 주기 메시지 송수신 방법을 제공하는데 그 목적이 있다. According to an aspect of the present invention, there is provided a mobile communication system, which is created to solve the above-described problems, includes: a synchronization unit for synchronizing a start time of a message transmission through a gateway for a car; The purpose of the method is to provide.

본 발명의 일 측면에 따른 차량용 게이트웨이의 주기 메시지 송수신 방법은, 차량용 게이트웨이가 메시지 수신 인터럽트가 발생하는지 체크하는 단계; 상기 메시지 수신 인터럽트가 발생할 경우, 상기 게이트웨이가 메시지 수신 카운터 값을 증가시키는 단계; 지정된 목표 수신 메시지 개수만큼 메시지를 수신할 경우, 상기 게이트웨이가 메시지 수신 버퍼를 검색하는 단계; 및 상기 게이트웨이가 상기 메시지 수신 버퍼에 수신된 메시지를 복사하여 상위 어플리케이션에 통지하거나 일반 제어기에 송신하는 단계;를 포함하는 것을 특징으로 한다.According to an aspect of the present invention, there is provided a method of transmitting / receiving a periodic message of a gateway for a vehicle, the method comprising: checking whether a gateway for a vehicle generates a message reception interrupt; Increasing the message reception counter value when the message reception interrupt occurs; Receiving a message corresponding to a predetermined number of target received messages, the gateway searching for a message receiving buffer; And a step in which the gateway copies the message received in the message reception buffer and notifies the upper application or transmits the copied message to the general controller.

본 발명에 있어서, 상기 메시지 수신 인터럽트가 발생하는지 체크 단계, 및 메시지 수신 카운터 값을 증가시키는 단계는 메시지가 수신될 때마다 반복해서 수행되며, 상기 메시지 수신 카운터 값은 목표 수신 메시지 개수가 미리 지정되는 것을 특징으로 한다.In the present invention, the step of checking whether the message reception interrupt occurs and the step of increasing the message reception counter value are repeatedly performed each time a message is received, and the message reception counter value is set to a number .

본 발명에 있어서, 상기 메시지 수신 버퍼에 수신된 메시지를 복사하여 상위 어플리케이션에 통지하거나 일반 제어기에 송신하는 단계는, 상기 지정된 목표 수신 메시지 개수만큼 반복해서 수행되는 것을 특징으로 한다.In the present invention, the step of copying the received message to the message reception buffer and notifying the upper application or transmitting the message to the general controller is repeatedly performed by the number of the designated target received messages.

본 발명에 있어서, 상기 메시지 수신 인터럽트가 발생할 경우, 상기 게이트웨이가 레디(Ready) 레디 메시지 수신 플래그 값이 1로 설정되었는지 체크하는 단계; 상기 레디 메시지 수신 플래그가 0으로 설정되었으면, 상기 게이트웨이가 메시지 수신 버퍼를 검색하는 단계; 상기 게이트웨이가 데이터베이스 상에 등록된 모든 일반 제어기로부터 레디(Ready) 메시지를 수신했는지 체크하는 단계; 상기 모든 일반 제어기로부터 레디(Ready) 메시지를 수신했으면, 상기 게이트웨이가 레디 메시지 수신 플래그 값을 1로 설정하고, 동기(Sync) 메시지를 상기 모든 일반 제어기에 송신하는 단계; 상기 레디(Ready) 메시지가 수신되었거나, 상기 모든 일반 제어기로부터 레디(Ready) 메시지를 수신하지 않았거나, 동기(Sync) 메시지를 상기 일반 제어기들에 송신하면, 상기 게이트웨이가 동기(Sync) 메시지 송신 플래그 값이 1인지 체크하는 단계: 상기 동기(Sync) 메시지 송신 플래그 값이 1이면, 상기 게이트웨이가 수신 타임 슬롯 인덱스에 맵핑된 목표 수신 메시지 개수가 0 인지 체크하고, 상기 수신 타임 슬롯 인덱스에 맵핑된 목표 수신 메시지 개수가 0이 아니면 메시지 수신 카운트를 1 증가시키는 단계; 상기 게이트웨이가 메시지 수신 카운트가 기 지정된 목표 수신 메시지 개수와 같은지 체크하여, 메시지 수신 카운트가 기 지정된 목표 수신 메시지 개수와 같으면, 메시지 수신 버퍼를 검색하는 단계; 상기 메시지 수신 버퍼를 검색한 후, 상기 게이트웨이가 상기 수신된 메시지가 허용 주기 오차를 벗어났는지 체크하고, 수신된 메시지가 허용 주기 오차를 벗어났을 경우, 동기(Sync) 메시지 송신 요청 플래그를 1로 설정하는 단계; 및 상기 수신된 메시지가 허용 주기 오차를 벗어나지 않았거나, 상기 동기(Sync) 메시지 송신 요청 플래그를 1로 설정하였으면, 상기 게이트웨이가 상기 수신 메시지를 복사하여 상기 모든 일반 제어기에 송신하는 단계;를 더 포함한다.In the present invention, if the message reception interrupt occurs, checking whether a value of a Ready ready message reception flag of the gateway is set to 1; If the ready message reception flag is set to 0, searching the message reception buffer by the gateway; Checking whether the gateway has received a Ready message from all common controllers registered on the database; Receiving a Ready message from all of the general controllers, the gateway sets a Ready message reception flag value to 1, and transmits a Sync message to all the general controllers; If the Ready message is received or a Ready message is not received from all the general controllers or a Sync message is sent to the general controllers, Checking if the number of the target received message mapped to the received time slot index is 0 if the value of the Sync message transmission flag is 1 and checking whether the target Increasing the message reception count by 1 if the number of received messages is not 0; Checking whether the message reception count is equal to a predetermined target number of received messages and searching for a message reception buffer if the message reception count is equal to a predetermined target number of received messages; After searching the message reception buffer, the gateway checks whether the received message is out of the allowable period error. If the received message is out of the allowable period error, the Sync message transmission request flag is set to 1 ; And if the received message does not deviate from the allowable period error or the synchronization message transmission request flag is set to 1, the gateway copies the received message and transmits the copied message to all the general controllers do.

본 발명에 있어서, 상기 수신된 메시지를 일반 제어기에 송신하기 위하여, 상기 게이트웨이는 메시지 송신 인터럽트가 발생할 경우, 동기(Sync) 메시지의 송신이 완료되었는지 체크는 단계; 상기 동기(Sync) 메시지의 송신이 완료되면, 상기 게이트웨이는 동기(Sync) 메시지 송신 플래그를 1로 설정하고, 주기 타이머를 재 시작하는 단계; 상기 주기 타이머 재 시작에 의해 주기 타이머 이벤트가 발생할 경우, 상기 게이트웨이는 동기(Sync) 메시지 요청 플래그 값이 1로 설정되어 있는지 체크하는 단계; 상기 동기(Sync) 메시지 요청 플래그 값이 1로 설정되어 있으면, 상기 게이트웨이가 동기(Sync) 메시지를 상기 일반 제어기에 송신한 후, 동기(Sync) 메시지 송신 요청 플래그를 0으로 설정한 다음 수신 타임 슬롯 인덱스를 1 증가시키는 단계; 및 상기 게이트웨이가 상기 수신 타임 슬롯 인덱스가 기 지정된 최대값에 도달했는지 체크하여, 상기 수신 타임 슬롯 인덱스가 최대값에 도달했으면, 수신 타임 슬롯 인덱스를 초기화하는 단계;를 포함하는 것을 특징으로 한다.In the present invention, in order to transmit the received message to a general controller, the gateway checks whether a transmission of a Sync message is completed when a message transmission interrupt occurs; When the transmission of the Sync message is completed, the gateway sets the Sync message transmission flag to 1 and restarts the periodic timer; If the periodic timer event occurs due to the restart of the periodic timer, the gateway checks whether a Sync message request flag value is set to 1; If the Sync message request flag is set to '1', the gateway transmits a Sync message to the general controller, sets a Sync message transmission request flag to 0, Incrementing the index by 1; And a step of the gateway checking whether the reception time slot index has reached a predetermined maximum value and initializing a reception time slot index if the reception time slot index has reached a maximum value.

본 발명에 있어서, 상기 주기 타이머 이벤트가 발생할 경우, 상기 동기(Sync) 메시지 요청 플래그 값이 1로 설정되어 있지 않으면, 상기 게이트웨이는 메시지 수신 카운트가 기 지정된 목표 수신 메시지 개수와 같은지 체크하는 단계; 상기 메시지 수신 카운트가 기 지정된 목표 수신 메시지 개수와 같으면, 상기 게이트웨이는 곧바로 상기 수신 타임 슬롯 인덱스를 1 증가시키는 단계; 및 상기 메시지 수신 카운트가 기 지정된 목표 수신 메시지 개수와 같지 않으면 동기(Sync) 메시지를 일반 제어기들에 송신한 후, 동기(Sync) 메시지 송신 요청 플래그를 0으로 설정한 다음, 상기 수신 타임 슬롯 인덱스를 1 증가시키는 단계;를 더 포함하는 것을 특징으로 한다.In the present invention, when the periodic timer event occurs, if the Sync message request flag is not set to '1', the gateway checks whether the message reception count is equal to a predetermined target number of received messages. If the message reception count is equal to a predefined number of target received messages, the gateway immediately increments the received time slot index by one; And if the message reception count is not equal to the predetermined target number of received messages, transmits a Sync message to general controllers, sets a Sync message transmission request flag to 0, 1) < / RTI >

본 발명에 있어서, 상기 게이트웨이가 메시지를 일반 제어기에 송신할 경우, 상기 일반 제어기에 메시지 수신 인터럽트가 발생됨에 따라 상기 일반 제어기가 동기(Sync) 메시지를 수신했는지 체크하는 단계; 상기 동기(Sync) 메시지를 수신했으면, 상기 일반 제어기가 상기 동기(Sync) 메시지로부터 상기 게이트웨이의 수신 타임 슬롯 인덱스를 읽어 자신의 송신 타임 슬롯 인덱스를 동일하게 설정하는 단계; 상기 일반 제어기가 주기 타이머가 실행 중인지 체크하는 단계; 및 상기 주기 타이머가 실행 중이면 상기 일반 제어기가 주기 타이머를 종료하였다가 다시 시작하고, 상기 주기 타이머가 실행 중이 아니면 주기 타이머를 시작하는 단계;를 포함하는 것을 특징으로 한다.In the present invention, when the gateway transmits a message to the general controller, checking whether the general controller has received a synchronization message as a message reception interrupt is generated in the general controller; If the Sync message is received, the general controller reads the reception time slot index of the gateway from the Sync message and sets its transmission time slot index to be the same; Checking whether the generic controller is running a periodic timer; And if the periodic timer is being executed, the general controller terminates and restarts the periodic timer, and if the periodic timer is not being executed, starting the periodic timer.

본 발명에 있어서, 상기 주기 타이머의 시작에 따라 주기 타이머 이벤트가 발생할 경우, 상기 일반 제어기가 동기(Sync) 메시지를 수신했는지 체크하는 단계; 상기 동기(Sync) 메시지를 수신했으면, 상기 일반 제어기가 현재 송신 타임 슬롯에 송신할 메시지가 있는지 체크하는 단계; 상기 현재 송신 타임 슬롯에 송신할 메시지가 있으면, 상기 일반 제어기가 메시지를 상기 게이트웨이에 송신하고, 송신 타임 슬롯 인덱스를 1 증가시키는 단계;를 포함하는 것을 특징으로 한다.In the present invention, if a cycle timer event occurs according to the start of the cycle timer, checking whether the general controller has received a sync message; Receiving a Sync message, checking if the general controller has a message to transmit in the current transmission time slot; If the message to be transmitted is present in the current transmission time slot, the general controller transmits a message to the gateway and increases the transmission time slot index by 1.

본 발명의 일 측면에 따르면, 본 발명은 차량용 게이트웨이를 통해 차량 내의 다른 제어기들의 메시지 전송 시작 시점을 동기화하고, 게이트웨이를 통해 라우팅되는 메시지의 송신 순서를 정렬하며, 타임 슬롯을 통한 수신 메시지 관리 및 주기적인 수신 작업을 수행할 수 있도록 함으로써, 게이트웨이의 메시지 수신 부하를 감소시킬 수 있고, 또한 주기 메시지의 주기 오차율을 감소시킬 수 있도록 한다.According to an aspect of the present invention, there is provided a method for controlling a message transmission start time, synchronizing start time of message transmission of other controllers in a vehicle, sorting a transmission order of messages routed through a gateway, It is possible to reduce the message reception load of the gateway and to reduce the period error rate of the periodic message.

도 1은 일반적인 게이트웨이 통신 시스템의 개략적인 구성을 보인 예시도.
도 2는 본 발명의 일 실시예에 따른 차량용 게이트웨이의 주기 메시지 송수신 방법을 설명하기 위한 흐름도.
도 3은 상기 도 2에 있어서, 주기 메시지의 수신을 위한 타임 슬롯 테이블의 구성을 설명하기 위한 예시도.
도 4는 상기 도 2에 있어서, 주기 메시지 송수신 동기화를 위한 동기(Sync) 메시지 송수신 방법을 설명하기 위한 예시도.
도 5 및 도 6은 상기 도 2에 있어서, 게이트웨이의 통신 메시지 수신 인터럽트 발생 시 처리 방법을 설명하기 위한 흐름도.
도 7은 상기 도 2에 있어서, 게이트웨이의 메시지 송신을 위한 인터럽트 처리 동작을 설명하기 위한 흐름도.
도 8은 상기 도 7에 있어서, 게이트웨이의 주기 타이머 처리 방법을 설명하기 위한 흐름도.
도 9는 상기 도 2에 있어서, 일반 제어기의 메시지 수신을 위한 인터럽트 처리 동작을 설명하기 위한 흐름도.
도 10은 상기 도 9에 있어서, 일반 제어기의 주기 타이머 처리 방법을 설명하기 위한 흐름도.
BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is an exemplary diagram showing a schematic configuration of a general gateway communication system; FIG.
BACKGROUND OF THE INVENTION Field of the Invention [0001]
FIG. 3 is an exemplary diagram illustrating a configuration of a time slot table for receiving a periodic message in FIG. 2; FIG.
FIG. 4 illustrates an exemplary method of transmitting and receiving a sync message for synchronizing transmission and reception of a periodic message in FIG. 2; FIG.
FIG. 5 and FIG. 6 are flowcharts for explaining a processing method when a communication message reception interruption of a gateway occurs in FIG. 2; FIG.
FIG. 7 is a flowchart for explaining an interrupt processing operation for message transmission by the gateway in FIG. 2; FIG.
FIG. 8 is a flowchart for explaining a method of processing a periodic timer of the gateway in FIG. 7; FIG.
FIG. 9 is a flowchart for explaining an interrupt processing operation for message reception by the general controller in FIG. 2; FIG.
10 is a flowchart for explaining a cycle timer processing method of the general controller in FIG.

이하, 첨부된 도면을 참조하여 본 발명에 따른 차량용 게이트웨이의 주기 메시지 송수신 방법의 일 실시예를 설명한다. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Hereinafter, an embodiment of a periodic message transmission / reception method of a gateway for a vehicle according to the present invention will be described with reference to the accompanying drawings.

이 과정에서 도면에 도시된 선들의 두께나 구성요소의 크기 등은 설명의 명료성과 편의상 과장되게 도시되어 있을 수 있다. 또한, 후술되는 용어들은 본 발명에서의 기능을 고려하여 정의된 용어들로서 이는 사용자, 운용자의 의도 또는 관례에 따라 달라질 수 있다. 그러므로 이러한 용어들에 대한 정의는 본 명세서 전반에 걸친 내용을 토대로 내려져야 할 것이다.In this process, the thicknesses of the lines and the sizes of the components shown in the drawings may be exaggerated for clarity and convenience of explanation. In addition, the terms described below are defined in consideration of the functions of the present invention, which may vary depending on the intention or custom of the user, the operator. Therefore, definitions of these terms should be made based on the contents throughout this specification.

도 2는 본 발명의 일 실시예에 따른 차량용 게이트웨이의 주기 메시지 송수신 방법을 설명하기 위한 흐름도이다.2 is a flowchart illustrating a method for transmitting and receiving a periodic message of a gateway for a vehicle according to an exemplary embodiment of the present invention.

도 2에 도시된 바와 같이, 본 실시예에 따른 게이트웨이(110)(즉, 게이트웨이 제어기)는, 통신(예 : CAN) 메시지 수신 인터럽트가 발생하는지 체크하여(S101), 통신 메시지 수신 인터럽트가 발생할 경우에 메시지 수신 카운터 값을 증가시킨다(S102).2, the gateway 110 according to the present embodiment (i.e., the gateway controller) checks whether a communication (e.g., CAN) message reception interrupt occurs (S101), and when a communication message reception interrupt occurs The message reception counter value is increased (S102).

상기 통신 메시지의 수신 인터럽트의 발생 체크 단계(S101)와 메시지 수신 카운터 값의 증가 단계(S102)는 메시지가 수신될 때마다 반복해서 수행되며, 상기 메시지 수신 카운터 값은 미리 지정된 목표 수신 메시지 개수(예 : N개)가 될때까지 증가한다.The check step (S101) of generating a reception interrupt of the communication message and the incrementing step (S102) of a message reception counter value are repeatedly performed each time a message is received, and the message reception counter value is a predetermined number : N).

따라서 상기 지정된 목표 수신 메시지 개수(예 : N개) 만큼 통신 메시지를 수신할 경우, 상기 게이트웨이(즉, 게이트웨이 제어기)(110)는 메시지 버퍼(즉, 수신된 메시지가 저장되는 N개의 메시지 수신 버퍼)(미도시)를 검색한다(S103).Accordingly, when receiving a communication message by the number of the designated target reception messages (for example, N), the gateway (i.e., gateway controller) 110 transmits a message buffer (i.e., N message reception buffers in which the received message is stored) (Not shown) (S103).

다음 상기 게이트웨이(즉, 게이트웨이 제어기)(110)는 상기 메시지 버퍼(즉, 수신된 메시지가 저장되는 N개의 메시지 수신 버퍼)(미도시)에 수신된 메시지(또는 데이터)를 복사하여(S104) 상위 어플리케이션(예 : 수신된 메시지를 처리하거나 전달하는 어플리케이션)으로 통지(또는 일반 제어기에 송신)한다(S105).Next, the gateway (i.e., gateway controller) 110 copies the received message (or data) to the message buffer (i.e., N message receiving buffers in which the received message is stored) (Or sends to the general controller) an application (e.g., an application that processes or delivers a received message) (S105).

이때 상기 수신된 메시지의 복사 단계(S104) 및 상기 복사한 메시지를 통지하는 단계(S105)는 상기 지정된 목표 수신 메시지 개수(예 : N개) 만큼 반복해서 수행된다.At this time, the step of copying the received message (S104) and the step of notifying the copied message (S105) are repeatedly performed by the number of the designated target received messages (for example, N).

도 3은 상기 도 2에 있어서, 주기 메시지의 수신을 위한 타임 슬롯 테이블의 구성을 설명하기 위한 예시도이다.3 is an exemplary diagram illustrating a configuration of a time slot table for receiving a periodic message in FIG.

도 3에 도시된 바와 같이, 상기 게이트웨이(110)(즉, 게이트웨이 제어기)는 특정 통신 데이터베이스(예 : CAN 데이터베이스)를 기반으로 수신할 주기 메시지를 확인하여 수신 타임 슬롯 인덱스 별로 수신해야 하는 메시지의 개수를 설정할 수 있다.As shown in FIG. 3, the gateway 110 (i.e., the gateway controller) checks a periodical message to be received based on a specific communication database (e.g., a CAN database) Can be set.

예컨대 메시지 수신 주기가 5ms 이고 수신할 메시지가 각각 20ms, 40ms의 주기를 가졌다고 가정하면, 수신 타임 슬롯 인덱스 별 목표 수신 메시지 개수는 아래와 같다. 즉, 수신 타임 슬롯 인덱스는 수신 주기(예 : 5ms) 마다 1씩 증가되며 K 값(여기서 수신할 메시지 주기들 중 최대값이 M 이라면, K = (M / 수신주기) - 1 이다)까지 증가하고 다시 초기화된다. For example, assuming that the message reception period is 5 ms and the message to be received has a period of 20 ms and 40 ms, respectively, the number of target reception messages per received time slot index is as follows. That is, the reception time slot index is incremented by 1 every reception period (e.g., 5 ms) and increases to K value (where K = (M / reception period) - 1 if the maximum value of the message periods to be received is M) And is reinitialized.

다시 말해 상기 예에서는 메시지의 주기 최대값이 40ms 이므로, 총 수신 타임 슬롯 개수는 8개이고 인덱스는 7까지 증가하고 다시 0으로 초기화된다. In other words, since the maximum value of the period of the message is 40 ms in the above example, the total number of reception time slots is 8, the index is increased to 7, and is initialized to 0 again.

따라서 상기 게이트웨이(즉, 게이트웨이 제어기)(110)는 주기 메시지 송신을 위한 송신 타임 슬롯 테이블을 상기 수신 타임 슬롯 테이블과 같은 방식으로 구성하여 타임 슬롯 인덱스 별로 할당된 메시지를 송신한다.Accordingly, the gateway (i.e., gateway controller) 110 constructs a transmission time slot table for periodic message transmission in the same manner as the reception time slot table, and transmits a message allocated for each time slot index.

도 4는 상기 도 2에 있어서, 주기 메시지 송수신 동기화를 위한 동기(Sync) 메시지 송수신 방법을 설명하기 위한 예시도이다.FIG. 4 is a diagram illustrating an exemplary method of transmitting and receiving a sync message for synchronizing transmission and reception of a periodic message in FIG.

본 실시예에서 일반 제어기(120 ~ 140)들은 시스템(예 : 차량의 통신 시스템) 시작 후 레디(Ready) 메시지를 상기 게이트웨이(즉, 게이트웨이 제어기)(110)에 송신한다. 참고로 메시지 ID는 제어기 간 동일하며 각각 자신의 네트워크 주소를 전달한다.In this embodiment, the generic controllers 120-140 send Ready messages to the gateway (i.e., gateway controller) 110 after starting the system (e.g., the vehicle's communication system). For reference, message IDs are the same between controllers and each carries its own network address.

상기 일반 제어기(120 ~ 140)들은 상기 게이트웨이(즉, 게이트웨이 제어기)(110)로부터 주기 동기(Sync) 메시지를 수신한 시점 기준으로 주기 타이머를 시작하고, 상기 주기 타이머에 의한 이벤트 발생 시마다 송신 타임 슬롯 인덱스를 증가시키고, 상기 증가된 현재의 인덱스에 할당된 메시지를 상기 게이트웨이(즉, 게이트웨이 제어기)(110)에 송신한다. The general controllers 120 to 140 start a periodic timer on the basis of a periodic synchronization message received from the gateway (i.e., gateway controller) 110, Increases the index, and sends the message assigned to the increased current index to the gateway (i.e., gateway controller) 110.

상기 게이트웨이(즉, 게이트웨이 제어기)(110)는 데이터베이스(미도시) 상에 등록된 모든 일반 제어기(120 ~ 140)들로부터 레디(Ready) 메시지를 수신한 후 동기(Sync) 메시지를 상기 일반 제어기(120 ~ 140)들에 송신한다. The gateway (i.e., gateway controller) 110 receives a Ready message from all the general controllers 120 to 140 registered on a database (not shown) and sends a Sync message to the general controller 120 to 140).

상기 게이트웨이(즉, 게이트웨이 제어기)(110)는 동기(Sync) 메시지를 송신하고 송신 완료 시점을 기준으로 주기 타이머를 시작한다.The gateway (i.e., gateway controller) 110 transmits a Sync message and starts a cycle timer based on the transmission completion time.

상기 게이트웨이(즉, 게이트웨이 제어기)(110)는 동기(Sync) 메시지에 현재의 수신 타임 슬롯 인덱스 값을 넣어서 송신한다. The gateway (i.e., gateway controller) 110 inserts a current reception time slot index value into a synchronization message and transmits the same.

상기 게이트웨이(즉, 게이트웨이 제어기)(110)는 동기(Sync) 메시지를 송신한 후 타이머 이벤트가 발생할 때마다(예 : 수신 주기 5ms 마다) 수신 타임 슬롯 인덱스를 증가시킨다.The gateway (i.e., gateway controller) 110 increases the reception time slot index every time a timer event occurs (e.g., every 5 ms reception period) after transmitting a Sync message.

상기 게이트웨이(즉, 게이트웨이 제어기)(110)는 수신한 주기 메시지의 오차(예 : 지정된 주기 내에 메시지가 전달되지 않는 오차)를 계산하여 기지정된 허용치보다 큰 경우 다음 타이머 이벤트 발생 시 동기(Sync) 메시지를 상기 일반 제어기(120 ~ 140)들에 송신한다.The gateway (i.e., the gateway controller) 110 calculates an error of the received periodic message (e.g., an error in which a message is not transmitted within a specified period), and outputs a Sync message To the general controllers (120-140).

상기 게이트웨이(즉, 게이트웨이 제어기)(110)는 현재 수신된 메시지 개수가 수신 타임 슬롯 인덱스 상의 목표 수신 메시지 개수와 같으면 수신한 모든 메시지를 타 채널(예 : 송신채널, 채널 2)로 송신한다.If the number of currently received messages is equal to the number of target received messages on the received time slot index, the gateway (i.e., gateway controller) 110 transmits all received messages on another channel (e.g., a transmission channel, channel 2).

상기 게이트웨이(즉, 게이트웨이 제어기)(110)는 상기 수신된 메시지를 타 채널(예 : 송신채널, 채널 2)로 송신 시, 메시지 ID 오름차순의 순서대로 목적지 채널로 전송한다. 이때 목적지(예 : 일반 제어기)에서 메시지 수신 시 순서가 변경되어 주기 오차가 생길 수도 있으나, 송신 시 ID로 정렬되어 송신되므로 주기 오차를 제거할 수 있다. 예컨대 시스템(예 : 차량의 통신 시스템) 초기화 시 수신할 메시지 ID를 메시지 수신 버퍼에 할당하는데, 메시지 수신 버퍼의 인덱스와 메시지의 ID를 오름차순으로 정렬하여 할당하면, 이후 수신된 메시지를 타 채널(예 : 송신채널, 채널 2)로 송신하는 경우 별도의 ID 순 정렬작업 없이 메시지 수신 버퍼의 인덱스 순으로 송신할 수 있다.The gateway (i.e., the gateway controller) 110 transmits the received message to the destination channel in ascending order of message ID when transmitting the message on another channel (e.g., transmission channel, channel 2). In this case, the order is changed when a message is received at a destination (for example, a general controller), so that a periodic error may occur. For example, when a system (for example, a communication system of a vehicle) is initialized, a message ID to be received is allocated to a message reception buffer. When an index of a message reception buffer and an ID of a message are sorted in ascending order, : Transmission channel, channel 2), it can be transmitted in the order of the indexes of the message reception buffers without performing a separate ID sort operation.

도 5 및 도 6은 상기 도 2에 있어서, 게이트웨이의 통신 메시지 수신 인터럽트 발생 시 처리 방법을 설명하기 위한 흐름도이다.FIG. 5 and FIG. 6 are flowcharts for explaining a processing method when a communication message reception interruption of a gateway occurs in FIG.

도 5에 도시된 바와 같이, 통신 메시지 수신 인터럽트가 발생할 경우(S201), 상기 게이트웨이(즉, 게이트웨이 제어기)(110)는 레디(Ready) 메시지가 수신되었는지(즉, 레디 메시지 수신 플래그 값이 1로 설정되었는지) 체크한다(S202).5, when a communication message reception interrupt occurs (S201), the gateway (i.e., gateway controller) 110 determines whether a Ready message has been received (S202).

즉, 상기 게이트웨이(즉, 게이트웨이 제어기)(110)는 레디 메시지 수신 플래그(예 : 레디 메시지 수신 시 1로 설정되는 플래그) 값이 "1"인지 체크한다.That is, the gateway (i.e., gateway controller) 110 checks whether a value of a ready message reception flag (e.g., flag set to 1 when receiving a ready message) is "1 ".

상기 체크(S202) 결과, 레디(Ready) 메시지가 수신되지 않았으면(S202의 아니오)(즉, 레디 메시지 수신 플래그가 0이면), 상기 게이트웨이(즉, 게이트웨이 제어기)(110)는 메시지 수신 버퍼(미도시)를 검색한다(S203).If the Ready message is not received (NO in S202) (i.e., the ready message reception flag is 0) as a result of the check (S202), the gateway (i.e., gateway controller) (S203).

다음 상기 게이트웨이(즉, 게이트웨이 제어기)(110)는 데이터베이스(미도시) 상에 등록된 모든 일반 제어기(120 ~ 140)들로부터 레디(Ready) 메시지를 수신했는지 체크한다(S204).Next, the gateway (i.e., the gateway controller) 110 checks whether a Ready message has been received from all the general controllers 120 to 140 registered on the database (S204).

상기 체크(S204) 결과, 모든 일반 제어기(120 ~ 140)들로부터 레디(Ready) 메시지를 수신했으면(S204의 예), 상기 게이트웨이(즉, 게이트웨이 제어기)(110)는 레디 메시지 수신 플래그 값을 1로 설정하고(S205), 동기(Sync) 메시지를 상기 일반 제어기(120 ~ 140)들에 송신한다(S206).If the Ready message is received from all the general controllers 120 to 140 as a result of the check (S204) (Yes in S204), the gateway (i.e., gateway controller) 110 sets the Ready message reception flag value to 1 (S205), and transmits a sync message to the general controllers 120-140 (S206).

한편 상기 레디 메시지 수신 플래그 값이 1로 설정되었는지 체크(S202)한 결과, 레디(Ready) 메시지가 수신되었거나(S202의 예), 상기 모든 일반 제어기(120 ~ 140)들로부터 레디(Ready) 메시지를 수신하지 않았거나(S204의 아니오), 동기(Sync) 메시지를 상기 일반 제어기(120 ~ 140)들에 송신(S206)한 후, 상기 게이트웨이(즉, 게이트웨이 제어기)(110)는 동기(Sync) 메시지 송신 플래그 값이 1인지 체크한다(S207)(도 6 참조).If it is determined in step S202 that the Ready message reception flag is set to '1', a READY message is received (YES in step S202) or a Ready message is received from all the general controllers 120-140 The gateway (i.e., the gateway controller) 110 transmits a Sync message to the general controllers 120 to 140 (S206) after not receiving the synchronization message (No in S204) It is checked whether the transmission flag value is 1 (S207) (see Fig. 6).

상기 체크(S207) 결과, 동기(Sync) 메시지 송신 플래그 값이 1이면(S207의 예), 상기 게이트웨이(즉, 게이트웨이 제어기)(110)는 수신 타임 슬롯 인덱스에 맵핑된 목표 수신 메시지 개수가 0인지 체크한다(S208).As a result of the check (S207), if the Sync message transmission flag value is 1 (YES in S207), the gateway (i.e., the gateway controller) 110 determines whether the number of target reception messages mapped to the reception time slot index is 0 (S208).

상기 체크(S208) 결과, 수신 타임 슬롯 인덱스에 맵핑된 목표 수신 메시지 개수가 0이 아니면(S208의 아니오)(즉, 수신 타임 슬롯 인덱스에 1 이상의 목표 수신 메시지 개수가 맵핑되어 있으면), 상기 게이트웨이(즉, 게이트웨이 제어기)(110)는 메시지 수신 카운트를 1 증가시킨다(S209).As a result of the check (S208), if the number of target reception messages mapped to the reception time slot index is not 0 (NO in S208) (that is, if at least one target reception message number is mapped in the reception time slot index) That is, the gateway controller 110 increments the message reception count by 1 (S209).

다음 상기 게이트웨이(즉, 게이트웨이 제어기)(110)는 메시지 수신 카운트가 기 지정된 목표 수신 메시지 개수와 같은지 체크한다(S210).Next, the gateway (i.e., the gateway controller) 110 checks whether the message reception count is equal to the designated target received message number (S210).

상기 체크(S210) 결과, 메시지 수신 카운트가 기 지정된 목표 수신 메시지 개수와 같으면(S210의 예), 상기 게이트웨이(즉, 게이트웨이 제어기)(110)는 메시지 수신 버퍼(미도시)를 검색한다(S211)(즉, 수신 메시지가 있는지 확인한다).If it is determined in step S210 that the message reception count is equal to the predetermined target number of received messages (YES in step S210), the gateway (i.e., the gateway controller) 110 searches for a message reception buffer (not shown) (I.e., confirms whether there is an incoming message).

상기 메시지 수신 버퍼(미도시)를 검색한 후, 상기 게이트웨이(즉, 게이트웨이 제어기)(110)는 수신된 메시지가 허용 주기 오차를 벗어났는지 체크한다(S212).After retrieving the message reception buffer (not shown), the gateway (i.e., gateway controller) 110 checks whether the received message is out of tolerance error (S212).

상기 체크(S212) 결과, 수신된 메시지가 허용 주기 오차를 벗어났을 경우(S212의 예), 상기 게이트웨이(즉, 게이트웨이 제어기)(110)는 동기(Sync) 메시지 송신 요청 플래그를 1로 설정한다(S213).If the received message is out of the allowable period error (S212) as a result of the check (S212), the gateway (i.e., the gateway controller) 110 sets the synchronization message transmission request flag to 1 S213).

한편 상기 수신된 메시지가 허용 주기 오차를 벗어나지 않았거나(S212의 아니오), 상기 동기(Sync) 메시지 송신 요청 플래그를 1로 설정한 후, 상기 게이트웨이(즉, 게이트웨이 제어기)(110)는 상기 수신 메시지를 복사하여(S214), 상기 일반 제어기(120 ~ 140)들에 송신한다(S215).If the received message does not deviate from the allowable period error (NO in S212), the gateway (i.e., gateway controller) 110 sets the Sync message transmission request flag to 1, (S214), and transmits it to the general controllers 120 to 140 (S215).

도 7은 상기 도 2에 있어서, 게이트웨이의 메시지 송신을 위한 인터럽트 처리 동작을 설명하기 위한 흐름도이다.7 is a flowchart for explaining an interrupt processing operation for message transmission by the gateway in FIG.

도 7에 도시된 바와 같이, 상기 게이트웨이(즉, 게이트웨이 제어기)(110)는 메시지 송신 인터럽트가 발생하면(S301), 동기(Sync) 메시지의 송신이 완료되었는지 체크한다(S302).As shown in FIG. 7, the gateway (i.e., gateway controller) 110 checks if transmission of a sync message is completed (S302) when a message transmission interrupt occurs (S301).

상기 체크(S302) 결과, 동기(Sync) 메시지의 송신이 완료되면(S302의 예), 상기 게이트웨이(즉, 게이트웨이 제어기)(110)는 동기(Sync) 메시지 송신 플래그를 1로 설정하고(S303), 주기 타이머를 재 시작한다(S304).As a result of the check (S302), when the transmission of the sync message is completed (YES in S302), the gateway (i.e., the gateway controller) 110 sets the sync message transmission flag to 1 (S303) , The cycle timer is restarted (S304).

도 8은 상기 도 7에 있어서, 게이트웨이의 주기 타이머 처리 방법을 설명하기 위한 흐름도이다.FIG. 8 is a flowchart for explaining a method of processing the periodic timer of the gateway in FIG. 7; FIG.

도 8에 도시된 바와 같이, 주기 타이머 이벤트가 발생할 경우(S401), 상기 게이트웨이(즉, 게이트웨이 제어기)(110)는, 동기(Sync) 메시지 요청 플래그 값이 1로 설정되어 있는지 체크한다(S402).8, when a periodic timer event occurs (S401), the gateway (i.e., the gateway controller) 110 checks whether a Sync message request flag value is set to 1 (S402) .

상기 체크(S402) 결과, 동기(Sync) 메시지 요청 플래그 값이 1로 설정되어 있으면(S402의 예), 상기 게이트웨이(즉, 게이트웨이 제어기)(110)는 동기(Sync) 메시지를 상기 일반 제어기(120 ~ 140)들에 송신한 후(S403), 동기(Sync) 메시지 송신 요청 플래그를 0으로 설정(S404)한 다음, 수신 타임 슬롯 인덱스를 1 증가시킨다(S405).As a result of the check (S402), if the Sync message request flag is set to 1 (YES in S402), the gateway (i.e., gateway controller) 110 transmits a Sync message to the general controller 120 (S403), sets a synchronization message transmission request flag to 0 (S404), and increments the reception time slot index by 1 (S405).

한편 상기 주기 타이머 이벤트가 발생한 후(S401), 상기 동기(Sync) 메시지 요청 플래그 값이 1로 설정되어 있지 않으면(S402의 아니오), 상기 게이트웨이(즉, 게이트웨이 제어기)(110)는 메시지 수신 카운트가 기 지정된 목표 수신 메시지 개수와 같은지 체크한다(S408).If the Sync message request flag is not set to '1' after the periodic timer event occurs (S401) (NO in S402), the gateway (ie, gateway controller) It is checked whether the number is equal to the number of designated target received messages (S408).

상기 체크(S408) 결과, 메시지 수신 카운트가 기 지정된 목표 수신 메시지 개수와 같으면(S408의 예), 상기 게이트웨이(즉, 게이트웨이 제어기)(110)는 곧바로 상기 수신 타임 슬롯 인덱스를 1 증가시킨다(S405). 그러나 메시지 수신 카운트가 기 지정된 목표 수신 메시지 개수와 같지 않으면(S408의 아니오), 상기 게이트웨이(즉, 게이트웨이 제어기)(110)는 동기(Sync) 메시지를 상기 일반 제어기(120 ~ 140)들에 송신한 후(S403), 동기(Sync) 메시지 송신 요청 플래그를 0으로 설정(S404)한 다음, 수신 타임 슬롯 인덱스를 1 증가시킨다(S405).As a result of the check (S408), if the message reception count is equal to the designated target reception message count (YES in S408), the gateway (i.e., gateway controller) 110 immediately increases the reception time slot index by 1 (S405) . However, if the message reception count is not equal to the pre-designated target number of received messages (NO in S408), the gateway (i.e., gateway controller) 110 transmits a Sync message to the general controllers 120-140 (S403), the sync message transmission request flag is set to 0 (S404), and the received time slot index is incremented by one (S405).

다음 상기 수신 타임 슬롯 인덱스가 최대값에 도달했는지 체크한다(S406).Next, it is checked whether the reception time slot index has reached a maximum value (S406).

상기 체크(S406) 결과, 수신 타임 슬롯 인덱스가 최대값에 도달했으면(S406의 예), 상기 게이트웨이(즉, 게이트웨이 제어기)(110)는 수신 타임 슬롯 인덱스를 초기화한다(S407).If it is determined in step S406 that the received time slot index has reached the maximum value (YES in step S406), the gateway (i.e., the gateway controller) 110 initializes the received time slot index in step S407.

도 9는 상기 도 2에 있어서, 일반 제어기의 메시지 수신을 위한 인터럽트 처리 동작을 설명하기 위한 흐름도이다.FIG. 9 is a flowchart illustrating an interrupt processing operation for receiving a message of the general controller in FIG.

도 9에 도시된 바와 같이, 상기 일반 제어기(120 ~ 140)들은 메시지 수신 인터럽트가 발생하면(S501), 동기(Sync) 메시지를 수신했는지 체크한다(S502).As shown in FIG. 9, the general controllers 120 to 140 check if a message reception interrupt occurs (S501) and whether a sync message has been received (S502).

상기 체크(S502) 결과, 동기(Sync) 메시지를 수신했으면(S502의 예), 상기 일반 제어기(120 ~ 140)들은 동기(Sync) 메시지로부터 상기 게이트웨이(즉, 게이트웨이 제어기)(110)의 수신 타임 슬롯 인덱스를 읽어 자신의 송신 타임 슬롯 인덱스를 동일하게 설정한다(S503).As a result of the check (S502), if the Sync message has been received (YES in S502), the general controllers 120 to 140 receive Sync messages from the gateway (i.e., gateway controller) The slot index is read and its own transmission time slot index is set to be the same (S503).

다음 상기 일반 제어기(120 ~ 140)들은 주기 타이머가 실행 중인지 체크한다(S504).Next, the general controllers 120 to 140 check whether the cycle timer is being executed (S504).

상기 체크(S504) 결과, 주기 타이머가 실행 중이면(S504의 예) 상기 일반 제어기(120 ~ 140)들은 주기 타이머를 종료(S505)하였다가 주기 타이머를 시작(S506)(즉, 재시작)하고, 만약 주기 타이머가 실행 중이 아니면(S504의 아니오) 주기 타이머를 시작(S506)한다.If it is determined in step S504 that the cycle timer is being executed (YES in step S504), the general controllers 120 to 140 terminate the cycle timer in step S505 and start the cycle timer in step S506 (i.e., restart) If the cycle timer is not being executed (NO in S504), the cycle timer is started (S506).

도 10은 상기 도 9에 있어서, 일반 제어기의 주기 타이머 처리 방법을 설명하기 위한 흐름도이다.10 is a flowchart for explaining a cycle timer processing method of the general controller in FIG.

도 10에 도시된 바와 같이, 주기 타이머 이벤트가 발생할 경우(S601), 상기 일반 제어기(120 ~ 140)들은 동기(Sync) 메시지를 수신했는지 체크한다(S602).As shown in FIG. 10, when a periodic timer event occurs (S601), the general controllers 120 to 140 check whether a sync message has been received (S602).

상기 체크(S602) 결과, 동기(Sync) 메시지를 수신했으면(S602의 예), 상기 일반 제어기(120 ~ 140)들은 현재 송신 타임 슬롯에 송신할 메시지가 있는지 체크한다(S603).As a result of the check (S602), if the synchronization message is received (S602), the general controllers 120 to 140 check whether there is a message to be transmitted in the current transmission time slot (S603).

상기 체크(S603) 결과, 현재 송신 타임 슬롯에 송신할 메시지가 있으면(S603의 예), 상기 일반 제어기(120 ~ 140)들은 메시지를 상기 게이트웨이(즉, 게이트웨이 제어기)(110)에 송신하고(S604), 송신 타임 슬롯 인덱스를 1 증가시킨다(S605).If it is determined in step S603 that there is a message to be transmitted in the current transmission time slot (YES in step S603), the general controllers 120 to 140 transmit the message to the gateway (i.e., gateway controller) 110 ), And increments the transmission time slot index by 1 (S605).

상기와 같이 본 실시예는 차량용 게이트웨이를 통해 차량 내의 다른 제어기들의 메시지 전송 시작 시점을 동기화하고, 게이트웨이를 통해 라우팅되는 메시지의 송신 순서를 정렬하며, 타임 슬롯을 통한 수신 메시지 관리 및 주기적인 수신 작업을 수행할 수 있도록 함으로써, 게이트웨이의 메시지 수신 부하를 감소시킬 수 있고, 또한 주기 메시지의 주기 오차율을 감소시킬 수 있도록 하는 효과가 있다.As described above, the present embodiment synchronizes the start time of message transmission of other controllers in the vehicle through the in-vehicle gateway, arranges the transmission order of the messages routed through the gateway, manages the reception message through the time slots, Thereby reducing the message reception load of the gateway and reducing the period error rate of the periodic message.

이상으로 본 발명은 도면에 도시된 실시예를 참고로 하여 설명되었으나, 이는 예시적인 것에 불과하며, 당해 기술이 속하는 분야에서 통상의 지식을 가진 자라면 이로부터 다양한 변형 및 균등한 타 실시예가 가능하다는 점을 이해할 것이다. 따라서 본 발명의 기술적 보호범위는 아래의 특허청구범위에 의해서 정하여져야 할 것이다.While the present invention has been particularly shown and described with reference to exemplary embodiments thereof, it is to be understood that the invention is not limited to the disclosed embodiments, but, on the contrary, I will understand the point. Accordingly, the technical scope of the present invention should be defined by the following claims.

110 : 게이트웨이 120 ~ 140 : 일반 제어기110: Gateways 120-140: General controller

Claims (9)

차량용 게이트웨이가 메시지 수신 인터럽트가 발생하는지 체크하는 단계;
상기 메시지 수신 인터럽트가 발생할 경우, 상기 게이트웨이가 메시지 수신 카운터 값을 증가시키는 단계;
지정된 목표 수신 메시지 개수만큼 메시지를 수신할 경우, 상기 게이트웨이가 메시지 수신 버퍼를 검색하는 단계; 및
상기 게이트웨이가 상기 메시지 수신 버퍼에 수신된 메시지를 복사하여 상위 어플리케이션에 통지하거나 일반 제어기에 송신하는 단계;를 포함하고,
상기 메시지 수신 인터럽트가 발생할 경우,
상기 게이트웨이가 레디(Ready) 메시지 수신 플래그 값이 1로 설정되었는지 체크하는 단계;
상기 레디 메시지 수신 플래그가 0으로 설정되었으면, 상기 게이트웨이가 메시지 수신 버퍼를 검색하는 단계;
상기 게이트웨이가 데이터베이스 상에 등록된 모든 일반 제어기로부터 레디(Ready) 메시지를 수신했는지 체크하는 단계; 및
상기 모든 일반 제어기로부터 레디(Ready) 메시지를 수신했으면, 상기 게이트웨이가 레디 메시지 수신 플래그 값을 1로 설정하고, 동기(Sync) 메시지를 상기 모든 일반 제어기에 송신하는 단계;를 더 포함하는 것을 특징으로 하는 차량용 게이트웨이의 주기 메시지 송수신 방법.
Checking whether a gateway for a car is receiving a message reception interrupt;
Increasing the message reception counter value when the message reception interrupt occurs;
Receiving a message corresponding to a predetermined number of target received messages, the gateway searching for a message receiving buffer; And
The gateway copying the received message into the message receiving buffer and notifying the upper application or transmitting the message to the general controller,
When the message reception interrupt occurs,
Checking whether a value of a Ready message reception flag of the gateway is set to 1;
If the ready message reception flag is set to 0, searching the message reception buffer by the gateway;
Checking whether the gateway has received a Ready message from all common controllers registered on the database; And
Setting a ready message reception flag value to 1 and transmitting a synchronization message to all the general controllers when the gateway receives a Ready message from all the general controllers; And transmitting and receiving the periodic message of the vehicle gateway.
제 1항에 있어서,
상기 메시지 수신 인터럽트가 발생하는지 체크하는 단계, 및 상기 메시지 수신 카운터 값을 증가시키는 단계는 메시지가 수신될 때마다 반복해서 수행되며, 상기 메시지 수신 카운터 값은 목표 수신 메시지 개수가 미리 지정되는 것을 특징으로 하는 차량용 게이트웨이의 주기 메시지 송수신 방법.
The method according to claim 1,
And the step of incrementing the message reception counter value is repeatedly performed each time a message is received, and the number of target reception messages is specified in advance in the message reception counter value. And transmitting and receiving the periodic message of the vehicle gateway.
제 1항에 있어서, 상기 메시지 수신 버퍼에 수신된 메시지를 복사하여 상위 어플리케이션에 통지하거나 일반 제어기에 송신하는 단계는,
상기 지정된 목표 수신 메시지 개수만큼 반복해서 수행되는 것을 특징으로 하는 차량용 게이트웨이의 주기 메시지 송수신 방법.
The method as claimed in claim 1, wherein the step of copying the received message to the message reception buffer and notifying the upper application of the message or transmitting the copied message to the general controller,
Wherein the periodic message is repeatedly performed as many times as the designated target received message number.
삭제delete 제 1항에 있어서,
상기 레디(Ready) 메시지가 수신되었거나, 상기 모든 일반 제어기로부터 레디(Ready) 메시지를 수신하지 않았거나, 동기(Sync) 메시지를 상기 일반 제어기들에 송신하면, 상기 게이트웨이가 동기(Sync) 메시지 송신 플래그 값이 1인지 체크하는 단계:
상기 동기(Sync) 메시지 송신 플래그 값이 1이면, 상기 게이트웨이가 수신 타임 슬롯 인덱스에 맵핑된 목표 수신 메시지 개수가 0 인지 체크하고, 상기 수신 타임 슬롯 인덱스에 맵핑된 목표 수신 메시지 개수가 0이 아니면 메시지 수신 카운트를 1 증가시키는 단계;
상기 게이트웨이가 메시지 수신 카운트가 기 지정된 목표 수신 메시지 개수와 같은지 체크하여, 메시지 수신 카운트가 기 지정된 목표 수신 메시지 개수와 같으면, 메시지 수신 버퍼를 검색하는 단계;
상기 메시지 수신 버퍼를 검색한 후, 상기 게이트웨이가 상기 수신된 메시지가 허용 주기 오차를 벗어났는지 체크하고, 수신된 메시지가 허용 주기 오차를 벗어났을 경우, 동기(Sync) 메시지 송신 요청 플래그를 1로 설정하는 단계; 및
상기 수신된 메시지가 허용 주기 오차를 벗어나지 않았거나, 상기 동기(Sync) 메시지 송신 요청 플래그를 1로 설정하였으면, 상기 게이트웨이가 상기 수신 메시지를 복사하여 상기 모든 일반 제어기에 송신하는 단계;를 더 포함하는 것을 특징으로 하는 차량용 게이트웨이의 주기 메시지 송수신 방법.
The method according to claim 1,
If the Ready message is received or a Ready message is not received from all the general controllers or a Sync message is sent to the general controllers, Checking whether the value is 1:
If the Sync message transmission flag is 1, the gateway checks whether the number of target reception messages mapped to the reception time slot index is 0. If the number of target reception messages mapped to the reception time slot index is not 0, Increasing the reception count by 1;
Checking whether the message reception count is equal to a predetermined target number of received messages and searching for a message reception buffer if the message reception count is equal to a predetermined target number of received messages;
After searching the message reception buffer, the gateway checks whether the received message is out of the allowable period error. If the received message is out of the allowable period error, the Sync message transmission request flag is set to 1 ; And
And if the received message does not deviate from the allowable period error or the synchronization message transmission request flag is set to 1, the gateway copies the received message and transmits the copied message to all the general controllers Wherein said periodic message transmission / reception method comprises the steps of:
제 1항에 있어서, 상기 수신된 메시지를 일반 제어기에 송신하기 위하여,
메시지 송신 인터럽트가 발생할 경우, 상기 게이트웨이가 동기(Sync) 메시지의 송신이 완료되었는지 체크하는 단계;
상기 동기(Sync) 메시지의 송신이 완료되면, 상기 게이트웨이는 동기(Sync) 메시지 송신 플래그를 1로 설정하고, 주기 타이머를 재 시작하는 단계;
상기 주기 타이머 재 시작에 의해 주기 타이머 이벤트가 발생할 경우, 상기 게이트웨이는 동기(Sync) 메시지 요청 플래그 값이 1로 설정되어 있는지 체크하는 단계;
상기 동기(Sync) 메시지 요청 플래그 값이 1로 설정되어 있으면, 상기 게이트웨이가 동기(Sync) 메시지를 상기 일반 제어기에 송신한 후, 동기(Sync) 메시지 송신 요청 플래그를 0으로 설정한 다음 수신 타임 슬롯 인덱스를 1 증가시키는 단계; 및
상기 수신 타임 슬롯 인덱스가 기 지정된 최대값에 도달했는지 체크하여, 상기 수신 타임 슬롯 인덱스가 최대값에 도달했으면, 상기 게이트웨이가 수신 타임 슬롯 인덱스를 초기화하는 단계;를 포함하는 것을 특징으로 하는 차량용 게이트웨이의 주기 메시지 송수신 방법.
2. The method of claim 1, further comprising:
Checking if the transmission of the Sync message is completed by the gateway when a message transmission interrupt occurs;
When the transmission of the Sync message is completed, the gateway sets the Sync message transmission flag to 1 and restarts the periodic timer;
If the periodic timer event occurs due to the restart of the periodic timer, the gateway checks whether a Sync message request flag value is set to 1;
If the Sync message request flag is set to '1', the gateway transmits a Sync message to the general controller, sets a Sync message transmission request flag to 0, Incrementing the index by 1; And
Checking whether the received time slot index has reached a predefined maximum value, and if the received time slot index has reached a maximum value, the gateway initializing a received time slot index. / RTI >
제 6항에 있어서, 상기 주기 타이머 이벤트가 발생할 경우,
상기 동기(Sync) 메시지 요청 플래그 값이 1로 설정되어 있지 않으면, 상기 게이트웨이는 메시지 수신 카운트가 기 지정된 목표 수신 메시지 개수와 같은지 체크하는 단계;
상기 메시지 수신 카운트가 기 지정된 목표 수신 메시지 개수와 같으면, 상기 게이트웨이는 곧바로 상기 수신 타임 슬롯 인덱스를 1 증가시키는 단계; 및
상기 메시지 수신 카운트가 기 지정된 목표 수신 메시지 개수와 같지 않으면 동기(Sync) 메시지를 일반 제어기들에 송신한 후, 동기(Sync) 메시지 송신 요청 플래그를 0으로 설정한 다음, 상기 수신 타임 슬롯 인덱스를 1 증가시키는 단계;를 더 포함하는 것을 특징으로 하는 차량용 게이트웨이의 주기 메시지 송수신 방법.
7. The method of claim 6, wherein if the periodic timer event occurs,
If the sync message request flag value is not set to 1, the gateway checks whether the message reception count is equal to the designated target received message count;
If the message reception count is equal to a predefined number of target received messages, the gateway immediately increments the received time slot index by one; And
If the message reception count is not equal to the pre-designated target number of received messages, the controller transmits a Sync message to general controllers, sets a Sync message transmission request flag to 0, and then sets the reception time slot index to 1 And transmitting the periodic message to the vehicle gateway.
제 1항에 있어서, 상기 게이트웨이가 메시지를 일반 제어기에 송신할 경우,
상기 일반 제어기에 메시지 수신 인터럽트가 발생됨에 따라 상기 일반 제어기가 동기(Sync) 메시지를 수신했는지 체크하는 단계;
상기 동기(Sync) 메시지를 수신했으면, 상기 일반 제어기가 상기 동기(Sync) 메시지로부터 상기 게이트웨이의 수신 타임 슬롯 인덱스를 읽어 자신의 송신 타임 슬롯 인덱스를 동일하게 설정하는 단계;
상기 일반 제어기가 주기 타이머가 실행 중인지 체크하는 단계; 및
상기 주기 타이머가 실행 중이면 상기 일반 제어기가 주기 타이머를 종료하였다가 다시 시작하고, 상기 주기 타이머가 실행 중이 아니면 주기 타이머를 시작하는 단계;를 포함하는 것을 특징으로 하는 차량용 게이트웨이의 주기 메시지 송수신 방법.
The method of claim 1, wherein, when the gateway sends a message to a general controller,
Checking whether the general controller has received a synchronization message when a message reception interruption is generated in the general controller;
If the Sync message is received, the general controller reads the reception time slot index of the gateway from the Sync message and sets its transmission time slot index to be the same;
Checking whether the generic controller is running a periodic timer; And
And if the periodic timer is being executed, the general controller terminates the periodic timer and restarts the periodic timer, and if the periodic timer is not being executed, starting the periodical timer.
제 8항에 있어서,
상기 주기 타이머의 시작에 따라 주기 타이머 이벤트가 발생할 경우,
상기 일반 제어기가 동기(Sync) 메시지를 수신했는지 체크하는 단계;
상기 동기(Sync) 메시지를 수신했으면, 상기 일반 제어기가 현재 송신 타임 슬롯에 송신할 메시지가 있는지 체크하는 단계;
상기 현재 송신 타임 슬롯에 송신할 메시지가 있으면, 상기 일반 제어기가 메시지를 상기 게이트웨이에 송신하고, 송신 타임 슬롯 인덱스를 1 증가시키는 단계;를 포함하는 것을 특징으로 하는 차량용 게이트웨이의 주기 메시지 송수신 방법.
9. The method of claim 8,
When a cycle timer event occurs according to the start of the cycle timer,
Checking whether the general controller has received a Sync message;
Receiving a Sync message, checking if the general controller has a message to transmit in the current transmission time slot;
And if the message is to be transmitted in the current transmission time slot, the general controller transmits a message to the gateway and increases the transmission time slot index by one.
KR1020160166795A 2016-12-08 2016-12-08 Method for transmitting and receiving periodic message of gateway device for vehicle KR101907438B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020160166795A KR101907438B1 (en) 2016-12-08 2016-12-08 Method for transmitting and receiving periodic message of gateway device for vehicle

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020160166795A KR101907438B1 (en) 2016-12-08 2016-12-08 Method for transmitting and receiving periodic message of gateway device for vehicle

Publications (2)

Publication Number Publication Date
KR20180066372A KR20180066372A (en) 2018-06-19
KR101907438B1 true KR101907438B1 (en) 2018-10-15

Family

ID=62790685

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020160166795A KR101907438B1 (en) 2016-12-08 2016-12-08 Method for transmitting and receiving periodic message of gateway device for vehicle

Country Status (1)

Country Link
KR (1) KR101907438B1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102429410B1 (en) * 2020-12-15 2022-08-03 현대오토에버 주식회사 Routing method and apparatus

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003179662A (en) * 2001-12-10 2003-06-27 Sony Corp Data communication system, data transmitter, data receiving apparatus, and method, and computer program
JP2006319759A (en) * 2005-05-13 2006-11-24 Denso Corp Gateway device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DK0954975T3 (en) * 1998-05-04 2006-04-18 Natural Asa Isomer-enriched compositions with conjugated linoleic acid
JP5138949B2 (en) * 2007-02-07 2013-02-06 日立オートモティブシステムズ株式会社 In-vehicle gateway device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003179662A (en) * 2001-12-10 2003-06-27 Sony Corp Data communication system, data transmitter, data receiving apparatus, and method, and computer program
JP2006319759A (en) * 2005-05-13 2006-11-24 Denso Corp Gateway device

Also Published As

Publication number Publication date
KR20180066372A (en) 2018-06-19

Similar Documents

Publication Publication Date Title
RU2682016C2 (en) Vehicle with improved communication system
KR102208580B1 (en) Unmanned vehicle, apparatus for supporting time synchronization between unmanned vehicles and method for the same
KR102011528B1 (en) Method and device for serial data transmission having a flexible message size and a variable bit length
EP3410239A1 (en) Vehicle control method and system
JP6886511B2 (en) Data transmission method and equipment
JP2008113097A (en) Gateway device and transfer control method
KR101907438B1 (en) Method for transmitting and receiving periodic message of gateway device for vehicle
US20180063246A1 (en) Method and apparatus for efficient data transfer protocol in a limited-bandwidth vehicle environment
CN106327143B (en) Method and apparatus for nodes in a flow
US10976750B2 (en) Base station for receiving and processing vehicle control information and/or traffic state information
JP2015065546A (en) Vehicle control unit
CN104537866A (en) Multifunctional dynamic bus stop voice broadcasting method and system
KR101612825B1 (en) Can controller, gateway for internal vehicle communication and control method the same
JP2015198393A (en) Emergency report system, service center, and portable telephone
CN112584345A (en) Device and method for vehicle-to-outside information interactive communication
EP2573981A2 (en) System and method for encoding a slot table for a communications controller
JP5372699B2 (en) In-vehicle network device
CN111246435B (en) relay device
CN104394188A (en) Method and system for data transmission in Internet of Vehicles
CN104575090A (en) Voice type bus route broadcasting method and system based on APP (application)
JP7110950B2 (en) network system
US11599678B2 (en) Method for ensuring the integrity of data to ensure operational safety and vehicle-to-X device
EP3116277B1 (en) Communication apparatus, congestion control method, and storage medium
CN106776065B (en) Method and device for using Mtp function by multiple systems
US11184919B2 (en) Communication device and methods for synchronizing communication channels and using the device

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