[go: up one dir, main page]

CN118348958A - Performance test method and device of vehicle-mounted controller, electric vehicle and medium - Google Patents

Performance test method and device of vehicle-mounted controller, electric vehicle and medium Download PDF

Info

Publication number
CN118348958A
CN118348958A CN202410475627.6A CN202410475627A CN118348958A CN 118348958 A CN118348958 A CN 118348958A CN 202410475627 A CN202410475627 A CN 202410475627A CN 118348958 A CN118348958 A CN 118348958A
Authority
CN
China
Prior art keywords
message
information
routing
vehicle
file
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
CN202410475627.6A
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.)
Chongqing Selis Phoenix Intelligent Innovation Technology Co ltd
Original Assignee
Chongqing Selis Phoenix Intelligent Innovation Technology Co ltd
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 Chongqing Selis Phoenix Intelligent Innovation Technology Co ltd filed Critical Chongqing Selis Phoenix Intelligent Innovation Technology Co ltd
Priority to CN202410475627.6A priority Critical patent/CN118348958A/en
Publication of CN118348958A publication Critical patent/CN118348958A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B23/00Testing or monitoring of control systems or parts thereof
    • G05B23/02Electric testing or monitoring
    • G05B23/0205Electric testing or monitoring by means of a monitoring system capable of detecting and responding to faults
    • G05B23/0208Electric 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/0213Modular 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
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/20Pc systems
    • G05B2219/24Pc safety
    • G05B2219/24065Real time diagnostics

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Automation & Control Theory (AREA)
  • Small-Scale Networks (AREA)

Abstract

本申请涉及一种车载控制器的性能测试方法、装置、电动车辆和介质。该方法包括:获取携带有报文定义信息的DBC文件;报文定义信息为用于发送和接收CAN报文的定义信息;对DBC文件进行解析,确定由报文定义信息组成的路由信息;基于路由信息,控制车载控制器向网关设备发送CAN报文,并记录对应的报文发送信息和报文接收信息,以实现车载控制器的路由转发功能;基于报文发送信息和报文接收信息,得到针对车载控制器在执行路由转发功能时的性能测试结果。采用本方法能够有效降低车载控制器的性能测试成本,并提高对车载控制器进行性能测试的效率和准确率,有利于电动车辆的开发应用。

The present application relates to a performance test method, device, electric vehicle and medium for an on-board controller. The method includes: obtaining a DBC file carrying message definition information; the message definition information is definition information for sending and receiving CAN messages; parsing the DBC file to determine routing information composed of the message definition information; based on the routing information, controlling the on-board controller to send CAN messages to the gateway device, and recording the corresponding message sending information and message receiving information to realize the routing forwarding function of the on-board controller; based on the message sending information and the message receiving information, obtaining the performance test results of the on-board controller when executing the routing forwarding function. The use of this method can effectively reduce the performance test cost of the on-board controller, and improve the efficiency and accuracy of the performance test of the on-board controller, which is beneficial to the development and application of electric vehicles.

Description

车载控制器的性能测试方法、装置、电动车辆和介质Performance testing method and device for vehicle controller, electric vehicle and medium

技术领域Technical Field

本申请涉及车载控制器技术领域,特别是涉及一种车载控制器的性能测试方法、车载控制器的性能测试装置、电动车辆、计算机可读存储介质和计算机程序产品。The present application relates to the technical field of vehicle-mounted controllers, and in particular to a performance testing method for a vehicle-mounted controller, a performance testing device for a vehicle-mounted controller, an electric vehicle, a computer-readable storage medium, and a computer program product.

背景技术Background technique

汽车开发中,车载网关控制器在电动车辆的内部通信网络中扮演着至关重要的角色,它相当于一个交通枢纽,负责不同模块和不同控制器(ECU)间的信息传递和处理。在将车载网关控制器应用于电动车辆之前,需要对其进行一系列的压力仿真测试,以检测车载网关控制器的性能满足使用需求。In automobile development, the vehicle gateway controller plays a vital role in the internal communication network of electric vehicles. It is equivalent to a transportation hub, responsible for information transmission and processing between different modules and different controllers (ECUs). Before the vehicle gateway controller is applied to electric vehicles, it needs to be subjected to a series of stress simulation tests to detect whether the performance of the vehicle gateway controller meets the use requirements.

目前,一般是通过仿真测试车载网关控制器在执行路由转发功能时的性能表现,来检测车载网关控制器的性能。然而,在目前的仿真测试方法中,需要人工来执行多个测试程序,例如对车辆数据进行人工解析和路由转发数据的人工分析,导致测试过程非常繁琐且容易出错,从而存在车载控制器的性能测试结果的效率较低和准确率不高的问题。At present, the performance of the vehicle gateway controller is generally tested by simulating the performance of the vehicle gateway controller when executing the routing forwarding function. However, in the current simulation test method, multiple test programs need to be performed manually, such as manual parsing of vehicle data and manual analysis of routing forwarding data, which makes the test process very cumbersome and prone to errors, resulting in low efficiency and accuracy of the performance test results of the vehicle controller.

发明内容Summary of the invention

针对上述问题,本公开提供一种车载控制器的性能测试方法、车载控制器的性能测试装置、电动车辆、计算机可读存储介质和计算机程序产品。本公开的技术方案如下:In view of the above problems, the present disclosure provides a performance test method for an on-board controller, a performance test device for an on-board controller, an electric vehicle, a computer-readable storage medium, and a computer program product. The technical solution of the present disclosure is as follows:

根据本公开实施例的第一方面,提供一种车载控制器的性能测试方法,包括:According to a first aspect of an embodiment of the present disclosure, a performance testing method for a vehicle-mounted controller is provided, comprising:

获取携带有报文定义信息的DBC文件;所述报文定义信息为用于发送和接收CAN报文的定义信息;Obtaining a DBC file carrying message definition information; the message definition information is definition information for sending and receiving CAN messages;

对所述DBC文件进行解析,确定由所述报文定义信息组成的路由信息;Parsing the DBC file to determine routing information composed of the message definition information;

基于所述路由信息,控制所述车载控制器向网关设备发送CAN报文,并记录对应的报文发送信息和报文接收信息,以实现所述车载控制器的路由转发功能;Based on the routing information, control the vehicle-mounted controller to send CAN messages to the gateway device, and record corresponding message sending information and message receiving information to realize the routing forwarding function of the vehicle-mounted controller;

基于所述报文发送信息和所述报文接收信息,得到针对所述车载控制器在执行所述路由转发功能时的性能测试结果。Based on the message sending information and the message receiving information, a performance test result of the vehicle-mounted controller when executing the routing forwarding function is obtained.

在一示例性实施例中,所述基于所述报文发送信息和所述报文接收信息,得到针对所述车载控制器在执行所述路由转发功能时的性能测试结果,包括:In an exemplary embodiment, obtaining a performance test result of the vehicle controller when executing the routing forwarding function based on the message sending information and the message receiving information includes:

基于所述报文发送信息和所述报文接收信息,计算所述车载控制器在执行所述路由转发功能时的丢包率和路由时延,以得到性能测试结果。Based on the message sending information and the message receiving information, the packet loss rate and routing delay of the vehicle controller when performing the routing forwarding function are calculated to obtain a performance test result.

在一示例性实施例中,所述报文发送信息包括各条所述CAN报文对应所属的CAN通道的报文发送周期、报文发送时间和报文发送计数;所述包围接收信息包括各条所述CAN报文对应所属的CAN通道的报文接收周期、报文接收时间和报文接收计数;In an exemplary embodiment, the message sending information includes the message sending cycle, message sending time and message sending count of the CAN channel to which each CAN message corresponds; the surrounding receiving information includes the message receiving cycle, message receiving time and message receiving count of the CAN channel to which each CAN message corresponds;

所述基于所述报文发送信息和所述报文接收信息,计算所述车载控制器在执行所述路由转发功能时的丢包率和路由时延,以得到性能测试结果,包括:The calculating, based on the message sending information and the message receiving information, the packet loss rate and the routing delay of the vehicle controller when performing the routing forwarding function to obtain the performance test result includes:

基于所述报文发送计数、所述报文接收计数、所述报文发送周期和所述报文接收周期之间的统计数据,计算得到所述车载控制器在执行所述路由转发功能时的丢包率;以及Based on the message sending count, the message receiving count, and the statistical data between the message sending cycle and the message receiving cycle, a packet loss rate of the vehicle controller when performing the routing forwarding function is calculated; and

基于所述报文发送时间和所述报文接收时间之间的统计数据,计算得到所述车载控制器在执行所述路由转发功能时的路由时延。Based on the statistical data between the message sending time and the message receiving time, the routing delay of the vehicle controller when performing the routing forwarding function is calculated.

在一示例性实施例中,所述对所述DBC文件进行解析,确定由所述报文定义信息组成的路由信息,包括:In an exemplary embodiment, parsing the DBC file to determine routing information composed of the message definition information includes:

基于预设函数,读取出所述DBC文件中的各行文件信息;Based on a preset function, read out each line of file information in the DBC file;

对各行所述文件信息分别进行信息匹配,得到所述DBC文件中存储的报文定义信息;所述报文定义信息至少包括CAN报文对应所属的通道信息、报文名称、唯一标识符、报文长度、报文发送标识和报文接收标识;Match the file information in each row to obtain the message definition information stored in the DBC file; the message definition information at least includes the channel information corresponding to the CAN message, the message name, the unique identifier, the message length, the message sending identifier and the message receiving identifier;

基于所述报文定义信息构建C语言数据结构体,并通过所述C语言数据结构体中的数组内容表征路由信息;其中,所述路由信息用于指示所述车载控制器在执行所述路由转发功能时的路由关系。A C language data structure is constructed based on the message definition information, and routing information is represented by array content in the C language data structure; wherein the routing information is used to indicate the routing relationship of the vehicle controller when executing the routing forwarding function.

在一示例性实施例中,所述基于所述路由信息,控制所述车载控制器向网关设备发送CAN报文,并记录对应的报文发送信息和报文接收信息,以实现所述车载控制器的路由转发功能,包括:In an exemplary embodiment, based on the routing information, controlling the vehicle controller to send a CAN message to a gateway device, and recording corresponding message sending information and message receiving information to implement the routing forwarding function of the vehicle controller includes:

控制所述车载控制器调用预设的第一函数接口,以基于所述函数接口按照所述路由关系向所述网关设备发送多条CAN报文,并记录对应的报文发送信息;Controlling the vehicle-mounted controller to call a preset first function interface to send a plurality of CAN messages to the gateway device according to the routing relationship based on the function interface, and recording corresponding message sending information;

控制所述网关设备调用预设的第二函数接口接收多条所述CAN报文,并记录对应的报文接收信息。The gateway device is controlled to call a preset second function interface to receive a plurality of CAN messages, and corresponding message reception information is recorded.

在一示例性实施例中,所述获取携带有报文定义信息的DBC文件,包括:In an exemplary embodiment, obtaining a DBC file carrying message definition information includes:

响应用户在图像界面中触发针对目标测试车型所对应的测试按钮,获取关联于所述目标测试车型的DBC文件的文件储存路径;其中,不同类型的测试车型所对应关联的DBC文件中的路由表的版本不同,所述路由表用于描述所述报文定义信息;In response to a user triggering a test button corresponding to a target test vehicle model in a graphic interface, a file storage path of a DBC file associated with the target test vehicle model is obtained; wherein different versions of a routing table in a DBC file associated with different types of test vehicle models are different, and the routing table is used to describe the message definition information;

基于所述文件储存路径,从数据文件夹中提取出对应CAN通道的DBC文件。Based on the file storage path, the DBC file corresponding to the CAN channel is extracted from the data folder.

在一示例性实施例中,在所述得到针对所述车载控制器在执行所述路由转发功能时的性能测试结果之后,还包括:In an exemplary embodiment, after obtaining the performance test result of the vehicle-mounted controller when executing the routing forwarding function, the method further includes:

在所述性能测试结果表征针对目标CAN报文的路由时延大于预设阈值时,基于预设函数,将所述目标CAN报文的通道信息、唯一标识符、报文发送周期、报文接收周期和路由时延数据写入到预设日志文件中存储。When the performance test result indicates that the routing delay for the target CAN message is greater than a preset threshold, based on a preset function, the channel information, unique identifier, message sending cycle, message receiving cycle and routing delay data of the target CAN message are written into a preset log file for storage.

根据本公开实施例的第二方面,提供一种车载控制器的性能测试装置,包括:According to a second aspect of an embodiment of the present disclosure, a performance testing device for a vehicle-mounted controller is provided, comprising:

文件获取模块,用于获取携带有报文定义信息的DBC文件;所述报文定义信息为用于发送和接收CAN报文的定义信息;A file acquisition module, used to acquire a DBC file carrying message definition information; the message definition information is definition information for sending and receiving CAN messages;

