CN111045416B - Method and device for analyzing CAN (controller area network) signal of whole vehicle by using diagnosis message - Google Patents
Method and device for analyzing CAN (controller area network) signal of whole vehicle by using diagnosis message Download PDFInfo
- Publication number
- CN111045416B CN111045416B CN201911320840.5A CN201911320840A CN111045416B CN 111045416 B CN111045416 B CN 111045416B CN 201911320840 A CN201911320840 A CN 201911320840A CN 111045416 B CN111045416 B CN 111045416B
- Authority
- CN
- China
- Prior art keywords
- diagnostic
- vehicle
- message
- data
- signal
- 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.)
- Active
Links
- 238000003745 diagnosis Methods 0.000 title claims abstract description 21
- 238000000034 method Methods 0.000 title claims description 29
- 238000004458 analytical method Methods 0.000 claims abstract description 27
- 238000004891 communication Methods 0.000 claims description 57
- 230000004044 response Effects 0.000 claims description 45
- 230000003068 static effect Effects 0.000 claims description 35
- 238000012544 monitoring process Methods 0.000 claims description 34
- 101150063504 CAN2 gene Proteins 0.000 claims description 20
- 230000008859 change Effects 0.000 claims description 12
- 238000006243 chemical reaction Methods 0.000 claims description 12
- 101000685724 Homo sapiens Protein S100-A4 Proteins 0.000 claims description 11
- 102100023087 Protein S100-A4 Human genes 0.000 claims description 11
- 101150008604 CAN1 gene Proteins 0.000 claims description 10
- 238000013500 data storage Methods 0.000 claims description 10
- 238000004364 calculation method Methods 0.000 claims description 8
- 230000008569 process Effects 0.000 claims description 8
- 238000012795 verification Methods 0.000 claims description 7
- 238000004088 simulation Methods 0.000 claims description 5
- 238000010835 comparative analysis Methods 0.000 claims description 4
- 238000012546 transfer Methods 0.000 claims description 4
- 238000010586 diagram Methods 0.000 description 4
- 230000008901 benefit Effects 0.000 description 2
- 238000013480 data collection Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 239000000446 fuel Substances 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000011056 performance test Methods 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B23/00—Testing or monitoring of control systems or parts thereof
- G05B23/02—Electric testing or monitoring
- G05B23/0205—Electric testing or monitoring by means of a monitoring system capable of detecting and responding to faults
- G05B23/0208—Electric testing or monitoring by means of a monitoring system capable of detecting and responding to faults characterized by the configuration of the monitoring system
- G05B23/0213—Modular or universal configuration of the monitoring system, e.g. monitoring system having modules that may be combined to build monitoring program; monitoring system that can be applied to legacy systems; adaptable monitoring system; using different communication protocols
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B2219/00—Program-control systems
- G05B2219/20—Pc systems
- G05B2219/24—Pc safety
- G05B2219/24065—Real time diagnostics
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Automation & Control Theory (AREA)
- Small-Scale Networks (AREA)
- Testing And Monitoring For Control Systems (AREA)
Abstract
Description
技术领域technical field
本发明属于汽车电子总线通信、诊断领域,尤其是涉及一种利用诊断报文解析整车CAN信号的方法。The invention belongs to the field of automobile electronic bus communication and diagnosis, and in particular relates to a method for analyzing CAN signals of a vehicle by using a diagnosis message.
背景技术Background technique
CAN是控制器局域网络(Controller Area Network,CAN)的简称,是目前国际上应用最广泛的现场总线之一,尤其广泛应用于汽车骨干网。从国际先进的车辆网络信号中对标出关键的整车参数对我们国内电动车及燃料电池车的开发具有重要价值,但是由于国际先进的电动车和燃料电池车的动力CAN、EVCAN等关键CAN网络负载率高,所以利用通信报文定位CAN信号和整车参数的对应关系需要花费测试工程师大量的时间和精力,而且对于各种车辆关键信号的定义是不一样的,这就对通过CAN通信报文信号定位整车参数带来了时间和技术上的极大困难。因此提出了一种利用诊断仪通过CAN诊断报文信号快速定位、标定整车参数的解析方法,这种解析方法的优点是解析快速准确而且不需要破坏整车任何线束,只要从车辆OBDII接口将车辆诊断CAN和诊断仪及Vector CANcase连接即可。CAN is the abbreviation of Controller Area Network (CAN), which is one of the most widely used field buses in the world, especially widely used in automobile backbone network. It is of great value to mark the key vehicle parameters from the international advanced vehicle network signals for the development of domestic electric vehicles and fuel cell vehicles. The network load rate is high, so it takes a lot of time and energy for test engineers to locate the correspondence between CAN signals and vehicle parameters using communication messages, and the definitions of key signals for various vehicles are different. The message signal locating the vehicle parameters brings great difficulties in time and technology. Therefore, an analysis method using a diagnostic instrument to quickly locate and calibrate the parameters of the vehicle through the CAN diagnosis message signal is proposed. The vehicle diagnostic CAN can be connected to the diagnostic instrument and Vector CANcase.
发明内容SUMMARY OF THE INVENTION
有鉴于此,本发明旨在提出一种利用诊断报文解析整车CAN信号的方法,应用诊断CAN总线、诊断仪和CAN报文采集工具和CAN报文监测记录软件,通过解析诊断CAN总线完成关键信号解析,为整车对标提供重要参考。In view of this, the present invention aims to propose a method for analyzing the CAN signal of a vehicle by using a diagnostic message. The diagnostic CAN bus, a diagnostic instrument, a CAN message acquisition tool and a CAN message monitoring and recording software are used to complete the analysis and diagnosis of the CAN bus. Analysis of key signals provides an important reference for vehicle benchmarking.
为达到上述目的,本发明的技术方案是这样实现的:In order to achieve the above object, the technical scheme of the present invention is achieved in this way:
一种利用诊断报文解析整车CAN信号的方法,利用诊断仪发送向诊断CAN总线发送请求服务并监测请求后的应答信号,同时用CAN报文监控工具监测并记录请求后的应答通讯报文,通过对比分析计算标定需解析的信号。A method of analyzing the CAN signal of a vehicle by using a diagnostic message, using a diagnostic instrument to send a request for service to a diagnostic CAN bus and monitoring the response signal after the request, and monitoring and recording the response communication message after the request with a CAN message monitoring tool , and calculate the signal to be analyzed through comparative analysis.
进一步的,具体包括如下步骤:Further, it specifically includes the following steps:
S1:将线束同时连接整车OBDII接口、诊断仪和CAN数据监测工具;S1: Connect the wiring harness to the vehicle OBDII interface, diagnostic instrument and CAN data monitoring tool at the same time;
S2:操作诊断仪访问整车各个控制器,同时利用CAN数据监测工具进行实车静态诊断数据采集;S2: Operate the diagnostic instrument to access each controller of the vehicle, and at the same time use the CAN data monitoring tool to collect the static diagnosis data of the real vehicle;
S3:将采集到的静态数据对标ISO14229、ISO15765诊断应用层标准,进行静态可变诊断报文数据定位解析,参照S2步骤中存储的诊断仪数据,快速定位诊断仪提供的整车静态可变参数和诊断报文数据的对应关系;S3: Align the collected static data with the ISO14229 and ISO15765 diagnostic application layer standards, perform static variable diagnostic message data location analysis, and refer to the diagnostic instrument data stored in step S2 to quickly locate the vehicle static variable provided by the diagnostic instrument. Correspondence between parameters and diagnostic message data;
S4:对在S3步骤中已初步定位的诊断报文对应的静态非零可变参数,通过改变车辆静态工况,使上述已定位参数从一组稳定值变化到另一组稳定值,计算相应整车静态可变参数对应诊断报文信号的比例系数、信号偏移量、数据存储格式、数据类型,并将其整理为excel格式的文件;S4: For the static non-zero variable parameters corresponding to the diagnostic messages that have been preliminarily located in step S3, by changing the static working conditions of the vehicle, the above-mentioned located parameters are changed from one set of stable values to another set of stable values, and the corresponding The vehicle static variable parameters correspond to the proportional coefficient, signal offset, data storage format, and data type of the diagnostic message signal, and organize them into excel format files;
S5:按照S2步骤中的方法进行实车动态诊断数据采集;S5: collect the real vehicle dynamic diagnosis data according to the method in step S2;
S6:按照S3步骤中的方法,将动态车况下可变参数和诊断报文数据的对应关系进行快速定位;S6: According to the method in step S3, quickly locate the corresponding relationship between variable parameters and diagnostic message data under dynamic vehicle conditions;
S7:针对在S6步骤中已初步定位的诊断报文对应的动态非零可变参数,通过改变车辆动态工况,使上述已定位参数从一组稳定值变化到另一组稳定值,计算相应整车动态可变参数对应诊断报文信号的比例系数、信号偏移量、数据存储格式、数据类型,并将其整理为excel格式的文件;S7: For the dynamic non-zero variable parameters corresponding to the diagnostic messages that have been preliminarily located in step S6, by changing the dynamic working conditions of the vehicle, the above-mentioned located parameters are changed from one set of stable values to another set of stable values, and the corresponding The dynamic variable parameters of the whole vehicle correspond to the proportional coefficient, signal offset, data storage format, and data type of the diagnostic message signal, and organize them into excel format files;
S8:编制解析后的整车参数转发规则,整理为excel格式的文件;S8: Compile the parsed vehicle parameter forwarding rules and organize them into excel format files;
S9:利用Vector CAPL Browser软件编写脚本代码,将在CAN监测工具CAN1通道上收到的控制器回复诊断仪的诊断响应报文按照自定义的通信报文格式转换到CAN监测工具另一条CAN2通道以通信报文格式发送;S9: Use Vector CAPL Browser software to write script code to convert the diagnostic response message from the controller to the diagnostic instrument received on the CAN1 channel of the CAN monitoring tool to another CAN2 channel of the CAN monitoring tool according to the customized communication message format. Communication message format sending;
S10:根据S4和S7步骤中整理的excel表格,编写CAN2上的通信数据库.dbc文件;S10: Write the communication database .dbc file on CAN2 according to the excel sheet sorted in steps S4 and S7;
S11:利用Vector CANoe软件中Simulation界面CAN2通道加载S10步骤中编写的通信数据库.dbc文件后,利用S9步骤中编写的CAPL转换脚本程序,配合Vector CANoe的Graphic功能,将.dbc识别出的解析的每一个整车参数信号从Trace窗口中拖拽到Graphic窗口中,改变车辆工况,对比诊断仪中该参数的曲线和Graphic窗口中的曲线变化趋势及该参数的最大值和最小值是否一致,如果一致则验证成功;如果不一致则返回S1步骤重新进行该参数的解析定位和标定。S11: Use the CAN2 channel of the Simulation interface in the Vector CANoe software to load the communication database .dbc file written in step S10, use the CAPL conversion script program written in step S9, and cooperate with the Graphic function of Vector CANoe to convert the parsed data identified by .dbc Drag each vehicle parameter signal from the Trace window to the Graphic window, change the vehicle operating conditions, compare the curve of the parameter in the diagnostic instrument with the curve change trend in the Graphic window, and whether the maximum and minimum values of the parameter are consistent, If they are consistent, the verification is successful; if they are inconsistent, return to step S1 to redo the analytical positioning and calibration of the parameter.
进一步的,所述步骤S2中,将CAN数据监测工具采集的数据记录为.asc格式的文件;同时将诊断仪的数据记录为图片格式或相应录屏格式的文件。Further, in the step S2, the data collected by the CAN data monitoring tool is recorded as a file in .asc format; at the same time, the data of the diagnostic instrument is recorded as a file in a picture format or a corresponding screen recording format.
进一步的,所述步骤S8中具体包括,包括编制解析后的整车参数转发规则,对报文ID、信号长度有效位、比例系数、信号偏移进行定义,整理为Excel格式的文件,不同车型采用不同的诊断服务标准。Further, the step S8 specifically includes, including compiling the parsed vehicle parameter forwarding rules, defining the message ID, the effective bit of the signal length, the proportional coefficient, and the signal offset, and arranging them into Excel format files, different models. Different diagnostic service standards are used.
进一步的,:所述步骤S9中具体包括:Further, the step S9 specifically includes:
S901:将从控制面板获取的诊断请求发送到CAN1通道;S901: Send the diagnostic request obtained from the control panel to the CAN1 channel;
S902:接收并缓存控制器返回的诊断响应ID及诊断响应报文的十六进制原始数据;S902: receive and cache the diagnostic response ID and the original hexadecimal data of the diagnostic response message returned by the controller;
S903:处理分析控制器返回的诊断响应报文中十六进制原始数据,按照S8步骤中编制的转发规则,识别解析出的相应参数对应的有效信号分别转存到自定义的结构体中,包括转发通信报文ID,转发通信报文DLC,转发通信报文十六进制原始数据;S903: Process the original hexadecimal data in the diagnostic response message returned by the analysis controller, and according to the forwarding rules prepared in step S8, identify and parse the valid signals corresponding to the corresponding parameters and transfer them to a user-defined structure respectively, Including forwarding communication message ID, forwarding communication message DLC, forwarding communication message hexadecimal raw data;
S904:将S903步骤中转存好的通信报文发送到CAN2通道。S904: Send the communication message transferred in step S903 to the CAN2 channel.
本发明的另一目的在于提出一种利用诊断报文解析整车CAN信号的装置,包括信号解析装置,用于利用诊断仪发送向诊断CAN总线发送请求服务并监测请求后的应答信号,同时用CAN报文监控工具监测并记录请求后的应答通讯报文,通过对比分析计算标定需解析的信号。Another object of the present invention is to provide a device for analyzing CAN signals of a vehicle by using a diagnostic message, including a signal analyzing device, which is used to send a request for service to the diagnostic CAN bus by using a diagnostic instrument and monitor the response signal after the request, and simultaneously use The CAN message monitoring tool monitors and records the response communication message after the request, and calculates the signal to be analyzed through comparative analysis and calibration.
进一步的,具体包括further, including
安装模块,用于将线束同时连接整车OBDII接口、诊断仪和CAN数据监测工具;Install the module to connect the wiring harness to the vehicle OBDII interface, diagnostic instrument and CAN data monitoring tool at the same time;
第一采集模块,用于操作诊断仪访问整车各个控制器,同时利用CAN数据监测工具进行实车静态诊断数据采集;The first acquisition module is used to operate the diagnostic instrument to access each controller of the vehicle, and at the same time use the CAN data monitoring tool to collect the static diagnosis data of the real vehicle;
定位解析模块,用于将采集到的静态数据对标ISO14229、ISO15765诊断应用层标准,进行静态可变诊断报文数据定位解析,参照采集模块中存储的诊断仪数据,快速定位诊断仪提供的整车静态可变参数和诊断报文数据的对应关系;The positioning analysis module is used to benchmark the collected static data against the ISO14229 and ISO15765 diagnostic application layer standards, and to perform positioning and analysis of static variable diagnostic message data, referring to the diagnostic instrument data stored in the acquisition module, to quickly locate the diagnostic instrument provided. Correspondence between vehicle static variable parameters and diagnostic message data;
第一计算模块,用于对在定位解析模块中已初步定位的诊断报文对应的静态非零可变参数,通过改变车辆静态工况,使上述已定位参数从一组稳定值变化到另一组稳定值,计算相应整车静态可变参数对应诊断报文信号的比例系数、信号偏移量、数据存储格式、数据类型,并将其整理为excel格式的文件;The first calculation module is used for the static non-zero variable parameters corresponding to the diagnostic messages that have been initially positioned in the positioning analysis module, by changing the static working conditions of the vehicle, so that the above-mentioned positioned parameters are changed from one set of stable values to another. Set the stable value, calculate the proportional coefficient, signal offset, data storage format, data type of the corresponding diagnostic message signal corresponding to the static variable parameters of the vehicle, and organize it into an excel format file;
第二采集模块,用于根据第一采集模块的方法进行实车动态诊断数据采集;The second collection module is used for collecting real vehicle dynamic diagnosis data according to the method of the first collection module;
定位模块,用于根据定位解析模块的方法将动态车况下可变参数和诊断报文数据的对应关系进行快速定位;The positioning module is used to quickly locate the corresponding relationship between variable parameters and diagnostic message data under dynamic vehicle conditions according to the method of the positioning analysis module;
第二计算模块,用于针对在定位模块中已初步定位的诊断报文对应的动态非零可变参数,通过改变车辆动态工况,使上述已定位参数从一组稳定值变化到另一组稳定值,计算相应整车动态可变参数对应诊断报文信号的比例系数、信号偏移量、数据存储格式、数据类型,并将其整理为excel格式的文件;The second calculation module is used to change the above-mentioned positioned parameters from one set of stable values to another set by changing the dynamic working conditions of the vehicle for the dynamic non-zero variable parameters corresponding to the diagnostic messages that have been preliminarily positioned in the positioning module. Stable value, calculate the proportional coefficient, signal offset, data storage format, data type of the corresponding diagnostic message signal corresponding to the dynamic variable parameters of the vehicle, and organize them into an excel format file;
编制模块,用于编制解析后的整车参数转发规则,整理为excel格式的文件;The compilation module is used to compile the parsed vehicle parameter forwarding rules and organize them into excel format files;
转换模块,用于利用Vector CAPL Browser软件编写脚本代码,将在CAN监测工具CAN1通道上收到的控制器回复诊断仪的诊断响应报文按照自定义的通信报文格式转换到CAN监测工具另一条CAN2通道以通信报文格式发送;The conversion module is used to write script code using Vector CAPL Browser software, and convert the diagnostic response message received by the controller to the diagnostic instrument on the CAN1 channel of the CAN monitoring tool to another one of the CAN monitoring tool according to the customized communication message format. CAN2 channel is sent in communication message format;
编写模块,用于根据第一计算模块和第二计算模块整理的excel表格,编写CAN2上的通信数据库.dbc文件;The writing module is used to write the communication database .dbc file on CAN2 according to the excel form organized by the first calculation module and the second calculation module;
验证模块,用于利用Vector CANoe软件中Simulation界面CAN2通道加载编写模块中编写的通信数据库.dbc文件后,利用转换模块中编写的CAPL转换脚本程序,配合VectorCANoe的Graphic功能,将.dbc识别出的解析的每一个整车参数信号从Trace窗口中拖拽到Graphic窗口中,改变车辆工况,对比诊断仪中该参数的曲线和Graphic窗口中的曲线变化趋势及该参数的最大值和最小值是否一致,如果一致则验证成功;如果不一致则返回S1步骤重新进行该参数的解析定位和标定。The verification module is used to load the communication database .dbc file written in the writing module using the CAN2 channel of the Simulation interface in the Vector CANoe software, and then use the CAPL conversion script program written in the conversion module to cooperate with the Graphic function of VectorCANoe. Drag each analyzed vehicle parameter signal from the Trace window to the Graphic window, change the vehicle operating conditions, compare the curve of the parameter in the diagnostic instrument with the curve change trend in the Graphic window, and whether the maximum and minimum values of the parameter are If they are consistent, the verification is successful; if they are inconsistent, return to step S1 to redo the analytical positioning and calibration of the parameter.
进一步的,所述第一采集模块中具体包括将CAN数据监测工具采集的数据记录为.asc格式的文件;同时将诊断仪的数据记录为图片格式或相应录屏格式的文件。Further, the first acquisition module specifically includes recording the data collected by the CAN data monitoring tool as a file in .asc format; meanwhile, recording the data of the diagnostic instrument as a file in a picture format or a corresponding screen recording format.
进一步的,所述编制模块具体包括编制解析后的整车参数转发规则,对报文ID、信号长度有效位、比例系数、信号偏移进行定义,整理为Excel格式的文件,不同车型采用不同的诊断服务标准。Further, the compiling module specifically includes compiling the parsed vehicle parameter forwarding rules, defining the message ID, the valid bits of the signal length, the proportional coefficient, and the signal offset, and arranging them into Excel format files. Different models use different rules. Diagnostic service standards.
进一步的,所述转换模块具体包括:Further, the conversion module specifically includes:
诊断请求发送模块,用于将从控制面板获取的诊断请求发送到CAN1通道;The diagnostic request sending module is used to send the diagnostic request obtained from the control panel to the CAN1 channel;
诊断响应接收模块,用于接收并缓存控制器返回的诊断响应ID及诊断响应报文的十六进制原始数据;The diagnostic response receiving module is used to receive and cache the diagnostic response ID returned by the controller and the original hexadecimal data of the diagnostic response message;
诊断响应报文解析模块,用于处理分析控制器返回的诊断响应报文中十六进制原始数据,按照编制模块中编制的转发规则,识别解析出的相应参数对应的有效信号分别转存到自定义的结构体中,包括转发通信报文ID,转发通信报文DLC,转发通信报文十六进制原始数据;The diagnostic response message parsing module is used to process the hexadecimal raw data in the diagnostic response message returned by the analysis controller, and according to the forwarding rules compiled in the compilation module, identify and parse the valid signals corresponding to the corresponding parameters and transfer them to The self-defined structure includes forwarding the communication message ID, forwarding the communication message DLC, and forwarding the original hexadecimal data of the communication message;
通信报文转发模块,用于将诊断响应报文解析模块中转存好的通信报文发送到CAN2通道。The communication message forwarding module is used to send the transferred communication message in the diagnostic response message parsing module to the CAN2 channel.
相对于现有技术,本发明所述的一种利用诊断报文解析整车CAN信号的方法具有以下优势:Compared with the prior art, the method for analyzing the CAN signal of a vehicle by using a diagnostic message according to the present invention has the following advantages:
本发明利用诊断仪发送向诊断CAN总线发送请求服务并监测请求后的应答信号,同时用CAN报文监控工具监测并记录请求后的应答通讯报文,通过对比分析计算标定需解析的信号。通过操作上位机控制面板可以同时监测各个控制器的实时数据,而诊断仪同一时间只能进入一个控制器系统进行单个控制器的参数监控。对整车各个控制器系统参数同时监测有利于先进车型后期性能试验时数据对标分析。The invention utilizes the diagnostic instrument to send the request service to the diagnostic CAN bus and monitors the response signal after the request, and uses the CAN message monitoring tool to monitor and record the response communication message after the request. By operating the control panel of the host computer, the real-time data of each controller can be monitored at the same time, while the diagnostic instrument can only enter one controller system at the same time to monitor the parameters of a single controller. Simultaneous monitoring of the parameters of each controller system of the whole vehicle is conducive to the data benchmarking analysis during the later performance test of advanced models.
附图说明Description of drawings
构成本发明的一部分的附图用来提供对本发明的进一步理解,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:The accompanying drawings constituting a part of the present invention are used to provide further understanding of the present invention, and the exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the attached image:
图1为本发明实施例所述的解析流程图示意图;1 is a schematic diagram of an analytical flowchart according to an embodiment of the present invention;
图2为本发明实施例所述的编写的CAPL脚本代码的识别转换流程示意图;Fig. 2 is the identification conversion process flow diagram of the CAPL script code written according to the embodiment of the present invention;
图3为本发明实施例所述的车内控制器支持ISO14229标准中22服务的车型的诊断解析示意图;FIG. 3 is a schematic diagram of the diagnosis and analysis of the vehicle model in which the in-vehicle controller supports 22 services in the ISO14229 standard according to an embodiment of the present invention;
图4为本发明实施例所述的车内控制器支持ISO14229标准中2C服务的车型的诊断解析示意图。FIG. 4 is a schematic diagram of the diagnosis analysis of the vehicle model in which the in-vehicle controller supports the 2C service in the ISO14229 standard according to the embodiment of the present invention.
具体实施方式Detailed ways
需要说明的是,在不冲突的情况下,本发明中的实施例及实施例中的特征可以相互组合。It should be noted that the embodiments of the present invention and the features of the embodiments may be combined with each other under the condition of no conflict.
下面将参考附图并结合实施例来详细说明本发明。The present invention will be described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
本发明提供一种利用诊断报文解析整车CAN信号方法,包括如下步骤:The present invention provides a method for analyzing CAN signals of a vehicle by using a diagnosis message, comprising the following steps:
S1,将所述一分二的线束公端连接到整车OBDII接口,线束另外两个母端同时连接诊断仪和CAN数据监测工具(Vector CANcase);S1, connect the male end of the wire harness divided into two parts to the OBDII interface of the vehicle, and connect the other two female ends of the wire harness to the diagnostic instrument and the CAN data monitoring tool (Vector CANcase) at the same time;
S2,操作诊断仪访问整车各个控制器,同时利用所述CAN数据监测工具进行实车静态诊断数据采集,并将数据记录为.asc格式的文件;同时将所述诊断仪的数据记录为图片格式或相应录屏格式的文件;S2, operate the diagnostic instrument to access each controller of the vehicle, use the CAN data monitoring tool to collect real vehicle static diagnosis data, and record the data as a file in .asc format; at the same time, record the data of the diagnostic instrument as a picture format or the corresponding screen recording format;
S3,将采集到的静态数据对标ISO14229、ISO15765等诊断应用层标准,进行静态可变诊断报文数据定位解析,参照S2步骤中存储的诊断仪数据,快速定位诊断仪提供的整车静态可变参数和诊断报文数据的对应关系;S3, benchmark the collected static data against the diagnostic application layer standards such as ISO14229 and ISO15765, and perform static variable diagnostic message data positioning and analysis. Referring to the diagnostic instrument data stored in step S2, quickly locate the vehicle static variable provided by the diagnostic instrument. Correspondence between variable parameters and diagnostic message data;
S4,针对在S3步骤中已初步定位的诊断报文对应的静态非零可变参数,通过改变车辆静态工况,使上述已定位参数从一组稳定值变化到另一组稳定值,方便快速准确计算相应整车静态可变参数对应诊断报文信号的比例系数、信号偏移量、数据存储格式、数据类型,并将其整理为excel格式的文件;S4, for the static non-zero variable parameters corresponding to the diagnostic messages that have been preliminarily located in step S3, by changing the static working conditions of the vehicle, the above-mentioned located parameters are changed from one set of stable values to another set of stable values, which is convenient and fast Accurately calculate the proportional coefficient, signal offset, data storage format and data type of the corresponding diagnostic message signal corresponding to the static variable parameters of the vehicle, and organize them into excel format files;
S5,按照所述S2步骤中的方法进行实车动态诊断数据采集;S5, according to the method in the step S2, carry out the real vehicle dynamic diagnosis data collection;
S6,按照所述S3步骤中的方法,将动态车况下可变参数和诊断报文数据的对应关系进行快速定位;S6, according to the method in the step S3, quickly locate the corresponding relationship between the variable parameters and the diagnostic message data under the dynamic vehicle condition;
S7,针对在S6步骤中已初步定位的诊断报文对应的动态非零可变参数,通过改变车辆动态工况,使上述已定位参数从一组稳定值变化到另一组稳定值,方便快速准确计算相应整车动态可变参数对应诊断报文信号的比例系数、信号偏移量、数据存储格式、数据类型,并将其整理为excel格式的文件;S7, for the dynamic non-zero variable parameters corresponding to the diagnostic messages that have been preliminarily located in step S6, by changing the dynamic working conditions of the vehicle, the above-mentioned located parameters are changed from one set of stable values to another set of stable values, which is convenient and fast Accurately calculate the proportional coefficient, signal offset, data storage format and data type of the corresponding diagnostic message signal corresponding to the dynamic variable parameters of the vehicle, and organize them into excel format files;
S8,编制解析后的整车参数转发规则,整理为excel格式的文件;以车内控制器支持ISO14229标准的22服务的车型和2C服务车型为例进行不同转发规则说明。S8, compile the parsed vehicle parameter forwarding rules, and organize them into excel format files; take the models with 22 services and 2C service models that the in-vehicle controller supports the ISO14229 standard as examples to explain different forwarding rules.
按照不同的转发机制,在此进行说明According to different forwarding mechanisms, it is explained here
S8-1,车内控制器支持ISO14229标准中22服务的车型,本发明按照以下流程进行诊断解析,如图3所示。S8-1, the in-vehicle controller supports vehicle models with 22 services in the ISO14229 standard, and the present invention performs diagnosis and analysis according to the following process, as shown in FIG. 3 .
对变量初始化,从面板上获取参数按键是否按下,若没按下,则继续等待;若按下,启动发送诊断请求定时器。To initialize the variable, obtain from the panel whether the parameter button is pressed, if not pressed, continue to wait; if pressed, start the sending diagnostic request timer.
定时时间未到,则继续等待;定时时间到,则发送22服务某个DID的诊断请求,并等待相应的DID诊断请求相应。If the timing time is not up, continue to wait; when the timing time is up, send 22 a diagnostic request to serve a certain DID, and wait for the corresponding DID diagnostic request to respond.
若未响应,则继续等待响应;若响应,对转发报文的ID及每个字节的信号值进行赋值,并启动转发报文1ms定时器。If it does not respond, it continues to wait for a response; if it responds, it assigns the ID of the forwarding message and the signal value of each byte, and starts the 1ms timer for forwarding the message.
定时时间未到,则继续等待;定时时间到,在另一个通道发送转发报文。If the timing time is not up, continue to wait; when the timing time is up, the forwarding message will be sent on another channel.
S8-1,车内控制器支持ISO14229标准中2C服务的车型,本发明按照以下流程进行诊断解析,如图4所示。S8-1, the in-vehicle controller supports the vehicle model of 2C service in the ISO14229 standard, the present invention performs diagnosis and analysis according to the following process, as shown in FIG. 4 .
对变量初始化,物理寻址发送动态数据请求AA 00,等待控制器发出相应ID的通信报文并判断是否byte[0]=0x00,若不是,则继续等待;若byte[0]=0x00,启动100ms定时器。Initialize the variable, send dynamic data request AA 00 through physical addressing, wait for the controller to send the corresponding ID communication message and judge whether byte[0]=0x00, if not, continue to wait; if byte[0]=0x00, start 100ms timer.
定时时间未到,继续等待;定时时间到,物理寻址发送动态请求2C FE,收到响应后判断是否是相应物理寻址响应,若不是,则输出响应错误;若是,输出响应正确并启动10ms定时器。If the timing time is not up, continue to wait; when the timing time is up, the physical addressing sends a dynamic request 2C FE, and after receiving the response, judge whether it is the corresponding physical addressing response. timer.
定时时间未到,继续等待;定时时间到,物理寻址发送动态请求2C FD,收到响应后判断是否是相应物理寻址响应,若不是,则输出响应错误;若是,输出响应正确并启动10ms定时器。If the timing time is not up, continue to wait; when the timing time is up, the physical addressing sends a dynamic request 2C FD, and after receiving the response, it is judged whether it is the corresponding physical addressing response. timer.
定时时间未到,继续等待;定时时间到,物理寻址发送动态请求AA 03 FE FD FC,等待控制器发出响应ID的通信报文并判断是否byte[0]=0xFE。If the timing time is not up, continue to wait; when the timing time is up, the physical addressing sends a dynamic request AA 03 FE FD FC, waits for the controller to send a communication message with a response ID, and judges whether byte[0]=0xFE.
若是,启动1ms定时器,定时时间到后在另一个通道转发相应通信报文;若不是,等待控制器发出响应ID的通信报文并判断是否byte[0]=0xFD。If so, start the 1ms timer, and forward the corresponding communication message on another channel after the time expires; if not, wait for the controller to send a communication message responding to the ID and determine whether byte[0]=0xFD.
若是,启动1ms定时器,定时时间到后在另一个通道转发相应通信报文;若不是,等待控制器发出响应ID的通信报文并判断是否byte[0]=0xFC。If so, start the 1ms timer, and forward the corresponding communication message on another channel after the time expires; if not, wait for the controller to send a communication message responding to the ID and determine whether byte[0]=0xFC.
若是,启动1ms定时器,定时时间到后在另一个通道转发相应通信报文;若不是,输出响应错误。If so, start a 1ms timer, and forward the corresponding communication message on another channel after the time expires; if not, output a response error.
S9,利用Vector CAPL Browser软件编写脚本代码,将在CAN监测工具CAN1通道上收到的控制器回复诊断仪的诊断响应报文按照自定义的通信报文格式转换到CAN监测工具另一条CAN2通道以通信报文格式发送,这样转发解析的优点是不改变原车的总线负载率;进一步S9步骤还包括以下子步骤:S9, use the Vector CAPL Browser software to write script code, and convert the diagnostic response message received by the controller on the CAN1 channel of the CAN monitoring tool to the diagnostic instrument to another CAN2 channel of the CAN monitoring tool according to the customized communication message format. The communication message format is sent, so that the advantage of forwarding and parsing is that the bus load rate of the original vehicle is not changed; further step S9 also includes the following sub-steps:
S9-1,诊断请求发送模块,用于将从控制面板获取的诊断请求发送到CAN1通道;S9-1, diagnostic request sending module, used to send the diagnostic request obtained from the control panel to the CAN1 channel;
S9-2,诊断响应接收模块,用于接收并缓存控制器返回的诊断响应ID及诊断响应报文的十六进制原始数据;S9-2, a diagnostic response receiving module, used to receive and cache the diagnostic response ID returned by the controller and the original hexadecimal data of the diagnostic response message;
S9-3,诊断响应报文解析模块,用于处理分析控制器返回的诊断响应报文中十六进制原始数据,按照S8步骤中编制的转发规则,识别解析出的相应参数对应的有效信号分别转存到自定义的结构体中,包括转发通信报文ID,转发通信报文DLC,转发通信报文十六进制原始数据;S9-3, a diagnostic response message parsing module, used to process the original hexadecimal data in the diagnostic response message returned by the analysis controller, and identify valid signals corresponding to the parsed corresponding parameters according to the forwarding rules compiled in step S8 They are respectively dumped into a self-defined structure, including forwarding the ID of the communication message, forwarding the DLC of the communication message, and forwarding the original hexadecimal data of the communication message;
S9-4,通信报文转发模块,用于将S9-3步骤中转存好的通信报文发送到CAN2通道;S9-4, the communication message forwarding module, used for sending the communication message transferred in step S9-3 to the CAN2 channel;
S10,根据S4和S7步骤中整理的excel表格,编写CAN2上的通信数据库.dbc文件;S10, write the communication database .dbc file on CAN2 according to the excel sheet sorted in steps S4 and S7;
S11,在所述笔记本电脑Vector CANoe软件中Simulation界面CAN2通道加载S10步骤中编写的通信数据库.dbc文件后,利用S9步骤中编写的CAPL转换脚本程序,配合VectorCANoe的Graphic功能,将.dbc识别出的解析的每一个整车参数信号从Trace窗口中拖拽到Graphic窗口中,改变车辆工况,对比诊断仪中该参数的曲线和Graphic窗口中的曲线变化趋势及该参数的最大值和最小值是否一致,如果一致则验证成功;如果不一致则返回S1步骤重新进行该参数的解析定位和标定。S11, after loading the communication database .dbc file written in step S10 on the CAN2 channel of the Simulation interface in the Vector CANoe software of the notebook computer, use the CAPL conversion script program written in the step S9 to cooperate with the Graphic function of VectorCANoe to identify the .dbc file. Drag each vehicle parameter signal analyzed from the Trace window to the Graphic window, change the vehicle operating conditions, and compare the curve of the parameter in the diagnostic instrument with the curve change trend in the Graphic window and the maximum and minimum values of the parameter. Whether it is consistent, if it is consistent, the verification is successful; if it is inconsistent, return to step S1 to re-analyze the positioning and calibration of the parameter.
以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the scope of the present invention. within the scope of protection.
Claims (8)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911320840.5A CN111045416B (en) | 2019-12-19 | 2019-12-19 | Method and device for analyzing CAN (controller area network) signal of whole vehicle by using diagnosis message |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911320840.5A CN111045416B (en) | 2019-12-19 | 2019-12-19 | Method and device for analyzing CAN (controller area network) signal of whole vehicle by using diagnosis message |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111045416A CN111045416A (en) | 2020-04-21 |
CN111045416B true CN111045416B (en) | 2020-10-30 |
Family
ID=70238278
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911320840.5A Active CN111045416B (en) | 2019-12-19 | 2019-12-19 | Method and device for analyzing CAN (controller area network) signal of whole vehicle by using diagnosis message |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111045416B (en) |
Families Citing this family (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111522332B (en) * | 2020-05-22 | 2024-08-27 | 厦门玖松信息科技有限公司 | Portable CAN detection and upgrading device and method |
CN111624981B (en) * | 2020-05-27 | 2021-06-15 | 安徽省爱夫卡电子科技有限公司 | Steering wheel angle calibration system and calibration method of automobile power-assisted steering system |
CN112415983B (en) * | 2020-11-18 | 2024-07-16 | 中国汽车工程研究院股份有限公司 | Working method for analyzing whole vehicle signals |
CN112799321B (en) * | 2020-12-14 | 2022-02-01 | 东风汽车集团有限公司 | DBC file rapid creating method following CAN bus communication protocol |
CN113542381B (en) * | 2021-07-06 | 2024-04-19 | 广州小鹏自动驾驶科技有限公司 | Message frame processing method and device |
CN115826558B (en) * | 2022-11-23 | 2023-09-19 | 中汽院新能源科技有限公司 | Diagnostic signal analysis method based on VehicleSPY |
CN118605442B (en) * | 2024-05-29 | 2024-12-24 | 维纳氢能科技有限公司 | Intelligent processing system for remote detection and fault diagnosis data of automobile |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP2275890A1 (en) * | 2009-06-29 | 2011-01-19 | Honeywell International Inc. | Vehicle system monitoring and communications architecture |
CN102673495A (en) * | 2011-03-16 | 2012-09-19 | 北汽福田汽车股份有限公司 | CAN (Controller Area Network) bus system and fault diagnosis method thereof |
CN104834303A (en) * | 2014-12-19 | 2015-08-12 | 北汽福田汽车股份有限公司 | Vehicle fault diagnosis method and system, and vehicle |
CN107450510A (en) * | 2017-06-28 | 2017-12-08 | 中国汽车工程研究院股份有限公司 | A kind of signal resolution method using diagnostic signal fast positioning CAN signal |
CN110162008A (en) * | 2019-05-10 | 2019-08-23 | 中国汽车技术研究中心有限公司 | A kind of new energy vehicle CAN bus analytic method |
-
2019
- 2019-12-19 CN CN201911320840.5A patent/CN111045416B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP2275890A1 (en) * | 2009-06-29 | 2011-01-19 | Honeywell International Inc. | Vehicle system monitoring and communications architecture |
CN102673495A (en) * | 2011-03-16 | 2012-09-19 | 北汽福田汽车股份有限公司 | CAN (Controller Area Network) bus system and fault diagnosis method thereof |
CN104834303A (en) * | 2014-12-19 | 2015-08-12 | 北汽福田汽车股份有限公司 | Vehicle fault diagnosis method and system, and vehicle |
CN107450510A (en) * | 2017-06-28 | 2017-12-08 | 中国汽车工程研究院股份有限公司 | A kind of signal resolution method using diagnostic signal fast positioning CAN signal |
CN110162008A (en) * | 2019-05-10 | 2019-08-23 | 中国汽车技术研究中心有限公司 | A kind of new energy vehicle CAN bus analytic method |
Also Published As
Publication number | Publication date |
---|---|
CN111045416A (en) | 2020-04-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111045416B (en) | Method and device for analyzing CAN (controller area network) signal of whole vehicle by using diagnosis message | |
CN110162008B (en) | A new energy vehicle CAN bus analysis method | |
CN110233768B (en) | UDS-based CAN bus test system and CAN bus test method | |
CN103728968A (en) | Automatic test system for CAN network and ECU functions | |
CN113190454A (en) | Real-vehicle test method and system for vehicle-mounted terminal software | |
CN103279118B (en) | The real-time mark system of a kind of integral new-energy passenger multiple units cooperative control device | |
CN106338978A (en) | CAN bus communication function test system and test method thereof | |
CN112925296B (en) | A Graphical In-Vehicle Network Diagnosis Method Based on Artificial Intelligence | |
CN107370637B (en) | Vehicle-mounted ECU communication function automatic test system and method | |
CN103593271A (en) | Method and device for chip tracking debugging of system on chip | |
CN113808299A (en) | Vehicle fault snapshot storage method, device and equipment based on fault system | |
CN110542565A (en) | Vehicle simulated ignition test method | |
CN111983990A (en) | Automatic testing platform for basic software | |
CN113377085A (en) | Vehicle decoder communication parameter analysis system | |
CN111624981B (en) | Steering wheel angle calibration system and calibration method of automobile power-assisted steering system | |
CN113985849A (en) | Method for writing DTC (digital control channel) read ECU (electronic control unit) version of automatic clear-reading whole vehicle based on CANoe software | |
CN117768348A (en) | Test method for HCU (hybrid control Unit) diagnosis of CANoe network | |
CN111708661A (en) | Pressure testing system and method suitable for central gateway | |
CN201037955Y (en) | Fuel batter whole automobile communication network testing device based on TTCAN | |
CN118091369A (en) | Chip testing method, system, device and computer readable storage medium | |
CN110618325A (en) | Vehicle simulation ignition pressure test system | |
CN114942623B (en) | Method and device for testing controller, vehicle and computer readable storage medium | |
CN201497911U (en) | Real-time vehicle failure prompting system | |
CN214851308U (en) | Vehicle-mounted equipment test system | |
CN115373366A (en) | An interactive diagnosis system, diagnosis method and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |