Automatic gateway routing testing method and device and storage medium

By obtaining and parsing the routing relationship requirements table and DBC files of the entire vehicle CAN network segment, generating gateway routing configuration files, and using gateway routing testing programs for automated testing, the problems of low efficiency and poor accuracy of gateway controller testing in the existing technology are solved, and efficient and accurate gateway routing automation testing is achieved.

CN119835185APending Publication Date: 2025-04-15SINO TRUK JINAN POWER CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411846621.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-16
Publication Date
2025-04-15

AI Technical Summary

Technical Problem

The prior art is difficult to realize automated testing of gateway controllers, especially in terms of the accuracy of routing relationships and the delay requirements of routing messages, resulting in low testing efficiency and inability to ensure the accuracy of test results.

Method used

By obtaining the routing relationship requirements table of the entire vehicle CAN network segment and the DBC files of each network segment, a gateway routing configuration file is generated, and the gateway routing test program is used to parse the message routing information, define simulated messages, and conduct automated testing, including identifier ID consistency test, data length consistency test, signal value consistency test, etc.

Benefits of technology

It realizes the accuracy of automated detection of packet routing relationships, improves testing efficiency, reduces human errors, and standardizes and simplifies gateway routing function verification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119835185A_ABST
    Figure CN119835185A_ABST
Patent Text Reader

Abstract

The invention provides a gateway routing automatic testing method and device and a storage medium. The method comprises the following steps of: obtaining a finished automobile CAN network segment routing relation demand table in a standard format and a DBC file of each network segment of the finished automobile; comparing and analyzing the whole vehicle CAN network segment routing relation demand table and each network segment DBC file to generate a gateway routing configuration file, and checking and solving problems existing in the whole vehicle CAN network segment routing relation demand table and the network segment DBC file; analyzing message routing information of the gateway routing configuration file by applying a gateway routing test program, defining a simulation message according to the message routing information, and sequentially testing the selected test cases; and monitoring and analyzing data of all CAN channels of the gateway by using a bus monitoring and analyzing tool so as to obtain a test result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of vehicle-mounted gateway routing testing, and in particular to a gateway routing automated testing method, device and storage medium. Background Art

[0002] With the gradual increase in the market share of new energy commercial vehicles, the electronic control products related to new energy commercial vehicles are frequently iterated. At present, the mainstream of the commercial vehicle industry adopts a distributed electronic and electrical architecture. A single network segment cannot meet the communication needs. It is necessary to add a gateway controller to realize segment management to reduce the bus load rate. The gateway controller can realize the message routing between different CAN bus segments. If the gateway controller does not work properly or lacks key message routing, it will cause the whole vehicle to not work properly. Therefore, the gateway controller program needs to be systematically functionally tested. Since there are many programs in the gateway controller and the gateway controller supports message routing of multiple CAN gateways, manual testing is inefficient and cannot guarantee the accuracy of routing information and the delay requirements of routing messages. It is urgent to develop a gateway routing automatic test device. At present, there are patents and technologies that disclose automatic parsing of DBC files to generate gateway routing information, and further configure test cases based on gateway routing information to realize the process of automated testing. However, the correctness of the routing relationship was not checked before the test, and there may be anomalies caused by non-gateway failures. In addition, the test cases of the gateway controller did not involve gateway diagnostic segment testing, gateway diagnostic mechanism routing testing, routing behavior testing under a small number of error frames, routing behavior testing during BusOff failures, and routing behavior testing during DLC ​​errors. Summary of the invention

[0003] In order to solve the above technical problem or at least partially solve the above technical problem, the present invention provides a gateway routing automatic testing method, device and storage medium.

[0004] In a first aspect, the present invention provides a gateway routing automation testing method, comprising:

[0005] Obtain the vehicle CAN network segment routing relationship requirement table and the DBC files of each network segment of the vehicle in a standard format; compare and analyze the vehicle CAN network segment routing relationship requirement table and each network segment DBC file to generate a gateway routing configuration file, and troubleshoot and solve the problems existing in the vehicle CAN network segment routing relationship requirement table and the network segment DBC file; apply the gateway routing test program to parse the message routing information of the gateway routing configuration file, define the simulation message according to the message routing information, and test the selected test cases in sequence, wherein the test contents involved in the test cases include: identifier ID consistency test, data length consistency test, signal value consistency test, gateway routing delay time test under normal state, gateway routing delay time test under high priority load rate state, gateway routing delay time test under low priority load rate state, gateway diagnostic network segment test, gateway diagnostic mechanism routing test, routing behavior test under a small number of error frames, routing behavior test during BusOff fault, and routing behavior test during DLC ​​error; use bus monitoring and analysis tools to monitor and analyze the data of all CAN channels of the gateway to obtain test results.

[0006] Furthermore, the process of comparing and analyzing the vehicle CAN network segment routing relationship requirement table and each network segment DBC file to generate a gateway routing configuration file, and troubleshooting and solving problems in the vehicle CAN network segment routing relationship requirement table and the network segment DBC file includes: S201: importing the vehicle CAN network segment routing relationship requirement table into the test management system;

[0007] S202: The test management system determines the number of network segments for this round of testing according to the network segment names in the vehicle CAN network segment routing relationship requirement table;

[0008] S203: setting the serial number of each CAN network segment based on the number of network segments, and importing the corresponding network segment DBC file;

[0009] S204: The test management system parses the uploaded network segment DBC file and compares it with the information in the vehicle CA N network segment routing relationship requirement table;

[0010] S205: Determine whether the number of packets that have not been parsed to the source network segment in the network segment DBC file is 0, if so, go to S206;

[0011] Otherwise, go to S210;

[0012] S206: Determine whether the number of messages that are not parsed to the target network segment in the network segment DBC file is 0, if so, go to S207;

[0013] Otherwise, go to S210;

[0014] S207: Determine whether the number of messages whose start bits of message signals are not parsed to the source network segment is 0, if so, go to S208;

[0015] Otherwise, go to S210;

[0016] S208: Determine whether the number of messages whose start bits of message signals are not parsed to the target network segment is 0, if so, go to S209;

[0017] Otherwise, go to S210;

[0018] S209: Generate the gateway routing configuration file;

[0019] S210: Locate the problematic message according to the prompt and modify the vehicle platform communication database, then go to S201.

[0020] Furthermore, the routing behavior test under a small number of error frames is used to test that the gateway controller does not route error frames to other network segments and the routing function is normal, including: S301: powering the gateway controller under test and waiting until the bus communication is stable;

[0021] S302: using a bus monitoring and analysis tool to simulate sending an error frame to any source network segment channel of the gateway controller under test at a set period;

[0022] S303: Use bus monitoring and analysis tools to monitor other network segment channels to check whether there are error frames for a certain period of time;

[0023] S304: according to the definition of the gateway routing configuration file, using the bus monitoring and analysis tool to simulate any message based on message routing and send it to the source network segment channel of the gateway controller under test, and check whether the gateway controller under test can correctly simulate the message;

[0024] S305: Use the bus monitoring and analysis tool to monitor the target network segment to determine whether a message with the same routing message ID as that sent by the source network segment is received. If the gateway controller under test can correctly forward the message, then continue to S306;

[0025] S306: Repeat S302 to S305, and use the bus monitoring and analysis tool to simulate error frames in other network segments to check whether the routing function of the gateway controller under test is affected.

[0026] Furthermore, the routing behavior test under a small number of error frames includes: S301*: powering the gateway controller under test and waiting until the bus communication is stable;

[0027] S302*: Use the bus test jammer to interfere with the RTR bit of the network management message sent by any source network segment channel of the gateway controller under test, so as to generate a sending error frame. Each time, the set message frame is interfered, and the number of interferences is set according to the set interval.

[0028] S303*: Use bus monitoring and analysis tools to monitor other network segment channels to check whether there are error frames and continue for a set time;

[0029] S304*: according to the definition of the gateway routing configuration file, use the bus monitoring and analysis tool to simulate any message based on message routing and send it to the source network segment channel of the gateway controller under test, and check whether the gateway controller under test can correctly simulate the message;

[0030] S305*: Use the bus monitoring and analysis tool to monitor the target network segment to determine whether a message with the same routing message ID as that sent by the source network segment is received. If the gateway controller under test can correctly forward the message, continue to S306*;

[0031] S306*: Repeat S302* to S305*, and use the bus monitoring and analysis tool to simulate error frames in other network segments to check whether the routing function of the gateway controller under test is affected.

[0032] Furthermore, the BusOff fault routing behavior test is used to detect whether the gateway routing strategy meets the requirements when a BusOff fault occurs in a channel of the gateway controller, including:

[0033] S311: Power the gateway controller under test and wait until the bus communication is stable;

[0034] S312: using a bus monitoring and analysis tool to simulate sending application messages other than gateway routing messages in all network segments;

[0035] S313: After ensuring that the gateway controller under test can correctly receive the application message, use the bus test jammer to interfere with the RTR bit of the network management message sent by any source network segment channel of the gateway controller under test, so that the source network segment channel is always in the BusOff state;

[0036] S314: Monitor the target network segment using a bus monitoring and analysis tool to determine whether the gateway controller under test sends a corresponding routing message according to the definition of the vehicle CAN network segment routing relationship requirement table;

[0037] S315: repeating steps S312 to S313, and using the bus monitoring and analysis tool to determine whether the routing functions between other network segments are normal;

[0038] S316: Repeat steps S312 to S314 to respectively determine whether the routing functions of other network segments of the controller under test are normal when any network segment is in the BusOff state.

[0039] Furthermore, the routing behavior test when DLC errors occur is used to detect whether the gateway can forward messages when DLC errors occur during the routing process, including:

[0040] S321: Power the gateway controller under test and wait until the bus communication is stable;

[0041] S322: according to the definition of the gateway routing configuration file, using the bus monitoring and analysis tool to simulate sending any message to the source network segment channel corresponding to the gateway controller under test;

[0042] S323: Change the DLC of the message to be smaller than the length defined in the network segment DBC file;

[0043] S324: Monitor the target network segment using a bus monitoring and analysis tool to observe whether the target network segment can route the message sent by the source network segment;

[0044] S325: according to the definition of the gateway routing configuration file, using the bus monitoring and analysis tool to simulate other messages and send them to the source network segment channel corresponding to the gateway controller under test;

[0045] S326: repeat steps S323 to S325 to change the DLC of the message to be smaller than the length defined in the network segment DBC file;

[0046] S327: Change the source network segment to traverse all source network segments, and repeat steps S322 to S326.

[0047] Furthermore, the routing behavior test when the DLC is wrong is used to verify whether the message can be routed normally when the source network segment message DLC is greater than the definition in the network segment DBC file, including:

[0048] S331: Power the gateway controller under test and wait until the bus communication is stable;

[0049] S332: according to the definition of the gateway routing configuration file, using the bus monitoring and analysis tool to simulate any message with a DLC less than 8 and send it to the source network segment channel corresponding to the gateway controller under test;

[0050] S333: Change the DLC of the message to 8;

[0051] S334: Use bus monitoring and analysis tools to monitor the target network segment to see whether the target network segment can route the message sent by the source network segment and whether the DLC is 8;

[0052] S335: according to the definition of the gateway routing configuration file, use the bus monitoring and analysis tool to simulate other messages with a DLC less than 8 and send them to the source network segment channel corresponding to the gateway controller under test;

[0053] S336: Change the source network segment to traverse all source network segments, and repeat steps S322 to S325.

[0054] Furthermore, the test results include test case serial number, test time, test description, actual test result value, expected result value, case test result, picture name and picture description.

[0055] In a second aspect, the present invention provides a gateway routing automation test device, comprising: a computer device for running a test management system and a gateway routing test program, a bus monitoring and analysis tool, a power supply and a gateway controller under test; the bus monitoring and analysis tool and the gateway controller under test communicate via a multi-channel CAN bus connection to perform a routing relationship test; the computer device comprises: at least one processing unit, the processing unit is connected to a storage unit via a bus unit, the storage unit stores a computer program, and the processing unit executes the computer program to implement the gateway routing automation test method.

[0056] In a third aspect, the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the gateway routing automation testing method is implemented.

[0057] The above technical solution provided by the embodiment of the present invention has the following advantages compared with the prior art:

[0058] The gateway routing automation testing method provided by the present invention applies for obtaining a standard format of a whole vehicle CAN network segment routing relationship requirement table and DBC files of each network segment of the whole vehicle; compares and analyzes the whole vehicle CAN network segment routing relationship requirement table and each network segment DBC file to generate a gateway routing configuration file, and checks and solves problems existing in the whole vehicle CAN network segment routing relationship requirement table and the network segment DBC file; before the test is executed, the accuracy of the message routing relationship can be automatically and accurately detected, repeated testing can be avoided, and anomalies caused by non-gateway failures can be avoided.

[0059] A gateway routing test program is applied to parse the message routing information of the gateway routing configuration file, a simulation message is defined according to the message routing information, and the selected test cases are tested in sequence, wherein the test contents involved in the test cases include: identifier ID consistency test, data length consistency test, signal value consistency test, gateway routing delay time test under normal state, gateway routing delay time test under high priority load rate state, gateway routing delay time test under low priority load rate state, gateway diagnostic network segment test, gateway diagnostic mechanism routing test, routing behavior test under a small number of error frames, routing behavior test during BusOff failure, and routing behavior test during DLC ​​error.

[0060] Users of the gateway routing automation test device do not need to master the entire process of all message routing designs, which makes the gateway routing function verification standardized and simplified. It can automatically count the gateway routing delay time in typical scenarios, reduce human errors, and greatly improve the testing efficiency of the gateway controller.

[0061] In addition, the invention has a reliable design principle, a simple structure and a very broad application prospect. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0063] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0064] Figure 1 A flow chart of a method for automating testing of gateway routing;

[0065] Figure 2 A flowchart for testing the management system to compare and analyze the vehicle CAN segment routing relationship requirement table and each segment DBC file to generate a gateway routing configuration file, and to troubleshoot and resolve problems in the vehicle CAN segment routing relationship requirement table and segment DBC file;

[0066] Figure 3 It is a schematic diagram of the vehicle CAN segment routing relationship requirement table;

[0067] Figure 4 Schematic diagram of the gateway routing configuration file;

[0068] Figure 5 This is a schematic diagram of the overall test report of the gateway routing test results;

[0069] Figure 6 A test report diagram of specific items of the gateway routing test results;

[0070] Figure 7 Schematic diagram of the gateway routing automation test setup. DETAILED DESCRIPTION

[0071] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0072] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0073] Example 1

[0074] See also Figure 1 and Figure 2 As shown, the present application provides a gateway routing automation testing method, comprising:

[0075] S100: Obtain the vehicle CAN network segment routing relationship requirement table and the DBC files of each network segment of the vehicle in a standard format. Use VDE (Vehicle Database Editor) software to manage the vehicle platform communication database, and automatically export the vehicle CAN network segment routing relationship requirement table and the DBC files of each network segment of the vehicle in a standard format from the vehicle platform communication database platform.

[0076] like Figure 3 As shown, the vehicle CAN segment routing relationship requirement table includes source segment name, source segment signal name, source segment message name, source segment message ID, target segment name, target segment signal name, target segment message name, target segment message ID, routing type, gateway controller name, message change record, and timeout value. The transmission paths and message change records of all messages of the tested gateway are obtained according to the vehicle CAN segment routing relationship requirement table.

[0077] The timeout value is the physical value of the target network segment signal, and needs to be calculated based on the bus value of the target network segment signal timeout value. For a target network segment signal that has no defined timeout value or an invalid value, the timeout value is filled with the number 0.

[0078] S200: The test management system compares and analyzes the vehicle CAN network segment routing relationship requirement table and each network segment DBC file to generate a gateway routing configuration file, and checks and solves problems in the vehicle CAN network segment routing relationship requirement table and the network segment DBC file to avoid using incorrect input testing to cause meaningless test results and waste time and energy.

[0079] like Figure 2 As shown, the following steps are included:

[0080] S201: Importing the vehicle CAN network segment routing relationship requirement table into the test management system;

[0081] S202: The test management system determines the number of network segments for this round of testing according to the network segment names in the vehicle CAN network segment routing relationship requirement table;

[0082] S203: setting the serial number of each CAN network segment based on the number of network segments, and importing the corresponding network segment DBC file;

[0083] S204: The test management system parses the uploaded network segment DBC file and compares it with the information in the vehicle CA N network segment routing relationship requirement table;

[0084] S205: Determine whether the number of packets that have not been parsed to the source network segment in the network segment DBC file is 0, if so, go to S206;

[0085] Otherwise, go to S210;

[0086] S206: Determine whether the number of messages that are not parsed to the target network segment in the network segment DBC file is 0, if so, go to S207;

[0087] Otherwise, go to S210;

[0088] S207: Determine whether the number of messages whose start bits of message signals are not parsed to the source network segment is 0, if so, go to S208;

[0089] Otherwise, go to S210;

[0090] S208: Determine whether the number of messages whose start bits of message signals are not parsed to the target network segment is 0, if so, go to S209;

[0091] Otherwise, go to S210;

[0092] S209: Generate the gateway routing configuration file;

[0093] In this embodiment, Figure 4 As shown, the gateway routing configuration file includes: the number of message routes, the nth message route, the message routing mode, the source network segment CAN channel number, the source network segment DBC name, the source network segment message ID, the source network segment message name, the source network segment node name, the source network segment signal name, the target network segment CAN channel number, the target network segment DBC name, the target network segment message ID, the target network segment message name, the target network segment node name, the target network segment signal name, and the signal timeout value.

[0094] Among them, the message routing mode is divided into direct message routing and periodic message routing. It is recommended to use "1" to represent direct message routing and "2" to represent periodic message routing.

[0095] S210: Locate the problematic message according to the prompt and modify the vehicle platform communication database, then go to S201.

[0096] S300: Apply the gateway routing test program to parse the message routing information of the gateway routing configuration file, define the simulation message according to the message routing information, and test the selected test cases in sequence.

[0097] In this embodiment, the test contents involved in the test case include: identifier ID consistency test, data length consistency test, signal value consistency test, gateway routing delay time test under normal state, gateway routing delay time test under high priority load rate state, gateway routing delay time test under low priority load rate state, gateway diagnostic network segment test, gateway diagnostic mechanism routing test, routing behavior test under a small number of error frames, routing behavior test during Bus Off failure, and routing behavior test during DLC ​​error.

[0098] In this embodiment, for the gateway routing delay time test in the normal state, the gateway routing delay time test in the high priority load rate state, and the gateway routing delay time test in the low priority load rate state, it is recommended that the routing delay time of the direct message routing is less than 2ms. The bus state load rate recommended for the high priority load rate state and the low priority load rate state is ≥90%.

[0099] The routing behavior test under a small number of error frames is used to test that the gateway controller does not route error frames to other network segments and the routing function is normal. The specific process can be performed as follows:

[0100] S301: Power the gateway controller under test and wait for 1 second until the bus communication is stable;

[0101] S302: using a bus monitoring and analysis tool to simulate sending an error frame to a source network segment channel of the gateway controller under test with a period of 100 ms;

[0102] In this embodiment, the bus monitoring and analysis tool is not limited to Vector's CANoe and Zhou Ligong's CAN card.

[0103] S303: Use bus monitoring and analysis tools to monitor other network segment channels to check whether there are error frames for a certain period of time;

[0104] In this embodiment, the recommended duration is 30 seconds.

[0105] S304: according to the definition of the gateway routing configuration file, using the bus monitoring and analysis tool to simulate any message based on message routing and send it to the source network segment channel of the gateway controller under test, and check whether the gateway controller under test can correctly simulate the message;

[0106] S305: Use the bus monitoring and analysis tool to monitor the target network segment to determine whether a message with the same routing message ID as that sent by the source network segment is received. If the gateway controller under test can correctly forward the message, then continue to S306;

[0107] S306: Repeat S302 to S305, and use the bus monitoring and analysis tool to simulate error frames in other network segments to check whether the routing function of the gateway controller under test is affected.

[0108] The routing behavior test process under a small number of error frames can also be performed as follows:

[0109] S301*: Power the gateway controller under test and wait for 1 second until the bus communication is stable;

[0110] S302*: Use the bus test jammer to interfere with the RTR bit of the network management message sent by a source network segment channel of the gateway controller under test, and create a sending error frame. Interfere 10 frames each time, with an interval of 100ms, and interfere 100 times;

[0111] In this embodiment, the bus test jammer is not limited to Vector's CANStress device and ihr's CANspider device.

[0112] S303*: Use bus monitoring and analysis tools to monitor other network segment channels to check whether there are error frames for a certain period of time;

[0113] S304*: according to the definition of the gateway routing configuration file, use the bus monitoring and analysis tool to simulate any message based on message routing and send it to the source network segment channel of the gateway controller under test, and check whether the gateway controller under test can simulate the message correctly;

[0114] S305*: Use the bus monitoring and analysis tool to monitor the target network segment to determine whether a message with the same routing message ID as that sent by the source network segment is received. If the gateway controller under test can correctly forward the message, continue to S306*;

[0115] S306*: Repeat S302* to S305*, and use the bus monitoring and analysis tool to simulate error frames in other network segments to check whether the routing function of the gateway controller under test is affected.

[0116] The routing behavior test during BusOff failure is used to detect whether the gateway's routing strategy meets the requirements when a BusOff failure occurs in a channel of the gateway controller. The specific process can be performed as follows:

[0117] S311: Power the gateway controller under test and wait for 1 second until the bus communication is stable;

[0118] S312: using a bus monitoring and analysis tool to simulate sending application messages other than gateway routing messages in all network segments;

[0119] S313: After ensuring that the gateway controller under test can correctly receive the application message, use the bus test jammer to interfere with the RTR bit of the network management message sent by a source network segment channel of the gateway controller under test, so that the source network segment channel is always in the BusOff state;

[0120] S314: Monitor the target network segment using a bus monitoring and analysis tool to determine whether the gateway controller under test sends a corresponding routing message according to the definition of the vehicle CAN network segment routing relationship requirement table;

[0121] S315: repeating steps S312 to S313, and using the bus monitoring and analysis tool to determine whether the routing functions between other network segments are normal;

[0122] S316: Repeat steps S312 to S314 to respectively determine whether the routing functions of other network segments of the controller under test are normal when a certain network segment is in the BusOff state.

[0123] The DLC error routing behavior test is used to detect whether the gateway can forward messages when a DLC error occurs during routing. It can be performed as follows:

[0124] S321: Power the gateway controller under test and wait for 1 second until the bus communication is stable;

[0125] S322: according to the definition of the gateway routing configuration file, using the bus monitoring and analysis tool to simulate a message to be sent to the source network segment channel corresponding to the gateway controller under test;

[0126] S323: Change the DLC of the message to make it smaller than the DBC definition length;

[0127] S324: Monitor the target network segment using a bus monitoring and analysis tool to observe whether the target network segment can route the message sent by the source network segment;

[0128] S325: according to the definition of the gateway routing configuration file, using the bus monitoring and analysis tool to simulate other messages and send them to the source network segment channel corresponding to the gateway controller under test;

[0129] S326: repeat steps S323 to S325 to change the DLC of the message to make it smaller than the DBC definition length;

[0130] S327: Change the source network segment (traverse all network segments), and repeat steps S322 to S326.

[0131] In this embodiment, for message routing, when the source network segment message DLC is smaller than the message DLC defined by the DBC, the gateway does not route the message.

[0132] The DLC error routing behavior test is used to verify whether the source network segment message DLC is greater than the DBC definition. Follow the steps below to perform:

[0133] S331: Power the gateway controller under test and wait for 1 second until the bus communication is stable;

[0134] S332: according to the definition of the gateway routing configuration file, a certain message (DLC<8) is simulated by using the bus monitoring and analysis tool and sent to the source network segment channel corresponding to the gateway controller under test;

[0135] S333: Change the DLC of the message to 8;

[0136] S334: Use bus monitoring and analysis tools to monitor the target network segment to see whether the target network segment can route the message sent by the source network segment and whether the DLC is 8;

[0137] S335: according to the definition of the gateway routing configuration file, use the bus monitoring and analysis tool to simulate other messages (DLC<8) and send them to the source network segment channel corresponding to the gateway controller under test;

[0138] S336: Change the source network segment (traverse all network segments), and repeat steps S322 to S325.

[0139] In this embodiment, for message routing, when the DLC of the source network segment message is greater than the DBC definition, the gateway routes the message normally, and the DLC is the same as the source network segment message.

[0140] S400: Use the bus monitoring and analysis tool to monitor and analyze the data of all CAN channels of the gateway to obtain the test results, and upload the test results to the test management system for the test personnel to view.

[0141] In this embodiment, Figure 5 and Figure 6 As shown, the test results include test case serial number, test time, test description, actual test result value, expected result value, case test result, picture name and picture description.

[0142] Example 2

[0143] like Figure 7 As shown, the gateway routing automation test device includes a computer device for running a test management system and a gateway routing test program, a bus monitoring and analysis tool, a power supply, and a gateway controller under test. The bus monitoring and analysis tool and the gateway controller under test communicate via a multi-channel CAN bus connection to perform a routing relationship test. The computer device includes: at least one processing unit, the processing unit is connected to a storage unit via a bus unit, the storage unit stores a computer program, and the processing unit executes the computer program to implement the gateway routing automation test method, including:

[0144] Obtain the vehicle CAN network segment routing relationship requirement table and the DBC files of each network segment of the vehicle in a standard format; compare and analyze the vehicle CAN network segment routing relationship requirement table and each network segment DBC file to generate a gateway routing configuration file, and troubleshoot and solve the problems existing in the vehicle CAN network segment routing relationship requirement table and the network segment DBC file; apply the gateway routing test program to parse the message routing information of the gateway routing configuration file, define the simulation message according to the message routing information, and test the selected test cases in sequence, wherein the test contents involved in the test cases include: identifier ID consistency test, data length consistency test, signal value consistency test, gateway routing delay time test under normal state, gateway routing delay time test under high priority load rate state, gateway routing delay time test under low priority load rate state, gateway diagnostic network segment test, gateway diagnostic mechanism routing test, routing behavior test under a small number of error frames, routing behavior test during BusOff fault, and routing behavior test during DLC ​​error; use bus monitoring and analysis tools to monitor and analyze the data of all CAN channels of the gateway to obtain test results.

[0145] Of course, the computer program stored in the storage unit of the gateway routing automation test device provided by the embodiment of the present invention is not limited to the method operations described above, and can also execute related operations in the gateway routing automation test method provided by any embodiment of the present invention.

[0146] Example 3

[0147] An embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program. When the computer program is executed, the gateway routing automation test method is implemented, including:

[0148] Obtain the vehicle CAN network segment routing relationship requirement table and the DBC files of each network segment of the vehicle in a standard format; compare and analyze the vehicle CAN network segment routing relationship requirement table and each network segment DBC file to generate a gateway routing configuration file, and troubleshoot and solve the problems existing in the vehicle CAN network segment routing relationship requirement table and the network segment DBC file; apply the gateway routing test program to parse the message routing information of the gateway routing configuration file, define the simulation message according to the message routing information, and test the selected test cases in sequence, wherein the test contents involved in the test cases include: identifier ID consistency test, data length consistency test, signal value consistency test, gateway routing delay time test under normal state, gateway routing delay time test under high priority load rate state, gateway routing delay time test under low priority load rate state, gateway diagnostic network segment test, gateway diagnostic mechanism routing test, routing behavior test under a small number of error frames, routing behavior test during BusOff fault, and routing behavior test during DLC ​​error; use bus monitoring and analysis tools to monitor and analyze the data of all CAN channels of the gateway to obtain test results.

[0149] A computer-readable storage medium provided by an embodiment of the present invention stores a computer program which is not limited to the method operations described above, but can also execute related operations in a gateway routing automation testing method provided by any embodiment of the present invention.

[0150] In the embodiments provided by the present invention, it should be understood that the disclosed methods, devices and storage media can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the description division of the circuit is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling shown or discussed can be indirect coupling through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0151] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A gateway routing automation testing method, characterized in that: include: Obtain the standard format of the vehicle CAN segment routing relationship requirement table and the DBC files of each segment of the vehicle; Compare and analyze the vehicle CAN network segment routing relationship requirement table and each network segment DBC file to generate a gateway routing configuration file, and troubleshoot and resolve problems in the vehicle CAN network segment routing relationship requirement table and network segment DBC file; A gateway routing test program is applied to parse the message routing information of the gateway routing configuration file, a simulation message is defined according to the message routing information, and the selected test cases are tested in sequence, wherein the test contents involved in the test cases include: identifier ID consistency test, data length consistency test, signal value consistency test, gateway routing delay time test under normal state, gateway routing delay time test under high priority load rate state, gateway routing delay time test under low priority load rate state, gateway diagnostic network segment test, gateway diagnostic mechanism routing test, routing behavior test under a small number of error frames, routing behavior test during BusOff fault, and routing behavior test during DLC ​​error; a bus monitoring and analysis tool is used to monitor and analyze the data of all CAN channels of the gateway to obtain the test results.

2. According to the gateway routing automation testing method of claim 1, it is characterized in that: The process of comparing and analyzing the whole vehicle CAN network segment routing relationship requirement table and each network segment DBC file to generate a gateway routing configuration file, and troubleshooting and resolving problems in the whole vehicle CAN network segment routing relationship requirement table and the network segment DBC file includes: S201: importing the whole vehicle CAN network segment routing relationship requirement table into the test management system; S202: The test management system determines the number of network segments for this round of testing according to the network segment names in the vehicle CAN network segment routing relationship requirement table; S203: setting the serial number of each CAN network segment based on the number of network segments, and importing the corresponding network segment DBC file; S204: The test management system parses the uploaded network segment DBC file and compares it with the information in the vehicle CA N network segment routing relationship requirement table; S205: Determine whether the number of packets that have not been parsed to the source network segment in the network segment DBC file is 0, if so, go to S206; Otherwise, go to S210; S206: Determine whether the number of messages that are not parsed to the target network segment in the network segment DBC file is 0, if so, go to S207; Otherwise, go to S210; S207: Determine whether the number of messages whose start bits of message signals are not parsed to the source network segment is 0, if so, go to S208; Otherwise, go to S210; S208: Determine whether the number of messages whose start bits of message signals are not parsed to the target network segment is 0, if so, go to S209; Otherwise, go to S210; S209: Generate the gateway routing configuration file; S210: Locate the problematic message according to the prompt and modify the vehicle platform communication database, then go to S201.

3. According to the gateway routing automation testing method of claim 1, it is characterized in that: The routing behavior test under a small number of error frames is used to test that the gateway controller does not route error frames to other network segments and the routing function is normal, including: S301: powering the gateway controller under test and waiting until the bus communication is stable; S302: using a bus monitoring and analysis tool to simulate sending an error frame to any source network segment channel of the gateway controller under test at a set period; S303: Use bus monitoring and analysis tools to monitor other network segment channels to check whether there are error frames for a certain period of time; S304: according to the definition of the gateway routing configuration file, using the bus monitoring and analysis tool to simulate any message based on message routing and send it to the source network segment channel of the gateway controller under test, and check whether the gateway controller under test can correctly simulate the message; S305: Use the bus monitoring and analysis tool to monitor the target network segment to determine whether a message with the same routing message ID as that sent by the source network segment is received. If the gateway controller under test can correctly forward the message, then continue to S306; S306: Repeat S302 to S305, and use the bus monitoring and analysis tool to simulate error frames in other network segments to check whether the routing function of the gateway controller under test is affected.

4. The gateway routing automation testing method according to claim 1, characterized in that: The routing behavior test under a small number of error frames includes: S301*: Power the gateway controller under test and wait until the bus communication is stable; S302*: Use the bus test jammer to interfere with the RTR bit of the network management message sent by any source network segment channel of the gateway controller under test, so as to generate a sending error frame. Each time, the set message frame is interfered, and the number of interferences is set according to the set interval. S303*: Use bus monitoring and analysis tools to monitor other network segment channels to check whether there are error frames and continue for a set time; S304*: according to the definition of the gateway routing configuration file, use the bus monitoring and analysis tool to simulate any message based on message routing and send it to the source network segment channel of the gateway controller under test, and check whether the gateway controller under test can correctly simulate the message; S305*: Use the bus monitoring and analysis tool to monitor the target network segment to determine whether a message with the same routing message ID as that sent by the source network segment is received. If the gateway controller under test can correctly forward the message, continue to S306*; S306*: Repeat S302* to S305*, and use the bus monitoring and analysis tool to simulate error frames in other network segments to check whether the routing function of the gateway controller under test is affected.

5. The gateway routing automation testing method according to claim 1, characterized in that: The BusOff fault routing behavior test is used to detect whether the gateway routing strategy meets the requirements when a BusOff fault occurs in a channel of the gateway controller, including: S311: Power the gateway controller under test and wait until the bus communication is stable; S312: using a bus monitoring and analysis tool to simulate sending application messages other than gateway routing messages in all network segments; S313: After ensuring that the gateway controller under test can correctly receive the application message, use the bus test jammer to interfere with the RTR bit of the network management message sent by any source network segment channel of the gateway controller under test, so that the source network segment channel is always in the BusOff state; S314: Monitor the target network segment using a bus monitoring and analysis tool to determine whether the gateway controller under test sends a corresponding routing message according to the definition of the vehicle CAN network segment routing relationship requirement table; S315: repeating steps S312 to S313, and using the bus monitoring and analysis tool to determine whether the routing functions between other network segments are normal; S316: Repeat steps S312 to S314 to respectively determine whether the routing functions of other network segments of the controller under test are normal when any network segment is in the BusOff state.

6. The gateway routing automation testing method according to claim 1, characterized in that: The DLC error routing behavior test is used to detect whether the gateway can forward messages when a DLC error occurs during routing, including: S321: Power the gateway controller under test and wait until the bus communication is stable; S322: according to the definition of the gateway routing configuration file, using the bus monitoring and analysis tool to simulate sending any message to the source network segment channel corresponding to the gateway controller under test; S323: Change the DLC of the message to be smaller than the length defined in the network segment DBC file; S324: Monitor the target network segment using a bus monitoring and analysis tool to observe whether the target network segment can route the message sent by the source network segment; S325: according to the definition of the gateway routing configuration file, using the bus monitoring and analysis tool to simulate other messages and send them to the source network segment channel corresponding to the gateway controller under test; S326: repeat steps S323 to S325 to change the DLC of the message to be smaller than the length defined in the network segment DBC file; S327: Change the source network segment to traverse all source network segments, and repeat steps S322 to S326.

7. The gateway routing automation testing method according to claim 1, characterized in that: The DLC error routing behavior test is used to verify whether the source segment message DLC is greater than the definition in the segment DBC file. It includes: S331: Power the gateway controller under test and wait until the bus communication is stable; S332: according to the definition of the gateway routing configuration file, using the bus monitoring and analysis tool to simulate any message with a DLC less than 8 and send it to the source network segment channel corresponding to the gateway controller under test; S333: Change the DLC of the message to 8; S334: Use bus monitoring and analysis tools to monitor the target network segment to see whether the target network segment can route the message sent by the source network segment and whether the DLC is 8; S335: according to the definition of the gateway routing configuration file, use the bus monitoring and analysis tool to simulate other messages with a DLC less than 8 and send them to the source network segment channel corresponding to the gateway controller under test; S336: Change the source network segment to traverse all source network segments, and repeat steps S322 to S325.

8. The gateway routing automation testing method according to claim 1, characterized in that: The test results include the test case number, test time, test description, actual test result value, expected result value, case test result, picture name and picture description.

9. A gateway routing automation test device, characterized in that: include: Computer equipment, bus monitoring and analysis tools, power supplies, and controllers for the gateways under test to run the test management system and gateway routing test programs; The bus monitoring and analysis tool and the gateway controller under test communicate through a multi-channel CAN bus connection to perform routing relationship testing; The computer device includes: at least one processing unit, the processing unit is connected to a storage unit via a bus unit, the storage unit stores a computer program, and the processing unit executes the computer program to implement the gateway routing automation testing method described in any one of claims 1-8.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the gateway routing automation testing method as described in any one of claims 1 to 8 is implemented.