KR20110035247A - Method for id transformation in can-based network - Google Patents

Method for id transformation in can-based network Download PDF

Info

Publication number
KR20110035247A
KR20110035247A KR1020090092878A KR20090092878A KR20110035247A KR 20110035247 A KR20110035247 A KR 20110035247A KR 1020090092878 A KR1020090092878 A KR 1020090092878A KR 20090092878 A KR20090092878 A KR 20090092878A KR 20110035247 A KR20110035247 A KR 20110035247A
Authority
KR
South Korea
Prior art keywords
message
deadline
transmission delay
time
transmission
Prior art date
Application number
KR1020090092878A
Other languages
Korean (ko)
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 KR1020090092878A priority Critical patent/KR20110035247A/en
Publication of KR20110035247A publication Critical patent/KR20110035247A/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2101/00Indexing scheme associated with group H04L61/00
    • H04L2101/60Types of network addresses
    • H04L2101/618Details of network addresses
    • H04L2101/627Controller area network [CAN] identifiers
    • 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
    • H04L12/40163Bus networks involving priority mechanisms by assigning priority to messages according to a message field
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0852Delays
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route
    • H04L43/106Active monitoring, e.g. heartbeat, ping or trace-route using time related information in packets, e.g. by adding timestamps
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Cardiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Environmental & Geological Engineering (AREA)
  • Small-Scale Networks (AREA)

Abstract

PURPOSE: An ID dynamic allocating method of a CAN based system is provided to perform a different operation by using a time stamp function of CAN without using a timer. CONSTITUTION: A changing area value of an ID is read out(S401). The transmission delay of a message is compared with a deadline value(S402). An order of a deadline is calculated(S403). The order is assigned based on the deadline of a changing area(S404). The initialization of the order is identified(S406). The current weight is compared with an initial weight(S408). An ID message of a transmission frame is recorded in a changing area(S405).

Description

CAN 기반 시스템에서의 ID 동적 할당 방법{Method for ID transformation in CAN-based network}ID dynamic allocation method in a CAN-based system {Method for ID transformation in CAN-based network}

본 발명은 CAN 기반 시스템에서의 ID 동적 할당 방법에 관한 것이다. 보다 상세하게는, CAN 기반 차량용 네트워크에서 메시지의 전송 권한을 동적으로 변환하는 ID 동적 할당 방법에 관한 것이다.The present invention relates to an ID dynamic allocation method in a CAN based system. More specifically, the present invention relates to an ID dynamic allocation method for dynamically converting a transmission authority of a message in a CAN-based vehicle network.

최근 들어 생산 및 판매되고 있는 자동차에는 ABS(Anti-Break System) 시스템, 에어백(Air-bag) 시스템, 자세 제어 시스템(TCS), 전조등 제어 시스템(AFS), 순항 제어 시스템(VCC), 첨단 고안전 자동차용 전자 장비들, 텔레매틱스, 지능형 교통시스템(ITS) 등 수많은 전자 제어 장치들이 적용되고 있다. 자동차의 안전 및 편리 등을 위하여 이와 같은 첨단 시스템은 갈수록 더 요구되어 관련 전자 장비들이 기하 급수적으로 늘어나게 될 것이다.Recently produced and sold automobiles include Anti-Break System (ABS) system, Air-bag system, Attitude Control System (TCS), Headlight Control System (AFS), Cruise Control System (VCC), Advanced High Safety Many electronic control devices are being applied, including automotive electronics, telematics, and intelligent transportation systems (ITS). Such advanced systems will be increasingly required for the safety and convenience of automobiles, and the related electronic equipment will grow exponentially.

또한, 환경 규제 등에 따라 기존의 엔진과 배터리/연료전지 등과 결합되어 출시되고 있는 하이브리드(hybrid) 자동차는 기존의 화석연료 자동차를 대체할 것으로 전망되며, 이와 같은 하이브리드 자동차는 휠씬 더 많은 전자 장비들을 필요로 한다. 하이브리드 자동차의 출현으로 자동차의 첨단 시스템 구현에 따른 관련 전자 장비들의 수는 더욱 가속화될 것으로 예상된다.In addition, hybrid vehicles, which are being released in combination with existing engines and batteries / fuel cells, are expected to replace conventional fossil fuel vehicles due to environmental regulations. Such hybrid vehicles require much more electronic equipment. Shall be. The advent of hybrid cars is expected to accelerate the number of related electronic devices associated with the implementation of advanced systems in cars.

위와 같은 자동차내 전자 제어 장치들은 센서 등과 같은 센싱부와 제어기 그리고 작동부 사이에 단방향 또는 양방향으로 통신이 이루어지게 되는데, 현재 각 전자제어장치(Electronic Control Unit: ECU)의 대부분은 차량용 네트워크 프로토콜로 CAN(Controller Area Network) 통신 네트워크로 연결되어 각종 제어에 필요한 메시지가 전달되고 있다. The above electronic control devices in the vehicle are one-way or two-way communication between the sensing unit, the sensor and the operating unit such as sensors, etc. Currently, most of the electronic control units (ECUs) are CAN network protocols for vehicles. (Controller Area Network) Messages connected to the communication network are required for various control.

