基于汽车网关的OBD车联网设计与实现

VIP免费
3.0 侯斌 2024-11-19 4 4 3.69MB 68 页 15积分
侵权投诉
绿色、安全、互联是当今汽车研究领域的重要发展方向。在物联网技术应用
不断普及、智能交通产业快速发展、汽车及零部件制造技术不断提高的今天,车
联网技术应运而生。该技术旨在实现车与车、车与人、车与道路等之间的信息互
联与共享,在提高社会资源利用率和减少道路交通环境污染的同时,确保驾驶员
和道路行人的生命安全。
本文根据国内外车联网技术的研究现状,以汽车网关为基础,提出了采用 OBD
模式车联网实现车与人之间信息互联的方法,该方法将 OBD 诊断端口的车辆 CAN
总线消息作为车联网的信息源,利用汽车网关的 CAN 总线通道读取总线报文,
制定与之相应的应用层协议,把 CAN 总线报文转换为 UART 协议串口传输信息,
使之作为 Wi-Fi 模块的输入信号,最终将车辆状态信息发送到安卓手机客户端。
同时,结合汽车电子领域的发展日益重视功能安全的现实,论文在方案设计
中融入了汽车主动安全的概念,并借助隐马尔科夫模型进行驾驶员换道行为分析。
在行为分析中,采集 CAN 总线报文中的方向盘转角 Steer_Angle向盘转动速度
Steer_Speed 和车辆横摆角 Yawrate 信号作为样本数据,利用 Baum-Welch 算法解决
隐马尔科夫模型的学习问题,借助 Matlab 工具箱训练样本数据确定其模型参数集,
然后利用向前-向后算法解决模型的估算问题,最终确定驾驶员行为。
此外,在整个 OBD 车联网系统集成过程中,为了保证系统的实时性,本文根
据汽车电子软件嵌入式 OSEK/VDX 规范,对其中的实时操作系统 RTOS 运行机制
进行了深入研究,实现车联网系统任务的实时调度。
最后,通过搭建硬件平台和编写软件代码,对系统进行整合,完成了 OBD
联网系统的离线软件编写和测试,并在汽车行使过程中进行了道路实时运行测试,
结果表明,整个系统运行正常,达到了预期的效果。
关键词:
OBD
车联网
CAN
总线
汽车网关
隐马尔科夫模型
OSEK/VDX
实时操作系统
ABSTRACT
Green, safety and connection are the main developed direction in the automotive
fields. Due to the widespread of internet of things, the rapid development of intelligent
transportation industry and the motivation from the automobile manufacturer, telematics
technology arises at the historic moment, which aims to realize the information
connection and sharing among vehicle to vehicle, vehicle to pedestrian, vehicle to
infrastructure and so on, to improve the utilization efficiency of social resource and to
reduce the traffic environment pollution, at the same to ensure the safety of drivers and
pedestrian.
According to the telematics research status in domestic and abroad, a new method
to realize the connection between vehicle and pedestrian is put forward in the thesis,
which can be named as OBD telematics. Through employing the vehicle gateway to
read the CAN-bus information from the OBD diagnostic port, corresponding protocol
transition has been made between CAN-bus and UART protocol. Finally, using the
Wi-Fi module, the vehicle information can be sent to the mobile android terminal.
Meanwhile, the OBD telematics system is not just a tool to do information
transmission. The active safety idea has been participated into the whole system design.
Hidden Markov Model (HMM) has been used to do analysis on the driver lane change
behavior. Steering wheel angle, steer wheel rotation speed and vehicle yaw rate signals
read from the CAN-bus are taken as the observed sequence and model training sample
data. In order to solve the learning problem of HMM, Baum-Welch algorithm has been
utilized in the Matlab toolbox to acquire the key parameter of the HMM. And the
forward-backward algorithm can help to solve the estimation problem of HMM, which
is useful to confirm the drivers behavior.
Whats more, during the process of system integration, in order to ensure it is a
real-time system, some deeply researches have been done on the operation mechanism
of the real-time operation system on the basis of the OSEK/VDX (Open System and the
Corresponding Interfaces for Automotive Electronic and Vehicle Distributed Executive)
specification. And task scheduling is achieved by using the software successfully.
By building the hardware platform and writing the software code, along with the
final system integration, offline test and road online test have been done about the OBD
telematics system. The result shows that the whole system can run normally and achieve
the desired results.
Key Word: OBD telematics, CAN-bus, Hidden Markov Model, Vehicle
gateway, OSEK/VDX real-time operation system
目录
ABSTRACT
第一章 ............................................................................................................... 1
1.1 课题研究背景与意义 ........................................................................................ 1
1.1.1 OBD 车联网的背景 ..................................................................................... 1
1.1.2 OBD 车联网技术的研究意义 ..................................................................... 3
1.2 车联网技术的研究现状 .................................................................................... 3
1.2.1 国外车联网技术的研究现状 ...................................................................... 4
1.2.2 国内车联网技术的研究现状 ...................................................................... 5
1.3 本文的主要研究工作 ........................................................................................ 6
第二章 OSEK/VDX 车电子嵌入式实时操作系统 ............................................... 8
2.1 OSEK/VDX 规范的发展历程 ............................................................................ 8
2.2 OSEK 操作系统的特点 ..................................................................................... 9
2.3 OSEK 操作系统的运行机制 ............................................................................ 10
2.3.1 任务 ............................................................................................................ 10
2.3.2 任务的优先级控制 ...................................................................................... 11
2.3.3 中断管理 .................................................................................................... 13
2.3.4 资源管理 .................................................................................................... 14
2.3.5 事件管理 .................................................................................................... 16
2.3.6 计数器和报警 ............................................................................................ 17
2.3.7 调度器 ........................................................................................................ 18
2.4 本章小结 .......................................................................................................... 18
第三章 基于 HMM 模型的驾驶员换道行为识别 ................................................... 19
3.1 马尔科夫模型 .................................................................................................. 19
3.2 隐马尔科夫模型 .............................................................................................. 20
3.3 隐马尔科夫模型中的三个问题 ...................................................................... 21
3.4 驾驶员换道行为识别 ...................................................................................... 25
3.4.1 驾驶员换道行为 HMM 结构定义 ............................................................ 25
3.4.2 隐马尔科夫模型参数集训练 .................................................................... 27
3.4.3 换道行为的识别 ........................................................................................ 29
3.5 本章小结 .......................................................................................................... 30
第四章 OBD 车联网硬件电路设计与实现 ............................................................. 31
4.1 汽车网关的功能作用 ....................................................................................... 31
4.2 网关硬件整体设计方案 .................................................................................. 32
4.3 电源处理电路 .................................................................................................. 33
4.4 微控制器 V850 最小系统 ............................................................................... 34
4.5 JTAG 接口电路 ................................................................................................ 35
4.6 Wi-Fi 模块接口电路 ......................................................................................... 36
4.7 CAN 总线通信驱动电路 .................................................................................. 37
4.8 本章小结 .......................................................................................................... 38
第五章 OBD 车联网软件设计与实现 ..................................................................... 39
5.1 OSEK/VDX 实时操作系统设计 ...................................................................... 39
5.1.1 系统节拍定时器 ........................................................................................ 39
5.1.2 系统任务与优先级初始化 ........................................................................ 39
5.1.3 任务调度 .................................................................................................... 41
5.2 CAN 通信程序设计 .......................................................................................... 41
5.2.1 CAN 控制器内部结构 ............................................................................... 42
5.2.2 CAN 控制器的初始化 ............................................................................... 43
5.2.3 CAN 总线位时序计算 ............................................................................... 43
5.2.4 CAN 报文的接收 ....................................................................................... 45
5.2.5 CAN 报文的发送 ....................................................................................... 46
5.3 CAN 总线协议与 UART 协议转换 ................................................................. 47
5.4 代码驱动自动生成 .......................................................................................... 49
5.4.1 微控制器 V850 代码驱动生成 ................................................................. 50
5.4.2 CAN 报文 DBC 文件代码驱动生成 ......................................................... 50
5.5 本章小结 ........................................................................................................... 51
第六章 OBD 车联网系统集成与实测评估 ............................................................. 52
6.1 软硬件开发平台 .............................................................................................. 52
6.1.1 硬件开发平台 ............................................................................................ 52
6.1.2 软件开发平台 ............................................................................................ 52
6.1.3 系统集成 .................................................................................................... 54
6.2 系统实测评估 .................................................................................................. 54
6.2.1 OSEK/VDX 实时操作系统评估 ............................................................... 54
6.2.2 OBD 车联网离线测试 ............................................................................... 55
6.2.3 OBD 车联网在线路测 ............................................................................... 56
6.3 本章小结 .......................................................................................................... 57
第七章 结论与展望 ................................................................................................... 58
参考文献 ..................................................................................................................... 60
在读期间公开发表的论文和承担科研项目及取得成果 ......................................... 63
......................................................................................................................... 64
摘要:

摘要绿色、安全、互联是当今汽车研究领域的重要发展方向。在物联网技术应用不断普及、智能交通产业快速发展、汽车及零部件制造技术不断提高的今天,车联网技术应运而生。该技术旨在实现车与车、车与人、车与道路等之间的信息互联与共享,在提高社会资源利用率和减少道路交通环境污染的同时,确保驾驶员和道路行人的生命安全。本文根据国内外车联网技术的研究现状,以汽车网关为基础,提出了采用OBD模式车联网实现车与人之间信息互联的方法,该方法将OBD诊断端口的车辆CAN总线消息作为车联网的信息源,利用汽车网关的CAN总线通道读取总线报文,并制定与之相应的应用层协议,把CAN总线报文转换为UART协议串口传输信息,使之作为...

展开>> 收起<<
基于汽车网关的OBD车联网设计与实现.pdf

共68页,预览7页

还剩页未读, 继续阅读

作者:侯斌 分类:高等教育资料 价格:15积分 属性:68 页 大小:3.69MB 格式:PDF 时间:2024-11-19

开通VIP享超值会员特权

  • 多端同步记录
  • 高速下载文档
  • 免费文档工具
  • 分享文档赚钱
  • 每日登录抽奖
  • 优质衍生服务
/ 68
客服
关注