The invention discloses a vehicular signal encapsulation method for optimizing the packet number of an automobile CAN network, in order to provide a vehicle signal encapsulation method for making the number of CAN network packets of a vehicle at least and satisfying the real-time requirements. The vehicle signal according to the length of the size are sorted in descending order, the heuristic optimization method based on the encapsulated CAN message, according to the Deadline Monotonic allocation method based on CAN message priority, the worst-case response time analysis of CAN on schedulability; if not scheduling, scheduling can never CAN message find the worst response time and the minimum value of the deadline CAN message and the CAN message in the most stringent deadline vehicle signal package to the new CAN message, in order to improve the original CAN message deadline; until CAN or no CAN anthology scheduling, packets can be decomposed so far. The invention has the advantages of realizing the optimization of the number of messages in the CAN network of the automobile and ensuring the real-time property of the system, and providing a new method for the design of the application layer protocol of the automobile CAN network.
【技术实现步骤摘要】
一种面向汽车CAN网络报文数优化的车辆信号封装方法
本专利技术涉及汽车ECU中车辆信号数据的处理,尤其是一种面向汽车CAN网络报文数优化的车辆信号封装方法,属于汽车电子领域。
技术介绍
随着人们对汽车动力性、安全性和舒适性要求的提高,汽车ECU(电子控制单元)和电子控制装置也在不断增加。它们并不仅仅与负载设备简单地连接在一起,更多的是与外围设备及其它ECU和电子控制装置进行信息交流,并经过复杂的控制决策运算,发出控制指令。为了提高车辆信号的利用率,要求大批车辆信号在不同的汽车ECU之间进行交换和共享,车载网络技术实现了汽车各ECU的实时控制。在多种车载网络技术中,CAN(ControllerAreaNetwork,控制器局域网)以其良好的运行特性,即高可靠性和独特设计,特别适合现代汽车各ECU间的互联通信。车辆信号的数据在ECU中被封装成报文并通过CAN总线进行传输,最简单的封装方法是每个CAN报文只装入一个车辆信号,由于CAN报文数和车辆信号数相同,大量CAN报文的传输增加了总线竞争机率和网络带宽消耗。为了降低每个ECU上的CAN报文数量,必须优化CAN网络报文数。CAN报文集的构造和优先级的选择又决定了CAN报文的响应时间,进而影响到系统实时特性。目前汽车CAN网络报文的车辆信号封装大多采用的是SAEJ1939协议,由于其对CAN报文的数据域进行了全面定义,导致没有车辆信号被封装时的CAN报文数据域的浪费。因此,有必要提出面向汽车CAN网络报文数优化的车辆信号封装方法,并满足系统实时性要求。
技术实现思路
本专利技术的目的是提供一种面向汽车CAN网络报文数 ...
【技术保护点】
一种面向汽车CAN网络报文数优化的车辆信号封装方法,其特征在于:首先设定车辆信号特征
【技术特征摘要】
1.一种面向汽车CAN网络报文数优化的车辆信号封装方法,其特征在于:首先设定车辆信号特征其中:是车辆信号产生周期;是车辆信号截止期;是车辆信号长度,单位为bit,且小于或等于CAN报文的数据域最大长度;CAN报文特征(T,D,L,DL,P),其中:T是CAN报文产生周期;D是CAN报文截止期;L是CAN报文长度,单位为bit;DL是CAN报文已经封装的车辆信号长度,单位为bit;P是CAN报文优先级,P越小,CAN报文优先级越大;然后,按照以下步骤操作:步骤1:在每个ECU上,将车辆信号根据长度大小按递减顺序排序,排序后的车辆信号集为S={s1,s2,…si…,sn};步骤2:向CAN报文中装入车辆信号si:步骤2(a):按顺序观察已经使用过的CAN报文集{f1,f2,…,fj},一旦发现车辆信号si能够装入{f1,f2,…,fj}中的某个CAN报文中,则将si装入该CAN报文中,并更新该CAN报文的周期和截止期;步骤2(b):如果si不能够装入{f1,f2,…,fj}中任何一个CAN报文中,则产生一个新CAN报文fj+1,该新CAN报文的时间特征为和将所述新CAN报文fj+1加入到所述已使用过的CAN报文集{f1,f2,…,fj}中构成新的已使用过的CAN报文集,并将新的已使用过的CAN报文集仍用{f1,f2,…,fj}的形式表示;步骤3:如果该ECU仍有车辆信号需要封装,则返回步骤2;如果仍有其他ECU的车辆信号需要封装,则返回步骤1;最终构造的CAN报文集为F={f1,f2,…,fm};步骤4:将最终构造的CAN报文集F={f1,f2,…,fm}中的各报文截止期Dj按升序排序,按截止期单调...
【专利技术属性】
技术研发人员:胡剑,李刚炎,胥军,牛子孺,
申请(专利权)人:武汉理工大学,
类型:发明
国别省市:湖北,42
还没有人留言评论。发表了对其他浏览者有用的留言会获得科技券。