CAN은 초기에 자동차 산업 분야에 적용하기 위해 고안된 시리얼 네트워크 통신 방식으로, 근래에는 자동차 분야뿐만 아니라 산업 전 분야에 폭 넓게 적용되고 있으며 자동차 분야에 적용되는 기본적인 CAN 네트워크 시스템 구성은 도 1과 같다. CAN은 마이크로컨트롤러들 간의 통신을 위한 버스 방식으로 자동차의 전자제어장치(ECU), 트랜스미션 제어 유닛(Transmission Control Unit: TCU), ABS의 마이크로컨트롤러 등과 데이터 통신을 수행한다. 상기 CAN은 고유의 아이디(ID)를 가지는 다수의 장치들을 하나의 버스를 통해 연결하여 장치들간 정보 교환을 할 수 있다. 상기 CAN은 OSI 7계층 중 물리계층(Physical Layer), 데이터 링크 계층(Data Link Layer) 및 어플리케이션 계층 (Application Layer)을 사용한다.CAN is a serial network communication scheme designed to be applied to the automotive industry in the early days. Recently, CAN is widely applied not only to the automobile field but also to all industries, and the basic CAN network system configuration applied to the automobile field is shown in FIG. 1. CAN is a bus for communication between microcontrollers and performs data communication with an electronic control unit (ECU) of a vehicle, a transmission control unit (TCU), and a microcontroller of ABS. The CAN may exchange information between devices by connecting a plurality of devices having unique IDs through a single bus. The CAN uses a physical layer, a data link layer, and an application layer among the OSI 7 layers.

도 1에 도시된 바와 같이, CAN 네트워크 시스템은 다수 개의 노드(node)를 구비하며 각 노드(2) 사이의 메시지 송수신은 CAN 버스(1)를 통해 이루어진다. 여기에서 상기 각 노드(2)는 메시지를 송수신함으로써 해당 동작을 수행하는 다수개의 전자 장치(ECU)들이 된다.As shown in FIG. 1, the CAN network system includes a plurality of nodes, and message transmission and reception between each node 2 is performed through the CAN bus 1. Here, each node 2 becomes a plurality of electronic devices (ECUs) that perform a corresponding operation by transmitting and receiving a message.

네트워크 시스템에 사용되는 메시지는 송신측이나 수신측의 주소를 포함하 지 않으며, 수신측의 식별자(ID) 정보만을 포함한다. CAN 버스(1)는 CAN 프로토콜에 따라 다수 개의 노드들(2) 또는 다수개의 전자 장치들(2) 각각에 고유한 식별자(ID)를 할당한다. 이는 공지된 기술에 따른 것이므로 상세한 설명은 생략하기로 한다. CAN 버스(1)의 각 노드에 연결된 전자장치(ECU)는 CAN 버스(1)를 통해 전송되는 메시지를 획득한다. 메시지의 식별자가 자신의 식별자와 동일하면 획득한 메시지를 입력 메시지로써 받아들이고, 이에 따른 동작을 수행한다. The message used in the network system does not include the address of the sender or the receiver, but includes only identifier (ID) information of the receiver. The CAN bus 1 assigns a unique identifier (ID) to each of the plurality of nodes 2 or the plurality of electronic devices 2 in accordance with the CAN protocol. Since this is in accordance with known techniques, a detailed description thereof will be omitted. An electronic device (ECU) connected to each node of the CAN bus 1 obtains a message transmitted via the CAN bus 1. If the identifier of the message is the same as its identifier, the acquired message is accepted as an input message, and the operation is performed accordingly.

CAN의 경우 다양한 에러 감지 메커니즘과 재전송 능력으로 데이터의 높은 안정성과 사용 가능성을 보장하고 있어서 현재 세계적으로 차량에 가장 널리 적용되고 있다. 또한 비교적 낮은 트래픽 조건에서는 네트워크 시스템에서의 메시지 충돌을 효과적으로 중재할 수가 있는 장점이 있다. 그러나 최근 들어 개발이 활발하게 진행되고 있는 지능형 자동차의 샤시 네트워크와 같이 다수의 센서 및 엑츄에이터로 이루어지면서 주기성(periodic) 메시지가 다수 발생하는 높은 트래픽 조건의 시스템에서는 도 2와 같이 평균 전송지연이 급격하게 증가하는 특성을 보이고 있다.In the case of CAN, various error detection mechanisms and retransmission capabilities ensure high reliability and availability of data, and are currently widely used in vehicles worldwide. In addition, there is an advantage that can effectively mediate message collisions in a network system under relatively low traffic conditions. However, in a high traffic condition system in which a plurality of sensors and actuators are generated and a large number of periodic messages are generated, such as the chassis network of an intelligent vehicle, which is being actively developed in recent years, the average transmission delay is suddenly shown in FIG. It is showing increasing characteristics.

본 발명은 상기한 바와 같은 문제점을 해결하기 위해 고안된 것으로서,The present invention is designed to solve the above problems,

본 발명은 CAN 기반 시스템에서 각 제어장치에서 생성되는 메시지의 최대 전송 지연 시간을 줄일 수 있는 ID 동적 할당 방법을 제공하는 것을 목적으로 한다.An object of the present invention is to provide an ID dynamic allocation method that can reduce the maximum transmission delay time of a message generated by each control device in a CAN-based system.

본 발명의 다른 목적은 시스템에 부하가 걸리지 않는 ID 동적 할당 방법을 제공하는 것이다.Another object of the present invention is to provide an ID dynamic allocation method in which the system is not overloaded.

