Multi-subnet cooperative sleep method and system based on CAN bus

文档序号:1215062 发布日期:2020-09-04 浏览:6次 中文

阅读说明:本技术 一种基于can总线多子网协同睡眠方法及系统 (Multi-subnet cooperative sleep method and system based on CAN bus ) 是由 梁亚丽 黄金山 刘晓祥 张晓光 高家君 陶英轩 荆伟 冯梓轩 马文峰 李英 于 2020-05-15 设计创作,主要内容包括:本发明属于软件技术领域,具体的说是一种应用于对车辆内Autosar网络管理、OSEK网络管理及主从睡眠管理共存情况下的整车协同睡眠处理,保证车辆在IGOFF以后正常通信的基于CAN总线多子网协同睡眠方法及系统。网关作为协同睡眠的主控ECU,通过CAN1口判断ECU1节点是否满足睡眠条件,通过CAN2口判断ECU2是否满足睡眠条件,通过CAN3口直接命令ECU3睡眠。本发明可以在整车各控制器睡眠方式及策略不同的情况下实现协同睡眠,从而保障各控制器零部件的通用性,进而缩短项目开发周期和费用。(The invention belongs to the technical field of software, and particularly relates to a CAN bus-based multi-subnet cooperative sleep method and a system, which are applied to the cooperative sleep processing of a whole vehicle under the coexistence condition of Autosar network management, OSEK network management and master-slave sleep management in the vehicle and ensure the normal communication of the vehicle after IGOFF. The gateway is used as a master control ECU for cooperative sleep, judges whether the ECU1 node meets the sleep condition through a CAN1 port, judges whether the ECU2 meets the sleep condition through a CAN2 port, and directly commands the ECU3 to sleep through a CAN3 port. The invention can realize cooperative sleep under the condition that the sleep modes and strategies of all controllers of the whole vehicle are different, thereby ensuring the universality of parts of all controllers and further shortening the project development period and the cost.)

1. A multi-subnet cooperative sleep method based on a CAN bus is characterized by comprising the following steps:

step one, the ECU1 stops sending the Autosar network management message when the sleep condition meets the requirement, the gateway monitors the Autosar network management message of the ECU1 through the CAN1 port, if the ECU1 stops sending the Autosar network management message, the step two is carried out, otherwise, the step one is continuously carried out;

step two, if the sleep condition of the ECU2 is met, sending an OSEK network management message with a sleep indication, monitoring the OSEK network management message of the ECU2 by the gateway through a CAN2 port, and executing the step three if the gateway monitors that the ECU2 sends the OSEK network management message with the sleep indication bit through the CAN2 port, otherwise, continuously executing the step two;

step three, the gateway CAN1 port stops sending the self Autosar network management message;

step four, the gateway judges the stop time of the Autosar network management message of the CAN1 port, if the stop time reaches 1 second, the step five is entered, otherwise, the step four is continuously executed;

step five, the gateway sends an OSEK network management message with a sleep response to the CAN2 port and sends a sleep signal instruction to the CAN3 port;

step six, the gateway, the ECU1, the ECU2 and the ECU3 enter a sleep state simultaneously, so that the cooperative sleep of the whole vehicle is realized;

and seventhly, after the whole vehicle is in cooperative sleep, if any node of the gateway, the ECU1, the ECU2 and the ECU3 is awakened, the whole vehicle is awakened to carry out normal communication, and the sleep process after the whole vehicle is awakened is the same as the above.

2. The CAN-bus-based multi-subnet cooperative sleep method as claimed in claim 1, wherein the ECU1 employs Autosar network management.

3. The CAN-bus-based multi-subnet cooperative sleep method as claimed in claim 1, wherein the ECU2 employs OSEK network management.

4. The CAN-bus-based multi-subnet cooperative sleep method as claimed in claim 1, wherein the ECU3 employs a master-slave network management using a gateway as a master controller.

5. A CAN bus-based multi-subnet cooperative sleep is characterized by comprising a first node (1-1), a second node (2-1), a third node (2-2) and a fourth node (2-3); the CAN1 port of the first node (1-1) is connected with the second node (2-1) through a CAN line; the CAN2 port of the first node (1-1) is connected with the third node (2-2) through a CAN line; the CAN3 port of the first node (1-1) is connected with the fourth node (2-3) through a CAN line.

6. A CAN-bus based multi-subnet cooperative sleep as claimed in claim 5 wherein the first node (1-1) is a gateway.

7. A CAN-bus based multi-subnet cooperative sleep as claimed in claim 5 wherein the second node (2-1) is ECU 1.

8. A CAN-bus based multi-subnet cooperative sleep as claimed in claim 5 wherein the third node (2-2) is ECU 2.

9. A CAN-bus based multi-subnet cooperative sleep as claimed in claim 5 wherein the fourth node (2-3) is ECU 3.

Technical Field

The invention belongs to the technical field of software, and particularly relates to a CAN bus-based multi-subnet cooperative sleep method and a system, which are applied to the cooperative sleep processing of a whole vehicle under the coexistence condition of Autosar network management, OSEK network management and master-slave sleep management in the vehicle and ensure the normal communication of the vehicle after IGOFF.

Background

The communication of the vehicle is mainly used for meeting the vehicle functions, some functions require the vehicle to still be capable of normally communicating after IGOFF, the network management used at present comprises an Autosar network management mode, an OSEK network management mode and a master-slave sleep management mode, the borrowing and using modes are commonly adopted by various vehicle type controllers for saving cost and reducing development amount, so that the Autosar network management mode, the OSEK network management mode and the master-slave sleep management mode exist in the same vehicle at the same time, and a strategy is needed for cooperating the whole vehicle sleep mode.

In order to realize cooperative sleep, similar design also needs to monitor and analyze the conditions of each subnet and node based on the gateway, but the specific implementation process and strategy may be different. And the current patent condition is inquired, most of the strategies relate to that the whole vehicle is distributed with different network groups according to functions, and a controller among the network groups carries out step-by-step sleep according to the functions.

Disclosure of Invention

The invention provides a method and a system for cooperative sleep under the condition that different network management modes coexist in a vehicle type with a CAN bus as a backbone network, which solve the problem of cooperative sleep of a whole vehicle under the condition that three network management modes, namely an Autosar network management mode, an OSEK network management mode and a master-slave sleep management mode, coexist in a vehicle.

The technical scheme of the invention is described as follows by combining the attached drawings:

a multi-subnet cooperative sleep method based on a CAN bus comprises the following steps:

step one, the ECU1 stops sending the Autosar network management message when the sleep condition meets the requirement, the gateway monitors the Autosar network management message of the ECU1 through the CAN1 port, if the ECU1 stops sending the Autosar network management message, the step two is carried out, otherwise, the step one is continuously carried out;

step two, if the sleep condition of the ECU2 is met, sending an OSEK network management message with a sleep indication, monitoring the OSEK network management message of the ECU2 by the gateway through a CAN2 port, and executing the step three if the gateway monitors that the ECU2 sends the OSEK network management message with the sleep indication bit through the CAN2 port, otherwise, continuously executing the step two;

step three, the gateway CAN1 port stops sending the self Autosar network management message;

step four, the gateway judges the stop time of the Autosar network management message of the CAN1 port, if the stop time reaches 1 second, the step five is entered, otherwise, the step four is continuously executed;

step five, the gateway sends an OSEK network management message with a sleep response to the CAN2 port and sends a sleep signal instruction to the CAN3 port;

step six, the gateway, the ECU1, the ECU2 and the ECU3 enter a sleep state simultaneously, so that the cooperative sleep of the whole vehicle is realized;

and seventhly, after the whole vehicle is in cooperative sleep, if any node of the gateway, the ECU1, the ECU2 and the ECU3 is awakened, the whole vehicle is awakened to carry out normal communication, and the sleep process after the whole vehicle is awakened is the same as the above.

The ECU1 employs Autosar network management.

The ECU2 employs OSEK network management.

The ECU3 employs master-slave network management with a gateway as the master controller.

A CAN bus-based multi-subnet cooperative sleep comprises a first node 1-1, a second node 2-1, a third node 2-2 and a fourth node 2-3; the CAN1 port of the first node 1-1 is connected with the second node 2-1 through a CAN line; the CAN2 port of the first node 1-1 is connected with the third node 2-2 through a CAN line; the CAN3 port of the first node 1-1 is connected to the fourth node 2-3 via a CAN line.

The first node 1-1 is a gateway.

The second node 2-1 is the ECU 1.

The third node 2-2 is the ECU 2.

The fourth node 2-3 is the ECU 3.

The invention has the beneficial effects that:

the invention can realize cooperative sleep under the condition that the sleep modes and strategies of all controllers of the whole vehicle are different, thereby ensuring the universality of parts of all controllers and further shortening the project development period and the cost.

Drawings

FIG. 1 is a block diagram of the system of the present invention;

FIG. 2 is a flow chart of the method of the present invention.

In the figure: 1-1, a first node; 2-1, a second node; 2-2, and a third node.

Detailed Description

The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.

Referring to fig. 1, a multi-subnet cooperative sleep based on CAN bus includes a first node 1-1, a second node 2-1, a third node 2-2, and a fourth node 2-3; the CAN1 port of the first node 1-1 is connected with the second node 2-1 through a CAN line; the CAN2 port of the first node 1-1 is connected with the third node 2-2 through a CAN line; the CAN3 port of the first node 1-1 is connected to the fourth node 2-3 via a CAN line. The first node 1-1 is a gateway. The second node 2-1 is the ECU 1. The third node 2-2 is the ECU 2. The ECU1 employs Autosar network management. The ECU2 employs OSEK network management. The ECU3 employs master-slave network management with a gateway as the master controller.

Referring to fig. 2, a multi-subnet cooperative sleep method based on a CAN bus includes the following steps:

step one, the ECU1 stops sending the Autosar network management message when the sleep condition meets the requirement, the gateway monitors the Autosar network management message of the ECU1 through the CAN1 port, if the ECU1 stops sending the Autosar network management message, the step two is carried out, otherwise, the step one is continuously carried out;

step two, if the sleep condition of the ECU2 is met, sending an OSEK network management message with a sleep indication, monitoring the OSEK network management message of the ECU2 by the gateway through a CAN2 port, and executing the step three if the gateway monitors that the ECU2 sends the OSEK network management message with the sleep indication bit through the CAN2 port, otherwise, continuously executing the step two;

step three, the gateway CAN1 port stops sending the self Autosar network management message;

step four, the gateway judges the stop time of the Autosar network management message of the CAN1 port, if the stop time reaches 1 second, the step five is entered, otherwise, the step four is continuously executed;

step five, the gateway sends an OSEK network management message with a sleep response to the CAN2 port and sends a sleep signal instruction to the CAN3 port;

step six, the gateway, the ECU1, the ECU2 and the ECU3 enter a sleep state simultaneously, so that the cooperative sleep of the whole vehicle is realized;

and seventhly, after the whole vehicle is in cooperative sleep, if any node of the gateway, the ECU1, the ECU2 and the ECU3 is awakened, the whole vehicle is awakened to carry out normal communication, and the sleep process after the whole vehicle is awakened is the same as the above.

8页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:硬件更新方法、装置、系统和计算机可读存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!