[go: up one dir, main page]

CN102882753A - Controller area network (CAN) message long delay processing method - Google Patents

Controller area network (CAN) message long delay processing method Download PDF

Info

Publication number
CN102882753A
CN102882753A CN2012102011603A CN201210201160A CN102882753A CN 102882753 A CN102882753 A CN 102882753A CN 2012102011603 A CN2012102011603 A CN 2012102011603A CN 201210201160 A CN201210201160 A CN 201210201160A CN 102882753 A CN102882753 A CN 102882753A
Authority
CN
China
Prior art keywords
message
busy
processing method
delay
delay processing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN2012102011603A
Other languages
Chinese (zh)
Inventor
张方伟
丁武俊
陈文强
潘之杰
赵福全
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Geely Holding Group Co Ltd
Zhejiang Geely Automobile Research Institute Co Ltd
Zhejiang Geely Automobile Research Institute Co Ltd Hangzhou Branch
Original Assignee
Zhejiang Geely Holding Group Co Ltd
Zhejiang Geely Automobile Research Institute Co Ltd
Zhejiang Geely Automobile Research Institute Co Ltd Hangzhou Branch
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 Zhejiang Geely Holding Group Co Ltd, Zhejiang Geely Automobile Research Institute Co Ltd, Zhejiang Geely Automobile Research Institute Co Ltd Hangzhou Branch filed Critical Zhejiang Geely Holding Group Co Ltd
Priority to CN2012102011603A priority Critical patent/CN102882753A/en
Publication of CN102882753A publication Critical patent/CN102882753A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Small-Scale Networks (AREA)

Abstract

本发明公开了一种CAN消息长延时处理方法,目的在于解决现有技术所存在的优先级低的消息发送困难影响实时性以及人为消减消息数量影响车辆控制功能全面发挥等技术问题,提供一种CAN消息长延时处理方法,它能够当网络繁忙时,在延迟时间达到所发送消息可以承受的最大延迟时,自动降低消息ID,将该消息的优先级提高后发送出去,提高发送消息的实时性,该方法包括以下步骤:启动消息发送;开始计时;判断消息类型;如果是周期性消息,在规定延时周期内没成功发送,则降低消息ID重新发送;如果是事件性消息,在规定时长内没成功发送,则降低消息ID重新发送。

Figure 201210201160

The invention discloses a long-delay processing method for CAN messages, aiming to solve the technical problems existing in the prior art that low-priority message sending difficulties affect real-time performance and artificially reducing the number of messages affects the full play of vehicle control functions, etc., and provides a method A CAN message long-delay processing method, which can automatically reduce the message ID when the delay time reaches the maximum delay that the sent message can bear when the network is busy, and send the message with a higher priority, improving the efficiency of sending the message Real-time, the method includes the following steps: start message sending; start timing; judge the message type; if it is a periodic message, if it is not successfully sent within the prescribed delay period, then reduce the message ID to resend; if it is an event message, If the message is not successfully sent within the specified time, the message ID will be lowered and resent.

Figure 201210201160

Description

一种CAN消息长延时处理方法A CAN message long-delay processing method

技术领域 technical field

本发明涉及汽车电子控制技术领域,尤其涉及一种对汽车CAN总线中消息发生长延时的处理方法。 The invention relates to the technical field of automobile electronic control, in particular to a method for processing long-delayed messages in the automobile CAN bus.

背景技术 Background technique

在CAN总线中,一般是事先确定好各消息的ID。CAN总线的优先级策略是根据ID值的大小来决定发送消息的优先级,ID值越小优先级越高。这样就会导致在网络繁忙的时候,会出现一些ID优先级低的信号传输时延逐渐增加,以至于长时间发送不出去,影响控制功能的实时性。 In the CAN bus, the ID of each message is generally determined in advance. The priority strategy of the CAN bus is to determine the priority of sending messages according to the size of the ID value, and the smaller the ID value, the higher the priority. This will lead to a gradual increase in the transmission delay of some signals with low ID priority when the network is busy, so that they cannot be sent out for a long time, affecting the real-time performance of the control function.