본 발명의 또 다른 목적은 CAN 기반 시스템에서 각 제어장치에서 생성되는 메시지들이 요구하는 서로 다른 전송지연 한계를 보장할 수 있는 ID 동적 할당 방법을 제공하는 것이다.It is still another object of the present invention to provide an ID dynamic allocation method that can guarantee different transmission delay limits required by messages generated by each control device in a CAN-based system.

본 발명의 또 다른 목적은 각 제어장치에서 생성되는 메시지들의 우선순위를 변경하여 우선순위가 상대적으로 낮은 메시지들에게 최소한의 전송기회를 부여하는 ID 동적 할당 방법을 제공하는 것이다.It is still another object of the present invention to provide an ID dynamic allocation method for changing the priority of messages generated by each control device to give a minimum transmission opportunity to messages having a relatively low priority.

본 발명의 또 다른 목적은 전송 지연 시간 측정 과정이 짧고 간단한 ID 동적 할당 방법을 제공하는 것이다.It is still another object of the present invention to provide an ID dynamic allocation method with a short transmission delay measurement process.

본 발명의 CAN 기반 시스템에서의 ID 동적 할당 방법은, 메시지의 전송 시간을 모니터링하여 메시지의 전송 지연을 측정하는 단계; 및 데드라인 시간을 기준으로 시스템에서 발생하는 메시지의 우선 순위를 할당하는 단계를 포함한다.In the CAN-based system of the present invention, the ID dynamic allocation method includes: measuring a transmission delay of a message by monitoring a transmission time of the message; And assigning priorities of messages occurring in the system based on the deadline time.

특히, 상기 전송 지연 측정 단계는, CAN 타임-스탬프(time-stamp) 기능을 이용하여 버퍼에 메시지가 저장되는 순간부터 CAN 버스 상으로 전송된 메시지의 EOF(End of File)가 나타나는 시간까지의 시간을 이용하여 메시지의 전송 지연을 계산하는 것을 특징으로 한다.In particular, the transmission delay measurement step, the time from the time the message is stored in the buffer using the CAN time-stamp function to the time when the end of file (EOF) of the message transmitted on the CAN bus appears It is characterized in that for calculating the transmission delay of the message using.

또한, 상기 CAN 기반 시스템에서의 ID 동적 할당 방법은, 29비트의 ID를 갖는 CAN 2.0 B의 표준을 따르는 것을 특징으로 한다.In addition, the ID dynamic allocation method in the CAN-based system is characterized in that it follows the standard of CAN 2.0 B having an ID of 29 bits.

또한, 상기 CAN 기반 시스템에서의 ID 동적 할당 방법은, 데이터 프레임을 29비트의 ID를 갖는 중재자 필드를 세 영역으로 나누는 것을 특징으로 한다.In addition, the ID dynamic allocation method in the CAN-based system is characterized by dividing a data frame into three regions of an arbiter field having an ID of 29 bits.

또한, 상기 중재자 필드는, 서로 다른 메시지 종류의 클래스를 구분하기 위한 2 bit의 메시지 타입 영역(grouping zone); 전송 지연이 데드라인을 초과한 횟수(count)부분과 데드라인을 기준으로 하는 회차(Weight) 부분으로 이루어진 체인징 영역(changing zone); 및 네트워크 설계에서 부여된 초기 ID를 적용하는 영역으로 나누어지는 것을 특징으로 한다.The moderator field may include a 2 bit message type zone for distinguishing classes of different message types; A changing zone comprising a count portion of which the transmission delay exceeds the deadline and a weight portion based on the deadline; And an area to which the initial ID given in the network design is applied.

또한, 상기 CAN 기반 시스템에서의 ID 동적 할당 방법은, 메시지의 전송지연이 데드라인 이상의 값이면 각 ID의 체인징 영역(anging zone)의 횟수(count)를 1만큼 감소시키고, 전송된 순서에서 데드라인을 넘은 순서만큼 감소시켜 현재의 체인징 영역(anging zone)의 회차(weight)에 대입하고, 전송지연이 데드라인을 넘지 않는 경우는 각 ID의 체인징 영역의 초기값을 유지하기 위해 회수(count)는 초기 설정했던 값을 대입하고, 회차(weight)는 하나 씩 증가시키는 것을 특징으로 한다.In addition, in the CAN-based system, the ID dynamic allocation method may reduce the number of changing zones of each ID by 1 when the transmission delay of the message is greater than or equal to the deadline, and the deadline in the transmitted order. It is reduced by the order exceeding, and assigned to the weight of the current changing zone. If the transmission delay does not exceed the deadline, the count is maintained to maintain the initial value of the changing zone of each ID. Substituting the initially set value, the weight is characterized by increasing one by one.

본 발명에 따른 ID 동적 할당방법은 다음과 같은 효과를 기대할 수 있다.The ID dynamic allocation method according to the present invention can expect the following effects.

첫째, 각 노드에서 발생하는 메시지의 정확한 우선순위가 정해져서 전송 지 연 시간을 줄 일수 있다.First, the exact priority of messages occurring at each node can be determined, reducing the transmission delay time.

둘째, 각 메시지의 데드라인만 정해주므로 네트워크의 변동에 따라 시간 축을 바꿀 필요가 없다.Second, it only determines the deadline of each message, so there is no need to change the time axis as the network changes.