文件解析模块,用于对所述DBC文件进行解析,确定由所述报文定义信息组成的路由信息;A file parsing module, used for parsing the DBC file to determine routing information composed of the message definition information;

功能测试模块,用于基于所述路由信息,控制所述车载控制器向网关设备发送CAN报文,并记录对应的报文发送信息和报文接收信息,以实现所述车载控制器的路由转发功能;A functional testing module, used to control the vehicle-mounted controller to send CAN messages to the gateway device based on the routing information, and record the corresponding message sending information and message receiving information, so as to realize the routing forwarding function of the vehicle-mounted controller;

测试结果模块,用于基于所述报文发送信息和所述报文接收信息,得到针对所述车载控制器在执行所述路由转发功能时的性能测试结果。A test result module is used to obtain a performance test result of the vehicle controller when executing the routing forwarding function based on the message sending information and the message receiving information.

根据本公开实施例的第三方面,提供一种电动车辆,包括:According to a third aspect of an embodiment of the present disclosure, there is provided an electric vehicle, comprising:

处理器以及与所述处理器连接的存储器,其中,所述存储器中存储有程序数据,所述处理器用于调取所述存储器中存储的所述程序数据,以实现如上述任一项所述的车载控制器的性能测试方法。A processor and a memory connected to the processor, wherein the memory stores program data, and the processor is used to call the program data stored in the memory to implement the performance testing method of the vehicle controller as described in any one of the above items.

根据本公开实施例的第四方面,提供一种计算机可读存储介质,所述计算机可读存储介质中包括程序数据,当所述程序数据由计算机设备的处理器执行时,使得所述计算机设备能够执行如上述任一项所述的车载控制器的性能测试方法。According to the fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, wherein the computer-readable storage medium includes program data. When the program data is executed by a processor of a computer device, the computer device is enabled to execute a performance testing method for a vehicle controller as described in any one of the above items.

根据本公开实施例的第五方面,提供一种计算机程序产品,所述计算机程序产品中包括程序指令,所述程序指令被计算机设备的处理器执行时,使得所述计算机设备能够执行如上述任一项所述的车载控制器的性能测试方法。According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, wherein the computer program product includes program instructions, and when the program instructions are executed by a processor of a computer device, the computer device is enabled to execute a performance testing method for a vehicle controller as described in any one of the above items.

本公开的实施例提供的技术方案至少带来以下有益效果:The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:

一方面,本方案通过先对携带有报文定义信息的DBC文件进行解析,以确定DBC文件中的路由信息,然后再基于路由信息,控制车载控制器向网关设备发送CAN报文,并记录对应的报文发送信息和报文接收信息,最后再基于报文发送信息和报文接收信息,得到针对车载控制器的性能测试结果,从而优化了车载控制器的性能测试流程,有效提高了性能测试的效率,降低了人力和物力的消耗;另一方面,本方案通过区别于现有的性能测试方式,通过对DBC文件进行解析,确定出由报文定义信息组成的路由信息,以基于路由信息控制车载控制器向网关设备发送CAN报文,并记录对应的报文发送信息和报文接收信息,从而能够利用报文发送信息和报文接收信息,得出车载控制器在执行路由转发功能时的性能测试结果,有效降低了企业的生产成本,并提高了对车载控制器进行性能测试的效率和准确率,有利于电动车辆的开发应用。On the one hand, this solution first parses the DBC file carrying the message definition information to determine the routing information in the DBC file, and then controls the vehicle controller to send CAN messages to the gateway device based on the routing information, and records the corresponding message sending information and message receiving information. Finally, based on the message sending information and the message receiving information, the performance test result for the vehicle controller is obtained, thereby optimizing the performance test process of the vehicle controller, effectively improving the efficiency of the performance test, and reducing the consumption of manpower and material resources; on the other hand, this solution is different from the existing performance test method. By parsing the DBC file, the routing information composed of the message definition information is determined, and the vehicle controller is controlled to send CAN messages to the gateway device based on the routing information, and the corresponding message sending information and the message receiving information are recorded, so that the performance test result of the vehicle controller when executing the routing forwarding function can be obtained by using the message sending information and the message receiving information, which effectively reduces the production cost of the enterprise, and improves the efficiency and accuracy of the performance test of the vehicle controller, which is conducive to the development and application of electric vehicles.

应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开。It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

为了更清楚地说明本申请实施例或相关技术中的技术方案,下面将对本申请实施例或相关技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他相关的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments of the present application or the related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

图1是根据一示例性实施例示出的一种车载控制器的性能测试方法的应用环境图。Fig. 1 is a diagram showing an application environment of a performance testing method for a vehicle-mounted controller according to an exemplary embodiment.

图2是根据一示例性实施例示出的一种车载控制器的性能测试方法的流程图。Fig. 2 is a flow chart showing a performance testing method of a vehicle-mounted controller according to an exemplary embodiment.

图3是根据一示例性实施例示出的一种提取DBC文件步骤的流程图。Fig. 3 is a flow chart showing a step of extracting a DBC file according to an exemplary embodiment.

图4是根据一示例性实施例示出的一种对DBC文件进行解析步骤的模块图。Fig. 4 is a module diagram showing steps of parsing a DBC file according to an exemplary embodiment.

图5是根据一示例性实施例示出的一种实现车载控制器实现路由转发功能步骤的模块图。Fig. 5 is a module diagram showing steps for implementing a routing forwarding function of a vehicle-mounted controller according to an exemplary embodiment.

图6是根据一示例性实施例示出的一种车载控制器的性能测试装置的结构框图。Fig. 6 is a structural block diagram of a performance testing device for a vehicle-mounted controller according to an exemplary embodiment.

图7是根据一示例性实施例示出的一种用于车载控制器性能测试的电动车辆的框图。Fig. 7 is a block diagram of an electric vehicle for testing the performance of an on-board controller according to an exemplary embodiment.

具体实施方式Detailed ways

为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

本申请实施例中的术语“和/或”指的是包括相关联的列举项目中的一个或多个的任何和全部的可能组合。还要说明的是:当用在本说明书中时,“包括/包含”指定所陈述的特征、整数、步骤、操作、元件和/或组件的存在,但是不排除一个或多个其他特征、整数、步骤、操作、元件和/或组件和/或它们的组群的存在或添加。The term "and/or" in the embodiments of the present application refers to any and all possible combinations of one or more of the associated enumerated items. It should also be noted that when used in this specification, "include/comprise" specifies the existence of the stated features, integers, steps, operations, elements and/or components, but does not exclude the existence or addition of one or more other features, integers, steps, operations, elements and/or components and/or their groups.

本申请中的术语“第一”、“第二”等是用于区别不同对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其它步骤或单元。The terms "first", "second", etc. in this application are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.

另外,本申请中尽管多次采用术语“第一”、“第二”等来描述各种操作(或各种元件或各种应用或各种指令或各种数据)等,不过这些操作(或元件或应用或指令或数据)不应受这些术语的限制。这些术语只是用于区分一个操作(或元件或应用或指令或数据)和另一个操作(或元件或应用或指令或数据)。In addition, although the terms "first", "second", etc. are used many times in this application to describe various operations (or various elements or various applications or various instructions or various data), etc., these operations (or elements or applications or instructions or data) should not be limited by these terms. These terms are only used to distinguish one operation (or element or application or instruction or data) from another operation (or element or application or instruction or data).

本申请实施例提供的车载控制器的性能测试方法,可以应用于如图1所示的应用环境中。其中,终端102通过通信网络与服务器104进行通信。数据存储系统可以存储服务器104需要处理的数据。数据存储系统可以集成在服务器104上,也可以放在云上或其他网络服务器上。The performance test method of the vehicle controller provided in the embodiment of the present application can be applied to the application environment shown in Figure 1. Among them, the terminal 102 communicates with the server 104 through a communication network. The data storage system can store data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers.

在一些实施例中,参考图1,服务器104获取携带有报文定义信息的DBC文件;报文定义信息为用于发送和接收CAN报文的定义信息;对DBC文件进行解析,确定由报文定义信息组成的路由信息;基于路由信息,控制车载控制器向网关设备发送CAN报文,并记录对应的报文发送信息和报文接收信息,以实现车载控制器的路由转发功能;基于报文发送信息和报文接收信息,得到针对车载控制器在执行路由转发功能时的性能测试结果。In some embodiments, referring to FIG1 , the server 104 obtains a DBC file carrying message definition information; the message definition information is definition information for sending and receiving CAN messages; the DBC file is parsed to determine routing information composed of the message definition information; based on the routing information, the vehicle-mounted controller is controlled to send CAN messages to the gateway device, and the corresponding message sending information and message receiving information are recorded to realize the routing forwarding function of the vehicle-mounted controller; based on the message sending information and the message receiving information, a performance test result of the vehicle-mounted controller when executing the routing forwarding function is obtained.

在一些实施例中,终端102(如移动终端、固定终端)可以以各种形式来实施。其中,终端102可为包括诸如移动电话、智能电话、笔记本电脑、便携式手持式设备、个人数字助理(PDA,Personal Digital Assistant)、平板电脑(PAD)等等的移动终端,终端102也可以是自动柜员机(Automated Teller Machine,ATM)、自动一体机、数字TV、台式计算机、固式计算机等等的固定终端。In some embodiments, the terminal 102 (such as a mobile terminal, a fixed terminal) can be implemented in various forms. The terminal 102 can be a mobile terminal including a mobile phone, a smart phone, a laptop, a portable handheld device, a personal digital assistant (PDA), a tablet computer (PAD), etc. The terminal 102 can also be a fixed terminal such as an automated teller machine (ATM), an automatic all-in-one machine, a digital TV, a desktop computer, a fixed computer, etc.

下面,假设终端102是固定终端。然而,本领域技术人员将理解的是,若有特别用于移动目的的操作或者元件,根据本申请公开的实施方式的构造也能够应用于移动类型的终端102。In the following, it is assumed that the terminal 102 is a fixed terminal. However, it will be understood by those skilled in the art that the configuration according to the embodiments disclosed in this application can also be applied to a mobile type terminal 102 if there are operations or elements specifically for mobile purposes.

在一些实施例中,服务器104运行的数据处理组件可以加载正在被执行的可以包括各种附加服务器应用和/或中间层应用中的任何一种,如包括HTTP(超文本传输协议)、FTP(文件传输协议)、CGI(通用网关界面)、RDBMS(关系型数据库管理系统)等。In some embodiments, the data processing component running on the server 104 may load any of a variety of additional server applications and/or middle-tier applications being executed, such as HTTP (Hypertext Transfer Protocol), FTP (File Transfer Protocol), CGI (Common Gateway Interface), RDBMS (Relational Database Management System), etc.

在一些实施例中,服务器104可以用独立的服务器或者是多个服务器组成的服务器集群来实现。服务器104可以适于运行提供前述公开中描述的终端102的一个或多个应用服务或软件组件。In some embodiments, the server 104 may be implemented as an independent server or a server cluster consisting of multiple servers. The server 104 may be suitable for running one or more application services or software components that provide the terminal 102 described in the above disclosure.

在一些实施例中,应用服务或软件组件运行的操作系统可以包括各种版本的Microsoft Windows®、Apple Macintosh®和/或Linux操作系统、各种商用或类UNIX®操作系统(包括但不限于各种GNU/Linux操作系统、Google Chrome®OS等)和/或移动操作系统,诸如iOS®、Windows®Phone、Android®OS、BlackBerry®OS、Palm®OS操作系统,以及其它在线操作系统或者离线操作系统,在这里不做具体的限制。In some embodiments, the operating system on which the application service or software component runs may include various versions of Microsoft Windows®, Apple Macintosh® and/or Linux operating systems, various commercial or UNIX®-like operating systems (including but not limited to various GNU/Linux operating systems, Google Chrome® OS, etc.) and/or mobile operating systems, such as iOS®, Windows® Phone, Android® OS, BlackBerry® OS, Palm® OS operating systems, and other online operating systems or offline operating systems, without specific limitation here.

在一些实施例中,如图2所示,提供了一种车载控制器的性能测试方法,以该方法应用于图1中的服务器104为例进行说明,该方法包括以下步骤:In some embodiments, as shown in FIG. 2 , a performance test method for a vehicle controller is provided. The method is described by taking the application of the method to the server 104 in FIG. 1 as an example. The method includes the following steps:

步骤S11:获取携带有报文定义信息的DBC文件。Step S11: Obtain a DBC file carrying message definition information.

其中,报文定义信息为用于发送和接收CAN报文的定义信息。The message definition information is definition information used to send and receive CAN messages.

其中,DBC文件是用于携带Controller Area Network (CAN)报文描述信息的文件。在汽车行业和其他领域中,CAN总线是一种常用的通信协议,用于在控制单元之间进行通信。Among them, the DBC file is used to carry the Controller Area Network (CAN) message description information. In the automotive industry and other fields, the CAN bus is a commonly used communication protocol for communication between control units.