公开日为2011年04月27日、公开号为CN102035707A的专利文献公开了一种的技术方案:车载CAN网络的通信实时性保障方法,首先确定基准周期内可以发送的最大消息数S,并判断是否大于需要发送的周期型消息个数S1与事件型消息预留个数S2的和,如果不大于,则优化电子控制单元发送周期消息的数量,直至满足大于条件,如果大于,则根据标志符ID将周期型消息分配到基准周期的时隙中,并为事件型消息做预留,生成消息调度表;最后选取一个电子控制单元作为CAN网络时序基准节点,以基准周期广播基准周期起始消息,各电子控制单元接收到基准周期起始消息后,依据消息调度表,发送周期性消息。从时序上对现有CAN总线的使用进行保障,使各个电子控制单元发送的消息能实时地发送出去,这样,车载CAN网络的通信实时性就得到了保障。但是该方案的不足之处是,在需要传输的消息数量比较多,超出其最大消息数S就得进行消息数量消减,这在现今车载网络节点不断增多、消息数量大的环境下,实施起来会非常困难,而且由于消息数量受到限制影响车辆控制功能全面发挥。 The patent document whose publication date is April 27, 2011 and whose publication number is CN102035707A discloses a technical solution: a method for ensuring real-time communication of vehicle-mounted CAN networks. Is it greater than the sum of the number S1 of periodic messages to be sent and the reserved number S2 of event messages? If not, optimize the number of periodic messages sent by the electronic control unit until the greater than condition is satisfied. If greater, then according to the identifier ID assigns periodical messages to the time slots of the reference period, and reserves them for event messages to generate a message schedule; finally selects an electronic control unit as the timing reference node of the CAN network, and broadcasts the start message of the reference period in the reference period , each electronic control unit sends a periodic message according to the message scheduling table after receiving the reference period start message. The use of the existing CAN bus is guaranteed from the time sequence, so that the messages sent by each electronic control unit can be sent out in real time, so that the real-time communication of the vehicle CAN network is guaranteed. However, the disadvantage of this solution is that when the number of messages to be transmitted is relatively large, the number of messages must be reduced if the maximum number of messages S is exceeded. This is difficult to implement in today's environment where the number of vehicle network nodes is increasing and the number of messages is large. It is very difficult, and because the number of messages is limited, it affects the full performance of vehicle control functions.

发明内容 Contents of the invention

本发明主要是解决现有技术所存在的优先级低的消息发送困难影响实时性以及人为消减消息数量影响车辆控制功能全面发挥等技术问题,提供一种CAN消息长延时处理方法,它能够当网络繁忙时,在延迟时间达到所发送消息可以承受的最大延迟时,自动降低消息ID,将该消息的优先级提高后发送出去,提高发送消息的实时性,该方案实施方便,成本低,使用效果好。 The present invention mainly solves the technical problems existing in the prior art that low-priority message sending difficulties affect real-time performance and artificially reducing the number of messages affects the full play of vehicle control functions, and provides a long-delay processing method for CAN messages, which can be used as When the network is busy, when the delay time reaches the maximum delay that the sent message can bear, the message ID will be automatically reduced, and the priority of the message will be increased before sending out to improve the real-time performance of sending messages. This solution is easy to implement, low in cost, and easy to use The effect is good.

本发明针对现有技术问题主要是通过下述技术方案得以解决的,一种CAN消息长延时处理方法,是一种CAN网络节点对长延时消息进行特别处理使这类消息在网络繁忙时也能够按规定时间发送出去的方法,该方法包括以下步骤: The present invention mainly solves the problems in the prior art through the following technical solutions, a CAN message long-delay processing method, which is a CAN network node that performs special processing on long-delay messages so that this type of message is processed when the network is busy. A method that can also be sent out according to a specified time, the method includes the following steps:

(A)启动消息发送; (A) initiate message sending;

(B) 开始计时; (B) start the timer;

(C)判断消息类型; (C) Determine the message type;

(D)如果是周期性消息,在规定延时周期内没成功发送,则降低消息ID重新发送; (D) If it is a periodic message, if it is not successfully sent within the specified delay period, the message ID will be lowered and resent;

(E) 如果是事件性消息,在规定时长内没成功发送,则降低消息ID重新发送。 (E) If it is an event message, if it is not successfully sent within the specified time, the message ID will be lowered and resent.

由于消息优先级与ID捆绑,优先级高的消息具有较小的ID。 Since message priority is tied to ID, messages with higher priority have smaller IDs.

消息的ID是消息的标识符,包含有消息优先级、节点地址等信息。 The ID of the message is the identifier of the message, including information such as message priority and node address.

由于在网络繁忙时,CAN总线要传输大量消息,优先级高的消息被优先传送,使得优先级低的消息被推迟传送。该方法通过节点在发送消息后计时,自动计算CAN消息由于网络繁忙而导致的延迟时间,当这个延迟时间达到所发送消息可以承受的最大延迟时(周期性消息的规定延时周期、事件性消息的规定时长),节点自动减小消息ID,使该消息的优先级提高后发送出去。 Because when the network is busy, the CAN bus will transmit a large number of messages, the messages with high priority will be sent first, so that the messages with low priority will be delayed. This method automatically calculates the delay time of the CAN message due to the busy network through the node timing after sending the message. When the delay time reaches the maximum delay that the sent message can bear (the specified delay period of the periodic message, event message specified duration), the node automatically reduces the message ID, so that the priority of the message is increased and sent out.

作为优选,为每个消息配置一常规ID,一繁忙ID,在网络繁忙导致延时达到规定时延后,消息使用繁忙ID发送。繁忙ID的发送优先级高,使用繁忙ID可以迅速占用CAN总线将消息发送出去。在网络不繁忙时,使用常规ID发送该消息。 Preferably, a regular ID and a busy ID are configured for each message, and the message is sent using the busy ID after the delay reaches a specified time delay due to the busy network. The sending priority of the busy ID is high, and the busy ID can quickly occupy the CAN bus to send the message. The regular ID is used to send the message when the network is not busy.

作为优选,消息在使用繁忙ID发送结束后恢复使用常规ID。恢复使用常规ID以适应CAN网络不繁忙时的设计需求,如果CAN网络继续繁忙,则通过计时判断延时,在再次达到规定延迟后再次使用繁忙ID发送,如此循环。 Advantageously, the message resumes using the regular ID after the message has been sent using the busy ID. Restore the use of regular IDs to meet the design requirements when the CAN network is not busy. If the CAN network continues to be busy, judge the delay by timing, and use the busy ID to send again after the specified delay is reached again, and so on.

作为优选,规定延时周期是3个常规发送周期,规定时长是200毫秒。对于周期性消息,规定延时周期设定为常规发送周期的3倍、事件性消息规定时长为200毫秒,在实践中这样的设置能够较好地满足CAN总线的负载率要求和低优先级消息的较好实时性。 Preferably, the prescribed delay period is 3 regular sending periods, and the prescribed duration is 200 milliseconds. For periodic messages, the specified delay period is set to 3 times the normal sending period, and the specified duration of event messages is 200 milliseconds. In practice, such settings can better meet the load rate requirements of the CAN bus and low-priority messages. better real-time performance.

作为优选,消息发送失败时采用降低后的消息ID重新发送。将发送失败的消息的ID标识降低,提高其优先级后再次发送出去。 Preferably, when the message fails to be sent, the reduced message ID is used to resend. Reduce the ID of the message that failed to be sent, increase its priority and send it again.

作为优选,降低后的消息ID是所述繁忙ID。为方便操作,将发送失败的消息直接采用所述繁忙ID发送出去。 Preferably, the reduced message ID is said busy ID. For the convenience of operation, the message that fails to be sent is sent directly using the busy ID.

本发明带来的有益效果是,它能够当网络繁忙时,在延迟时间达到所发送消息可以承受的最大延迟时,自动降低消息ID,将该消息的优先级提高后发送出去,提高发送消息的实时性,方案实施方便,成本低,使用效果好。 The beneficial effect brought by the present invention is that when the network is busy, when the delay time reaches the maximum delay that the sent message can withstand, the message ID will be automatically reduced, and the priority of the message will be sent out, improving the efficiency of sending the message. Real-time, easy implementation of the scheme, low cost and good use effect.

附图说明 Description of drawings

图1是本发明的一种消息处理流程图。 Fig. 1 is a flow chart of message processing in the present invention.

具体实施方式 Detailed ways

下面通过实施例,并结合附图,对本发明的技术方案作进一步具体说明。 The technical solution of the present invention will be further specifically described below through the embodiments and in conjunction with the accompanying drawings.

实施例: 如图1所示,本发明是一种CAN消息长延时处理方法,该方法包括以下步骤: Embodiment: As shown in Figure 1, the present invention is a kind of CAN message long delay processing method, and this method comprises the following steps:

步骤101,为网络节点中每个消息配置一个常规ID和一个繁忙ID,在网络不繁忙时,消息使用常规ID发送,在网络繁忙出现消息发送延时并超过规定延时的时候使用繁忙ID发送,繁忙ID标识的优先级高于常规ID; Step 101, configure a regular ID and a busy ID for each message in the network node. When the network is not busy, the message is sent using the regular ID, and when the network is busy and the delay in sending the message exceeds the specified delay, the message is sent using the busy ID. , the priority of the busy ID is higher than that of the regular ID;