셋째, 타이머를 사용하지 않고 CAN의 타임-스탬프(time-stamp) 기능을 사용하므로서 시스템에 부하가 걸리지 않아 시스템이 다른 동작을 할 수 있게 된다.Third, by using the time-stamp function of CAN without using a timer, the system is not overloaded, allowing the system to perform other operations.

이하, 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자가 본 발명의 기술적 사상을 용이하게 실시할 수 있을 정도로 상세히 설명하기 위하여, 본 발명의 가장 바람직한 실시예를 도면을 참조하여 설명하기로 한다. 우선 각 도면의 구성요소들에 참조부호를 부가함에 있어서, 동일한 구성요소들에 대해서는 비록 다른 도면상에 표시되더라도 가능한 한 동일한 부호를 가지도록 한다. 또한, 본 발명을 설명함에 있어, 관련된 공지 구성 또는 기능에 대한 구체적인 설명이 본 발명의 요지를 흐릴 수 있다고 판단되는 경우에는 그 상세한 설명은 생략한다. Hereinafter, the most preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings so that those skilled in the art may easily implement the technical idea of the present invention. First, in adding reference numerals to the components of each drawing, the same components have the same reference numerals as much as possible even though they are displayed on 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.

이하, 첨부된 도면을 참고하여 본 발명에 따른 CAN 시스템에서 ID 동적할당 방법의 상세한 동작을 설명한다.Hereinafter, a detailed operation of an ID dynamic allocation method in a CAN system according to the present invention will be described with reference to the accompanying drawings.

도 3은 본 발명에 따른 ID 변환 알고리즘의 데이터 프레임 구조를 나타낸 것이다. 3 shows a data frame structure of the ID conversion algorithm according to the present invention.

CAN 2.0 B 규격에서 정의하고 있는 데이터 프레임을 기반으로 하여 구성되며 29비트의 ID를 가질 수 있는 중재자 필드(Arbitration Field)만 크게 세 영역으로 나누어진 형태이다. 따라서 기본적으로 현재 널리 사용되고 있는 CAN 의 기본적인 프로토콜과 호환이 가능하면서, 동적으로 ID를 조정하는 것이 가능한 구조로 되어 있다.It is composed based on the data frame defined in the CAN 2.0 B standard and only the Arbitration Field, which can have an ID of 29 bits, is divided into three areas. Therefore, it is basically compatible with the basic protocol of CAN which is widely used, and it is possible to adjust ID dynamically.

하드 리얼타임(hard real time) 메시지나 소프트 리얼타임(soft real time) 메시지처럼, 시스템에서 발생되는 메시지는 각기 다른 요구 특성을 갖는다. 특히 어떠한 메시지의 타입보다도 전송이 우선적으로 되어야 하는 긴급 메시지도 존재하게 된다. 이러한 서로 다른 메시지 종류의 클래스를 구분하기 위한 2 비트(bit)의 메시지 타입(Message Type) 영역을 중재자 필드(Arbitration Field)의 첫 번째 영역으로 할당하여 메시지의 종류를 구분한다. 실제로 전송되는 메시지의 우선순위를 결정하게 되는 체인징 영역 (changing zone)은 ID 변환 알고리즘을 사용하는 부분이다. 횟수(count)부분과 회차(weight)부분으로 나눠지며 두 번째 영역으로 할당한다. 제일 마지막 영역은 네트워크의 설계에서 부여된 초기 ID를 적용하는 영역이다. 이 구간은 원래 메시지를 식별하는 식별자 기능과 동적 ID 할당 기법의 동작 중에 ID의 체인징 영역 (changing zone)의 값이 같아지더라도 메시지가 가지는 기존 우선순위를 보장하는 기능을 갖는다.Like hard real time messages or soft real time messages, messages generated by the system have different requirements. In particular, there is an urgent message in which transmission should be given priority over any message type. A message type area of 2 bits for distinguishing classes of different message types is allocated to the first area of the Arbitration Field to classify the message types. The changing zone that determines the priority of the messages actually sent is the part that uses the ID translation algorithm. It is divided into a count part and a weight part and allocated to the second area. The last area is the area that applies the initial ID given in the network design. This section has the function of identifying the original message and guaranteeing the existing priority of the message even if the ID of the changing zone of the ID is the same during the operation of the dynamic ID allocation scheme.

ID 변환 알고리즘의 전송지연 측정은 메시지의 전송지연을 측정하는 과정이 필요하다. 이 과정은 CAN 타임-스탬프 (Time-stamp) 기능을 이용하면 버퍼에 메시지가 저장되는 순간부터 CAN 버스 상으로 전송된 메시지의 EOF가 나타나는 시간까 지 시간을 자동으로 기록하게 된다. 이 시간을 이용하여 메시지의 전송 지연을 계산하고, 다음으로 ID를 변환하기 위한 절차를 수행하게 된다.Transmission delay measurement of the ID conversion algorithm needs to measure the transmission delay of the message. This process uses the CAN Time-stamp function to automatically record the time from the moment the message is stored in the buffer to the time the EOF of the message sent on the CAN bus appears. This time is used to calculate the transmission delay of the message, and then the procedure for converting the ID is performed.