在一实施例中,DBC文件包含了CAN网络中使用的消息、信号、节点、以及通信速率等信息,以便在不同设备之间进行数据交换和通信。In one embodiment, the DBC file contains information such as messages, signals, nodes, and communication rates used in the CAN network to facilitate data exchange and communication between different devices.

在一实施例中,DBC文件是由车辆制造商提供的,它是确保车载控制器(例如网关控制器)正确工作的重要依据。车载控制器中的路由表的来源通常是DBC文件,其是一种标准的数据格式文件,它包含了车辆网络中所有信号的定义,如它们的ID、周期、大小和名字等。这些信息被用来生成路由表,用于指导车载控制器如何处理和转发数据包。In one embodiment, the DBC file is provided by the vehicle manufacturer and is an important basis for ensuring that the vehicle controller (such as a gateway controller) works correctly. The source of the routing table in the vehicle controller is usually the DBC file, which is a standard data format file that contains the definition of all signals in the vehicle network, such as their ID, period, size, and name. This information is used to generate a routing table to instruct the vehicle controller on how to process and forward data packets.

在一实施例中,DBC文件中包括有多种基础元素、关键字和数据字段,以用于表达其特定的信息含义。In one embodiment, the DBC file includes a variety of basic elements, keywords, and data fields to express its specific information meaning.

在一些实施例中,基础元素包括:In some embodiments, the base elements include:

Version,其指定了DBC文件的格式版本,确保兼容性。Version, which specifies the format version of the DBC file to ensure compatibility.

Nodes,其列出了CAN总线上的节点数量和名称,每个节点代表一个ECU(电子控制单元),其节点名称是唯一的。Nodes, which lists the number and names of nodes on the CAN bus. Each node represents an ECU (electronic control unit) and its node name is unique.

Messages,其描述了在CAN总线上传输的消息,包括其ID、名称、长度和周期等信息。Messages, which describe the messages transmitted on the CAN bus, including information such as its ID, name, length and period.

Signals,其定义了每条CAN消息中各个信号的名称、长度、位置、单位、因子、范围等详细信息。Signals, which defines the name, length, position, unit, factor, range and other detailed information of each signal in each CAN message.

Environment Variables,其可以定义环境变量,用于表示常量或变量值。Environment Variables, which can define environment variables to represent constant or variable values.

Value Tables,其创建信号值与实际物理值之间的映射表,方便数据解析。Value Tables, which create mapping tables between signal values and actual physical values to facilitate data parsing.

Comments,其注释部分用于记录有关CAN总线的额外信息或说明。Comments: The comments section is used to record additional information or instructions about the CAN bus.

在一些实施例中,关键字包括:In some embodiments, keywords include:

BU_,其后跟一系列空格分隔的节点名称,这些名称必须在整个DBC文件中唯一。BU_ followed by a series of space-delimited node names that must be unique throughout the DBC file.

BO_,其指代消息或报文,包含其属性和相关信号。BO_, which refers to a message or packet, including its attributes and related signals.

SG_,其用于定义单个信号的属性,如其在消息中的位置和所占位数。SG_, which is used to define the properties of a single signal, such as its position in the message and the number of bits it occupies.

在一些实施例中,数据字段包括:DBC文件能够处理8字节十六进制CAN报文和原始CAN数据,一个CAN帧的数据字段最多可以包含8个单byte值、64个单bit值或一个64-bit值,或是这些值的任何组合。In some embodiments, the data field includes: The DBC file can process 8-byte hexadecimal CAN messages and raw CAN data. The data field of a CAN frame can contain up to 8 single-byte values, 64 single-bit values, or a 64-bit value, or any combination of these values.

在一实施例中,CAN报文为用于描述由目标车辆发出的CAN信号的比特序列。In one embodiment, the CAN message is a bit sequence used to describe a CAN signal sent by a target vehicle.

在一实施例中,CAN报文是在CAN总线上传输的数据单元,包含了发送者的标识符、控制域、数据域和校验域等信息。CAN报文可以承载一个或多个CAN信号。CAN信号是CAN报文中的一个数据段,用于表示特定的信息或参数。一个CAN报文可以包含多个CAN信号,每个CAN信号都有自己的起始位、长度、数据类型和值域。In one embodiment, a CAN message is a data unit transmitted on a CAN bus, including information such as a sender identifier, a control field, a data field, and a check field. A CAN message can carry one or more CAN signals. A CAN signal is a data segment in a CAN message, used to represent specific information or parameters. A CAN message can contain multiple CAN signals, each of which has its own start bit, length, data type, and value field.

在实际应用中,CAN信号通常用于表示传感器数据、执行器控制命令等具体信息。CAN报文通过携带一个或多个CAN信号,实现了不同控制单元之间的数据交换和通信。通过解析CAN报文中的CAN信号,接收端可以获取到发送端发送的具体数据内容,从而实现系统之间的实时通信和数据交换。In practical applications, CAN signals are usually used to represent specific information such as sensor data and actuator control commands. CAN messages carry one or more CAN signals to achieve data exchange and communication between different control units. By parsing the CAN signals in the CAN messages, the receiver can obtain the specific data content sent by the sender, thereby achieving real-time communication and data exchange between systems.

步骤S12:对DBC文件进行解析,确定由报文定义信息组成的路由信息。Step S12: Parse the DBC file to determine routing information consisting of message definition information.

在一些实施例中,服务器可以首先对DBC文件进行文件读取,如使用编程语言(如C语音、Python等)中的文件读取功能,打开并读取DBC文件,以将DBC文件的内容读取到内存中的数据结构中,以便后续的文本扫描和分析;然后再文本进行扫描,即遍历读取的DBC文件内容,逐行扫描文本,其中在扫描过程中,可以使用正则表达式(regular expression)来匹配CAN报文的定义,以确定CAN报文的报文信息,即在扫描过程中,可以查找包含CAN消息定义的行(例如,筛选“BO_”开头的行,其关键字“BO_”后内容为报文的唯一标识符,再其后依次为报文名称、报文长度和发/收标志),从而通过匹配这些行,可以确定CAN报文的报文定义信息,这些报文定义信息用于组成DBC文件中的路由表;最后,根据路由表中的报文定义信息,生成用于表征路由关系的路由信息,并将该路由信息导入到程序中,以供后续的处理和使用。In some embodiments, the server may first read the DBC file, such as using a file reading function in a programming language (such as C language, Python, etc.) to open and read the DBC file, so as to read the content of the DBC file into a data structure in memory for subsequent text scanning and analysis; and then scan the text, that is, traverse the read DBC file content and scan the text line by line, wherein during the scanning process, a regular expression may be used to match the definition of the CAN message to determine the message information of the CAN message, that is, during the scanning process, a line containing a CAN message definition may be found (for example, filtering a line beginning with "BO_", wherein the content after the keyword "BO_" is a unique identifier of the message, and then the message name, message length, and send/receive flag are sequentially followed), so that by matching these lines, the message definition information of the CAN message may be determined, and the message definition information is used to form a routing table in the DBC file; finally, based on the message definition information in the routing table, routing information for characterizing the routing relationship is generated, and the routing information is imported into the program for subsequent processing and use.

其中,在电动汽车的开发中,路由表常见的存储格式为DBC文件,即服务器预先将每一CAN通道的报文定义信息按照路由表的形式保存到对应的DBC文件中。Among them, in the development of electric vehicles, the common storage format of the routing table is the DBC file, that is, the server saves the message definition information of each CAN channel in the corresponding DBC file in the form of a routing table in advance.

其中,表征路由关系的路由信息用于指示某目标CAN报文是属于哪一路的CAN通道、其是以什么发送周期发出、其最终是发送到哪一(几)路的CAN通道。The routing information representing the routing relationship is used to indicate which CAN channel a target CAN message belongs to, at what sending cycle it is sent, and to which CAN channel (several) it is finally sent.

步骤S13:基于路由信息,控制车载控制器向网关设备发送CAN报文,并记录对应的报文发送信息和报文接收信息,以实现车载控制器的路由转发功能。Step S13: Based on the routing information, control the vehicle controller to send CAN messages to the gateway device, and record the corresponding message sending information and message receiving information to realize the routing forwarding function of the vehicle controller.

具体地,服务器在一方面可以控制车载控制器调用预设的函数接口按照路由信息所对应的路由关系,来向网关设备连续发送多条CAN报文,并记录对应的报文发送信息。服务器在另一方面可以控制网关设备调用预设的函数接口按照路由信息所对应的路由关系,来接收CAN报文,并记录对应的报文接收信息。Specifically, on one hand, the server can control the vehicle controller to call the preset function interface to continuously send multiple CAN messages to the gateway device according to the routing relationship corresponding to the routing information, and record the corresponding message sending information. On the other hand, the server can control the gateway device to call the preset function interface to receive CAN messages according to the routing relationship corresponding to the routing information, and record the corresponding message receiving information.

在一实施例中,报文发送信息包括各条CAN报文对应所属的CAN通道的报文发送周期、报文发送时间和报文发送计数;以及,包围接收信息包括各条CAN报文对应所属的CAN通道的报文接收周期、报文接收时间和报文接收计数。In one embodiment, the message sending information includes the message sending cycle, message sending time and message sending count of the CAN channel to which each CAN message belongs; and the surrounding receiving information includes the message receiving cycle, message receiving time and message receiving count of the CAN channel to which each CAN message belongs.

步骤S14:基于报文发送信息和报文接收信息,得到针对车载控制器在执行路由转发功能时的性能测试结果。Step S14: Based on the message sending information and the message receiving information, a performance test result of the vehicle controller when executing the routing forwarding function is obtained.

具体地,服务器基于报文发送信息和报文接收信息,计算车载控制器在执行路由转发功能时的丢包率和路由时延,以得到性能测试结果。Specifically, the server calculates the packet loss rate and routing delay of the vehicle controller when performing the routing forwarding function based on the message sending information and the message receiving information to obtain the performance test result.

其中,服务器基于报文发送信息和报文接收信息,计算车载控制器在执行路由转发功能时的丢包率的过程,可以包括如下步骤:基于报文发送计数、报文接收计数、报文发送周期和报文接收周期之间的统计数据,计算得到车载控制器在执行路由转发功能时的丢包率。Among them, the process in which the server calculates the packet loss rate of the vehicle controller when performing the routing forwarding function based on the message sending information and the message receiving information may include the following steps: based on the message sending count, the message receiving count, the statistical data between the message sending cycle and the message receiving cycle, the packet loss rate of the vehicle controller when performing the routing forwarding function is calculated.

在一示例性实施例中,服务器可以基于如下的丢包率计算公式,计算得出车载控制器在执行路由转发功能时的丢包率:In an exemplary embodiment, the server may calculate the packet loss rate of the vehicle controller when performing the routing forwarding function based on the following packet loss rate calculation formula:

lost=rxCount-txCount*txPeriod/rxCount。lost=rxCount-txCount*txPeriod/rxCount.

其中,lost为丢包率、rxCount为报文接收计数、txCount为报文发送计数、txPeriod为报文发送周期。Among them, lose is the packet loss rate, rxCount is the message receiving count, txCount is the message sending count, and txPeriod is the message sending period.

其中,服务器基于报文发送信息和报文接收信息,计算车载控制器在执行路由转发功能时的路由时延的过程,可以包括如下步骤:基于报文发送时间和报文接收时间之间的统计数据,计算得到车载控制器在执行路由转发功能时的路由时延。Among them, the process of the server calculating the routing delay of the vehicle controller when performing the routing forwarding function based on the message sending information and the message receiving information may include the following steps: based on the statistical data between the message sending time and the message receiving time, the routing delay of the vehicle controller when performing the routing forwarding function is calculated.

在一示例性实施例中,服务器可以基于如下的路由时延计算公式,计算得出车载控制器在执行路由转发功能时的路由时延:In an exemplary embodiment, the server may calculate the routing delay of the vehicle controller when performing the routing forwarding function based on the following routing delay calculation formula:

difLatency=(rxTime-txTime)/1000000。difLatency = (rxTime - txTime) / 1000000.

其中,difLatency为路由时延(单位由纳秒换算为毫秒)、rxTime为报文接收时间、txTime为报文发送时间。Among them, difLatency is the routing delay (converted from nanoseconds to milliseconds), rxTime is the message receiving time, and txTime is the message sending time.

