CAN network test method, system and related device
By sending test packets with high and low priority in the CAN network and monitoring the sending of messages, evaluating the stability of the CAN network, the problem of instability in the CAN network affecting the sending of ECU packets is solved, and early detection and adjustment are achieved to ensure that The vehicle is running stably.
Patent Information
- Application Number
- CN202411335345.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-24
- Publication Date
- 2024-12-10
AI Technical Summary
In vehicles, it is difficult to detect the unstable situation of the CAN network and early detection, which affects the transmission of ECU messages and affects the stable operation of the vehicle.
By sending stability test messages with high and low priority in the CAN network, performing high load injection operations, and monitoring the message transmission of electronic control units, evaluating network stability, and determining whether the network is in a stable state.
It realizes early detection of CAN network instability in high-load environments, providing designers with a basis for adjustment and ensuring stable vehicle operation.
Smart Images

Figure CN119109822A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of vehicle testing technology, and in particular to a CAN network testing method, system and related devices. Background Art
[0002] At present, the ECU (Electronic Control Unit) in the vehicle transmits data through the CAN network. When the CAN network is overloaded due to abnormalities (such as the transmission of a large number of undesigned messages), whether the ECU messages can be sent normally will directly affect the stable operation of the vehicle. It is particularly important to detect this network instability as early as possible during the vehicle CAN network design process so that designers can make targeted adjustments in a timely manner. Summary of the invention
[0003] In view of the above problems, the present application provides a CAN network testing method and related devices to achieve the purpose of early detection of instability problems in the CAN network. The specific scheme is as follows:
[0004] The first aspect of the present application provides a CAN network testing method, comprising:
[0005] Obtaining a stability test message, the stability test message comprising: a first stability test message and a second stability test message, the sending priority of the first stability test message being higher than the sending priority of a message of each electronic control unit in the CAN network, and the sending priority of the second stability test message being lower than the sending priority of a message of each electronic control unit in the CAN network;
[0006] In the high priority test phase, a first high load injection operation is performed on the CAN network, and messages sent by each of the electronic control units before, during and after the first high load injection operation are monitored to obtain first monitoring result data, wherein the first high load injection operation includes: sending the first stability test message to the CAN network at a preset load rate and a first sending period;
[0007] In the low priority test phase, a second high load injection operation is performed on the CAN network, and messages sent by each of the electronic control units before, during and after the second high load injection operation are monitored to obtain second monitoring result data, wherein the second high load injection operation includes: sending the second stability test message to the CAN network at the preset load rate and the second sending period;
[0008] The stability of the CAN network is evaluated according to the first monitoring result data and the second monitoring result data.
[0009] In a possible implementation, the evaluating the CAN network stability according to the first monitoring result data and the second monitoring result data includes:
[0010] If both the first monitoring result data and the second monitoring result data satisfy corresponding test pass conditions, it is determined that the CAN network is in a stable state;
[0011] If the first monitoring result data and / or the second monitoring result data do not meet the corresponding test pass conditions, it is determined that the CAN network is in an unstable state.
[0012] In a possible implementation, the test pass condition corresponding to the first monitoring result data includes:
[0013] Before the first high load injection operation is performed, no error frame is monitored, and the error of the monitored period of each electronic control unit sending a message is within a preset range;
[0014] No error frame is monitored during the execution of the first high load injection operation;
[0015] After the first high-load injection operation is executed, no error frame is monitored, and the error of the period of each electronic control unit sending a message monitored is within a preset range.
[0016] In a possible implementation, the test pass condition corresponding to the second monitoring result data includes:
[0017] No error frame is monitored before, during and after the second high-load injection operation is performed, and the error of the period of each electronic control unit sending a message monitored is within a preset range.
[0018] In a possible implementation, the process of determining the preset range includes:
[0019] The preset range is determined according to the size relationship between the preset message sending period and the error judgment period of the electronic control unit.
[0020] In a possible implementation, determining the preset range according to the size relationship between the preset message sending period and the error judgment period of the electronic control unit includes:
[0021] If the preset message sending period is greater than the error judgment period, a first tolerance is obtained;
[0022] If the preset message sending period is not greater than the error judgment period, a second tolerance is obtained, and the second tolerance is greater than the first tolerance.
[0023] In a possible implementation, in the high priority test phase and the low priority test phase, the duration for monitoring the messages sent by each electronic control unit in each execution phase is the same.
[0024] A second aspect of the present application provides a CAN network testing device, comprising:
[0025] A test message acquisition module, used to acquire a stability test message, the stability test message comprising: a first stability test message and a second stability test message, the sending priority of the first stability test message being higher than the sending priority of a message of each electronic control unit in the CAN network, and the sending priority of the second stability test message being lower than the sending priority of a message of each electronic control unit in the CAN network;
[0026] A high priority test module is used to perform a first high load injection operation on the CAN network during a high priority test phase, and monitor messages sent by each of the electronic control units before, during and after the first high load injection operation is performed to obtain first monitoring result data, wherein the first high load injection operation includes: sending the first stability test message to the CAN network at a preset load rate and a first sending period;
[0027] A low priority test module is used to perform a second high load injection operation on the CAN network during a low priority test phase, and monitor messages sent by each of the electronic control units before, during and after the second high load injection operation is performed to obtain second monitoring result data, wherein the second high load injection operation includes: sending the second stability test message to the CAN network at the preset load rate and the second sending period; and
[0028] The stability evaluation module is used to evaluate the stability of the CAN network according to the first monitoring result data and the second monitoring result data.
[0029] A third aspect of the present application provides an electronic device, comprising at least one processor and a memory connected to the processor, wherein:
[0030] The memory is used to store computer programs;
[0031] The processor is used to execute the computer program so that the electronic device can implement the CAN network testing method of the above-mentioned first aspect or any implementation manner of the first aspect.
[0032] The fourth aspect of the present application provides a CAN network testing system, comprising a display terminal and a testing device connected in sequence, wherein the testing device is connected to each electronic control unit via a CAN network, and the testing device is used to execute each step of the CAN network testing method as described in the first aspect or any implementation of the first aspect.
[0033] The fifth aspect of the present application provides a computer program product, including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements the CAN network testing method of the first aspect or any implementation of the first aspect.
[0034] In a sixth aspect, the present application provides a computer storage medium, which carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement the CAN network testing method of the above-mentioned first aspect or any implementation of the first aspect.
[0035] By means of the above technical scheme, the CAN network testing method provided by the present application performs a first high load injection operation on the CAN network according to the non-destructive arbitration mechanism in the CAN network in the high priority test phase, and sends a first stability test message to the CAN network with a preset load rate and a first sending cycle. In the low priority test phase, a second high load injection operation is performed on the CAN network, and a second stability test message is sent to the CAN network with a preset load rate and a second sending cycle, wherein the sending priority of the first stability test message is higher than the sending priority of the message of each electronic control unit in the CAN network, and the sending priority of the second stability test message is lower than the sending priority of the message of each electronic control unit in the CAN network. The messages sent by the electronic control unit before, during and after the execution of each high load injection operation are monitored, and each monitoring result is used as the basis for stability evaluation, so as to realize the stability test of the CAN network under a high load environment, and can assist the test personnel to timely discover the instability in the network, and provide a basis for subsequent targeted adjustments. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0037] Figure 1 A system structure diagram for remote CAN network testing provided by this application;
[0038] Figure 2A structural diagram of a terminal provided for this application;
[0039] Figure 3 A structural diagram of a server provided for this application;
[0040] Figure 4 Flow chart of the CAN network testing method provided for this application;
[0041] Figure 5 Schematic diagram of the non-destructive arbitration mechanism of the CAN network provided for this application;
[0042] Figure 6 A structural diagram of the CAN network test device provided for this application;
[0043] Figure 7 The structure diagram of the CAN network test system provided for this application;
[0044] Figure 8 This is a structural diagram of the electronic device provided for this application. DETAILED DESCRIPTION
[0045] The following describes the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. The terms used in the implementation method section of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application.
[0046] The embodiments of the present application are described below in conjunction with the accompanying drawings. Those skilled in the art will appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0047] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, which is only to describe the distinction mode adopted by the objects of the same attributes when describing in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0048] See also Figure 1 , Figure 1 A schematic diagram of a system architecture for remotely performing CAN network testing is shown. The system may include a terminal 100 and a server 200. The server 200 may include one or more servers ( Figure 1In the example, a server is included, and the server 200 can provide the method provided in the embodiment of the present application for one or more terminals.
[0049] Among them, an application for setting the stability test message can be installed on the terminal 100. The above application and web page can provide an interface. The terminal 100 can receive the relevant parameters entered by the user on the parameter setting interface and send the above parameters to the server 200. The server 200 can obtain the processing results based on the received parameters and return the processing results to the terminal 100.
[0050] It should be understood that in some optional implementations, the terminal 100 can also complete the action of obtaining the processing result based on the received parameters by itself without the cooperation of the server, and the embodiments of the present application are not limited to this.
[0051] Next describe Figure 1 The product form of the mid-terminal 100;
[0052] The terminal 100 in the embodiment of the present application can be a mobile phone, a tablet computer, a wearable device, a vehicle-mounted device, an augmented reality (AR) / virtual reality (VR) device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), etc., and the embodiment of the present application does not impose any limitation on this.
[0053] Figure 2 An optional hardware structure diagram of the terminal 100 is shown.
[0054] refer to Figure 2 As shown, the terminal 100 may include a radio frequency unit 110, a memory 120, an input unit 130, a display unit 140, a camera 150 (optional), an audio circuit 160 (optional), a speaker 161 (optional), a microphone 162 (optional), an earphone jack 163 (optional), a processor 170, an external interface 180, a power supply 190 and other components. Those skilled in the art will appreciate that Figure 2 These are merely examples of terminals or multi-function devices and do not constitute limitations on the terminals or multi-function devices, which may include more or fewer components than those shown in the figures, or combinations of certain components, or different components.
[0055] The input unit 130 can be used to receive input digital or character information, and generate key signal input related to the user settings and function control of the portable multifunctional device. Specifically, the input unit 130 may include a touch screen 131 (optional) and / or other input devices 132. The touch screen 131 can collect the user's touch operations on or near it (such as the user's operation on or near the touch screen using any suitable object such as fingers, joints, stylus, etc.), and drive the corresponding connection device according to a pre-set program. The touch screen can detect the user's touch action on the touch screen, convert the touch action into a touch signal and send it to the processor 170, and can receive and execute the command sent by the processor 170; the touch signal at least includes the touch point coordinate information. The touch screen 131 can provide an input interface and an output interface between the terminal 100 and the user. In addition, the touch screen can be implemented using multiple types such as resistive, capacitive, infrared and surface acoustic wave. In addition to the touch screen 131, the input unit 130 can also include other input devices. Specifically, other input devices 132 may include, but are not limited to, one or more of a physical keyboard, function keys (such as a volume control key, a switch key, etc.), a trackball, a mouse, a joystick, and the like.
[0056] Among them, the input device 132 can receive input data and the like.
[0057] The display unit 140 can be used to display information input by the user or information provided to the user, various menus of the terminal 100, interactive interfaces, file display and / or playback of any multimedia file. In the embodiment of the present application, the display unit 140 can be used to display the interface of parameter setting, processing results, etc.
[0058] The memory 120 can be used to store instructions and data. The memory 120 can mainly include an instruction storage area and a data storage area. The data storage area can store various data, such as multimedia files, texts, etc.; the instruction storage area can store software units such as operating systems, applications, instructions required for at least one function, or their subsets and extensions. It can also include a non-volatile random access memory; provide the processor 170 with hardware, software and data resources including management of computing and processing equipment, and support control software and applications. It is also used for the storage of multimedia files, and the storage of running programs and applications.
[0059] The processor 170 is the control center of the terminal 100. It uses various interfaces and lines to connect various parts of the entire terminal 100. By running or executing instructions stored in the memory 120 and calling data stored in the memory 120, it executes various functions of the terminal 100 and processes data, thereby controlling the terminal device as a whole. Optionally, the processor 170 may include one or more processing units; preferably, the processor 170 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface and application program, and the modem processor mainly processes wireless communication. It is understandable that the above-mentioned modem processor may not be integrated into the processor 170. In some embodiments, the processor and the memory may be implemented on a single chip, and in some embodiments, they may also be implemented separately on separate chips. The processor 170 may also be used to generate corresponding operation control signals, send them to corresponding components of the computing and processing device, read and process data in the software, especially read and process data and programs in the memory 120, so that each functional module therein performs corresponding functions, thereby controlling the corresponding components to act according to the requirements of the instructions.
[0060] The radio frequency unit 110 (optional) can be used for receiving and sending information or receiving and sending signals during a call, for example, after receiving the downlink information of the base station, it is sent to the processor 170 for processing; in addition, the designed uplink data is sent to the base station. Generally, the RF circuit includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (Low Noise Amplifier, LNA), a duplexer, etc. In addition, the radio frequency unit 110 can also communicate with network devices and other devices through wireless communication. The wireless communication can use any communication standard or protocol, including but not limited to Global System of Mobile communication (Global System of Mobile communication, GSM), General Packet Radio Service (General Packet Radio Service, GPRS), Code Division Multiple Access (Code Division Multiple Access, CDMA), Wideband Code Division Multiple Access (Wideband Code Division Multiple Access, WCDMA), Long Term Evolution (Long Term Evolution, LTE), email, Short Messaging Service (SMS), etc.
[0061] In this embodiment of the present application, the radio frequency unit 110 can send data of the stability test message to the server 200 and receive the processing result sent by the server 200.
[0062] It should be understood that the radio frequency unit 110 is optional and can be replaced by other communication interfaces, such as a network port.
[0063] The terminal 100 also includes a power supply 190 (such as a battery) for supplying power to various components. Preferably, the power supply can be logically connected to the processor 170 through a power management system, so that the power management system can manage functions such as charging, discharging, and power consumption.
[0064] The terminal 100 further includes an external interface 180 , which may be a standard Micro USB interface or a multi-pin connector, and may be used to connect the terminal 100 to communicate with other devices, or to connect a charger to charge the terminal 100 .
[0065] Although not shown, the terminal 100 may also include a flashlight, a wireless fidelity (WiFi) module, a Bluetooth module, sensors with different functions, etc., which are not described in detail here. Some or all of the methods described below may be applied in the following embodiments. Figure 2 In the terminal 100 shown.
[0066] Next describe Figure 1 The product form of the server 200;
[0067] Figure 3 A structural diagram of a server 200 is provided, such as Figure 3 As shown, the server 200 includes a bus 201, a processor 202, a communication interface 203, and a memory 204. The processor 202, the memory 204, and the communication interface 203 communicate with each other via the bus 201.
[0068] The bus 201 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0069] The processor 202 may be any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0070] The memory 204 may include a volatile memory, such as a random access memory (RAM). The memory 204 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).
[0071] The memory 204 may be used to store software codes related to the CAN network test method, and the processor 202 may execute the steps of the CAN network test method of the chip, and may also schedule other units to implement corresponding functions.
[0072] It should be understood that the above-mentioned terminal 100 and server 200 can be centralized or distributed devices, and the processors in the above-mentioned terminal 100 and server 200 (such as processor 170 and processor 202) can be hardware circuits (such as application specific integrated circuit (ASIC), field-programmable gate array (FPGA), general-purpose processor, digital signal processor (DSP), microprocessor or microcontroller, etc.), or a combination of these hardware circuits. For example, the processor can be a hardware system with an instruction execution function, such as a CPU, DSP, etc., or a hardware system without an instruction execution function, such as an ASIC, FPGA, etc., or a combination of the above-mentioned hardware systems without an instruction execution function and hardware systems with an instruction execution function.
[0073] Reference Figure 4 , Figure 4 A flow chart of a CAN network testing method provided in an embodiment of the present application is as follows: Figure 4As shown, a CAN network testing method provided in an embodiment of the present application may include steps 401 to 404, and these steps are described in detail below.
[0074] 401. Obtain a stability test message, the stability test message including: a first stability test message and a second stability test message, the sending priority of the first stability test message is higher than the sending priority of the message of each electronic control unit in the CAN network, and the sending priority of the second stability test message is lower than the sending priority of the message of each electronic control unit in the CAN network.
[0075] Specifically, the access to the CAN bus uses a non-destructive arbitration mechanism. Non-destructive means that the winner of the arbitration (i.e., the information with high priority) will not be disturbed and does not need to be restarted. The loser of the arbitration will not be destroyed, but will wait until the information is sent before the next arbitration, until it wins and obtains the right to send. The implementation of this mechanism relies on the execution of the line-and mechanism, that is, there are two logical levels on the CAN bus, explicit and implicit. When a node sends a dominant level, it will overwrite the implicit level sent by other nodes, where the dominant level is logical 0 and the implicit level is logical 1. According to this judgment logic, the smaller the ID (Identifier, node identifier) value, the higher the sending priority.
[0076] Exemplary references Figure 5 As shown in the figure, there are three nodes in the CAN network: node A, node B and node C. The ID of node A is 0x123, the ID of node B is 0x07F, and the ID of node C is 0x3E9. The sending priority is arranged from high to low as follows: node B, node A, node C. Based on this, in the first arbitration stage, when all three nodes send data, only the data of node B is sent. In the second arbitration stage, when only nodes A and C send data, only node A sends data, and in the third arbitration stage, node C sends data.
[0077] Based on the above-mentioned non-destructive arbitration mechanism, two types of stability test messages can be set respectively, wherein the sending priority of the first stability test message is higher than the sending priority of the message of each electronic control unit in the CAN network, and the sending priority of the second stability test message is lower than the sending priority of the message of each electronic control unit in the CAN network.
[0078] In order to facilitate the direct acquisition of stability test messages, the process of comparing the sending priorities of the identifiers of other electronic control units in the CAN network is omitted. The message with the smallest ID allowed in the CAN network (for example, 0x001) can be directly used as the first stability test message, and the message with the largest ID (for example, 0x7FF) can be used as the second stability test message.
[0079] It is understandable that those skilled in the art can adjust the message to be used according to the needs in accordance with the conditions of the above-mentioned message, and no limitation is made here.
[0080] 402. In a high priority test phase, a first high load injection operation is performed on the CAN network, and messages sent by each electronic control unit before, during and after the first high load injection operation are monitored to obtain first monitoring result data. The first high load injection operation includes: sending a first stability test message to the CAN network at a preset load rate and a first sending period.
[0081] Specifically, in order to verify the stability of the electronic control unit message sending when the CAN network is under high load, the load rate of the test equipment sending messages to the CAN network can be set to 100%. Then the message is sent according to the set message sending cycle, such as 1ms. It can be divided into three sub-stages, namely the pre-execution stage, the execution stage and the execution completion stage, and the monitoring time of each stage is the same. According to the characteristics of the non-destructive arbitration mechanism, before the injection of high-priority messages, the messages sent by the monitored electronic control unit should be normal. During the injection of high-priority messages, the messages of the electronic control unit will not be monitored. After the injection stage, the messages sent by the monitored electronic control unit should be normal. Based on this, the messages before, during and after the injection operation are monitored to obtain the corresponding monitoring result data.
[0082] 403. In the low priority test phase, a second high load injection operation is performed on the CAN network, and messages sent by each electronic control unit before, during and after the second high load injection operation are monitored to obtain second monitoring result data. The second high load injection operation includes: sending the second stability test message to the CAN network at a preset load rate and a second sending period.
[0083] Specifically, in the low priority test phase, since the message sent by the test equipment is the message of the lowest transmission level, the electronic control unit in the CAN network will not affect the transmission of the message of the electronic control unit before, during, and after the second high load injection operation is executed. Based on this principle, the messages of the three sub-phases are monitored to obtain the corresponding second monitoring result data, wherein the second transmission cycle is the same as the first transmission cycle to ensure the consistency and accuracy of the test.
[0084] 404. Evaluate the stability of the CAN network according to the first monitoring result data and the second monitoring result data.
[0085] Specifically, on the basis of obtaining the above-mentioned first monitoring result data and the second monitoring result data, the stability is evaluated according to the results of the messages to be monitored in the above-mentioned sub-stages, wherein only when the first monitoring result data and the second monitoring result data both meet the corresponding test pass conditions, the CAN network is determined to be in a stable state. On the contrary, if the first monitoring result data and / or the second monitoring result data do not meet the corresponding test pass conditions, the CAN network is determined to be in an unstable state. It can be seen from the above that the CAN network test method sends the highest and lowest priority messages on the CAN network according to the non-destructive arbitration mechanism of the CAN bus, and monitors the message sending of the DUT itself before, during, and after the high-load environment is injected, so as to verify the message sending stability of the DUT when the CAN network is under high load. It enables testers to discover this network instability as early as possible, providing an accurate reference for targeted adjustments.
[0086] In a possible implementation, in order to facilitate the determination of CAN network stability, the first monitoring result data corresponds to a test pass condition that needs to be met, including:
[0087] Before the first high load injection operation is performed, no error frame is monitored, and the error of the period of each electronic control unit sending a message monitored is within a preset range;
[0088] No error frame is monitored during the execution of the first high load injection operation;
[0089] After the first high load injection operation is performed, no error frame is monitored, and the error of the period of each electronic control unit sending a message monitored is within a preset range.
[0090] Specifically, during the execution of the first high-load injection operation, since the test equipment sends the highest priority message to the CAN network, it theoretically will not monitor messages sent by other electronic control units in the injection sub-phase, and can only monitor the highest priority messages sent by itself. Therefore, the test pass condition here only includes no error frame being monitored. The error frame here indicates that the frame format of the monitored message is correct.
[0091] In the low priority test phase, since the messages sent to the CAN network in the injection sub-phase are the lowest level messages, theoretically, they will not affect the sending of messages from other electronic control units. They should be consistent with the monitoring results of the sub-phase before injection and after injection. Therefore, the test pass conditions corresponding to the second monitoring result data may include:
[0092] No error frame is monitored before, during, or after the second high load injection operation is executed, and the error of the period of each electronic control unit sending a message monitored is within a preset range.
[0093] Among them, the message sending cycle of each electronic control unit in the CAN network is fixed. The message sending cycle of the electronic control unit is monitored and statistically analyzed. The obtained statistical value is compared with the electronic control unit sending cycle set in the system. The obtained error is used as the standard for whether the CAN network is normal, which can more accurately measure the stability of the CAN network.
[0094] In a possible implementation, the process of determining the preset range includes:
[0095] The preset range is determined according to the size relationship between the preset message sending period of the electronic control unit and the error judgment period.
[0096] Specifically, different preset ranges can be set according to the different message sending cycles of each electronic control unit, and the error judgment cycle can be used as a comparison basis. Thus, the preset error ranges corresponding to sending cycles of different sizes are different, thereby making a more accurate judgment on stability.
[0097] For example, for an electronic control unit with a message transmission cycle of less than 100ms, the preset range of the corresponding error is ±10%, and for an electronic control unit with a message transmission cycle of not less than 100ms, the preset range of the corresponding error is ±3%. That is, the error required for a longer transmission cycle is smaller, and the error required for a shorter transmission cycle can be appropriately larger, so as to more truly reflect the stability of message transmission.
[0098] In a possible implementation, the preset range may be represented by a tolerance (allowable deviation), and the preset range may be determined according to the size relationship between the preset message sending period of the electronic control unit and the error judgment period, which may specifically include:
[0099] If the preset message sending period is greater than the error judgment period, a first tolerance is obtained.
[0100] If the preset message sending period is not greater than the error judgment period, a second tolerance is obtained, and the second tolerance is greater than the first tolerance.
[0101] Specifically, when the error judgment period is 100ms, when the preset message sending period is greater than 100ms, the corresponding tolerance is ±3%, and when the preset message sending period is not greater than 100ms, the corresponding tolerance is ±10%.
[0102] It is understandable that those skilled in the art may adjust the tolerance range as required, and no limitation is imposed herein.
[0103] In a possible implementation, to ensure consistency and accuracy of the stability test, in the high priority test phase and the low priority test phase, the duration of monitoring the messages sent by each electronic control unit in each execution phase is the same.
[0104] As a specific application of the above CAN network test, the stability test of an electronic control unit is taken as an example for explanation. The electronic control unit itself sends 2 frames of messages, namely: message ID = 0x333, message period is 50ms; message ID = 0x444, message period is 200ms.
[0105] The test equipment sends the message with the largest and smallest ID on the CAN bus, that is, the message with ID 0x7FF and 0x001, and the sending cycle is 1ms.
[0106] The test steps for the low priority testing phase are as follows:
[0107]
[0108] The test environment is as follows Figure 7 As shown, it includes a display terminal and a test device connected in sequence. The test device is connected to each electronic control unit through a CAN network. The DUT (Device Under Test) here refers to the electronic control unit.
[0109] In the pre-execution stage (including steps 1 to 3), the message sent by the electronic control unit is monitored, and the duration of this stage is 5000ms.
[0110] During the execution phase (including steps 4 to 6), the message with ID 0x7FF is periodically sent at a high load rate, and the message of the single control unit is monitored for 5000ms.
[0111] In the execution end phase (including steps 7 to 10), after stopping the sending of messages in the high-load environment, the monitoring is continued for 5000ms.
[0112] The corresponding test pass conditions are:
[0113]
[0114] Similarly, the test steps for the high priority test phase are as follows:
[0115]
[0116] In the pre-execution stage (including steps 1 to 3), the message sent by the electronic control unit is monitored, and the duration of this stage is 5000ms.
[0117] During the execution phase (including steps 4 to 6), the message with ID 0x001 is periodically sent at a high load rate, and the message of the single control unit is monitored for 5000ms.
[0118] In the execution end phase (including steps 7 to 10), after stopping the sending of messages in the high-load environment, the monitoring is continued for 5000ms.
[0119] The corresponding test pass conditions are:
[0120]
[0121] A CAN network testing method provided in an embodiment of the present application is introduced above, and a device for executing the above CAN network testing method will be introduced below.
[0122] See also Figure 6 , Figure 6 This is a schematic diagram of the structure of a CAN network testing device provided in an embodiment of the present application. Figure 6 As shown, the CAN network test device comprises:
[0123] A test message acquisition module 601 is used to acquire a stability test message, wherein the stability test message includes: a first stability test message and a second stability test message, wherein the sending priority of the first stability test message is higher than the sending priority of the message of each electronic control unit in the CAN network, and the sending priority of the second stability test message is lower than the sending priority of the message of each electronic control unit in the CAN network;
[0124] The high priority test module 602 is used to perform a first high load injection operation on the CAN network in a high priority test phase, and monitor the messages sent by each of the electronic control units before, during and after the first high load injection operation is performed to obtain first monitoring result data, wherein the first high load injection operation includes: sending the first stability test message to the CAN network at a preset load rate and a first sending period;
[0125] The low priority test module 603 is used to perform a second high load injection operation on the CAN network during the low priority test phase, and monitor the messages sent by each electronic control unit before, during and after the second high load injection operation to obtain second monitoring result data, wherein the second high load injection operation includes: sending the second stability test message to the CAN network at the preset load rate and the second sending period; and
[0126] The stability evaluation module 604 is used to evaluate the stability of the CAN network according to the first monitoring result data and the second monitoring result data.
[0127] In a possible implementation, the process of evaluating the stability of the CAN network by the stability evaluation module 604 according to the first monitoring result data and the second monitoring result data includes:
[0128] If both the first monitoring result data and the second monitoring result data satisfy corresponding test pass conditions, it is determined that the CAN network is in a stable state;
[0129] If the first monitoring result data and / or the second monitoring result data do not meet the corresponding test pass conditions, it is determined that the CAN network is in an unstable state.
[0130] In a possible implementation, the test pass condition corresponding to the first monitoring result data of the stability evaluation module 604 includes:
[0131] Before the first high load injection operation is performed, no error frame is monitored, and the error of the monitored period of each electronic control unit sending a message is within a preset range;
[0132] No error frame is monitored during the execution of the first high load injection operation;
[0133] After the first high-load injection operation is executed, no error frame is monitored, and the error of the period of each electronic control unit sending a message monitored is within a preset range.
[0134] In a possible implementation, the test pass condition corresponding to the second monitoring result data in the stability evaluation module 604 includes:
[0135] No error frame is monitored before, during and after the second high-load injection operation is performed, and the error of the period of each electronic control unit sending a message monitored is within a preset range.
[0136] In a possible implementation, the process of determining the preset range in the stability evaluation module 604 includes:
[0137] The preset range is determined according to the size relationship between the preset message sending period and the error judgment period of the electronic control unit.
[0138] In a possible implementation, the stability evaluation module 604 determines the preset range according to the relationship between the preset message sending period and the error judgment period of the electronic control unit, including:
[0139] If the preset message sending period is greater than the error judgment period, a first tolerance is obtained;
[0140] If the preset message sending period is not greater than the error judgment period, a second tolerance is obtained, and the second tolerance is greater than the first tolerance.
[0141] In a possible implementation, in the high priority test phase and the low priority test phase, the duration for monitoring the messages sent by each electronic control unit in each execution phase is the same.
[0142] The present application also provides an electronic device in an embodiment. Figure 8 As shown, it shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiment of the present application. The electronic device in the embodiment of the present application may include but is not limited to fixed terminals such as mobile phones, laptops, PDAs (personal digital assistants), PADs (tablet computers), desktop computers, etc. Figure 8 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0143] like Figure 8 As shown, the electronic device may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage device 808 to a random access memory (RAM) 803. When the electronic device is powered on, various programs and data required for the operation of the electronic device are also stored in the RAM 803. The processing device 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0144] Typically, the following devices may be connected to the I / O interface 805: input devices 806 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 807 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 808 including, for example, a memory card, a hard disk, etc.; and communication devices 809. The communication device 809 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although Figure 8 An electronic device having various devices is shown, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0145] An embodiment of the present application also provides a computer program product including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements any CAN network testing method provided in the embodiment of the present application.
[0146] A computer-readable storage medium is also provided in an embodiment of the present application. The storage medium carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any CAN network testing method provided in the embodiment of the present application.
[0147] Reference Figure 7 As shown, a CAN network testing system is also provided in an embodiment of the present application, including a display terminal and a testing device connected in sequence, the testing device is connected to each electronic control unit via a CAN network, and the testing device is used to execute each step of the CAN network testing method described in the above embodiment.
[0148] It should also be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the drawings of the device embodiments provided by the present application, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines.
[0149] Through the description of the above implementation mode, the technicians in the field can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course, it can also be implemented by special hardware including special integrated circuits, special CPUs, special memories, special components, etc. In general, all functions completed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be various, such as analog circuits, digital circuits or special circuits. However, for the present application, software program implementation is a better implementation mode in more cases. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer floppy disk, a U disk, a mobile hard disk, a ROM, a RAM, a disk or an optical disk, etc., including a number of instructions to enable a computer device (which can be a personal computer, a training device, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0150] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.
[0151] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a training device, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, training device, or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device, a data center, etc. that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.
Claims
1. A CAN network testing method, characterized in that: include: Obtaining a stability test message, the stability test message comprising: a first stability test message and a second stability test message, the sending priority of the first stability test message being higher than the sending priority of a message of each electronic control unit in the CAN network, and the sending priority of the second stability test message being lower than the sending priority of a message of each electronic control unit in the CAN network; In the high priority test phase, a first high load injection operation is performed on the CAN network, and messages sent by each of the electronic control units before, during and after the first high load injection operation are monitored to obtain first monitoring result data, wherein the first high load injection operation includes: sending the first stability test message to the CAN network at a preset load rate and a first sending period; In the low priority test phase, a second high load injection operation is performed on the CAN network, and messages sent by each of the electronic control units before, during and after the second high load injection operation are monitored to obtain second monitoring result data, wherein the second high load injection operation includes: sending the second stability test message to the CAN network at the preset load rate and the second sending period; The stability of the CAN network is evaluated according to the first monitoring result data and the second monitoring result data.
2. The CAN network testing method according to claim 1, characterized in that: The evaluating the stability of the CAN network according to the first monitoring result data and the second monitoring result data includes: If both the first monitoring result data and the second monitoring result data satisfy corresponding test pass conditions, it is determined that the CAN network is in a stable state; If the first monitoring result data and / or the second monitoring result data do not meet the corresponding test pass conditions, it is determined that the CAN network is in an unstable state.
3. The CAN network testing method according to claim 2, characterized in that: The test pass condition corresponding to the first monitoring result data includes: Before the first high load injection operation is performed, no error frame is monitored, and the error of the monitored period of each electronic control unit sending a message is within a preset range; No error frame is monitored during the execution of the first high load injection operation; After the first high-load injection operation is executed, no error frame is monitored, and the error of the period of each electronic control unit sending a message monitored is within a preset range.
4. The CAN network testing method according to claim 2, characterized in that: The test pass condition corresponding to the second monitoring result data includes: No error frame is monitored before, during and after the second high-load injection operation is performed, and the error of the period of each electronic control unit sending a message monitored is within a preset range.
5. The CAN network testing method according to claim 3 or 4, characterized in that: The process of determining the preset range includes: The preset range is determined according to the size relationship between the preset message sending period and the error judgment period of the electronic control unit.
6. The CAN network testing method according to claim 5, characterized in that: The step of determining the preset range according to the size relationship between the preset message sending period and the error judgment period of the electronic control unit includes: If the preset message sending period is greater than the error judgment period, a first tolerance is obtained; If the preset message sending period is not greater than the error judgment period, a second tolerance is obtained, and the second tolerance is greater than the first tolerance.
7. The CAN network testing method according to claim 1, characterized in that: In the high priority test phase and the low priority test phase, the duration of monitoring the messages sent by each electronic control unit in each execution phase is the same.
8. A CAN network testing device, characterized in that: include: A test message acquisition module, used to acquire a stability test message, the stability test message comprising: a first stability test message and a second stability test message, the sending priority of the first stability test message being higher than the sending priority of a message of each electronic control unit in the CAN network, and the sending priority of the second stability test message being lower than the sending priority of a message of each electronic control unit in the CAN network; A high priority test module is used to perform a first high load injection operation on the CAN network during a high priority test phase, and monitor messages sent by each of the electronic control units before, during and after the first high load injection operation is performed to obtain first monitoring result data, wherein the first high load injection operation includes: sending the first stability test message to the CAN network at a preset load rate and a first sending period; A low priority test module is used to perform a second high load injection operation on the CAN network during a low priority test phase, and monitor messages sent by each of the electronic control units before, during and after the second high load injection operation is performed to obtain second monitoring result data, wherein the second high load injection operation includes: sending the second stability test message to the CAN network at the preset load rate and the second sending period; and The stability evaluation module is used to evaluate the stability of the CAN network according to the first monitoring result data and the second monitoring result data.
9. An electronic device, characterized in that: The method comprises at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program so that the electronic device can implement the CAN network testing method as described in any one of claims 1 to 7.
10. A CAN network testing system, characterized in that: It comprises a display terminal and a test device connected in sequence, wherein the test device is connected to each electronic control unit via a CAN network, and the test device is used to execute each step of the CAN network test method as claimed in any one of claims 1 to 7.
Citation Information
Cited By
Arbitration mechanism testing method, device and equipment of electronic equipment and vehicle
CN119758966A