ID 변환 알고리즘은 논리적으로 각 ID의 체인징 영역(changing zone) 부분에 전송지연이 데드라인을 초과한 횟수(count)와 데드라인을 기준으로 몇 번째 전송(weight)이 되었는가를 다루고 있다. 이 부분의 다루기 위해서는 메시지의 전송순서를 알아야 한다. 전송순서를 알기 위해서는 CAN 2.0 B규격에서 프레임을 기준으로 계산할 수 있다. 500k bps의 전송속도, 최대 데이터크기와 스터프(stuff) 비트의 크기 등을 고려하여 메시지가 버퍼에서 버스 라인으로 나오는데 걸리는 시간을 아래의 수학식 1과 같이 계산할 수 있다.The ID conversion algorithm logically deals with the number of times the transmission delay exceeds the deadline and the number of weights based on the deadline in the changing zone of each ID. To deal with this part, you must know the order in which messages are sent. To know the transmission order, the frame can be calculated based on the CAN 2.0 B standard. Considering the transmission speed of 500k bps, the maximum data size and the stuff bit size, the time taken for the message to come out of the buffer to the bus line can be calculated as in Equation 1 below.

Figure 112009060158812-PAT00001
Figure 112009060158812-PAT00001

여기서, 67은 확장형 데이터 프레임(CAN 2.0B)에서 데이터 필드를 제외한 필드들의 총 비트 수이고, 8*D는 데이터의 길이의 총 비트 수이다. 그리고 (55+8*D)/5는 데이터 프레임이 가질 수 있는 최대 스터프(stuff) 비트의 크기를 나타낸 것이다. 여기서 τbit는 1비트를 전송하는데 걸리는 시간으로서 전송속도의 역수이다. 전송속도는 500k bps 이므로 임으로 역수인 2㎲가 되고, 데이터의 길이를 8 byte로 잡았을 때 한 메시지가 버스 라인으로 나오는데 걸리는 시간은 약 310㎲가 된다. 즉, 한 메시지가 전송될 때 최대 310㎲가 걸리게 되는 것과 같다.Here, 67 is the total number of bits of the fields excluding the data field in the extended data frame (CAN 2.0B), and 8 * D is the total number of bits of the length of the data. And (55 + 8 * D) / 5 represents the maximum stuff bit size that a data frame can have. Where τbit is the time taken to transmit 1 bit and is the inverse of the transmission rate. Since the transmission speed is 500k bps, the inverse number is 2㎲, and when the length of data is 8 bytes, it takes about 310㎲ for a message to come out on the bus line. That is, it takes up to 310 ms when a message is sent.

메시지의 전송시간를 계산하였다면 전송된 순서를 알 수 있다. 수학식 2는 메시지의 전송된 순서를 계산하는 식이다.Once you have calculated the transmission time of the message, you know the order in which it was sent. Equation 2 calculates the order in which the messages are transmitted.

Figure 112009060158812-PAT00002
Figure 112009060158812-PAT00002

여기서, TO는 전송된 순서이고, RT는 실제 전송지연이다. PT는 각 MCU에서 고정적으로 메시지를 보내기 위한 처리시간으로 고정된 상수이다. C는 한 개의 메시지가 나오는 최대 시간으로 수학식 1과 같이 계산된다. 순서를 나타내는 값이기 때문에 소수점자리는 무시하기 위해 round[x]는 8비트 값을 반환해준다. Here, TO is the order of transmission and RT is the actual transmission delay. PT is a constant that is a fixed processing time for sending a message in each MCU. C is calculated as shown in Equation 1 as the maximum time of one message. Round [x] returns an 8-bit value to ignore the decimal places because it is an ordered value.

데드라인이 몇 번째 순서에 전송되어야 넘는지 확인하기 위해서 수학식 3과 같이 계산할 수 있다.In order to check in which order the deadline must be transmitted, it can be calculated as in Equation 3.

Figure 112009060158812-PAT00003
Figure 112009060158812-PAT00003

여기서, MO는 데드라인 이후에 몇 번째 순서인가를 나타내고, MT는 데드라인 시간이고, PT는 각 MCU에서 고정적으로 메시지를 보내기 위한 처리시간으로 고정된 상수이다. C는 한 개의 메시지가 나오는 최대 시간으로 수학식 1과 같이 계산된다. 순서를 나타내는 값이기 때문에 소수점자리는 무시하기 위해 round[x]는 8비트 값을 반환해준다.Here, MO indicates the order of the deadline after the deadline, MT is the deadline time, PT is a constant fixed as the processing time for sending a message from each MCU. C is calculated as shown in Equation 1 as the maximum time of one message. Round [x] returns an 8-bit value to ignore the decimal places because it is an ordered value.

다음으로는 체인징 영역 (changing zone)에서의 회차(weight)를 대입하는 방법에 대한 것으로 수학식 4와 같이 표현된다.Next, a method of substituting a weight in a changing zone is represented by Equation 4.

Next weight = Present weight - (TO-MO)Next weight = Present weight-(TO-MO)

여기서, 전송된 순서에서 데드라인을 넘은 순서만큼 감소시켜 현재 ID의 체인징 영역 (changing zone)부분의 회차(weight)에 대입한다.In this case, the transmission order is reduced by the order of crossing the deadline, and substituted into the weight of the changing zone of the current ID.

도 4는 본 발명에 따른 ID 할당 방법의 진행과정에서의 ID 변환 알고리즘을 나타낸 흐름도이다. ID 변환 알고리즘은 각 메시지의 주기에 따라 전송된 후 동작한다. 4 is a flowchart illustrating an ID conversion algorithm in the process of ID allocation method according to the present invention. The ID conversion algorithm operates after being transmitted according to the period of each message.