步骤102,启动消息发送,发送时使用常规ID发送; Step 102, start message sending, and use the regular ID to send when sending;

步骤103,消息发送后,节点对该消息启动计时器开始计时; Step 103, after the message is sent, the node starts a timer for the message and starts timing;

步骤104,对该发送消息进行判断,如果为周期性消息则转步骤106,如果为事件性消息则转步骤105; Step 104, judge the sent message, if it is a periodic message then go to step 106, if it is an event message then go to step 105;

步骤105,事件性消息的延迟时间等于或大于200毫秒还没成功发送出去,即达到规定时长的时候还没成功发送出去,则转步骤107; Step 105, if the delay time of the event message is equal to or greater than 200 milliseconds and has not been successfully sent out, that is, it has not been successfully sent out when the specified duration is reached, then go to step 107;

步骤106,周期性消息达到3个常规发送周期还没成功发送出去,即达到规定延时周期还没成功发送出去,则转步骤107; Step 106, if the periodic message has not been successfully sent out after reaching 3 regular sending periods, that is, it has not been successfully sent out after reaching the specified delay period, then go to step 107;

步骤107,节点将该消息ID自动改为繁忙ID后,使该消息能够顺利占有CAN网络,重新发送出去; Step 107, after the node automatically changes the message ID to a busy ID, the message can successfully occupy the CAN network and resend it;

步骤108,使用繁忙ID重新发送的消息,发送结束后将该消息的ID恢复为常规ID; Step 108, use the busy ID to resend the message, and restore the ID of the message to the regular ID after sending;

步骤109,检查是否有发送失败的消息,将发送失败的消息重复步骤107,节点把该消息ID自动改为繁忙ID后,使该消息能够顺利占有CAN网络,重新发送出去,之后转步骤108,将该消息的ID恢复为常规ID。 Step 109, check whether there is a message that failed to send, and repeat step 107 for the message that failed to send, after the node automatically changes the message ID to a busy ID, so that the message can successfully occupy the CAN network, resend, and then turn to step 108, Revert the message's ID back to the regular ID.

  the

所以本发明具有能够当网络繁忙时,所发送消息的最大延迟时间达到规定值的时候,自动将该消息ID更改为所述繁忙ID后发送出去,对发送失败的消息同样使用所述繁忙ID重新发送出去,提高发送消息的实时性,方案实施方便,成本低,使用效果好等特征。 Therefore, the present invention has the ability to automatically change the message ID to the busy ID when the maximum delay time of the sent message reaches a specified value when the network is busy, and then use the busy ID to send the message that failed to send. Send out, improve the real-time performance of sending messages, the solution is easy to implement, low cost, good use effect and other characteristics.

Claims (6)

1. a CAN message long delay processing method is that a kind of CAN network node is processed especially to long delay message, and the method that this class message also can be sent when network is busy in required time is characterized in that the method may further comprise the steps:
(A) initiation message sends;
(B) beginning timing;
(C) judge type of message;
(D) if periodic message does not have successfully to send in the regulation delay cycle, then reduce message id and resend;
(E) if event message does not have successfully to send in the regulation duration, then reduce message id and resend.
2. described a kind of CAN message long delay processing method according to claim 1 is characterized in that: be each message arrangement one conventional ID, a busy ID delays when causing time-delay to reach regulation in that network is busy, and message uses busy ID to send.
3. described a kind of CAN message long delay processing method according to claim 2 is characterized in that: described message recovers to use described conventional ID after using busy ID to send to finish.
4. described a kind of CAN message long delay processing method according to claim 1, it is characterized in that: described regulation delay cycle is 3 conventional transmission cycles, and described regulation duration is 200 milliseconds.
5. described a kind of CAN message long delay processing method according to claim 1 and 2 is characterized in that: adopt the message id after reducing to resend when described message sends unsuccessfully.
6. described a kind of CAN message long delay processing method according to claim 5, it is characterized in that: the message id after the described reduction is described busy ID.
CN2012102011603A 2012-06-15 2012-06-15 Controller area network (CAN) message long delay processing method Pending CN102882753A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2012102011603A CN102882753A (en) 2012-06-15 2012-06-15 Controller area network (CAN) message long delay processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2012102011603A CN102882753A (en) 2012-06-15 2012-06-15 Controller area network (CAN) message long delay processing method

Publications (1)

Publication Number Publication Date
CN102882753A true CN102882753A (en) 2013-01-16

Family

ID=47483907

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2012102011603A Pending CN102882753A (en) 2012-06-15 2012-06-15 Controller area network (CAN) message long delay processing method