在一些实施例中,服务器可以基于性能测试结果,对车载控制器进行性能评估、优化指导以及质量控制。具体地,在第一方面,服务器可以对不同型号和版本的车载控制器进行路由性能的量化评估,以帮助开发者了解其产品在高负载情况下的性能表现;在第二方面,服务器通过丢包率和路由时延作为衡量指标,为车载控制器的进一步优化提供数据支撑和改进方向;在第三方面,在相关的车辆产品发布之前,对车载控制器进行压力测试,以确保车载控制器能够在极端条件下的可靠性,从而提升产品质量。In some embodiments, the server can perform performance evaluation, optimization guidance, and quality control on the vehicle controller based on the performance test results. Specifically, in the first aspect, the server can perform quantitative evaluation of the routing performance of vehicle controllers of different models and versions to help developers understand the performance of their products under high load conditions; in the second aspect, the server uses packet loss rate and routing delay as measurement indicators to provide data support and improvement direction for further optimization of the vehicle controller; in the third aspect, before the relevant vehicle products are released, the vehicle controller is stress tested to ensure the reliability of the vehicle controller under extreme conditions, thereby improving product quality.

上述车载控制器的性能测试的过程中,一方面,本方案通过先对携带有报文定义信息的DBC文件进行解析,以确定DBC文件中的路由信息,然后再基于路由信息,控制车载控制器向网关设备发送CAN报文,并记录对应的报文发送信息和报文接收信息,最后再基于报文发送信息和报文接收信息,得到针对车载控制器的性能测试结果,从而优化了车载控制器的性能测试流程,有效提高了性能测试的效率,降低了人力和物力的消耗;另一方面,本方案通过区别于现有的性能测试方式,通过对DBC文件进行解析,确定出由报文定义信息组成的路由信息,以基于路由信息控制车载控制器向网关设备发送CAN报文,并记录对应的报文发送信息和报文接收信息,从而能够利用报文发送信息和报文接收信息,得出车载控制器在执行路由转发功能时的性能测试结果,有效降低了企业的生产成本,并提高了对车载控制器进行性能测试的效率和准确率,有利于电动车辆的开发应用。During the performance test of the above-mentioned on-board controller, on the one hand, this solution first parses the DBC file carrying the message definition information to determine the routing information in the DBC file, and then controls the on-board controller to send CAN messages to the gateway device based on the routing information, and records the corresponding message sending information and message receiving information, and finally obtains the performance test results for the on-board controller based on the message sending information and the message receiving information, thereby optimizing the performance test process of the on-board controller, effectively improving the efficiency of the performance test, and reducing the consumption of manpower and material resources; on the other hand, this solution is different from the existing performance test method, by parsing the DBC file to determine the routing information composed of the message definition information, so as to control the on-board controller to send CAN messages to the gateway device based on the routing information, and record the corresponding message sending information and message receiving information, so that the performance test results of the on-board controller when executing the routing forwarding function can be obtained by using the message sending information and the message receiving information, which effectively reduces the production cost of the enterprise, and improves the efficiency and accuracy of the performance test of the on-board controller, which is conducive to the development and application of electric vehicles.

本领域技术人员可以理解地,在具体实施方式的上述方法中,所揭露的方法可以通过更为具体的方式以实现。例如,以上所描述的服务器基于路由信息,控制车载控制器向网关设备发送CAN报文,并记录对应的报文发送信息和报文接收信息,以实现车载控制器的路由转发功能的实施方式仅仅是示意性的。Those skilled in the art can understand that in the above method of the specific implementation, the disclosed method can be implemented in a more specific manner. For example, the above described server controls the vehicle controller to send CAN messages to the gateway device based on the routing information, and records the corresponding message sending information and message receiving information to implement the routing forwarding function of the vehicle controller. The implementation method is only illustrative.

本申请中公开的车载控制器的性能测试方法,可以应用于汽车开发工具,例如Vehicle Spy3中。其中,该汽车开发工具集成了诊断、节点/ECU(Electronic ControlUnit)仿真、数据获取、自动测试和车内通信网络监控等功能,其可以通过连接硬件设备(如网关设备)即可与各种车载ECU进行通信。The performance test method of the vehicle controller disclosed in this application can be applied to automobile development tools, such as Vehicle Spy3. The automobile development tool integrates functions such as diagnosis, node/ECU (Electronic Control Unit) simulation, data acquisition, automatic testing and in-vehicle communication network monitoring, and can communicate with various vehicle ECUs by connecting hardware devices (such as gateway devices).

在一些实施例中,该汽车开发工具包括硬件连接功能(SetUp-HardWare)、报文查看页面(Spy Networks-Messages)、图像面板(Measurement–Graphical Panels)、重用软件模块(Function Block)、数据变量(Application Signal)和c代码接口(C Codelnterface)。In some embodiments, the automotive development tool includes a hardware connection function (SetUp-HardWare), a message viewing page (Spy Networks-Messages), a graphic panel (Measurement-Graphical Panels), a reusable software module (Function Block), a data variable (Application Signal) and a C code interface (C Codelnterface).

其中,Function Block能运行工程师配置相应的脚本并进行自动执行,以完成自动执行的任务。Among them, Function Block can run the corresponding scripts configured by engineers and execute them automatically to complete the automatic execution tasks.

其中,硬件连接功能用将汽车开发工具与硬件设备(如网关设备)进行连接。Among them, the hardware connection function is used to connect automotive development tools with hardware devices (such as gateway devices).

其中,该图像界面为汽车开发工具中的用户界面或者图像界面,其允许工程师自定义的用户界面,支持添加多种不同类型的工具,例如图表(graphs)、条状图(bar-graphs)、发送按钮(transmitbuttons)、下拉菜单(dropdowns)、測试按钮(test buttons)、仪表(meters)、把手(knob)、显示(LEDs/lights)、文本显示(text displays)和数字输入框(numericentrybox)等。每个工具都可以重新定义大小以及在面板上随意放置。可以选择一组工具及其测试按钮,并将设置其对齐。在设置显示之后,可以锁定面板,以阻止由于鼠标移动造成工具位置变动。工程师可以创建一些图形面板的集合并且将其分发至其他人员。Among them, the graphical interface is the user interface or graphical interface in the automotive development tool, which allows engineers to customize the user interface and supports adding many different types of tools, such as graphs, bar-graphs, transmit buttons, drop-down menus, test buttons, meters, knobs, displays (LEDs/lights), text displays, and numeric entry boxes. Each tool can be resized and placed anywhere on the panel. A group of tools and their test buttons can be selected and their alignment can be set. After setting the display, the panel can be locked to prevent the tool position from changing due to mouse movement. Engineers can create a collection of graphic panels and distribute them to other people.

其中,Application Signal用来存储变量,其可以保存用户设置的值,或者不是必须从网络报文推断踹的计算信号。比如,创建一个信号,当该信号关联一个函数发生器后,它的值就会随函数发生器改变。Application Signal is used to store variables, which can save user-set values or calculated signals that do not necessarily need to be inferred from network messages. For example, when a signal is created and associated with a function generator, its value will change with the function generator.

其中,c代码接口(C Code lnterface)提供了一种利用c代码与汽车开发工具所工作的通信协议进行通信的方式。在汽车开发工具中使用C代码可以重用汽车开发工具的所有功能,例如:报文解码、报文接受、数据库解码、信号显示以及缓冲捕获等,c代码接口支持基于事件和一步一步的过程类型编程。Among them, the C code interface provides a way to communicate with the communication protocol that the automotive development tool works on using C code. Using C code in the automotive development tool can reuse all the functions of the automotive development tool, such as: message decoding, message reception, database decoding, signal display, and buffer capture. The C code interface supports event-based and step-by-step process type programming.

在一实施例中,服务器可以执行如下的流程步骤,以执行本申请中汽车开发工具的各项功能,如下:In one embodiment, the server may execute the following process steps to execute the various functions of the automotive development tool in this application, as follows:

步骤一:在Application Signal功能中添加信号变量,所添加的变量将会在CCode Interface中作为变量由用户在系统界面中选取的值传输到代码中,如代表开始信号、负载、丢包数、时延、测试车型dbc文件存放路径的变量等。Step 1: Add signal variables in the Application Signal function. The added variables will be used as variables in the CCode Interface and transferred to the code by the values selected by the user in the system interface, such as variables representing the start signal, load, number of packet losses, delay, and storage path of the test vehicle model dbc file.

步骤二:将步骤一中的信号变量添加到C Code Interface-Edit-event handlercode中,然后C Code Interface将会生成对应报文的C代码函数变量和接口,从而工程师可通过在C代码中调用这些接口控制对应变量的输入和输出;其中,生成的信息响应函数接口与图像界面的按钮管理,当工程师点击图像界面的按钮时,对应C代码中的函数接口将会执行,以实现工程师期望的逻辑。Step 2: Add the signal variable in step 1 to C Code Interface-Edit-event handlercode, and then C Code Interface will generate C code function variables and interfaces for the corresponding messages, so that engineers can control the input and output of the corresponding variables by calling these interfaces in C code; among them, the generated information response function interface is managed by the button of the graphic interface. When the engineer clicks the button of the graphic interface, the function interface in the corresponding C code will be executed to realize the logic expected by the engineer.

步骤三:在Graphical Panels中,添加实现汽车开发工具的功能所需要的各种按钮,并在每个按钮的属性设置功能-信号功能中将这些按钮与对应的信号报文、信号变量关联,以实现按钮控制整个汽车开发工具的功能和显示程序中的输出功能。Step 3: In Graphical Panels, add various buttons required to implement the functions of the automotive development tool, and associate these buttons with the corresponding signal messages and signal variables in the property setting function-signal function of each button to realize the button control of the entire automotive development tool function and the output function in the display program.

在一些实施例中,汽车开发工具的各项功能的实现方式如下:In some embodiments, the various functions of the automotive development tool are implemented as follows:

测试ECU功能:在图像界面添加一个drop down list按钮,在其属性页面编辑下列选项,添加支持的网关控制器。将其值关联到变量GWTstSW,在CCodeInterface的C代码中根据变量GWTstSW切换不同的网关控制器程序。Test ECU function: Add a drop down list button in the graphical interface, edit the following options in its property page, add supported gateway controllers, associate its value with the variable GWTstSW, and switch different gateway controller programs according to the variable GWTstSW in the C code of CCodeInterface.

测试车型功能:不同车型、不同版本的路由表DBC文件不同,该drop down list按钮用以选择不同的DBC导入CCodeInterface的C代码中。在图像界面添加一个drop downlist按钮,在其属性页面编辑下列选项,添加支持测试的路由表DBC文件的存放路径。将其值关联到变量GWTstVehicleType中,在CCodeInterface的C代码中根据变量GWTstVehicleType的值读取对应路由表的DBC文件,并按照DBC文件的格式,解析出报文的路由关系和不同报文的发送周期。Test vehicle model function: Different models and versions of routing table DBC files are different. The drop down list button is used to select different DBCs to import into the C code of CCodeInterface. Add a drop downlist button in the image interface, edit the following options on its property page, and add the storage path of the routing table DBC file that supports testing. Associate its value with the variable GWTstVehicleType, read the DBC file of the corresponding routing table according to the value of the variable GWTstVehicleType in the C code of CCodeInterface, and parse the routing relationship of the message and the sending cycle of different messages according to the format of the DBC file.

开始运行功能:添加一个 on off button按钮控制程序运行,将其关联到变量GWTset On Off中控制CCodeInterface的C代码中开始执行。Start running function: Add an on off button to control the program running, and associate it with the C code that controls CCodeInterface in the variable GWTset On Off to start execution.

通道名称获取功能:由界面键入,不同DBC文件可能每路CAN通道名称略有不同。Channel name acquisition function: typed in the interface, different DBC files may have slightly different names for each CAN channel.

当前负载计算功能:为每路CAN通道添加一个TextDisplay按钮,在该按钮的属性页面设置其关联的型号为对应CAN通道的“Percent Use”,该功能由硬件设备自动计算获得。Current load calculation function: Add a TextDisplay button for each CAN channel, and set its associated model to the "Percent Use" of the corresponding CAN channel in the button's property page. This function is automatically calculated by the hardware device.

最大负载记录功能:记录程序运行期间最大的负载值。Maximum load recording function: record the maximum load value during program operation.

丢包统计功能:统计每路can通道是否存在路由转发丢包的数量。为每路CAN通道添加一个TextDisplay按钮,并在其属性页面中关联变量MsgRouteLost。该按钮具有数值显示功能,用来显示在变量中添加的负载数组变量MsgRouteLost,该数组的值在C CodeInterface的C代码中进行计算。Packet loss statistics function: count the number of packet losses in routing forwarding for each CAN channel. Add a TextDisplay button to each CAN channel and associate the variable MsgRouteLost in its property page. The button has a numerical display function, which is used to display the load array variable MsgRouteLost added in the variable. The value of the array is calculated in the C code of the C CodeInterface.

其中,变量MsgRouteLost表示消息丢失的情况。在通信系统中,如果发送的消息未能成功到达目标节点,就会被认为是消息丢失。这可能是由于网络故障、传输错误、节点故障等原因导致的。消息丢失可能会导致通信系统的数据不一致性,因此在设计通信系统时需要考虑消息丢失的情况并采取相应的措施来处理。The variable MsgRouteLost indicates the situation of message loss. In a communication system, if a sent message fails to reach the target node successfully, it is considered as message loss. This may be caused by network failure, transmission error, node failure, etc. Message loss may cause data inconsistency in the communication system, so when designing a communication system, it is necessary to consider the situation of message loss and take corresponding measures to deal with it.