현재 ID의 체인징 영역 값(count, weight)을 읽어들인다(S401).The changing area value (count, weight) of the current ID is read (S401).

메시지의 전송지연이 데드라인 이상의 값이면(S402), 현재 순서와 데드라인의 순서를 계산하고 (S403), 각 ID의 체인징 영역 (changing zone) 부분의 데드라인을 넘어간 횟수(count)를 1만큼 감소시키고 회차(weight)는 현재 순서에서 데드라인 순서를 감한 값으로 변환한다. 체인징 영역 (changing zone) 부분의 데드라인을 기준으로 몇 번째 전송(weight)되었는지 확인하는 부분은 위의 <식 4>와 같이 대입한다(S404).If the transmission delay of the message is greater than or equal to the deadline (S402), the current order and the order of the deadline are calculated (S403), and the number of times beyond the deadline of the changing zone portion of each ID is counted by one. Decrease and weight convert the deadline order from the current order to the subtracted value. The part that checks the number of weights based on the deadline of the changing zone part is substituted as shown in Equation 4 above (S404).

전송지연이 데드라인을 넘지 않는 경우는, 각 ID의 체인징 영역(changing zone) 부분의 초기값을 유지하기 위해 회수(count)는 초기 설정했던 값을 대입하고, 회차(weight)는 하나씩 증가시킨다.If the transmission delay does not exceed the deadline, the count substitutes the initially set value and the weight is increased by one in order to maintain the initial value of the changing zone portion of each ID.

회수가 초기화되었는지 확인하고(S406), 초기화되어 있지 않은 경우에는 초 기화를 수행한다(S407).Check whether the number of times is initialized (S406), if not initialized is performed (S407).

회차(weight)가 초기 회차(initial weight) 값보다 작은지 판단하고 (S408), 작은 값이면 회차 값(weight)을 증가시킨다(S409).It is determined whether the weight is smaller than the initial weight value (S408), and if it is a small value, the weight value is increased (S409).

이와 같은 알고리즘의 수행을 거친 전송 프레임의 ID 메시지를 체인징 영역에 기록한다(S405).The ID message of the transmission frame, which has undergone such an algorithm, is recorded in the changing area (S405).

도 5는 이러한 알고리즘의 동작의 실시 예를 나타낸 예시도이다. 알고리즘은 ID의 우선순위에 따라 가상의 큐(queue)처럼 전송순서에 따라 메시지의 우선순위에 따라 전송이 된다. 5 is an exemplary view showing an embodiment of the operation of such an algorithm. The algorithm is transmitted according to the priority of the message in the order of transmission, like a virtual queue according to the priority of the ID.

도 5와 같이 각 노드마다 하나의 메시지를 동시에 보내고, 메시지는 동일한 데드라인라고 가정한다. 하드 리얼타임(hard real-time)메시지 2개(unique ID: 1, 2)와 소프트 리얼타임(soft real-time) 메시지 4개(unique ID 11, 12, 21, 22)를 전송한다.As shown in FIG. 5, one message is simultaneously transmitted to each node, and the message is assumed to be the same deadline. Send two hard real-time messages (unique ID: 1, 2) and four soft real-time messages (unique ID 11, 12, 21, 22).

첫 번째 사이클에서는 중재자 초기 ID 설정에 unique ID의 우선순위에 따라 ID 1, 2, 11, 12, 21, 22 순서로 전송된다. ID 21, ID 22 메시지의 전송지연이 데드라인을 초과하였으므로 ID 21, 22 메시지는 회수(count)에서 -1이 더해지고 데드라인을 기준으로 넘은 순서가 ID 21은 첫 번째로 -1이 되고, ID 22는 두 번째로 -2가 된다. In the first cycle, the IDs 1, 2, 11, 12, 21, and 22 are transmitted in the order of the moderator initial ID according to the priority of the unique ID. Since the delay of sending ID 21, ID 22 message exceeds the deadline, ID 21, 22 message is added with -1 in the count, and ID 21 is the first -1 in the order of deadline. ID 22 is -2 the second time.

두 번째 사이클에서는 알고리즘에 의해 변경된 회수(count)와 회차(weight)에 의해 하드 리얼타임(hard real-time) 메시지인 ID 1, 2은 앞쪽으로 순서가 정해 지고, 소프트 리얼타임(soft real-time) 메시지 중에서 ID가 가장 낮게 변경된 ID 22 메시지가 세 번째, ID 21이 네 번째에 오게 된다. In the second cycle, the hard real-time messages ID 1 and 2 are ordered forward by the count and weight changed by the algorithm, and soft real-time. ) The ID 22 message with the lowest ID among the messages is third, and ID 21 is fourth.

이러한 동작 사이클(cycle)이 계속 진행되면 8 사이클(cycle)마다 처음의 우선 순위와 같은 형태로 메시지가 나열되게 된다.If this operation cycle continues, the messages are listed in the same form as the initial priority every eight cycles.

전술한 바에 따르면, 각 노드에서 발생하는 메시지의 정확한 우선순위가 정해져서 전송 지연 시간을 줄 일수 있고, 각 메시지의 데드라인만 정해주므로 네트워크의 변동에 따라 시간 축을 바꿀 필요가 없다. 또한, 타이머를 사용하지 않고 CAN의 타임-스탬프(time-stamp) 기능을 사용하므로서 시스템에 부하가 걸리지 않아 시스템이 다른 동작을 할 수 있게 된다.As described above, the exact priorities of the messages generated in each node can be determined to reduce the transmission delay time, and since only the deadline of each message is determined, there is no need to change the time axis as the network changes. In addition, by using the time-stamp function of CAN without using a timer, the system is not overloaded, allowing the system to perform other operations.

이상, 본 발명의 실시예에 대하여 도시하고 설명하였지만, 본 발명은 상술한 특정의 실시예에 한정되지 아니하며, 청구범위에서 청구하는 본 발명의 요지를 벗어남이 없이 당해 발명이 속하는 기술분야에서 통상의 지식을 가진자에 의해 다양한 변형실시가 가능한 것은 물론이고, 이러한 변형 실시예들은 본 발명의 기술적 사상이나 전망으로부터 개별적으로 이해되어져서는 안될 것이다.As mentioned above, although embodiment of this invention was shown and demonstrated, this invention is not limited to the specific embodiment mentioned above, Comprising: It is common in the art to which this invention pertains without deviating from the summary of this invention claimed in the Claim. Various modifications can be made by those skilled in the art, and these modifications should not be individually understood from the technical spirit or the scope of the present invention.

도 1은 CAN 네트워크 시스템의 구성을 개략적으로 나타낸 예시도이다.1 is an exemplary view schematically showing a configuration of a CAN network system.

도 2는 버스 트래픽과 평균 전송 지연시간과의 관계를 나타낸 그래프이다.2 is a graph showing the relationship between bus traffic and average transmission delay time.

도 3은 ID의 기능적 영역을 나타낸 예시도이다.3 is an exemplary diagram illustrating a functional area of an ID.

도 4는 본 발명에 따른 ID 변환 알고리즘의 동작 순서를 나타낸 흐름도이다.4 is a flowchart illustrating an operation procedure of an ID conversion algorithm according to the present invention.

도 5는 본 발명에 따른 ID 변환 알고리즘의 동작의 실시 예를 나타낸 예시도이다. 5 is an exemplary view showing an embodiment of the operation of the ID conversion algorithm according to the present invention.

Claims (6)

메시지의 전송 시간을 모니터링하여 메시지의 전송 지연을 측정하는 단계; 및Monitoring a transmission time of the message to measure a transmission delay of the message; And 데드라인 시간을 기준으로 시스템에서 발생하는 메시지의 우선 순위를 할당하는 단계를 포함하는 CAN 기반 시스템에서의 ID 동적 할당 방법.A method for dynamically assigning IDs in a CAN-based system comprising assigning priorities of messages occurring in the system based on deadline time. 청구항 1에 있어서, The method according to claim 1, 상기 전송 지연 측정 단계는, The transmission delay measuring step, CAN 타임-스탬프(time-stamp) 기능을 이용하여 버퍼에 메시지가 저장되는 순간부터 CAN 버스 상으로 전송된 메시지의 EOF(End of File)가 나타나는 시간까지의 시간을 이용하여 메시지의 전송 지연을 계산하는 것을 특징으로 하는 CAN 기반 시스템에서의 ID 동적 할당 방법.Using the CAN time-stamp function, the transmission delay of a message is calculated using the time from when the message is stored in the buffer until the end of file (EOF) of the message sent on the CAN bus. Dynamic ID allocation method in a CAN-based system, characterized in that. 청구항 1에 있어서, The method according to claim 1, 29비트의 ID를 갖는 CAN 2.0 B의 표준을 따르는 것을 특징으로 하는 CAN 기반 시스템에서의 ID 동적 할당 방법.A method for dynamically assigning IDs in a CAN-based system, characterized by the standard of CAN 2.0 B with an ID of 29 bits. 청구항 3에 있어서, The method of claim 3, 데이터 프레임을 29비트의 ID를 갖는 중재자 필드를 세 영역으로 나누는 것을 특징으로 하는 CAN 기반 시스템에서의 ID 동적 할당 방법.An ID dynamic allocation method in a CAN-based system, characterized by dividing a data frame into three regions of an arbiter field having an ID of 29 bits. 청구항 4에 있어서, The method according to claim 4, 상기 중재자 필드는,The moderator field is 서로 다른 메시지 종류의 클래스를 구분하기 위한 2 bit의 메시지 타입 영역(grouping zone);A 2 bit message type zone for distinguishing classes of different message types; 전송 지연이 데드라인을 초과한 횟수(count)부분과 데드라인을 기준으로 하는 회차(Weight) 부분으로 이루어진 체인징 영역(changing zone); 및A changing zone comprising a count portion of which the transmission delay exceeds the deadline and a weight portion based on the deadline; And 네트워크 설계에서 부여된 초기 ID를 적용하는 영역으로 나누어지는 것을 특징으로 하는 CAN 기반 시스템에서의 ID 동적 할당 방법.ID dynamic allocation method in a CAN-based system, characterized in that divided into the area to apply the initial ID given in the network design. 청구항 5에 있어서, The method according to claim 5, 메시지의 전송지연이 데드라인 이상의 값이면 각 ID의 체인징 영역(anging zone)의 횟수(count)를 1만큼 감소시키고, 전송된 순서에서 데드라인을 넘은 순서만큼 감소시켜 현재의 체인징 영역(changing zone)의 회차(weight)에 대입하고,If the transmission delay of the message is greater than or equal to the deadline, the number of changing zones of each ID is reduced by 1, and the current switching zone is decreased by the order of crossing the deadline in the order of transmission. Is substituted into the weight of 전송지연이 데드라인을 넘지 않는 경우는 각 ID의 체인징 영역의 초기값을 유지하기 위해 회수(count)는 초기 설정했던 값을 대입하고, 회차(weight)는 하나 씩 증가시키는 것을 특징으로 하는 CAN 기반 시스템에서의 ID 동적 할당 방법.If the transmission delay does not exceed the deadline, the CAN-based method is characterized in that the count is substituted for the initial value and the weight is increased by one to maintain the initial value of the changing area of each ID. How to assign IDs dynamically in the system.
KR1020090092878A 2009-09-30 2009-09-30 Method for id transformation in can-based network KR20110035247A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020090092878A KR20110035247A (en) 2009-09-30 2009-09-30 Method for id transformation in can-based network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020090092878A KR20110035247A (en) 2009-09-30 2009-09-30 Method for id transformation in can-based network