Country Status (1)

Country Link
CN (1) CN102882753A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107005449A (en) * 2014-11-20 2017-08-01 国立大学法人名古屋大学 Communication system and communicator
CN108293014A (en) * 2015-10-21 2018-07-17 倍福自动化有限公司 Communication network, its operating method and participant in a communication network
CN111327499A (en) * 2018-12-14 2020-06-23 北京宝沃汽车有限公司 Method and device for sending message and automobile
CN113037846A (en) * 2021-03-17 2021-06-25 成都新希望金融信息有限公司 Data reporting method and device, electronic equipment and computer readable storage medium
WO2021238090A1 (en) * 2020-05-27 2021-12-02 东风柳州汽车有限公司 Adaptive adjustment control method and apparatus, gateway terminal, and storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102340432A (en) * 2010-07-21 2012-02-01 浙江吉利汽车研究院有限公司 A method for distributing standard format identifiers of vehicle-mounted CAN bus

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102340432A (en) * 2010-07-21 2012-02-01 浙江吉利汽车研究院有限公司 A method for distributing standard format identifiers of vehicle-mounted CAN bus

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
刘向明,方建安: "CAN总线网络的实时性研究和改进", 《现代电子技术》, vol. 34, no. 22, 15 November 2011 (2011-11-15), pages 46 - 49 *
李佳,朱元,田光宇: "CAN与TTCAN通信延迟时间的分析", 《清华大学学报(自然科学版)》, vol. 46, no. 2, 28 February 2006 (2006-02-28), pages 261 - 264 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107005449A (en) * 2014-11-20 2017-08-01 国立大学法人名古屋大学 Communication system and communicator
CN107005449B (en) * 2014-11-20 2020-09-04 国立大学法人名古屋大学 Communication system and communication device
CN108293014A (en) * 2015-10-21 2018-07-17 倍福自动化有限公司 Communication network, its operating method and participant in a communication network
US10735219B2 (en) 2015-10-21 2020-08-04 Beckhoff Automation Gmbh System and method for packet transmission in a communications network
CN108293014B (en) * 2015-10-21 2020-12-01 倍福自动化有限公司 Communication network, method of operation thereof and participants in communication network
CN111327499A (en) * 2018-12-14 2020-06-23 北京宝沃汽车有限公司 Method and device for sending message and automobile
WO2021238090A1 (en) * 2020-05-27 2021-12-02 东风柳州汽车有限公司 Adaptive adjustment control method and apparatus, gateway terminal, and storage medium
CN113037846A (en) * 2021-03-17 2021-06-25 成都新希望金融信息有限公司 Data reporting method and device, electronic equipment and computer readable storage medium

Similar Documents

Publication Publication Date Title
CN103109570B (en) Method for parameter configuration and base station, subscriber equipment
JP5946585B2 (en) Discontinuous reception dynamic setting method and terminal
JP5944065B2 (en) Service agent method, modem and terminal
CN102882753A (en) Controller area network (CAN) message long delay processing method
CN106851848B (en) Method and device for parallel data transmission
CN102665270B (en) Method for reducing uplink voice service transmission delay in long term evolution (LTE) system
CN108024320A (en) Transmit method, the network equipment and the terminal device of information
CN103200653A (en) Method and device for discontinuous reception
CN102077624A (en) Method, device and terminal for determining transmission mode
CN102821477A (en) Method and device for regulating scheduling request cycle
JP2020509627A (en) Method for determining discontinuous reception state, terminal device and network device
CN101938414A (en) Method and device for transmitting messages
CN101222775A (en) A method and base station for maintaining uplink synchronization
CN102098113A (en) Method for realizing water sound sensor network MAC (Media Access Control) protocol based on ALOHA and TDMA (Time Division Multiple Access)
WO2018059098A1 (en) Uplink control information sending method and apparatus, and terminal
CN107295687B (en) A kind of downlink control information DCI scheduling control method and device
CN103618658A (en) Automobile FlexRay bus design method based on time fragment minimization
CN114071558A (en) Communication method, device and computer readable storage medium
CN105933964A (en) Parameter configuration method, base station and user equipment
CN103338158A (en) GOOSE message transmission delay jitter suppression method
CN101888018B (en) Electric tilt antenna control device
CN109274564B (en) CAN bus network control method and CAN bus network
CN105472770B (en) A method, device and system for optimizing long air interface connection
CN110048955A (en) Jamming control method, device, computer equipment and storage medium
US10390302B2 (en) Data scheduling method and apparatus

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20130116