时延统计功能:统计每路can通道路由转发的时延。为每路CAN通道添加一个TextDisplay按钮,并在其属性页面中关联变量MsgRouteLatency。该按钮具有数值显示功能,用来显示在变量中添加的时延数组变量MsgRouteLatency,该数组的值在C CodeInterface的C代码中进行计算。Latency statistics function: Statistics the latency of each CAN channel routing forwarding. Add a TextDisplay button for each CAN channel and associate the variable MsgRouteLatency in its property page. This button has a numerical display function, which is used to display the latency array variable MsgRouteLatency added in the variable. The value of this array is calculated in the C code of C CodeInterface.

其中,变量MsgRouteLatency表示消息传输的延迟时间。在通信系统中,消息从发送端到接收端的传输过程中会存在一定的延迟,这个延迟时间即为消息传输的延迟。消息传输的延迟受到多种因素的影响,包括网络拥塞、传输距离、传输介质等。在实时通信系统中,消息传输的延迟时间通常需要控制在一定范围内,以确保系统的实时性和可靠性。The variable MsgRouteLatency represents the delay time of message transmission. In a communication system, there will be a certain delay in the transmission process of a message from the sender to the receiver. This delay time is the message transmission delay. The message transmission delay is affected by many factors, including network congestion, transmission distance, transmission medium, etc. In a real-time communication system, the message transmission delay time usually needs to be controlled within a certain range to ensure the real-time performance and reliability of the system.

增加负载功能:用于显示手动负载控制增加的负载值。Increase load function: used to display the load value increased by manual load control.

负载控制功能:用于实现对每路CAN通道的负载增减功能,以模拟测试在不同负载情况下网关控制器的性能。为每路CAN通道添加一个TextDisplay按钮,并在其属性页面中关联变量NetworkLoadCtr。同时该按钮具有数值显示功能,用来显示在变量中添加的负载数组变量NetworkLoadCtr,该数组的值在CCodeInterface的C代码中用来控制负载报文的发送量。Load control function: used to implement the load increase and decrease function for each CAN channel to simulate and test the performance of the gateway controller under different load conditions. Add a TextDisplay button to each CAN channel and associate the variable NetworkLoadCtr in its property page. At the same time, the button has a numerical display function to display the load array variable NetworkLoadCtr added in the variable. The value of this array is used in the C code of CCodeInterface to control the amount of load messages sent.

其中,变量NetworkLoadCtr表示网络负载控制器。在网络通信系统中,网络负载控制器通常用于监控和管理网络负载,以确保网络资源的合理利用和系统性能的稳定。网络负载控制器可根据网络流量情况动态调整数据传输速率、优化数据传输路径、实现负载均衡等功能,从而有效地管理网络负载,提高网络的可靠性和效率。The variable NetworkLoadCtr represents the network load controller. In a network communication system, the network load controller is usually used to monitor and manage the network load to ensure the rational use of network resources and the stability of system performance. The network load controller can dynamically adjust the data transmission rate, optimize the data transmission path, and implement load balancing according to the network traffic situation, thereby effectively managing the network load and improving the reliability and efficiency of the network.

其中,当工程师在图形界面增减负载控制的值时,程序对应的变量NetworkLoadCtr数组发生改变,并判断当前CAN通道负载和输入负载的大小,①若当前CAN通道负载<输入负载的大小,则增大负载报文的发送速率;②若当前CAN通道负载>输入负载的大小,则减小负载报文的发送速率。Among them, when the engineer increases or decreases the value of the load control in the graphical interface, the corresponding variable NetworkLoadCtr array of the program changes, and judges the size of the current CAN channel load and the input load. ① If the current CAN channel load is less than the size of the input load, the sending rate of the load message is increased; ② If the current CAN channel load is greater than the size of the input load, the sending rate of the load message is reduced.

其中,负载报文是在C程序中特意为控制负载填充的报文,其报文CANid由路由表取得,长度统一为8(CAN)/64(CANFD),数据的每一位自动循环填充0x00-0xff的值。Among them, the load message is a message specially filled in the C program to control the load. The message CANid is obtained from the routing table, and the length is uniformly 8 (CAN)/64 (CANFD). Each bit of the data is automatically filled with a value of 0x00-0xff.

在一示例性实施例中,参阅图3,图3为本申请中提取DBC文件一实施例中的流程示意图。其中,在步骤S11中,即服务器获取携带有报文定义信息的DBC文件的过程,具体包括如下步骤:In an exemplary embodiment, refer to FIG3 , which is a flow chart of extracting a DBC file in an embodiment of the present application. In step S11 , the process of the server obtaining a DBC file carrying message definition information specifically includes the following steps:

步骤S111:响应用户在图像界面中触发针对目标测试车型所对应的测试按钮,获取关联于目标测试车型的DBC文件的文件储存路径。Step S111: In response to the user triggering a test button corresponding to a target test vehicle model in the graphic interface, a file storage path of a DBC file associated with the target test vehicle model is obtained.

其中,不同类型的测试车型所对应关联的DBC文件中的路由表的版本不同,路由表用于描述报文定义信息。Among them, different types of test vehicle models correspond to different versions of the routing table in the DBC file, and the routing table is used to describe the message definition information.

步骤S112:基于文件储存路径,从数据文件夹中提取出对应CAN通道的DBC文件。Step S112: extracting the DBC file corresponding to the CAN channel from the data folder based on the file storage path.

具体地,工程师首先在图像界面中触发针对目标测试车型所对应的测试按钮,然后服务器再获取关联于该目标测试车型的DBC文件的文件储存路径;最后服务器再根据文件储存路径,从数据文件夹中提取出对应CAN通道的DBC文件。Specifically, the engineer first triggers the test button corresponding to the target test vehicle model in the graphic interface, and then the server obtains the file storage path of the DBC file associated with the target test vehicle model; finally, the server extracts the DBC file corresponding to the CAN channel from the data folder based on the file storage path.

在一示例性实施例中,参阅图4,图4为本申请中对DBC文件进行解析一实施例中的流程示意图。其中,在步骤S12中,即服务器对DBC文件进行解析,确定由报文定义信息组成的路由信息的过程,具体包括如下步骤:In an exemplary embodiment, refer to FIG4, which is a flow chart of an embodiment of parsing a DBC file in the present application. In step S12, the server parses the DBC file to determine the routing information composed of the message definition information, which specifically includes the following steps:

步骤S121:基于预设函数,读取出DBC文件中的各行文件信息。Step S121: Based on a preset function, read out each line of file information in the DBC file.

在一些实施例中,服务器可以将DBC文件的文件存储路径输入到fopen()函数中,以使fopen()函数打开DBC文件,并通过fget方法按行读取出DBC文件中的每一行文件信息。In some embodiments, the server may input the file storage path of the DBC file into the fopen() function, so that the fopen() function opens the DBC file and reads each line of file information in the DBC file line by line through the fget method.

步骤S122:对各行文件信息分别进行信息匹配,得到DBC文件中存储的报文定义信息。Step S122: performing information matching on each line of file information to obtain the message definition information stored in the DBC file.

其中,报文定义信息至少包括CAN报文对应所属的通道信息、报文名称、唯一标识符、报文长度、报文发送标识和报文接收标识。The message definition information at least includes the channel information corresponding to the CAN message, the message name, the unique identifier, the message length, the message sending identifier and the message receiving identifier.

在一些实施例中,服务器可以使用if (line.substr(0, 3) == "BU_")语句,来从文件信息中筛选出以“BU_ ”开头的行,以得到CAN报文对应所属的通道信息。其中,CAN通道为关键字“BU_ ”后的内容,如BU_: Node_1 GW即代表Node_1通道。In some embodiments, the server may use the if (line.substr(0, 3) == "BU_") statement to filter out the lines starting with "BU_" from the file information to obtain the channel information corresponding to the CAN message. The CAN channel is the content after the keyword "BU_", such as BU_: Node_1 GW, which represents the Node_1 channel.

在一些实施例中,服务器可以使用if (line.substr(0, 3) == "BO_")语句,来从文件信息中筛选出以“BO_ ”开头的行,关键字“BO_ ”后内容为唯一标识符,再其后依次为报文名称、报文长度、报文发送标识/报文接收标识。如BO_ 261 VCU1_vehicleTorque_105:8 Node_1解析出的内容为:canid=261,报文名称VCU1_vehicleTorque_105,报文长度=8,该报文在Node_1这CAN通道发出。若该报文为该通道收时,最后发/收标准为“GW”。In some embodiments, the server can use the if (line.substr(0, 3) == "BO_") statement to filter out the lines starting with "BO_" from the file information. The content after the keyword "BO_" is a unique identifier, followed by the message name, message length, and message sending identifier/message receiving identifier. For example, the content parsed from BO_ 261 VCU1_vehicleTorque_105:8 Node_1 is: canid=261, message name VCU1_vehicleTorque_105, message length=8, and the message is sent from the CAN channel of Node_1. If the message is received by the channel, the final send/receive standard is "GW".

在一些实施例中,服务器可以使用if (line.substr(0, 3) == "BA_")语句,来从文件信息中筛选出以“BA_ ”开头的行,以得到CAN报文对应的报文发送周期。其中,关键字“BA_”后的内容即为报文发送周期,如BA_ "GenMsgCycleTime" BO_ 324 10;代表报文GenMsgCycleTime周期为10ms。In some embodiments, the server can use the if (line.substr(0, 3) == "BA_") statement to filter out the lines starting with "BA_" from the file information to obtain the message sending cycle corresponding to the CAN message. Among them, the content after the keyword "BA_" is the message sending cycle, such as BA_ "GenMsgCycleTime" BO_ 324 10; represents that the message GenMsgCycleTime cycle is 10ms.

步骤S123:基于报文定义信息构建C语言数据结构体,并通过C语言数据结构体中的数组内容表征路由信息。Step S123: construct a C language data structure based on the message definition information, and represent the routing information through the array content in the C language data structure.

其中,路由信息用于指示车载控制器在执行路由转发功能时的路由关系。The routing information is used to indicate the routing relationship of the vehicle controller when performing the routing forwarding function.

其中,服务器可以通过定义CAN报文对应的数据结构体,以更好地组织和管理CAN通信中的报文信息,便于程序对CAN报文数据进行解析和处理。在实际的嵌入式系统开发中,CAN报文对应的数据结构体通常用于描述电动车辆的各种状态和参数信息,以便系统能够准确地解析和处理CAN报文数据。Among them, the server can better organize and manage the message information in CAN communication by defining the data structure corresponding to the CAN message, so as to facilitate the program to parse and process the CAN message data. In the actual embedded system development, the data structure corresponding to the CAN message is usually used to describe various states and parameter information of electric vehicles so that the system can accurately parse and process the CAN message data.

在一些实施例中,服务器可以首先使用C语言结构体模拟创建一个容器map,其中,该容器map的key为每一条CAN报文的唯一标识符,即报文ID,该容器map的value为一个数组,其数组内容为其在出现的CAN通道上的通道名称、报文长度、报文周期、报文收/发标志;然后,服务器再将解析的所有报文定义信息按CAN报文的唯一标识符存入到该map中,以得用于表征路由信息的C语言数据结构体,从而即可通过该数据结构体中的value得到CAN报文是从哪一路的CAN通道发出、以什么报文周期发出、传到哪一(几)路的CAN通道。In some embodiments, the server may first use a C language structure to simulate the creation of a container map, wherein the key of the container map is a unique identifier of each CAN message, namely, the message ID, and the value of the container map is an array, the array content of which is the channel name, message length, message cycle, and message receive/send flag on the CAN channel on which it appears; then, the server stores all parsed message definition information into the map according to the unique identifier of the CAN message to obtain a C language data structure for characterizing routing information, thereby being able to obtain from the value in the data structure which CAN channel the CAN message is sent from, at what message cycle it is sent, and to which CAN channel(s) the CAN message is transmitted.

在一示例性实施例中,参阅图5,图5为本申请中实现车载控制器实现路由转发功能一实施例中的流程示意图。其中,在步骤S13中,即服务器基于路由信息,控制车载控制器向网关设备发送CAN报文,并记录对应的报文发送信息和报文接收信息,以实现车载控制器的路由转发功能的过程,具体包括如下步骤:In an exemplary embodiment, refer to FIG5 , which is a flow chart of an embodiment of implementing the routing forwarding function of the vehicle controller in the present application. In step S13, the server controls the vehicle controller to send CAN messages to the gateway device based on the routing information, and records the corresponding message sending information and message receiving information to implement the routing forwarding function of the vehicle controller, which specifically includes the following steps:

步骤S131:控制车载控制器调用预设的第一函数接口,以基于函数接口按照路由关系向网关设备发送多条CAN报文,并记录对应的报文发送信息。Step S131: Control the vehicle controller to call a preset first function interface to send multiple CAN messages to the gateway device according to the routing relationship based on the function interface, and record the corresponding message sending information.

具体地,服务器可以控制车载控制器调用预设的第一函数接口以按照路由信息所对应的路由关系,来向网关设备连续发送多条CAN报文,并记录对应的报文发送信息。Specifically, the server can control the vehicle controller to call a preset first function interface to continuously send multiple CAN messages to the gateway device according to the routing relationship corresponding to the routing information, and record the corresponding message sending information.

其中,服务器可以模拟车载控制器向网关设备发送CAN报文,以测试其能否转发CAN报文,其中,服务器可以根据车载控制的实时负载,来控制关联的变量Network LoadCtr以增减报文发送的频率,其中,报文发送的频率可以使用毫秒定时器来控制。The server can simulate the vehicle controller to send CAN messages to the gateway device to test whether it can forward CAN messages. The server can control the associated variable Network LoadCtr to increase or decrease the frequency of message sending according to the real-time load of the vehicle control. The frequency of message sending can be controlled using a millisecond timer.

在一实施例中,服务器可以控制车载控制器调用C Code Interface中对应C代码框架的Generic Message Transmit()函数接口,来向网关设备连续发送CAN报文,并且在发送成功时,记录到该条CAN报文对应所属的CAN通道的报文发送计数txCount、报文发送周期txPeriod和报文发送时间txTime到结构体变量中。In one embodiment, the server can control the vehicle controller to call the Generic Message Transmit() function interface corresponding to the C code framework in the C Code Interface to continuously send CAN messages to the gateway device, and when the sending is successful, the message sending count txCount, message sending period txPeriod and message sending time txTime of the CAN channel to which the CAN message belongs are recorded in the structure variable.

其中,在发送CAN报文的过程中,发送的CAN报文的计数值可以自动填充为0x00——0xFF的值。In the process of sending the CAN message, the count value of the sent CAN message can be automatically filled with a value of 0x00-0xFF.

步骤S132:控制网关设备调用预设的第二函数接口接收多条CAN报文,并记录对应的报文接收信息。Step S132: Control the gateway device to call a preset second function interface to receive multiple CAN messages, and record corresponding message reception information.

具体地,服务器可以控制网关设备调用预设的第二函数接口按照路由信息所对应的路由关系,来接收车载控制器发送过来的每条CAN报文,并记录对应的报文接收信息。Specifically, the server can control the gateway device to call the preset second function interface to receive each CAN message sent by the vehicle controller according to the routing relationship corresponding to the routing information, and record the corresponding message reception information.

在一实施例中,服务器可控制网关设备调用C Code Interface中对应C代码框架的Every Message()函数接口,来接收车载控制器发送过来的每条CAN报文。其中,该函数接口每当网关设备每次抓到CAN报文时自动执行相应的报文逻辑,并记录其收到的每条CAN报文对应所属的CAN通道的报文接收周期rxPeriod,和收到报文接收时间rxTime和报文接收计数rxCount。其中,每当网关设备收到一条CAN报文时对其计数加一。In one embodiment, the server can control the gateway device to call the Every Message() function interface corresponding to the C code framework in the C Code Interface to receive each CAN message sent by the vehicle controller. The function interface automatically executes the corresponding message logic every time the gateway device captures a CAN message, and records the message receiving period rxPeriod of the CAN channel to which each CAN message received corresponds, the received message receiving time rxTime, and the message receiving count rxCount. The count is increased by one every time the gateway device receives a CAN message.

在一示例性实施例中,在服务器得到针对车载控制器执行路由转发功能时的性能测试结果之后,还可以包括如下步骤:在性能测试结果表征针对目标CAN报文的路由时延大于预设阈值时,基于预设函数,将目标CAN报文的通道信息、唯一标识符、报文发送周期、报文接收周期和路由时延数据写入到预设日志文件中存储。In an exemplary embodiment, after the server obtains the performance test results when executing the routing forwarding function for the on-board controller, the following steps may also be included: when the performance test results indicate that the routing delay for the target CAN message is greater than a preset threshold, based on a preset function, the channel information, unique identifier, message sending period, message receiving period and routing delay data of the target CAN message are written into a preset log file for storage.

具体地,当服务器计算到针对某目标CAN报文的路由时延大于预设的阈值时,表征车载控制器在对该目标CAN报文执行路由转发功能时出现路由时延异常,则服务器自动使用预设函数(例如fwrite函数)将该目标CAN报文的CAN通道信息、唯一标识符、报文发送周期、报文接收周期和路由时延数据写入到日志log文件中存储,以供工程师在后续进行数据跟踪,从而在实际部署之前预防潜在故障。Specifically, when the server calculates that the routing delay for a target CAN message is greater than a preset threshold, it indicates that an abnormal routing delay occurs when the on-board controller performs the routing forwarding function for the target CAN message. The server automatically uses a preset function (such as the fwrite function) to write the CAN channel information, unique identifier, message sending cycle, message receiving cycle and routing delay data of the target CAN message into the log file for storage, so that engineers can track the data later, thereby preventing potential failures before actual deployment.

在另一示例性实施例中,在服务器得到针对车载控制器执行路由转发功能时的性能测试结果之后,还可以包括如下步骤:基于预设函数,将各CAN报文的通道信息、唯一标识符、性能测试结果写入到预设日志文件中存储。In another exemplary embodiment, after the server obtains the performance test results when executing the routing forwarding function for the vehicle-mounted controller, the following steps may also be included: based on a preset function, the channel information, unique identifier, and performance test results of each CAN message are written into a preset log file for storage.

具体地,在车载控制器执行完成路由转发功能,并得到对应的性能测试结果时,表征车载控制器在对该所有的CAN报文均执行完成路由转发功能,则服务器自动使用预设函数(例如fwrite函数)将各个CAN报文的CAN通道信息、唯一标识符和性能测试结果写入到日志log文件中存储,以供工程师在后续进行数据跟踪,从而在实际部署之前预防潜在故障。Specifically, when the on-board controller completes the routing and forwarding function and obtains the corresponding performance test results, it indicates that the on-board controller has completed the routing and forwarding function for all CAN messages. The server automatically uses a preset function (such as the fwrite function) to write the CAN channel information, unique identifier and performance test results of each CAN message into the log file for storage, so that engineers can track the data later, thereby preventing potential failures before actual deployment.

这样,一方面,本方案通过先对携带有报文定义信息的DBC文件进行解析,以确定DBC文件中的路由信息,然后再基于路由信息,控制车载控制器向网关设备发送CAN报文,并记录对应的报文发送信息和报文接收信息,最后再基于报文发送信息和报文接收信息,得到针对车载控制器的性能测试结果,从而优化了车载控制器的性能测试流程,有效提高了性能测试的效率,降低了人力和物力的消耗;另一方面,本方案通过区别于现有的性能测试方式,通过对DBC文件进行解析,确定出由报文定义信息组成的路由信息,以基于路由信息控制车载控制器向网关设备发送CAN报文,并记录对应的报文发送信息和报文接收信息,从而能够利用报文发送信息和报文接收信息,得出车载控制器在执行路由转发功能时的性能测试结果,有效降低了企业的生产成本,并提高了对车载控制器进行性能测试的效率和准确率,有利于电动车辆的开发应用。In this way, on the one hand, this solution first parses the DBC file carrying the message definition information to determine the routing information in the DBC file, and then controls the vehicle controller to send CAN messages to the gateway device based on the routing information, and records the corresponding message sending information and message receiving information. Finally, based on the message sending information and the message receiving information, the performance test result for the vehicle controller is obtained, thereby optimizing the performance test process of the vehicle controller, effectively improving the efficiency of the performance test, and reducing the consumption of manpower and material resources; on the other hand, this solution is different from the existing performance test method. By parsing the DBC file, the routing information composed of the message definition information is determined, and the vehicle controller is controlled to send CAN messages to the gateway device based on the routing information, and the corresponding message sending information and the message receiving information are recorded, so that the performance test result of the vehicle controller when executing the routing forwarding function can be obtained by using the message sending information and the message receiving information, which effectively reduces the production cost of the enterprise, and improves the efficiency and accuracy of the performance test of the vehicle controller, which is conducive to the development and application of electric vehicles.

应该理解的是,虽然图2-图5的附图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以通过其它的顺序执行。而且,图2-图5中的至少一部分步骤可以包括多个步骤或者多个阶段,这些步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤中的步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that, although the various steps in the accompanying drawings of Fig. 2-Fig. 5 are shown in sequence according to the indication of the arrows, these steps are not necessarily performed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be performed in other orders. Moreover, at least a portion of the steps in Fig. 2-Fig. 5 may include a plurality of steps or a plurality of stages, and these steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with other steps or at least a portion of the steps or stages in other steps.

可以理解的是,本说明书中上述方法的各个实施例之间相同/相似的部分可互相参见,每个实施例重点说明的是与其他实施例的不同之处,相关之处参见其他方法实施例的说明即可。It can be understood that the same/similar parts between the various embodiments of the above method in this specification can refer to each other, and each embodiment focuses on the differences from other embodiments. For related points, please refer to the description of other method embodiments.

图6是本申请实施例提供的一种车载控制器的性能测试装置的结构框图。参照图6,该车载控制器的性能测试装置10包括:文件获取模块11、文件解析模块12、功能测试模块13和测试结果模块14。Fig. 6 is a structural block diagram of a performance test device for a vehicle-mounted controller provided in an embodiment of the present application. Referring to Fig. 6 , the performance test device 10 for a vehicle-mounted controller includes: a file acquisition module 11 , a file parsing module 12 , a function test module 13 and a test result module 14 .

其中,该文件获取模块11,用于获取携带有报文定义信息的DBC文件;所述报文定义信息为用于发送和接收CAN报文的定义信息;The file acquisition module 11 is used to acquire a DBC file carrying message definition information; the message definition information is definition information for sending and receiving CAN messages;

其中,该文件解析模块12,用于对所述DBC文件进行解析,确定由所述报文定义信息组成的路由信息;The file parsing module 12 is used to parse the DBC file and determine the routing information composed of the message definition information;

其中,该功能测试模块13,用于基于所述路由信息,控制所述车载控制器向网关设备发送CAN报文,并记录对应的报文发送信息和报文接收信息,以实现所述车载控制器的路由转发功能;The function test module 13 is used to control the vehicle controller to send CAN messages to the gateway device based on the routing information, and record the corresponding message sending information and message receiving information to realize the routing forwarding function of the vehicle controller;

其中,该测试结果模块14,用于基于所述报文发送信息和所述报文接收信息,得到针对所述车载控制器在执行所述路由转发功能时的性能测试结果。The test result module 14 is used to obtain the performance test result of the vehicle controller when executing the routing forwarding function based on the message sending information and the message receiving information.

在一实施例中,所述怠速运行数据包括发电转速数据、环境温度数据和怠速运行时长;In one embodiment, the idle operation data includes power generation speed data, ambient temperature data and idle operation time;

在所述基于所述报文发送信息和所述报文接收信息,得到针对所述车载控制器在执行所述路由转发功能时的性能测试结果的方面,该车载控制器的性能测试装置10还用于执行:In the aspect of obtaining the performance test result of the vehicle-mounted controller when executing the routing forwarding function based on the message sending information and the message receiving information, the performance test device 10 of the vehicle-mounted controller is further used to perform:

基于所述报文发送信息和所述报文接收信息,计算所述车载控制器在执行所述路由转发功能时的丢包率和路由时延,以得到性能测试结果。Based on the message sending information and the message receiving information, the packet loss rate and routing delay of the vehicle controller when performing the routing forwarding function are calculated to obtain a performance test result.

在一实施例中,所述报文发送信息包括各条所述CAN报文对应所属的CAN通道的报文发送周期、报文发送时间和报文发送计数;所述包围接收信息包括各条所述CAN报文对应所属的CAN通道的报文接收周期、报文接收时间和报文接收计数;In one embodiment, the message sending information includes the message sending cycle, message sending time and message sending count of the CAN channel to which each CAN message corresponds; the surrounding receiving information includes the message receiving cycle, message receiving time and message receiving count of the CAN channel to which each CAN message corresponds;

在所述基于所述报文发送信息和所述报文接收信息,计算所述车载控制器在执行所述路由转发功能时的丢包率和路由时延,以得到性能测试结果的方面,该车载控制器的性能测试装置10还用于执行:In the aspect of calculating the packet loss rate and routing delay of the vehicle-mounted controller when performing the routing forwarding function based on the message sending information and the message receiving information to obtain the performance test result, the performance testing device 10 of the vehicle-mounted controller is also used to perform:

基于所述报文发送计数、所述报文接收计数、所述报文发送周期和所述报文接收周期之间的统计数据,计算得到所述车载控制器在执行所述路由转发功能时的丢包率;以及Based on the message sending count, the message receiving count, and the statistical data between the message sending cycle and the message receiving cycle, a packet loss rate of the vehicle controller when performing the routing forwarding function is calculated; and

基于所述报文发送时间和所述报文接收时间之间的统计数据,计算得到所述车载控制器在执行所述路由转发功能时的路由时延。Based on the statistical data between the message sending time and the message receiving time, the routing delay of the vehicle controller when performing the routing forwarding function is calculated.

在一实施例中,在所述对所述DBC文件进行解析,确定由所述报文定义信息组成的路由信息的方面,该车载控制器的性能测试装置10还用于执行:In one embodiment, in the aspect of parsing the DBC file to determine the routing information composed of the message definition information, the performance testing device 10 of the vehicle controller is further used to perform:

基于预设函数,读取出所述DBC文件中的各行文件信息;Based on a preset function, read out each line of file information in the DBC file;

对各行所述文件信息分别进行信息匹配,得到所述DBC文件中存储的报文定义信息;所述报文定义信息至少包括CAN报文对应所属的通道信息、报文名称、唯一标识符、报文长度、报文发送标识和报文接收标识;Match the file information in each row to obtain the message definition information stored in the DBC file; the message definition information at least includes the channel information corresponding to the CAN message, the message name, the unique identifier, the message length, the message sending identifier and the message receiving identifier;

基于所述报文定义信息构建C语言数据结构体,并通过所述C语言数据结构体中的数组内容表征路由信息;其中,所述路由信息用于指示所述车载控制器在执行所述路由转发功能时的路由关系。A C language data structure is constructed based on the message definition information, and routing information is represented by array content in the C language data structure; wherein the routing information is used to indicate the routing relationship of the vehicle controller when executing the routing forwarding function.

在一实施例中,在所述基于所述路由信息,控制所述车载控制器向网关设备发送CAN报文,并记录对应的报文发送信息和报文接收信息,以实现所述车载控制器的路由转发功能的方面,该车载控制器的性能测试装置10还用于执行:In one embodiment, in the aspect of controlling the vehicle-mounted controller to send CAN messages to the gateway device based on the routing information, and recording the corresponding message sending information and message receiving information to realize the routing forwarding function of the vehicle-mounted controller, the performance testing device 10 of the vehicle-mounted controller is further used to perform:

控制所述车载控制器调用预设的第一函数接口,以基于所述函数接口按照所述路由关系向所述网关设备发送多条CAN报文,并记录对应的报文发送信息;Controlling the vehicle-mounted controller to call a preset first function interface to send a plurality of CAN messages to the gateway device according to the routing relationship based on the function interface, and recording corresponding message sending information;

控制所述网关设备调用预设的第二函数接口接收多条所述CAN报文,并记录对应的报文接收信息。The gateway device is controlled to call a preset second function interface to receive a plurality of CAN messages, and corresponding message reception information is recorded.

在一实施例中,在所述获取携带有报文定义信息的DBC文件的方面,该车载控制器的性能测试装置10还用于执行:In one embodiment, in the aspect of obtaining the DBC file carrying the message definition information, the performance testing device 10 of the vehicle-mounted controller is further used to execute:

响应用户在图像界面中触发针对目标测试车型所对应的测试按钮,获取关联于所述目标测试车型的DBC文件的文件储存路径;其中,不同类型的测试车型所对应关联的DBC文件中的路由表的版本不同,所述路由表用于描述所述报文定义信息;In response to a user triggering a test button corresponding to a target test vehicle model in a graphic interface, a file storage path of a DBC file associated with the target test vehicle model is obtained; wherein different versions of a routing table in a DBC file associated with different types of test vehicle models are different, and the routing table is used to describe the message definition information;

基于所述文件储存路径,从数据文件夹中提取出对应CAN通道的DBC文件。Based on the file storage path, the DBC file corresponding to the CAN channel is extracted from the data folder.

在一实施例中,在所述得到针对所述车载控制器在执行所述路由转发功能时的性能测试结果之后,该车载控制器的性能测试装置10还用于执行:In one embodiment, after obtaining the performance test result of the vehicle-mounted controller when executing the routing forwarding function, the performance test device 10 of the vehicle-mounted controller is further used to perform:

在所述性能测试结果表征针对目标CAN报文的路由时延大于预设阈值时,基于预设函数,将所述目标CAN报文的通道信息、唯一标识符、报文发送周期、报文接收周期和路由时延数据写入到预设日志文件中存储。When the performance test result indicates that the routing delay for the target CAN message is greater than a preset threshold, based on a preset function, the channel information, unique identifier, message sending cycle, message receiving cycle and routing delay data of the target CAN message are written into a preset log file for storage.

图7是本申请实施例提供的一种电动车辆的框图。参照图7,该电动车辆包括处理器、存储器、输入/输出接口(Input/Output,简称I/O)和通信接口。其中,处理器、存储器和输入/输出接口通过系统总线连接,通信接口通过输入/输出接口连接到系统总线。其中,该电动车辆的处理器用于提供计算和控制能力。该电动车辆的存储器包括非易失性存储介质和内存储器。该非易失性存储介质存储有操作系统、计算机程序和数据库。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该电动车辆的数据库用于存储电动车辆的里程保养数据。该电动车辆的输入/输出接口用于处理器与外部设备之间交换信息。该电动车辆的通信接口用于与外部的终端通过网络连接通信。该计算机程序被处理器执行时以实现如上述的车载控制器的性能测试方法。FIG7 is a block diagram of an electric vehicle provided in an embodiment of the present application. Referring to FIG7, the electric vehicle includes a processor, a memory, an input/output interface (Input/Output, referred to as I/O) and a communication interface. Among them, the processor, the memory and the input/output interface are connected through a system bus, and the communication interface is connected to the system bus through the input/output interface. Among them, the processor of the electric vehicle is used to provide computing and control capabilities. The memory of the electric vehicle includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the electric vehicle is used to store mileage maintenance data of the electric vehicle. The input/output interface of the electric vehicle is used to exchange information between the processor and an external device. The communication interface of the electric vehicle is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the performance test method of the vehicle controller as described above is implemented.

在一些实施例中,电动车辆为一种电子设备,该电子设备中的计算系统可以运行一个或多个操作系统,包括以上讨论的任何操作系统以及任何商用的服务器操作系统。该电动车辆还可以运行各种附加服务器应用和/或中间层应用中的任何一种,包括HTTP(超文本传输协议)服务器、FTP(文件传输协议)服务器、CGI(通用网关界面)服务器、超级服务器、数据库服务器等。示例性数据库服务器包括但不限于可从(国际商业机器)等商购获得的数据库服务器。In some embodiments, the electric vehicle is an electronic device in which a computing system can run one or more operating systems, including any of the operating systems discussed above and any commercially available server operating systems. The electric vehicle can also run any of a variety of additional server applications and/or middle-tier applications, including HTTP (Hypertext Transfer Protocol) servers, FTP (File Transfer Protocol) servers, CGI (Common Gateway Interface) servers, super servers, database servers, etc. Exemplary database servers include, but are not limited to, database servers commercially available from (International Business Machines) and the like.

在一些实施例中,处理器通常控制电动车辆的整体操作,诸如与显示、数据处理、数据通信和记录操作相关联的操作。处理器可以包括一个或多个处理器组件来执行计算机程序,以完成上述的方法的全部或部分步骤。此外,处理器组件可以包括一个或多个模块,便于处理器组件和其他组件之间的交互。例如,处理器组件可以包括多媒体模块,以方便利用多媒体组件控制用户电动车辆和处理器之间的交互。In some embodiments, the processor generally controls the overall operation of the electric vehicle, such as operations associated with display, data processing, data communication, and recording operations. The processor may include one or more processor components to execute a computer program to perform all or part of the steps of the above method. In addition, the processor component may include one or more modules to facilitate interaction between the processor component and other components. For example, the processor component may include a multimedia module to facilitate the interaction between the user's electric vehicle and the processor using the multimedia component to control.

本申请实施例提供的一种计算机可读存储介质。该计算机可读存储介质上存储有计算机程序,其中,计算机程序被处理器执行时实现如上述的车载控制器的性能测试方法。An embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the performance test method of the vehicle-mounted controller as described above is implemented.

在本申请各个实施例中的各功能单元集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在计算机可读存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机可读存储介质在一个计算机程序中,包括若干指令用以使得一台计算机设备(可以是个人计算机,系统服务器,或者网络设备等)、电子设备(例如MP3、MP4等,也可以是手机、平板电脑、可穿戴设备等智能终端,也可以是台式电脑等)或者处理器(processor)以执行本申请各个实施方式方法的全部或部分步骤。If the integrated units of the functional units in the various embodiments of the present application are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer-readable storage medium includes several instructions in a computer program to enable a computer device (which can be a personal computer, a system server, or a network device, etc.), an electronic device (such as MP3, MP4, etc., or a smart terminal such as a mobile phone, a tablet computer, a wearable device, or a desktop computer, etc.) or a processor to execute all or part of the steps of the various implementation methods of the present application.

本申请实施例提供的一种计算机程序产品。该计算机程序产品中包括程序指令,该程序指令可由电动车辆的处理器执行以实现如上述的车载控制器的性能测试方法。An embodiment of the present application provides a computer program product, which includes program instructions, and the program instructions can be executed by a processor of an electric vehicle to implement the performance test method of the vehicle controller as described above.

本领域内的技术人员应明白,本申请的实施例可提供有车载控制器的性能测试方法、车载控制器的性能测试装置、电动车辆、计算机可读存储介质或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机程序指令(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that the embodiments of the present application may provide a performance test method for an on-board controller, a performance test device for an on-board controller, an electric vehicle, a computer-readable storage medium, or a computer program product. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may take the form of a computer program product implemented on one or more computer program instructions (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

本申请是参照根据本申请实施例中的车载控制器的性能测试方法、车载控制器的性能测试装置、电动车辆、计算机可读存储介质或计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序产品实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序产品到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的程序指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present application is described with reference to the flow chart and/or block diagram of the performance test method of the vehicle-mounted controller, the performance test device of the vehicle-mounted controller, the electric vehicle, the computer-readable storage medium or the computer program product according to the embodiment of the present application. It should be understood that each process and/or box in the flow chart and/or block diagram, and the combination of the process and/or box in the flow chart and/or block diagram can be realized by a computer program product. These computer program products can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the program instructions executed by the processor of the computer or other programmable data processing device generate a device for realizing the function specified in one process or multiple processes in the flow chart and/or one box or multiple boxes in the block diagram.

这些计算机程序产品也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机程序产品中的程序指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program products may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to operate in a specific manner, so that the program instructions stored in the computer program product produce a manufactured product including an instruction device that implements the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.

这些程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的程序指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These program instructions may also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the program instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.

需要说明的,上述的各种方法、装置、电子设备、计算机可读存储介质、计算机程序产品等根据方法实施例的描述还可以包括其他的实施方式,具体的实现方式可以参照相关方法实施例的描述,在此不作一一赘述。It should be noted that the above-mentioned various methods, devices, electronic devices, computer-readable storage media, computer program products, etc. may also include other implementation methods according to the description of the method embodiments. The specific implementation methods can refer to the description of the relevant method embodiments, and will not be described one by one here.

本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本公开的其它实施方案。本公开旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由权利要求指出。Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.

应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利要求来限制。It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (10)

1.一种车载控制器的性能测试方法,其特征在于,所述方法包括:1. A performance testing method for a vehicle-mounted controller, characterized in that the method comprises: 获取携带有报文定义信息的DBC文件;所述报文定义信息为用于发送和接收CAN报文的定义信息;Obtaining a DBC file carrying message definition information; the message definition information is definition information for sending and receiving CAN messages; 对所述DBC文件进行解析,确定由所述报文定义信息组成的路由信息;Parsing the DBC file to determine routing information composed of the message definition information; 基于所述路由信息,控制所述车载控制器向网关设备发送CAN报文,并记录对应的报文发送信息和报文接收信息,以实现所述车载控制器的路由转发功能;Based on the routing information, control the vehicle-mounted controller to send CAN messages to the gateway device, and record corresponding message sending information and message receiving information to realize the routing forwarding function of the vehicle-mounted controller; 基于所述报文发送信息和所述报文接收信息,得到针对所述车载控制器在执行所述路由转发功能时的性能测试结果。Based on the message sending information and the message receiving information, a performance test result of the vehicle-mounted controller when executing the routing forwarding function is obtained. 2.根据权利要求1所述的方法,其特征在于,所述基于所述报文发送信息和所述报文接收信息,得到针对所述车载控制器在执行所述路由转发功能时的性能测试结果,包括:2. The method according to claim 1, characterized in that the obtaining of the performance test result of the vehicle controller when executing the routing forwarding function based on the message sending information and the message receiving information comprises: 基于所述报文发送信息和所述报文接收信息,计算所述车载控制器在执行所述路由转发功能时的丢包率和路由时延,以得到性能测试结果。Based on the message sending information and the message receiving information, the packet loss rate and routing delay of the vehicle controller when performing the routing forwarding function are calculated to obtain a performance test result. 3.根据权利要求2所述的方法,其特征在于,所述报文发送信息包括各条所述CAN报文对应所属的CAN通道的报文发送周期、报文发送时间和报文发送计数;所述包围接收信息包括各条所述CAN报文对应所属的CAN通道的报文接收周期、报文接收时间和报文接收计数;3. The method according to claim 2, characterized in that the message sending information includes the message sending cycle, message sending time and message sending count of the CAN channel to which each CAN message corresponds; the surrounding receiving information includes the message receiving cycle, message receiving time and message receiving count of the CAN channel to which each CAN message corresponds; 所述基于所述报文发送信息和所述报文接收信息,计算所述车载控制器在执行所述路由转发功能时的丢包率和路由时延,以得到性能测试结果,包括:The calculating, based on the message sending information and the message receiving information, the packet loss rate and the routing delay of the vehicle controller when performing the routing forwarding function to obtain the performance test result includes: 基于所述报文发送计数、所述报文接收计数、所述报文发送周期和所述报文接收周期之间的统计数据,计算得到所述车载控制器在执行所述路由转发功能时的丢包率;以及Based on the message sending count, the message receiving count, and the statistical data between the message sending cycle and the message receiving cycle, a packet loss rate of the vehicle controller when performing the routing forwarding function is calculated; and 基于所述报文发送时间和所述报文接收时间之间的统计数据,计算得到所述车载控制器在执行所述路由转发功能时的路由时延。Based on the statistical data between the message sending time and the message receiving time, the routing delay of the vehicle controller when performing the routing forwarding function is calculated. 4.根据权利要求1所述的方法,其特征在于,所述对所述DBC文件进行解析,确定由所述报文定义信息组成的路由信息,包括:4. The method according to claim 1, wherein the step of parsing the DBC file to determine the routing information composed of the message definition information comprises: 基于预设函数,读取出所述DBC文件中的各行文件信息;Based on a preset function, read out each line of file information in the DBC file; 对各行所述文件信息分别进行信息匹配,得到所述DBC文件中存储的报文定义信息;所述报文定义信息至少包括CAN报文对应所属的通道信息、报文名称、唯一标识符、报文长度、报文发送标识和报文接收标识;Match the file information in each row to obtain the message definition information stored in the DBC file; the message definition information at least includes the channel information corresponding to the CAN message, the message name, the unique identifier, the message length, the message sending identifier and the message receiving identifier; 基于所述报文定义信息构建C语言数据结构体,并通过所述C语言数据结构体中的数组内容表征路由信息;其中,所述路由信息用于指示所述车载控制器在执行所述路由转发功能时的路由关系。A C language data structure is constructed based on the message definition information, and routing information is represented by array content in the C language data structure; wherein the routing information is used to indicate the routing relationship of the vehicle controller when executing the routing forwarding function. 5.根据权利要求4所述的方法,其特征在于,所述基于所述路由信息,控制所述车载控制器向网关设备发送CAN报文,并记录对应的报文发送信息和报文接收信息,以实现所述车载控制器的路由转发功能,包括:5. The method according to claim 4, characterized in that, based on the routing information, controlling the vehicle controller to send CAN messages to the gateway device, and recording the corresponding message sending information and message receiving information to realize the routing forwarding function of the vehicle controller, comprises: 控制所述车载控制器调用预设的第一函数接口,以基于所述函数接口按照所述路由关系向所述网关设备发送多条CAN报文,并记录对应的报文发送信息;Controlling the vehicle-mounted controller to call a preset first function interface to send a plurality of CAN messages to the gateway device according to the routing relationship based on the function interface, and recording corresponding message sending information; 控制所述网关设备调用预设的第二函数接口接收多条所述CAN报文,并记录对应的报文接收信息。The gateway device is controlled to call a preset second function interface to receive a plurality of CAN messages, and corresponding message reception information is recorded. 6.根据权利要求1所述的方法,其特征在于,所述获取携带有报文定义信息的DBC文件,包括:6. The method according to claim 1, characterized in that the step of obtaining a DBC file carrying message definition information comprises: 响应用户在图像界面中触发针对目标测试车型所对应的测试按钮,获取关联于所述目标测试车型的DBC文件的文件储存路径;其中,不同类型的测试车型所对应关联的DBC文件中的路由表的版本不同,所述路由表用于描述所述报文定义信息;In response to a user triggering a test button corresponding to a target test vehicle model in a graphic interface, a file storage path of a DBC file associated with the target test vehicle model is obtained; wherein different versions of a routing table in a DBC file associated with different types of test vehicle models are different, and the routing table is used to describe the message definition information; 基于所述文件储存路径,从数据文件夹中提取出对应CAN通道的DBC文件。Based on the file storage path, the DBC file corresponding to the CAN channel is extracted from the data folder. 7.根据权利要求1所述的方法,其特征在于,在所述得到针对所述车载控制器在执行所述路由转发功能时的性能测试结果之后,还包括:7. The method according to claim 1, characterized in that after obtaining the performance test result of the vehicle controller when executing the routing forwarding function, it also includes: 在所述性能测试结果表征针对目标CAN报文的路由时延大于预设阈值时,基于预设函数,将所述目标CAN报文的通道信息、唯一标识符、报文发送周期、报文接收周期和路由时延数据写入到预设日志文件中存储。When the performance test result indicates that the routing delay for the target CAN message is greater than a preset threshold, based on a preset function, the channel information, unique identifier, message sending cycle, message receiving cycle and routing delay data of the target CAN message are written into a preset log file for storage. 8.一种车载控制器的性能测试装置,其特征在于,所述装置包括:8. A performance test device for a vehicle-mounted controller, characterized in that the device comprises: 文件获取模块,用于获取携带有报文定义信息的DBC文件;所述报文定义信息为用于发送和接收CAN报文的定义信息;A file acquisition module, used to acquire a DBC file carrying message definition information; the message definition information is definition information for sending and receiving CAN messages; 文件解析模块,用于对所述DBC文件进行解析,确定由所述报文定义信息组成的路由信息;A file parsing module, used for parsing the DBC file to determine routing information composed of the message definition information; 功能测试模块,用于基于所述路由信息,控制所述车载控制器向网关设备发送CAN报文,并记录对应的报文发送信息和报文接收信息,以实现所述车载控制器的路由转发功能;A functional testing module, used to control the vehicle-mounted controller to send CAN messages to the gateway device based on the routing information, and record the corresponding message sending information and message receiving information, so as to realize the routing forwarding function of the vehicle-mounted controller; 测试结果模块,用于基于所述报文发送信息和所述报文接收信息,得到针对所述车载控制器在执行所述路由转发功能时的性能测试结果。A test result module is used to obtain a performance test result of the vehicle controller when executing the routing forwarding function based on the message sending information and the message receiving information. 9.一种电动车辆,其特征在于,所述电动车辆包括处理器以及与所述处理器连接的存储器,其中,所述存储器中存储有程序数据,所述处理器用于调取所述存储器中存储的所述程序数据,以执行如权利要求1-7中任一项所述的方法。9. An electric vehicle, characterized in that the electric vehicle comprises a processor and a memory connected to the processor, wherein program data is stored in the memory, and the processor is used to call the program data stored in the memory to execute the method as described in any one of claims 1-7. 10.一种计算机可读存储介质,内部存储有程序指令,其特征在于,所述程序指令在被处理器执行时以实现如权利要求1-7中任一项所述的方法。10. A computer-readable storage medium having program instructions stored therein, wherein the program instructions, when executed by a processor, implement the method according to any one of claims 1 to 7.
CN202410475627.6A 2024-04-19 2024-04-19 Performance test method and device of vehicle-mounted controller, electric vehicle and medium Pending CN118348958A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410475627.6A CN118348958A (en) 2024-04-19 2024-04-19 Performance test method and device of vehicle-mounted controller, electric vehicle and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410475627.6A CN118348958A (en) 2024-04-19 2024-04-19 Performance test method and device of vehicle-mounted controller, electric vehicle and medium

Publications (1)

Publication Number Publication Date
CN118348958A true CN118348958A (en) 2024-07-16

Family

ID=91811452

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410475627.6A Pending CN118348958A (en) 2024-04-19 2024-04-19 Performance test method and device of vehicle-mounted controller, electric vehicle and medium

Country Status (1)

Country Link
CN (1) CN118348958A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119270825A (en) * 2024-10-08 2025-01-07 重庆赛力斯凤凰智创科技有限公司 Vehicle automated testing method, device, electronic equipment and storage medium
CN120090896A (en) * 2025-04-30 2025-06-03 重庆长安汽车股份有限公司 Communication method, system and vehicle

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2002082727A1 (en) * 2001-04-06 2002-10-17 Nfratech Inc. Method for collecting a network performance information, computer readable medium storing the same, and an analysis system and method for network performance
CN115242689A (en) * 2022-07-14 2022-10-25 南京芯驰半导体科技有限公司 Vehicle-mounted gateway testing method and system and computer readable storage medium
CN115378846A (en) * 2022-08-04 2022-11-22 中国电信股份有限公司 Method, device, equipment and storage medium for testing time delay and packet loss rate of router
CN115981286A (en) * 2023-02-02 2023-04-18 浙江迪捷软件科技有限公司 Method and device for realizing virtual calibration of automobile based on virtual simulation platform
CN115987821A (en) * 2022-10-27 2023-04-18 合众新能源汽车股份有限公司 Gateway routing test method and device
CN117240942A (en) * 2023-08-31 2023-12-15 惠州亿纬锂能股份有限公司 DBC file detection method, device, vehicle-mounted equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2002082727A1 (en) * 2001-04-06 2002-10-17 Nfratech Inc. Method for collecting a network performance information, computer readable medium storing the same, and an analysis system and method for network performance
CN115242689A (en) * 2022-07-14 2022-10-25 南京芯驰半导体科技有限公司 Vehicle-mounted gateway testing method and system and computer readable storage medium
CN115378846A (en) * 2022-08-04 2022-11-22 中国电信股份有限公司 Method, device, equipment and storage medium for testing time delay and packet loss rate of router
CN115987821A (en) * 2022-10-27 2023-04-18 合众新能源汽车股份有限公司 Gateway routing test method and device
CN115981286A (en) * 2023-02-02 2023-04-18 浙江迪捷软件科技有限公司 Method and device for realizing virtual calibration of automobile based on virtual simulation platform
CN117240942A (en) * 2023-08-31 2023-12-15 惠州亿纬锂能股份有限公司 DBC file detection method, device, vehicle-mounted equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119270825A (en) * 2024-10-08 2025-01-07 重庆赛力斯凤凰智创科技有限公司 Vehicle automated testing method, device, electronic equipment and storage medium
CN120090896A (en) * 2025-04-30 2025-06-03 重庆长安汽车股份有限公司 Communication method, system and vehicle

Similar Documents

Publication Publication Date Title
CN111083225B (en) Data processing method and device in Internet of things platform and Internet of things platform
CN118348958A (en) Performance test method and device of vehicle-mounted controller, electric vehicle and medium
CN111552633A (en) Interface abnormal call testing method and device, computer equipment and storage medium
CN110554958A (en) Graph database testing method, system, device and storage medium
CN114880240B (en) Automatic test system and method for equipment of Internet of things, storage medium and equipment
CN104503429B (en) Rail traffic vehicles static test datamation processing method and processing device
CN110851471A (en) Distributed log data processing method, device and system
CN114416561A (en) A stress test configuration method and device
CN114880176A (en) A kind of aviation data conversion unit testing system, method and device
CN111522729A (en) Method, device and system for determining rule release
US20180123900A1 (en) Scenario driven, technology agnostic network simulation
CN118473979A (en) Simulation test method, system and terminal for vehicle communication
CN115982043A (en) Vehicle interface testing method, device, equipment and storage medium
US20180123899A1 (en) Technology agnostic network simulation
CN119396382A (en) Configurable Flink code implementation method, device, equipment, medium and product
CN115114147B (en) Test system based on structured description language
CN205864449U (en) Charging equipment of electric automobile communication protocol consistency test device
CN114416597B (en) Method and device for generating test case records
CN106330556A (en) A method and device for generating service module calling association information
CN114285840B (en) Vehicle data acquisition method, intelligent terminal and storage medium
CN117435458A (en) Automatic integrated test method based on complete vehicle CAN signal simulation
CN109783417B (en) Serial port communication device and method
CN111966394B (en) ETL-based data analysis method, device, equipment and storage medium
CN110971483B (en) Pressure testing method and device and computer system
CN111966544A (en) Batch server automatic testing system and method based on real-time interaction

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