Publications (1)

Publication Number Publication Date
KR20110035247A true KR20110035247A (en) 2011-04-06

Family

ID=44043616

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020090092878A KR20110035247A (en) 2009-09-30 2009-09-30 Method for id transformation in can-based network

Country Status (1)

Country Link
KR (1) KR20110035247A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101505369B1 (en) * 2014-04-15 2015-03-24 부산대학교 산학협력단 Control area network method for sensor measuring
KR101519793B1 (en) * 2014-06-24 2015-05-12 현대자동차주식회사 Network system for vehicle and data transmission method of a different kind communication controller in the same system
US9436261B2 (en) 2013-06-05 2016-09-06 Samsung Sdi Co., Ltd. Battery management system, and method of managing the same
KR101714770B1 (en) * 2015-12-14 2017-03-09 현대오트론 주식회사 ID Dynamic Allocating Method for CAN Communication System, and CAN Communication System
WO2022080520A1 (en) * 2020-10-14 2022-04-21 엘지전자 주식회사 Method for transmitting message at high rate by vehicle
US11831464B2 (en) 2020-06-29 2023-11-28 Lg Energy Solution, Ltd. Network routing device and method

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9436261B2 (en) 2013-06-05 2016-09-06 Samsung Sdi Co., Ltd. Battery management system, and method of managing the same
KR101505369B1 (en) * 2014-04-15 2015-03-24 부산대학교 산학협력단 Control area network method for sensor measuring
KR101519793B1 (en) * 2014-06-24 2015-05-12 현대자동차주식회사 Network system for vehicle and data transmission method of a different kind communication controller in the same system
US10051091B2 (en) 2014-06-24 2018-08-14 Hyundai Motor Company Network system for vehicle and data transmission method of heterogeneous communication controllers in the same system
KR101714770B1 (en) * 2015-12-14 2017-03-09 현대오트론 주식회사 ID Dynamic Allocating Method for CAN Communication System, and CAN Communication System
US11831464B2 (en) 2020-06-29 2023-11-28 Lg Energy Solution, Ltd. Network routing device and method
WO2022080520A1 (en) * 2020-10-14 2022-04-21 엘지전자 주식회사 Method for transmitting message at high rate by vehicle

Similar Documents

Publication Publication Date Title
KR20110035247A (en) Method for id transformation in can-based network
JP6500875B2 (en) In-vehicle network system and communication control method in in-vehicle network system
US10668876B2 (en) In-vehicle network system
CN111565139B (en) Data processing and storage system and method in a vehicle of an on-board communication network architecture
US10153825B2 (en) Vehicle-mounted control device
KR20190006922A (en) Method for transmitting data via a serial communication bus, correspondingly designed bus interface and correspondingly designed computer program
CN112019440B (en) CAN bus multicast method based on identifier multiplexing
KR20200136751A (en) Apparatus for communicating diagnosis of a vehicle, system having the same and method thereof
CN112543153A (en) Message forwarding method, device, system, equipment and storage medium
JP4909350B2 (en) Message transmission method
KR20070117264A (en) Flexray-can gateway structure and message mapping method
US11409761B2 (en) Vehicle data management device, vehicle data management system, and method of managing vehicle data
CA2490561C (en) Bus system for an aircraft
JP2006340099A (en) Gateway unit
CN108076680B (en) Bus system, member station of a bus system and method for configuring a static bus system for dynamic communication
Kim et al. Performance evaluation of node-mapping-based flexray-can gateway for in-vehicle networking system
Park et al. Optimal priority assignment for scheduling mixed can and can-fd frames
KR100583811B1 (en) The can message identifier allocation method and the can message transfer arbitration method for the humanoid robot
CN112787901A (en) Network hub, forwarding method and vehicle-mounted network system
Elżbieta Communication in Automotive Networks Illustrated with an Example of Vehicle Stability Program: Part I-Control Area Network
JP7151930B2 (en) RELAY DEVICE, COMMUNICATION NETWORK SYSTEM AND COMMUNICATION CONTROL METHOD
KR20120022194A (en) Method for mediating message with differed typed protocol
KR101439489B1 (en) Ethernet address allocation method and apparatus in ethernet network for vehicle
KR101514398B1 (en) Gateway in-vehicle based on virtual bus concepet and message transmission method thereof
KR100911336B1 (en) Message Converting Apparatus Between Flexray and CAN Communication

Legal Events

Date Code Title Description
WITN Application deemed withdrawn, e.g. because no request for examination was filed or no examination fee was paid