Message test method and device for vehicle-mounted gateway, vehicle and storage medium
By obtaining and parsing the test parameter group of the preset routing table, generating and executing target test scripts, and monitoring the flocking value, the problem of insufficient performance evaluation of on-board gateways in the high-load data transmission scenarios in the existing technology is solved, and efficient and comprehensive testing results are achieved.
Patent Information
- Application Number
- CN202510668977.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-23
- Publication Date
- 2025-07-18
AI Technical Summary
The prior art is difficult to fully evaluate the performance bottlenecks of on-board gateways in simulated high-load data transmission scenarios during actual vehicle operation, especially packet loss problems, and the testing efficiency is low.
By obtaining the test parameter group corresponding to the preset routing table, parsing the target test parameter group, selecting the CAN channel and/or ECU to generate executable target test scripts, executing the test scripts and monitoring the gateway's flocking value in frame drop situations to evaluate the performance status.
It significantly improves the comprehensiveness and accuracy of on-board gateway testing, ensures that each message is timely and effectively verified, and improves the testing efficiency.
Smart Images

Figure CN120342900A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of vehicles, and in particular, to a message testing method, device, vehicle, and storage medium for an in-vehicle gateway. Background Art
[0002] In the related art, mainly by increasing the bus load and sending routing messages one by one for testing, in order to simulate the routing processing ability of the gateway under a high-load environment, by sending messages one by one and monitoring indicators such as their routing situation, cycle, signal, data length consistency, and delay time, to evaluate the performance bottleneck and stability of the gateway; or, connecting multiple controllers on a test bench for long-term operation testing, observing the reliability, durability, and whether there are problems such as performance degradation or failures of the gateway through long-term continuous operation.
[0003] However, the current testing methods fail to fully simulate the short-time large-data-volume transmission scenarios that may occur in actual vehicle operation, so it is difficult to reveal the potential performance bottlenecks of the gateway when processing high-load data routing, such as the problem of message loss caused by insufficient processing speed, and the testing efficiency is relatively low. Summary of the Invention
[0004] The present invention aims to at least solve one of the technical problems existing in the prior art.
[0005] For this reason, one object of the present invention is to propose a message testing method for an in-vehicle gateway, which enhances the comprehensiveness and accuracy of the testing, and also significantly improves the efficiency of the testing work through automated means.
[0006] For this reason, the second object of the present invention is to propose a message testing device for an in-vehicle gateway.
[0007] For this reason, the third object of the present invention is to propose a vehicle.
[0008] For this reason, the fourth object of the present invention is to propose a computer-readable storage medium.
[0009] To achieve the above object, an embodiment of the first aspect of the present invention discloses a message testing method for an in-vehicle gateway, including: obtaining a test parameter group corresponding to a preset routing table, parsing the test parameter group to obtain a target test parameter group; based on the target test parameter group, selecting a CAN channel and / or an ECU to generate an executable target test script; executing the target test script to test the message, and monitoring the swarm value of the gateway in the case of frame loss, where the swarm value is used to characterize the performance state of the gateway.
[0010] The message testing method for an in-vehicle gateway according to an embodiment of the present invention can provide clear and definite guidance for message testing by obtaining a test parameter group corresponding to a preset routing table and parsing the test parameter group to obtain a target test parameter group, ensuring the accuracy and effectiveness of the test. Then, based on the target test parameter group, a CAN channel and / or an ECU are selected to generate an executable target test script, ensuring that the target test script can accurately simulate the communication scenario in a real network environment. Then, the target test script is executed to test the message, so that all routing messages can be tested in parallel at the same time, significantly improving the comprehensiveness and coverage of the test, and ensuring that each message can be verified in a timely and effective manner. At the same time, by monitoring the flocking value of the gateway routing in the case of frame loss, the routing processing ability of the gateway can be accurately evaluated, and the stability and recovery ability of the gateway in the face of network congestion or packet loss can be intuitively reflected, thereby enhancing the comprehensiveness and accuracy of the test. The efficiency of the test work is also significantly improved by automated means.
[0011] In addition, the message testing method for an in-vehicle gateway according to the above embodiment of the present invention may further have the following additional technical features: In some embodiments, selecting a CAN channel and / or an ECU to generate an executable target test script includes: based on the message information of the CAN channel and / or the message information of the ECU, using the functions of a simulation tool to configure and control the behavior of the CAN channel and / or the ECU; generating the executable target test script according to the results of the configuration and control.
[0012] In some embodiments, using the functions of a simulation tool to configure and control the behavior of the CAN channel includes: grouping the CAN channels to obtain a CAN test group, and simultaneously simulating and sending all the messages in each CAN test group; setting a first random start logic in the CAN script to randomly arrange the start order of each CAN test group within a first preset time range.
[0013] In some embodiments, using the functions of a simulation tool to configure and control the behavior of the ECU includes: grouping the ECUs to obtain an ECU test group, and simultaneously simulating and sending all the messages in each ECU test group; setting a second random start logic in the ECU script to randomly arrange the start order of each ECU test group within a second preset time.
[0014] In some embodiments, before executing the target test script to test the message, it includes: performing hardware configuration, channel configuration, and test configuration on the simulation tool.
[0015] In some embodiments, performing the target test script to test the message includes: setting an initial time parameter; within the initial time parameter, randomly starting the CAN channel or the ECU, and continuously testing the message for a first preset time.
[0016] In some embodiments, after continuously testing the message for the first preset time, it includes: determining whether there is a frame loss phenomenon in the gateway; if not, at intervals of a second preset time, gradually reducing the initial time parameter until a frame loss phenomenon occurs, and obtaining the flocking value of each running CAN test group and / or ECU test group.
[0017] To achieve the above object, an embodiment of the second aspect of the present invention discloses a message testing device for an in-vehicle gateway, including: an acquisition module, configured to acquire a test parameter group corresponding to a preset routing table, and parse the test parameter group to obtain a target test parameter group; a generation module, configured to select a CAN channel and / or an ECU based on the target test parameter group to generate an executable target test script; a test module, configured to execute the target test script to test the message, and monitor the flocking value of the gateway in the case of frame loss, where the flocking value is used to characterize the performance state of the gateway.
[0018] According to the message testing device for an in-vehicle gateway of the embodiments of the present invention, the acquisition module acquires the test parameter group corresponding to the preset routing table and parses the test parameter group to obtain the target test parameter group, which can provide clear and definite guidance for message testing and ensure the accuracy and effectiveness of the test. Then, the generation module selects a CAN channel and / or an ECU based on the target test parameter group to generate an executable target test script, ensuring that the target test script can accurately simulate the communication scenario in the real network environment. Then, the test module executes the target test script to test the message, so that all routing messages can be tested in parallel at the same time, significantly improving the comprehensiveness and coverage of the test, and ensuring that each message can be verified in a timely and effective manner. At the same time, by monitoring the flocking value of the gateway routing in the case of frame loss, the routing processing ability of the gateway can be accurately evaluated, and the stability and recovery ability of the gateway in the face of network congestion or packet loss can be intuitively reflected, thereby enhancing the comprehensiveness and accuracy of the test, and also significantly improving the efficiency of the test work through automated means.
[0019] To achieve the above object, an embodiment of the third aspect of the present invention discloses a vehicle, comprising: the message test device for the vehicle-mounted gateway described in the embodiment of the second aspect of the present invention, or a processor, a memory, and a message test program for the vehicle-mounted gateway stored on the memory and executable on the processor, where when the message test program for the vehicle-mounted gateway is executed by the processor, it implements the message test method for the vehicle-mounted gateway described in any one of the embodiments of the first aspect of the present invention.
[0020] According to the vehicle of the embodiment of the present invention, by obtaining a test parameter group corresponding to a preset routing table and parsing the test parameter group to obtain a target test parameter group, it can provide clear and definite guidance for message testing, ensure the accuracy and effectiveness of the test. Then, based on the target test parameter group, a CAN channel and / or an ECU are selected to generate an executable target test script, ensuring that the target test script can accurately simulate the communication scenario in the real network environment. Then, the target test script is executed to test the message, so that all routing messages can be tested in parallel at the same time, significantly improving the comprehensiveness and coverage of the test, and ensuring that each message can be verified in a timely and effective manner. At the same time, by monitoring the congestion value of the gateway routing in the case of frame loss, the routing processing ability of the gateway can be accurately evaluated, and the stability and recovery ability of the gateway in the face of network congestion or packet loss can be intuitively reflected, thereby enhancing the comprehensiveness and accuracy of the test, and also significantly improving the efficiency of the test work through automated means.
[0021] To achieve the above object, an embodiment of the fourth aspect of the present invention discloses a computer-readable storage medium, on which a message test program for a vehicle-mounted gateway is stored, and when the message test program for the vehicle-mounted gateway is executed by a processor, it implements the message test method for the vehicle-mounted gateway described in any one of the embodiments of the first aspect of the present invention.
[0022] A computer-readable storage medium according to an embodiment of the present invention, when a message test program for an in-vehicle gateway stored thereon is executed by a processor, by obtaining a test parameter group corresponding to a preset routing table and parsing the test parameter group to obtain a target test parameter group, can provide clear and definite guidance for message testing, ensure the accuracy and effectiveness of the test. Then, based on the target test parameter group, select a CAN channel and / or an ECU to generate an executable target test script, ensure that the target test script can accurately simulate the communication scenario in a real network environment, and then execute the target test script to test the message. In this way, all routing messages can be tested in parallel at the same time, significantly improving the comprehensiveness and coverage of the test, and ensuring that each message can be verified in a timely and effective manner. At the same time, by monitoring the swarm value of the gateway routing in the case of frame loss, the routing processing ability of the gateway can be accurately evaluated, and the stability and recovery ability of the gateway in the face of network congestion or packet loss can be intuitively reflected, thereby enhancing the comprehensiveness and accuracy of the test, and also significantly improving the efficiency of the test work through automated means.
[0023] Additional aspects and advantages of the present invention will be given in part in the following description, become apparent in part from the following description, or be learned through the practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The above and / or additional aspects and advantages of the present invention will become apparent and be readily understood from the description of the embodiments in conjunction with the following drawings, in which: Figure 1 is a schematic diagram of a test environment according to an embodiment of the present invention; Figure 2 is a flowchart of a message test method for an in-vehicle gateway according to an embodiment of the present invention; Figure 3 is a structural block diagram of a message test device for an in-vehicle gateway according to an embodiment of the present invention; Figure 4 is a structural block diagram of a vehicle according to an embodiment of the present invention; Figure 5 is a structural block diagram of a vehicle according to another embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0025] Embodiments of the present invention will be described in detail below. The embodiments described with reference to the drawings are exemplary. Embodiments of the present invention will be described in detail below.
[0026] Reference will be made below to Figure 1 and Figure 2 to describe a message test method for an in-vehicle gateway according to an embodiment of the present invention.
[0027] As shown in Figure 1As shown in the figure, it is a schematic diagram of the test environment of the embodiment of the present invention. The test environment is composed of a host computer, a hardware interface (such as VN1640A), a programmable power supply, an automated test cabinet, a simulation tool, and a DUT (Device Under Test). The simulation tool is, for example, CANoe (CAN open environment).
[0028] Among them, the host computer is connected to other devices (such as the hardware interface VN1640A and the programmable power supply) and the simulation tool CANoe in the automated test cabinet through interfaces such as Ethernet or USB (Universal Serial Bus) to achieve data transmission and the issuance of control instructions. Among them, the host computer serves as the control center of the entire test environment. The host computer is responsible for parsing the preset routing table, generating corresponding test parameter groups according to the routing rules, that is, generating target test parameter groups, and importing these target test parameter groups into the simulation tool CANoe. The simulation tool CANoe then uses these target test parameter groups to simulate the messages that need to be routed and sends them to the DUT through the bus. At the same time, the host computer is also responsible for recording and monitoring the messages on the bus, including key information such as the arrival time, content, and priority of the messages. In addition, the host computer can also record the flocking value on the bus (that is, the bus load condition) and conduct in-depth analysis of the test results, and finally draw an evaluation conclusion on the gateway performance.
[0029] The hardware interface VN1640A is connected to the bus through the cables in the automated test cabinet and communicates with the host computer through Ethernet or USB interfaces to ensure real-time data transmission and processing. The hardware interface VN1640A serves as a bridge between the simulation tool CANoe and the physical bus and is responsible for collecting and outputting the signals on the bus. During the test, the hardware interface VN1640A can capture the messages on the bus in real time and transfer them to the simulation tool CANoe for analysis; at the same time, the hardware interface VN1640A can also send simulated messages to the bus according to the instructions of the simulation tool CANoe to test the routing function of the gateway.
[0030] The programmable power supply is connected to the DUT through a power cord and communicates with the host computer through a serial port or Ethernet interface to receive control instructions and feedback the current voltage value. The programmable power supply can simulate different supply voltages according to the instructions of the host computer to test the performance of the gateway under different voltage conditions.
[0031] The automated test cabinet connects all hardware devices through internal cables to form a complete test system. At the same time, the cabinet is also connected to the host computer through external interfaces (such as Ethernet ports, USB ports, etc.) to achieve data transmission and the issuance of control instructions. The automated test cabinet is the physical carrier of the test environment, integrating all the above-mentioned hardware devices (such as the hardware interface VN1640A, programmable power supply, etc.), and providing a safe and stable test environment. In addition, the automated test cabinet usually also contains auxiliary facilities such as a heat dissipation system and a protection circuit inside to ensure the smooth progress of the test process.
[0032] The simulation tool CANoe runs on the host computer and is connected to hardware devices such as the hardware interface VN1640A through Ethernet or USB interfaces to achieve data transmission and the issuance of control instructions. The simulation tool CANoe supports multiple automotive network protocols and can simulate complex network topologies and communication scenarios. During the test, the simulation tool CANoe uses the target test parameter set generated by the host computer to simulate the messages that need to be routed and sends them to the bus through the hardware interface VN1640A. At the same time, it can also capture the messages on the bus in real time and conduct detailed analysis and statistics.
[0033] The DUT is connected to the hardware interface VN1640A through the bus and receives the simulated messages from the simulation tool CANoe; at the same time, it is connected to the programmable power supply through power lines (such as KL30 and KL15) to receive power supplies of different voltages. In addition, for the DUT (such as CAN bus devices) that needs to configure terminal resistors, the terminal resistors such as R1~Rn need to be selectively configured according to the device type (terminal type or non-terminal type). During the test, the DUT receives the messages from the bus and forwards them according to the preset routing rules. At the same time, it also needs to meet the power supply requirements under different voltage conditions to test its power supply adaptability.
[0034] Among them, when the battery supplies power to KL30, the DUT cannot work. Only when the battery supplies power to both KL30 and KL15 at the same time can the DUT be awakened to work.
[0035] The resistance value of the termination resistor is, for example, 120 Ω. For a terminal-type DUT, the termination resistor needs to be selectively configured. Specifically, the resistors located at both ends of the bus, namely R1 and the resistors configured every other node (such as R3, R5, …, Rn-1), are configured to ensure the complete transmission of signals and the reduction of reflections. For a non-terminal-type DUT, since the DUT may be located anywhere on the bus rather than at the end, all the termination resistors from R1 to Rn need to be configured. Although in practical applications, non-terminal-type DUTs usually do not directly access these termination resistors, but are configured by devices (such as gateways or controllers) at both ends of the bus, in this test environment, to simulate a complete bus scenario, non-terminal-type DUTs may be required to have the ability to access these termination resistors or at least consider their effects. Such a configuration helps to ensure the stability and reliability of bus communication, especially under long-distance transmission or high-load conditions.
[0036] Figure 2 is a flowchart of a message testing method for an in-vehicle gateway according to an embodiment of the present invention. As Figure 2 shown, the method at least includes step S1 - step S3.
[0037] Step S1, obtain a test parameter group corresponding to a preset routing table, and parse the test parameter group to obtain a target test parameter group.
[0038] In the embodiment, during the test preparation stage of the gateway device, first, a preset routing table needs to be imported into the host computer. This preset routing table usually exists in the form of an Excel spreadsheet, and testers need to follow a specific template to fill in this table.
[0039] For example, the preset routing table details the path rules that data packets should follow when transmitting in the network, including key information such as the destination address, next-hop address, outgoing interface, etc. Based on this preset routing table, a corresponding test parameter group will be generated. This test parameter group contains various detailed configuration information required for performing gateway tests, such as the type, size, sending frequency, duration, target IP (Intellectual Property, Internet Protocol address) address range, expected delay and jitter range, packet loss rate threshold, etc. of the test data packets. Subsequently, the host computer will parse this test parameter group. The parsing process, for example, involves a detailed analysis of the specific meaning, value range, dependencies between parameters, and how to match specific rules in the preset routing table for each parameter. Through this parsing step, the host computer can filter out the test parameters directly related to the current test scenario and meeting the requirements of the preset routing table, and finally form a target test parameter group that precisely matches the test requirements. Furthermore, the target test parameter group provides clear and definite guidance for the subsequent execution of gateway tests, ensuring the accuracy and effectiveness of the tests.
[0040] Step S2: Based on the target test parameter group, select a CAN channel and / or an ECU to generate an executable target test script.
[0041] In an embodiment, during the process of testing the gateway device based on the target test parameter group, the target test parameter group is imported into a simulation tool to select a specific CAN (Controller Area Network) channel and / or an ECU (Electronic Control Unit) to generate an executable target test script.
[0042] This means that the tester needs to carefully consider the association between each test parameter and the CAN communication channel as well as the ECU, because different CAN channels may carry different network traffic, and the ECU is responsible for processing and controlling specific information in this traffic. According to the specific requirements in the target test parameter group, such as specific data packet formats, transmission rates, target addresses, etc., the tester will select the corresponding CAN channel and / or ECU as the test object. This selection process ensures that the test script can accurately simulate the communication scenarios in a real network environment and comprehensively test the performance, stability, compatibility, etc. of the gateway device. Subsequently, using these selections, the simulation tool CANoe will generate a target test script that strictly corresponds to the target test parameter group and can be directly executed on the selected CAN channel and / or ECU.
[0043] Step S3: Execute the target test script to test the message and monitor the flocking value of the gateway in the case of frame loss, where the flocking value is used to characterize the performance state of the gateway.
[0044] In an embodiment, during the process of executing the target test script, the message (i.e., the data packet in network communication) will be tested according to the instructions in the target test script. To simulate various communication scenarios in a real network environment, including normal data transmission and possible abnormal situations, to comprehensively evaluate the performance of the gateway device.
[0045] Moreover, during the test, the upper computer will monitor the performance of the gateway in the case of frame loss (i.e., data packet loss), to ensure that the tester can intuitively understand the performance of the gateway when facing the challenge of frame loss by continuously monitoring and recording the flocking value of the gateway during the test, so as to make an accurate assessment of its performance state. Among them, frame loss is one of the common problems in network communication, which may be caused by various factors such as network congestion, device failure, or signal interference.
[0046] Thus, in the embodiments of the present invention, by obtaining the test parameter group corresponding to the preset routing table and parsing the test parameter group to obtain the target test parameter group, it is possible to provide clear and definite guidance for message testing, ensuring the accuracy and effectiveness of the testing. Then, based on the target test parameter group, a CAN channel and / or an ECU are selected to generate an executable target test script, ensuring that the target test script can accurately simulate the communication scenarios in the real network environment. Then, the target test script is executed to test the message, so that all routing messages can be tested in parallel at the same time, significantly improving the comprehensiveness and coverage of the testing, and ensuring that each message can be verified in a timely and effective manner. At the same time, by monitoring the flocking value of the gateway routing in the case of frame loss, the routing processing ability of the gateway can be accurately evaluated, and the stability and recovery ability of the gateway in the face of network congestion or packet loss can be intuitively reflected, thus enhancing the comprehensiveness and accuracy of the testing, and also significantly improving the efficiency of the testing work through automated means.
[0047] In an embodiment of the present invention, selecting a CAN channel and / or an ECU to generate an executable target test script includes: based on the message information of the CAN channel and / or the message information of the ECU, using the functions of the simulation tool to configure and control the behavior of the CAN channel and / or the ECU; generating an executable target test script according to the results of the configuration and control.
[0048] In the embodiment, the process of generating the executable target test script involves the selection and configuration of the CAN channel and / or the ECU. First, the message information of the CAN channel and / or the message information of the ECU is analyzed. For example, these message information details the structure, content, and transmission rules of the data packets in network communication. Subsequently, the tester will use a professional simulation tool, such as CANoe, and according to the specific requirements of the target test parameter group, accurately configure the CAN channel and / or the ECU, such as setting the sending rate, content, target address, etc. of the data packet, and controlling the communication behavior of the data, such as starting, stopping, restarting, etc. Based on the results of these configurations and controls, the simulation tool will generate a target test script that strictly corresponds to the target test parameter group and can be directly executed on the selected CAN channel and / or ECU, thus ensuring the accuracy and effectiveness of the testing when performing message testing based on the target test script.
[0049] In an embodiment of the present invention, using the functions of the simulation tool to configure and control the behavior of the CAN channel includes: grouping the CAN channels to obtain CAN test groups, enabling all messages within each CAN test group to be simulated and sent simultaneously; setting a first random start logic in the CAN script to randomly arrange the start order of each CAN test group within a first preset time range.
[0050] In an embodiment, multiple CAN channels are grouped to form multiple CAN test groups, so that all messages within each CAN test group can be simulated and sent simultaneously, thereby simulating a more realistic and complex network communication scenario. Subsequently, in the generated CAN script, according to the first random start logic, the start order of each CAN test group is randomly arranged within a preset time range. The introduction of this randomness not only increases the diversity of the test, making the test results more comprehensive and reliable, but also is closer to the uncertainty of message sending in actual network communication, which helps to more realistically evaluate the performance and stability of the gateway device in a complex network environment.
[0051] In an embodiment of the present invention, the functions of a simulation tool are used to configure and control the behavior of an ECU, including: grouping the ECUs to obtain ECU test groups, enabling all messages within each ECU test group to be simulated and sent simultaneously; setting a second random start logic in the ECU script to randomly arrange the start order of each ECU test group within a second preset time.
[0052] In an embodiment, the ECUs are grouped to form multiple ECU test groups to ensure that all messages within each ECU test group can be simulated and sent simultaneously, thereby more realistically restoring the interaction scenario between ECUs in network communication. Further, in the generated ECU script, based on the second random start logic, the start order of each ECU test group is randomly arranged within a preset time range. This random design not only enhances the diversity and complexity of the test, making the test results more comprehensive and reliable, but also is closer to the uncertainty of ECU startup in actual vehicle network communication, thereby being able to more effectively evaluate the performance and stability of the gateway device when communicating with the ECU.
[0053] In an embodiment of the present invention, before executing a target test script to test messages, it includes: performing hardware configuration, channel configuration, and test configuration on the simulation tool.
[0054] In an embodiment, before importing the target test script into the simulation tool and executing the target test script to test messages, it is necessary to perform hardware configuration, channel configuration, and test configuration on the simulation tool.
[0055] Specifically, the hardware configuration involves selecting hardware devices that meet the test requirements, such as high-performance computers or dedicated test equipment, and ensuring that they meet the hardware resource requirements of the simulation tool. Channel configuration refers to setting the communication channels in the simulation tool according to the needs of the test scenario, including selecting appropriate communication protocols, setting channel parameters, and configuring the connection relationships between channels, etc., to ensure that messages can be transmitted accurately and efficiently in the simulation environment. Finally, in the test configuration stage, according to the specific test objectives and requirements, detailed parameter settings and configuration adjustments are made to the simulation tool, including setting the execution parameters of the test script, configuring the input and output methods of the test data, and setting the monitoring and analysis indicators of the test results, etc., to provide a solid foundation and guarantee for executing the target test script through the configuration of the simulation tool, and to ensure the accuracy and effectiveness of the message test.
[0056] In an embodiment of the present invention, executing the target test script to test the message includes: setting an initial time parameter; within the initial time parameter, randomly starting a CAN channel or an ECU, and continuously testing the message for a first preset time.
[0057] In the embodiment, during the process of executing the target test script to test the message, an initial time parameter will be set. For example, the initial time parameter is 200 milliseconds, and this initial time parameter is determined based on the time required for the power-on controller to wake up, so as to ensure that the controller has enough time to stabilize and enter the working state.
[0058] Within this initial time parameter, a time point is randomly selected to start the CAN channel or the ECU, so as to simulate the uncertainty of message sending in actual network communication and increase the diversity of the test. Once the CAN channel or the ECU is started, the test script will immediately start continuously testing the message, and the test time length is the first preset time. For example, the first preset time is 30 minutes, so as to ensure that all possible communication behaviors and abnormal situations can be captured, thereby comprehensively evaluating the performance and stability of the CAN channel or the ECU.
[0059] In an embodiment of the present invention, after continuously testing the message for the first preset time, it includes: judging whether there is a frame loss phenomenon in the gateway; if not, at intervals of a second preset time, gradually reducing the initial time parameter until a frame loss phenomenon occurs, and obtaining the swarm values of each running CAN test group and / or ECU test group.
[0060] In an embodiment, after the message has been continuously tested for a set first preset time, it will be checked whether there is a frame loss phenomenon in the gateway. If no frame loss phenomenon is detected during this 30-minute test period, that is, the gateway has maintained communication stability during this period and no frame loss has occurred, then the test will enter the next stage. In this stage, the system will adopt a strategy of gradually approaching, with the second preset time as the interval. For example, the second preset time is 10 milliseconds. The initial time parameter will be gradually reduced, that is, the initial time parameter will be gradually reduced at a step of 10 milliseconds to accurately find the minimum time parameter value that causes frame loss. That is, at this time parameter, the communication begins to become unstable, manifested as a frame loss phenomenon.
[0061] After each adjustment of the time parameter and re-running of the test, the swarm value of the CAN test group and / or ECU test group during each run will be recorded to reflect the network communication load situation and message processing ability under different time parameters based on the swarm value.
[0062] Through such testing and adjustment, the critical point at which the frame loss phenomenon occurs can be accurately located, and its potential impact on network communication performance can be deeply analyzed, so as to accurately evaluate and optimize the stability and efficiency of message communication.
[0063] According to the message testing method for an in-vehicle gateway according to an embodiment of the present invention, by obtaining a test parameter group corresponding to a preset routing table and parsing the test parameter group to obtain a target test parameter group, clear and definite guidance can be provided for message testing, ensuring the accuracy and effectiveness of the test. Then, based on the target test parameter group, a CAN channel and / or ECU are selected to generate an executable target test script, ensuring that the target test script can accurately simulate the communication scenario in a real network environment. Then, the target test script is executed to test the message, so that all routing messages can be tested in parallel at the same time, significantly improving the comprehensiveness and coverage of the test, and ensuring that each message can be verified in a timely and effective manner. At the same time, by monitoring the swarm value of the gateway routing in the case of frame loss, the routing processing ability of the gateway can be accurately evaluated, and the stability and recovery ability of the gateway in the face of network congestion or packet loss can be intuitively reflected, thus enhancing the comprehensiveness and accuracy of the test, and also significantly improving the efficiency of the test work through automated means.
[0064] A further embodiment of the present invention also discloses a message testing device for an in-vehicle gateway.
[0065] As Figure 3 shown, the message testing device 2 for an in-vehicle gateway includes: an acquisition module 21, a generation module 22, and a testing module 23.
[0066] Among them, the acquisition module 21 is used to acquire a test parameter group corresponding to a preset routing table, parse the test parameter group, and obtain a target test parameter group; the generation module 22 is used to select a CAN channel and / or an ECU based on the target test parameter group to generate an executable target test script; the test module 23 is used to execute the target test script to test the message, and monitor the flocking value of the gateway in the case of frame loss, where the flocking value is used to characterize the performance state of the gateway.
[0067] In an embodiment of the present invention, the generation module 22 selects a CAN channel and / or an ECU to generate an executable target test script, including: configuring and controlling the behavior of the CAN channel and / or the ECU by using the functions of a simulation tool based on the message information of the CAN channel and / or the message information of the ECU; generating an executable target test script according to the configuration and control results.
[0068] In an embodiment of the present invention, the generation module 22 uses the functions of a simulation tool to configure and control the behavior of the CAN channel, including: grouping CAN channels to obtain a CAN test group, and simulating and sending all messages in each CAN test group simultaneously; setting a first random start logic in the CAN script to randomly arrange the start order of each CAN test group within a first preset time range.
[0069] In an embodiment of the present invention, the generation module 22 uses the functions of a simulation tool to configure and control the behavior of the ECU, including: grouping ECUs to obtain an ECU test group, and simulating and sending all messages in each ECU test group simultaneously; setting a second random start logic in the ECU script to randomly arrange the start order of each ECU test group within a second preset time.
[0070] In an embodiment of the present invention, before the test module 23 executes the target test script to test the message, it includes: performing hardware configuration, channel configuration, and test configuration on the simulation tool.
[0071] In an embodiment of the present invention, the test module 23 executes the target test script to test the message, including: setting an initial time parameter; randomly starting a CAN channel or an ECU within the initial time parameter, and continuously testing the message for a first preset time.
[0072] In an embodiment of the present invention, after the test module 23 continuously tests the message for a first preset time, it includes: determining whether the gateway has a frame loss phenomenon; if not, reducing the initial time parameter step by step at intervals of a second preset time until a frame loss phenomenon occurs, and obtaining the flocking value of each running CAN test group and / or ECU test group.
[0073] According to the message testing device 2 for an in-vehicle gateway according to an embodiment of the present invention, by obtaining a test parameter group corresponding to a preset routing table through an obtaining module 21 and parsing the test parameter group to obtain a target test parameter group, it can provide clear and definite guidance for message testing, ensuring the accuracy and effectiveness of the test. Then, a generating module 22 selects a CAN channel and / or an ECU based on the target test parameter group to generate an executable target test script, ensuring that the target test script can accurately simulate the communication scenario in a real network environment. Then, a testing module 23 executes the target test script to test the message, so that all routing messages can be tested in parallel at the same time, significantly improving the comprehensiveness and coverage of the test, and ensuring that each message can be verified in a timely and effective manner. At the same time, by monitoring the flocking value of the gateway routing in the case of frame loss, the routing processing ability of the gateway can be accurately evaluated, and the stability and recovery ability of the gateway in the face of network congestion or packet loss can be intuitively reflected, thereby enhancing the comprehensiveness and accuracy of the test, and also significantly improving the efficiency of the test work through automated means.
[0074] A further embodiment of the present invention also discloses a vehicle.
[0075] In some embodiments, as Figure 4 shown, the vehicle 3 includes the message testing device 2 for an in-vehicle gateway described in the above embodiment of the present invention.
[0076] In other embodiments, as Figure 5 shown, the vehicle 3 includes a processor 31, a memory 32, and a message testing program for an in-vehicle gateway stored on the memory and executable on the processor 31. When the message testing program for an in-vehicle gateway is executed by the processor 31, it implements the message testing method for an in-vehicle gateway described in the above embodiment of the present invention.
[0077] According to the vehicle 3 of an embodiment of the present invention, by obtaining a test parameter group corresponding to a preset routing table and parsing the test parameter group to obtain a target test parameter group, it can provide clear and definite guidance for message testing, ensuring the accuracy and effectiveness of the test. Then, based on the target test parameter group, a CAN channel and / or an ECU are selected to generate an executable target test script, ensuring that the target test script can accurately simulate the communication scenario in a real network environment. Then, the target test script is executed to test the message, so that all routing messages can be tested in parallel at the same time, significantly improving the comprehensiveness and coverage of the test, and ensuring that each message can be verified in a timely and effective manner. At the same time, by monitoring the flocking value of the gateway routing in the case of frame loss, the routing processing ability of the gateway can be accurately evaluated, and the stability and recovery ability of the gateway in the face of network congestion or packet loss can be intuitively reflected, thereby enhancing the comprehensiveness and accuracy of the test, and also significantly improving the efficiency of the test work through automated means.
[0078] A further embodiment of the present invention also discloses a computer-readable storage medium, on which a message test program for a vehicle-mounted gateway is stored. When the message test program for the vehicle-mounted gateway is executed by a processor, it implements the message test method for the vehicle-mounted gateway as described in the above embodiments of the present invention.
[0079] According to the computer-readable storage medium of the embodiment of the present invention, when the message test program for the vehicle-mounted gateway stored thereon is executed by a processor, by obtaining a test parameter group corresponding to a preset routing table and parsing the test parameter group to obtain a target test parameter group, it can provide clear and definite guidance for message testing, ensuring the accuracy and effectiveness of the test. Then, based on the target test parameter group, a CAN channel and / or an ECU are selected to generate an executable target test script, ensuring that the target test script can accurately simulate the communication scenario in a real network environment. Then, the target test script is executed to test the message, so that all routing messages can be tested in parallel at the same time, significantly improving the comprehensiveness and coverage of the test, and ensuring that each message can be verified in a timely and effective manner. At the same time, by monitoring the congestion value of the gateway routing in the case of frame loss, the routing processing ability of the gateway can be accurately evaluated, and the stability and recovery ability of the gateway in the face of network congestion or packet loss can be intuitively reflected, thereby enhancing the comprehensiveness and accuracy of the test, and also significantly improving the efficiency of the test work through automated means.
[0080] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples", etc. means that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example.
[0081] Although the embodiments of the present invention have been shown and described, those of ordinary skill in the art can understand that various changes, modifications, substitutions, and variations can be made to these embodiments without departing from the principles and spirit of the present invention. The scope of the present invention is defined by the claims and their equivalents.
Claims
1. A message testing method for an in-vehicle gateway, characterized in that, Including: Obtain a test parameter group corresponding to a preset routing table, and parse the test parameter group to obtain a target test parameter group; Based on the target test parameter group, select a CAN channel and / or an ECU to generate an executable target test script; Execute the target test script to test the message, and monitor the swarm value of the gateway in the case of frame loss, where the swarm value is used to characterize the performance state of the gateway.
2. The message testing method for an in-vehicle gateway according to claim 1, characterized in that, Selecting a CAN channel and / or an ECU to generate an executable target test script includes: Based on the message information of the CAN channel and / or the message information of the ECU, use the functions of the simulation tool to configure and control the behavior of the CAN channel and / or the ECU; According to the results of the configuration and control, generate the executable target test script.
3. The message testing method for an in-vehicle gateway according to claim 2, characterized in that Using the functions of the simulation tool to configure and control the behavior of the CAN channel includes: Group the CAN channels to obtain CAN test groups, and simulate and send all the messages in each CAN test group simultaneously; Set a first random start logic in the CAN script to randomly arrange the start order of each CAN test group within a first preset time range.
4. The message testing method for an in-vehicle gateway according to claim 2, characterized in that Using the functions of the simulation tool to configure and control the behavior of the ECU includes: Group the ECUs to obtain ECU test groups, and simulate and send all the messages in each ECU test group simultaneously; Set a second random start logic in the ECU script to randomly arrange the start order of each ECU test group within a second preset time.
5. The message testing method for an in-vehicle gateway according to claim 3 or 4, characterized in that, Before executing the target test script to test the message, it includes: Perform hardware configuration, channel configuration, and test configuration on the simulation tool.
6. The message testing method for an in-vehicle gateway according to claim 1, wherein Executing the target test script to test the message includes: Set initial time parameters; Within the initial time parameters, randomly start the CAN channel or ECU, and continuously test the message for a first preset time.
7. The message testing method for an in-vehicle gateway according to claim 6, characterized in that, After continuously testing the message for the first preset time, it includes: Judge whether there is a frame loss phenomenon in the gateway; If not, at intervals of a second preset time, gradually reduce the initial time parameters until a frame loss phenomenon occurs, and obtain the swarm value of each running CAN test group and / or ECU test group.
8. A message testing device for an in-vehicle gateway, characterized in that, Including: An acquisition module for obtaining a test parameter group corresponding to a preset routing table, and parsing the test parameter group to obtain a target test parameter group; A generation module for selecting a CAN channel and / or an ECU based on the target test parameter group to generate an executable target test script; A test module for executing the target test script to test the message and monitoring the swarm value of the gateway in the case of frame loss, where the swarm value is used to characterize the performance state of the gateway.
9. A vehicle, characterized in that, Including: The message test device for an in-vehicle gateway according to claim 8; Or, A processor, a memory, and a message test program for a vehicle gateway stored on the memory and executable on the processor, wherein when the message test program for the vehicle gateway is executed by the processor, it implements the message test method for the vehicle gateway according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, A message test program for a vehicle gateway is stored on the computer-readable storage medium, and when the message test program for the vehicle gateway is executed by the processor, it implements the message test method for the vehicle gateway according to any one of claims 1-7.