[go: up one dir, main page]

CN119835185A - Gateway route automatic test method, device and storage medium - Google Patents

Gateway route automatic test method, device and storage medium Download PDF

Info

Publication number
CN119835185A
CN119835185A CN202411846621.1A CN202411846621A CN119835185A CN 119835185 A CN119835185 A CN 119835185A CN 202411846621 A CN202411846621 A CN 202411846621A CN 119835185 A CN119835185 A CN 119835185A
Authority
CN
China
Prior art keywords
network segment
routing
test
gateway
message
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202411846621.1A
Other languages
Chinese (zh)
Inventor
刘昌林
段钊
冯金盾
肖坤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China National Heavy Duty Truck Group Jinan Power Co Ltd
Original Assignee
China National Heavy Duty Truck Group Jinan Power Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China National Heavy Duty Truck Group Jinan Power Co Ltd filed Critical China National Heavy Duty Truck Group Jinan Power Co Ltd
Priority to CN202411846621.1A priority Critical patent/CN119835185A/en
Publication of CN119835185A publication Critical patent/CN119835185A/en
Pending legal-status Critical Current

Links

Landscapes

  • Small-Scale Networks (AREA)

Abstract

The application provides a gateway route automatic test method, a gateway route automatic test device and a storage medium. The method comprises the steps of obtaining a complete vehicle CAN network segment routing relation demand table and complete vehicle network segment DBC files in a standard format, comparing and analyzing the complete vehicle CAN network segment routing relation demand table and the complete vehicle network segment DBC files to generate gateway routing configuration files, solving and solving problems existing in the complete vehicle CAN network segment routing relation demand table and the network segment DBC files, analyzing message routing information of the gateway routing configuration files by using a gateway routing test program, defining simulation messages according to the message routing information and testing in sequence according to selected test cases, and monitoring and analyzing data of all CAN channels of a gateway by using a bus monitoring and analyzing tool to obtain test results.

Description

Gateway route automatic test method, device and storage medium
Technical Field
The present invention relates to the field of vehicle-mounted gateway routing test technologies, and in particular, to a gateway routing automatic test method, device and storage medium.
Background
With the gradual increase of the market share of the new energy commercial vehicle, the related electric control products of the new energy commercial vehicle are frequently iterated, the current main stream of the commercial vehicle industry adopts a distributed electronic and electric architecture, a single network segment can not meet the communication requirement, a gateway controller is required to be added, and the network segment management is realized so as to reduce the bus load rate. The gateway controller CAN realize message routing among different CAN bus segments, and if the gateway controller cannot work normally or lacks key message routing, the whole vehicle cannot work normally, so that the gateway controller program needs to perform systematic functional test. Because the gateway controller has more programs, and the gateway controller supports the message routing of the multipath CAN gateway, the test is performed manually, the efficiency is low, the accuracy of routing information and the time delay requirement of routing messages cannot be ensured, and the development of an automatic test device for gateway routing is needed. At present, patent and technology disclose automatically analyzing DBC files to generate gateway routing information, and further carrying out test case configuration based on the gateway routing information so as to realize an automatic test process. However, the correctness of the routing relationship is not checked before the test, and an abnormality caused by a non-gateway fault may exist, and the test case of the gateway controller does not relate to the gateway diagnosis network segment test, the gateway diagnosis mechanism route test, the route behavior test under a small number of error frames, the route behavior test under BusOff faults and the route behavior test under DLC errors.
Disclosure of Invention
In order to solve the above technical problems or at least partially solve the above technical problems, the present invention provides a gateway routing automation test method, a device and a storage medium.
In a first aspect, the present invention provides a method for automatically testing a gateway route, including:
The method comprises the steps of obtaining a complete vehicle CAN network segment routing relation demand table and complete vehicle network segment DBC files in a standard format, comparing and analyzing the complete vehicle CAN network segment routing relation demand table and the complete vehicle network segment DBC files to generate gateway routing configuration files, solving problems existing in the complete vehicle CAN network segment routing relation demand table and the network segment DBC files, analyzing message routing information of the gateway routing configuration files by using a gateway routing test program, defining simulation messages according to the message routing information and sequentially testing the selected test cases, wherein test contents related to the test cases comprise identifier ID consistency test, data length consistency test, signal value consistency test, gateway routing delay time test in a normal state, gateway routing delay time test in a high priority load rate state, gateway routing delay time test in a low priority load rate state, gateway diagnosis network segment test, gateway diagnosis mechanism routing test, routing behavior test in a small number of error frames, routing behavior test in BusOff fault and routing behavior test in error, and using a monitoring bus to obtain all monitoring data channel analysis results.
Further, the process of comparing and analyzing the whole CAN network segment routing relation demand table and each network segment DB C file to generate a gateway routing configuration file, and solving the problems existing in the whole CAN network segment routing relation demand table and the network segment DBC file comprises S201, importing the whole CA N network segment routing relation demand table into a test management system;
S202, a test management system determines the number of network segments tested in the round according to the network segment names of the routing relation demand table of the CAN network segments of the whole vehicle;
s203, setting serial numbers of each CAN network segment based on the number of the network segments, and importing corresponding network segment DBC files;
S204, analyzing the uploaded network segment DBC file by the test management system, and comparing the uploaded network segment DBC file with the information of the whole-vehicle CA N network segment routing relation demand table;
s205, judging whether the number of the messages which are not analyzed to the source network segment in the network segment DBC file is 0, if so, turning to S206;
Otherwise, go to S210;
S206, judging whether the number of the messages which are not analyzed to the target network segment in the network segment DBC file is 0, if so, turning to S207;
Otherwise, go to S210;
s207, judging whether the number of the messages of the message signal start bit which is not analyzed to the source network segment is 0, if so, turning to S208;
Otherwise, go to S210;
S208, judging whether the number of the messages of the message signal start bit which is not analyzed to the target network segment is 0, if so, turning to S209;
Otherwise, go to S210;
s209, generating the gateway route configuration file;
S210, locating a message of a problem according to the prompt, modifying the whole vehicle platform communication database, and turning to S201.
Furthermore, the routing behavior test under a small number of error frames is used for testing that the gateway controller does not route the error frames to other network segments and the routing function is normal, and comprises the following steps that S301, power is supplied to the tested gateway controller, and waiting for the bus communication to be stable;
S302, using a bus monitoring analysis tool to simulate and send error frames to any source network segment channel of a tested gateway controller in a set period;
S303, monitoring other network segment channels by using a bus monitoring analysis tool to check whether an error frame exists or not, and lasting for a certain time;
S304, according to the definition of the gateway route configuration file, simulating any message based on the message route by using a bus monitoring analysis tool to send the message to a source network segment channel of the tested gateway controller, and checking whether the tested gateway controller can simulate the message correctly;
s305, monitoring a target network segment by using a bus monitoring analysis tool, judging whether a message consistent with a routing message ID sent by a source network segment is received or not, and continuing S306 if the tested gateway controller can correctly forward the message;
s306, repeating S302 to S305, and respectively simulating error frames in other network segments by using a bus monitoring analysis tool to check whether the routing function of the tested gateway controller is affected.
Further, the route behavior test under a small number of error frames includes S301 supplying power to the gateway controller to be tested, waiting until the bus communication is stable;
S302, using a bus test interferometer to interfere RTR bits of network management messages sent by any source network segment channel of a tested gateway controller, manufacturing sending error frames, and interfering set message frames each time according to set intervals and interference set times;
S303, monitoring other network segment channels by using a bus monitoring analysis tool, checking whether an error frame exists, and continuously setting time;
s304, according to the definition of the gateway route configuration file, simulating any message based on the message route by using a bus monitoring analysis tool to send the message to a source network segment channel of the tested gateway controller, and checking whether the tested gateway controller can simulate the message correctly;
S305, monitoring a target network segment by using a bus monitoring analysis tool, judging whether a message consistent with a source network segment sending route message ID is received or not, and continuing S306 if the tested gateway controller can correctly forward the message;
And S306, repeating S302 to S305, and using the bus monitoring analysis tool to simulate error frames in other network segments respectively to check whether the routing function of the tested gateway controller is affected.
Further, the routing behavior test at BusOff failure is used to detect whether the routing policy of the gateway meets the requirement when a certain channel of the gateway controller has BusOff failure, and includes:
s311, supplying power to the tested gateway controller, and waiting until bus communication is stable;
S312, simulating and transmitting application messages except gateway routing messages in all network segments by using a bus monitoring and analyzing tool;
s313, after ensuring that a tested gateway controller can correctly receive an application message, using a bus test interferometer to interfere an RTR bit of a network management message sent by any source network segment channel of the tested gateway controller, so that the source network segment channel is always in BusOff states;
s314, monitoring a target network segment by using a bus monitoring analysis tool, judging whether a tested gateway controller is defined according to a routing relation demand table of the whole vehicle CAN network segment, and sending a corresponding routing message;
S315, repeating the steps S312 to S313, and respectively judging whether the routing function between other network segments is normal or not by using a bus monitoring analysis tool;
s316, repeating the steps S312 to S314, and respectively judging whether the routing functions of other network segments of the controlled controller are normal when any network segment is in BusOff state.
Further, the routing behavior test when DLC is wrong is used to detect whether the gateway can forward the message when DLC is wrong in the routing process, including:
s321, supplying power to a tested gateway controller, and waiting until bus communication is stable;
S322, according to the definition of the gateway route configuration file, using a bus monitoring analysis tool to simulate any message and send the message to a source network segment channel corresponding to the tested gateway controller;
S323, changing DLC of the message to be smaller than the defined length in the network segment DBC file;
S324, monitoring a target network segment by using a bus monitoring analysis tool, and observing whether the target network segment can route a message sent by a source network segment;
S325, according to the definition of the gateway route configuration file, using a bus monitoring analysis tool to simulate other messages and send the messages to a source network segment channel corresponding to a tested gateway controller;
s326, repeating the steps S323 to S325, and changing DLC of the message to be smaller than the defined length in the network segment DBC file;
s327, changing the source network segment to traverse all source network segments, repeating steps S322 to S326.
Further, the routing behavior test when DLC is wrong is used to verify whether the source network segment message DLC is larger than the normal routing message defined in the network segment DBC file, and includes:
s331, supplying power to a tested gateway controller, and waiting until bus communication is stable;
s332, according to the definition of the gateway routing configuration file, using a bus monitoring analysis tool to simulate any DLC message smaller than 8 and send the message to a source network segment channel corresponding to a tested gateway controller;
S333, changing DLC of the message to 8;
s334, monitoring a target network segment by using a bus monitoring analysis tool, and observing whether the target network segment can route a message sent by a source network segment or not, wherein DLC is 8 or not;
S335, according to the definition of the gateway route configuration file, other messages with DLC less than 8 simulated by using a bus monitoring analysis tool are sent to a source network segment channel corresponding to the tested gateway controller;
S336, changing the source network segment to traverse all source network segments, repeating steps S322 to S325.
Further, the test result comprises a test case number, a test time, a test description, an actual test result value, an expected result value, a case test result, a picture name and a picture description.
The invention provides a gateway route automation testing device, which comprises computer equipment, a bus monitoring analysis tool, a power supply and a tested gateway controller, wherein the computer equipment is used for running a test management system and a gateway route testing program, the bus monitoring analysis tool and the tested gateway controller are communicated through a multi-path CAN bus connection so as to conduct route relation testing, the computer equipment comprises at least one processing unit, the processing unit is connected with a storage unit through the bus unit, the storage unit stores the computer program, and the processing unit executes the computer program to realize the gateway route automation testing method.
In a third aspect, the present invention provides a computer readable storage medium storing a computer program which, when executed by a processor, implements the gateway routing automation test method.
Compared with the prior art, the technical scheme provided by the embodiment of the invention has the following advantages:
The gateway route automatic test method provided by the invention applies for obtaining the standard-format complete vehicle CAN network segment route relation demand table and the complete vehicle network segment DBC files, compares and analyzes the complete vehicle CAN network segment route relation demand table and the complete vehicle network segment DBC files to generate gateway route configuration files, and solves the problems existing in the complete vehicle CAN network segment route relation demand table and the network segment DBC files, and CAN automatically and accurately detect the accuracy of the message route relation before test execution, thereby avoiding repeated test and avoiding abnormity caused by non-gateway faults.
And analyzing the message routing information of the gateway routing configuration file by using a gateway routing test program, defining a simulation message according to the message routing information, and sequentially testing the selected test cases, wherein the test cases comprise an identifier ID consistency test, a data length consistency test, a signal value consistency test, a gateway routing delay time test in a normal state, a gateway routing delay time test in a high-priority load rate state, a gateway routing delay time test in a low-priority load rate state, a gateway diagnosis network segment test, a gateway diagnosis mechanism routing test, a routing behavior test in a small number of error frames, a routing behavior test in BusOff failure and a routing behavior test in DLC error.
The user of the automatic gateway route testing device does not need to master the whole process of all message route designs, so that the verification of the gateway route function is standardized and simplified, the gateway route delay time under a typical scene can be automatically counted, the human error is reduced, and the testing efficiency of the gateway controller is greatly improved.
In addition, the invention has reliable design principle, simple structure and very wide application prospect.
Drawings
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.
In order to more clearly illustrate the embodiments of the invention or the technical solutions of the prior art, the drawings which are used in the description of the embodiments or the prior art will be briefly described, and it will be obvious to a person skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1 is a flow chart of a gateway routing automation test method;
FIG. 2 is a flow chart for comparing and analyzing the network segment routing relation demand table and the network segment DBC files of the whole vehicle by the test management system to generate gateway routing configuration files, and for solving and solving the problems existing in the network segment routing relation demand table and the network segment DBC files of the whole vehicle;
FIG. 3 is a schematic diagram of a complete vehicle CAN network segment routing relationship demand table;
FIG. 4 is a schematic diagram of a gateway routing profile;
FIG. 5 is a schematic diagram of an overall test report of gateway routing test results;
FIG. 6 is a schematic diagram of a test report of a specific item of gateway routing test results;
Fig. 7 is a schematic diagram of a gateway route automation test device.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises an element.
Example 1
Referring to fig. 1 and 2, the present application provides an automatic testing method for gateway routing, which includes:
S100, acquiring a routing relation demand table of the whole vehicle CAN network segment and DBC files of each network segment of the whole vehicle in a standard format. And using VDE (Vehicle Database Editor) software to manage a whole vehicle platform communication database, and automatically deriving a whole vehicle CAN network segment routing relation demand table and a whole vehicle network segment DBC file in a standard format from the whole vehicle platform communication database platform.
As shown in fig. 3, the routing relationship requirement table of the whole vehicle CAN network segment includes a source network segment name, a source network segment signal name, a source network segment message ID, a target network segment name, a target network segment signal name, a target network segment message ID, a routing type, a gateway controller name, a message change record, and a timeout value. And acquiring transmission paths and message change records of all messages of the tested gateway according to the whole CAN network segment routing relation demand table.
The timeout value is a physical value of the target network segment signal, and is calculated according to a bus value of the timeout value of the target network segment signal, and the timeout value is filled with digital 0 for the target network segment signal without defining the timeout value or an invalid value.
And S200, the test management system compares and analyzes the routing relation demand table of the whole CAN network segment and the DBC files of each network segment to generate gateway routing configuration files, and the problems in the routing relation demand table of the whole CAN network segment and the DBC files of the network segment are solved, so that the meaningless test results caused by using the wrong input test are avoided, and the time and the energy are wasted.
As shown in fig. 2, the method comprises the following steps:
s201, importing the routing relation demand table of the whole CAN network segment into a test management system;
S202, a test management system determines the number of network segments tested in the round according to the network segment names of the routing relation demand table of the CAN network segments of the whole vehicle;
s203, setting serial numbers of each CAN network segment based on the number of the network segments, and importing corresponding network segment DBC files;
S204, analyzing the uploaded network segment DBC file by the test management system, and comparing the uploaded network segment DBC file with the information of the whole-vehicle CA N network segment routing relation demand table;
s205, judging whether the number of the messages which are not analyzed to the source network segment in the network segment DBC file is 0, if so, turning to S206;
Otherwise, go to S210;
S206, judging whether the number of the messages which are not analyzed to the target network segment in the network segment DBC file is 0, if so, turning to S207;
Otherwise, go to S210;
s207, judging whether the number of the messages of the message signal start bit which is not analyzed to the source network segment is 0, if so, turning to S208;
Otherwise, go to S210;
S208, judging whether the number of the messages of the message signal start bit which is not analyzed to the target network segment is 0, if so, turning to S209;
Otherwise, go to S210;
s209, generating the gateway route configuration file;
In this embodiment, as shown in fig. 4, the gateway routing configuration file includes a number of message routes, an nth message route, a message routing manner, a source network segment CAN channel number, a source network segment DBC name, a source network segment message ID, a source network segment message name, a source network segment node name, a source network segment signal name, a target network segment CAN channel number, a target network segment DBC name, a target network segment message ID, a target network segment message name, a target network segment node name, a target network segment signal name, and a signal timeout value.
The message routing method is divided into direct message routing and periodic message routing, wherein the direct message routing is recommended to be represented by 1, and the periodic message routing is recommended to be represented by 2.
S210, locating a message of a problem according to the prompt, modifying the whole vehicle platform communication database, and turning to S201.
And S300, analyzing the message routing information of the gateway routing configuration file by using a gateway routing test program, defining a simulation message according to the message routing information, and sequentially testing the selected test cases.
In this embodiment, the test cases include identifier ID consistency test, data length consistency test, signal value consistency test, gateway routing delay time test in normal state, gateway routing delay time test in high priority load rate state, gateway routing delay time test in low priority load rate state, gateway diagnostic network segment test, gateway diagnostic mechanism routing test, routing behavior test in small number of error frames, routing behavior test in Bus Off fault and routing behavior test in DLC fault.
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 route is less than 2ms. The bus state load rate recommended by the high-priority load rate state and the low-priority load rate state is more than or equal to 90 percent.
The routing behavior test under a small number of error frames is used to test that the gateway controller does not route the error frames to other network segments and the routing function is normal. The specific flow can be executed according to the following steps:
s301, supplying power to a tested gateway controller, and waiting for 1S until bus communication is stable;
s302, using a bus monitoring analysis tool to simulate and send error frames to a certain source network segment channel of a tested gateway controller by taking 100ms as a period;
in this embodiment, the bus monitoring and analyzing tool is not limited to the CAN card of CANoe, qigong of Vector company.
S303, monitoring other network segment channels by using a bus monitoring analysis tool to check whether an error frame exists or not, and lasting for a certain time;
in this embodiment, the duration is recommended to be 30s.
S304, according to the definition of the gateway route configuration file, simulating any message based on the message route by using a bus monitoring analysis tool to send the message to a source network segment channel of the tested gateway controller, and checking whether the tested gateway controller can simulate the message correctly;
s305, monitoring a target network segment by using a bus monitoring analysis tool, judging whether a message consistent with a routing message ID sent by a source network segment is received or not, and continuing S306 if the tested gateway controller can correctly forward the message;
s306, repeating S302 to S305, and respectively simulating error frames in other network segments by using a bus monitoring analysis tool to check whether the routing function of the tested gateway controller is affected.
The route behavior test flow under a small number of error frames can also be executed according to the following steps:
s301, supplying power to a tested gateway controller, and waiting for stable communication from 1S to a bus;
S302, using a bus test interferometer to interfere RTR bits of a network management message sent by a source network segment channel of a tested gateway controller, and manufacturing a sending error frame, wherein each time of interference is 10 frames, the interval is 100ms, and the interference is 100 times;
in this embodiment, the bus test interferometer is not limited to CANSTRESS devices of Vector and CANSPIDER devices of ihr.
S303, monitoring other network segment channels by using a bus monitoring analysis tool to check whether an error frame exists or not, and lasting for a certain time;
s304, according to the definition of the gateway route configuration file, simulating any message based on the message route by using a bus monitoring analysis tool to send the message to a source network segment channel of the tested gateway controller, and checking whether the tested gateway controller can simulate the message correctly;
S305, monitoring a target network segment by using a bus monitoring analysis tool, judging whether a message consistent with a source network segment sending route message ID is received or not, and continuing S306 if the tested gateway controller can correctly forward the message;
And S306, repeating S302 to S305, and using the bus monitoring analysis tool to simulate error frames in other network segments respectively to check whether the routing function of the tested gateway controller is affected.
The routing behavior test at BusOff failure is used to detect whether the routing policy of the gateway meets the requirements when a certain channel of the gateway controller fails BusOff. The specific flow can be executed according to the following steps:
s311, supplying power to the tested gateway controller, and waiting for 1S until the bus communication is stable;
S312, simulating and transmitting application messages except gateway routing messages in all network segments by using a bus monitoring and analyzing tool;
s313, after ensuring that a tested gateway controller can correctly receive an application message, using a bus test interferometer to interfere an RTR bit of a network management message sent by a certain source network segment channel of the tested gateway controller, so that the source network segment channel is always in BusOff state;
s314, monitoring a target network segment by using a bus monitoring analysis tool, judging whether a tested gateway controller is defined according to a routing relation demand table of the whole vehicle CAN network segment, and sending a corresponding routing message;
S315, repeating the steps S312 to S313, and respectively judging whether the routing function between other network segments is normal or not by using a bus monitoring analysis tool;
S316, repeating the steps S312 to S314, and respectively judging whether the routing function of other network segments of the controlled controller is normal or not when the network segment is in BusOff state.
The routing behavior test when DLC is wrong is used for detecting whether the gateway can forward the message when DLC is wrong in the routing process. It can be performed as follows:
S321, supplying power to a tested gateway controller, and waiting for 1S until bus communication is stable;
S322, according to the definition of the gateway route configuration file, using a bus monitoring analysis tool to simulate a certain message to be sent to a source network segment channel corresponding to the tested gateway controller;
s323, changing DLC of the message to be smaller than DBC definition length;
S324, monitoring a target network segment by using a bus monitoring analysis tool, and observing whether the target network segment can route a message sent by a source network segment;
S325, according to the definition of the gateway route configuration file, using a bus monitoring analysis tool to simulate other messages and send the messages to a source network segment channel corresponding to a tested gateway controller;
s326, repeating the steps S323 to S325, and changing DLC of the message to be smaller than DBC definition length;
S327, changing the source network segment (traversing all network segments), repeating steps S322 to S326.
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.
The routing behavior test when DLC is wrong is used for verifying whether the source network segment message DLC is larger than the DBC definition and can normally route the message, and the method is implemented according to the following steps:
s331, supplying power to a tested gateway controller, and waiting for stable communication from 1S to a bus;
S332, according to the definition of the gateway route configuration file, using a bus monitoring analysis tool to simulate a certain message (DLC < 8) and sending the message to a source network segment channel corresponding to a tested gateway controller;
S333, changing DLC of the message to 8;
s334, monitoring a target network segment by using a bus monitoring analysis tool, and observing whether the target network segment can route a message sent by a source network segment or not, wherein DLC is 8 or not;
s335, according to the definition of the gateway route configuration file, using a bus monitoring analysis tool to simulate other messages (DLC < 8) and sending the messages to a source network segment channel corresponding to a tested gateway controller;
S336, changing the source network segment (traversing all network segments), repeating steps S322 to S325.
In this embodiment, for message routing, when the source network segment message DLC is greater than the DBC definition, the gateway routes the message normally, and DLC is the source network segment message.
And S400, monitoring and analyzing the data of all CAN channels of the gateway by using a bus monitoring and analyzing tool to obtain a test result, and uploading the test result to a test management system for a tester to check.
In this embodiment, as shown in fig. 5 and 6, the test result includes a test case number, a test time, a test description, an actual test result value, an expected result value, a case test result, a picture name, and a picture description.
Example 2
As shown in fig. 7, the gateway route automation test apparatus includes a computer device for running a test management system and a gateway route test program, a bus monitoring analysis tool, a power supply, and a gateway controller under test. The bus monitoring analysis tool and the tested gateway controller are communicated through the multi-path CAN bus connection, so that the routing relation test is carried out. The computer equipment comprises at least one processing unit, wherein the processing unit is connected with a storage unit through a bus unit, the storage unit stores a computer program, and the processing unit executes the computer program to realize the gateway route automatic test method, and the method comprises the following steps:
The method comprises the steps of obtaining a complete vehicle CAN network segment routing relation demand table and complete vehicle network segment DBC files in a standard format, comparing and analyzing the complete vehicle CAN network segment routing relation demand table and the complete vehicle network segment DBC files to generate gateway routing configuration files, solving problems existing in the complete vehicle CAN network segment routing relation demand table and the network segment DBC files, analyzing message routing information of the gateway routing configuration files by using a gateway routing test program, defining simulation messages according to the message routing information and sequentially testing the selected test cases, wherein test contents related to the test cases comprise identifier ID consistency test, data length consistency test, signal value consistency test, gateway routing delay time test in a normal state, gateway routing delay time test in a high priority load rate state, gateway routing delay time test in a low priority load rate state, gateway diagnosis network segment test, gateway diagnosis mechanism routing test, routing behavior test in a small number of error frames, routing behavior test in BusOff fault and routing behavior test in error, and using a monitoring bus to obtain all monitoring data channel analysis results.
Of course, the storage unit in the automatic test device for gateway routing provided by the embodiment of the present invention is not limited to the above-mentioned method operations, and may also perform the related operations in the automatic test method for gateway routing provided by any embodiment of the present invention.
Example 3
The embodiment of the invention provides a computer readable storage medium, which stores a computer program, and when the computer program is executed, the method for automatically testing gateway routing is realized, comprising the following steps:
The method comprises the steps of obtaining a complete vehicle CAN network segment routing relation demand table and complete vehicle network segment DBC files in a standard format, comparing and analyzing the complete vehicle CAN network segment routing relation demand table and the complete vehicle network segment DBC files to generate gateway routing configuration files, solving problems existing in the complete vehicle CAN network segment routing relation demand table and the network segment DBC files, analyzing message routing information of the gateway routing configuration files by using a gateway routing test program, defining simulation messages according to the message routing information and sequentially testing the selected test cases, wherein test contents related to the test cases comprise identifier ID consistency test, data length consistency test, signal value consistency test, gateway routing delay time test in a normal state, gateway routing delay time test in a high priority load rate state, gateway routing delay time test in a low priority load rate state, gateway diagnosis network segment test, gateway diagnosis mechanism routing test, routing behavior test in a small number of error frames, routing behavior test in BusOff fault and routing behavior test in error, and using a monitoring bus to obtain all monitoring data channel analysis results.
The computer readable storage medium according to the embodiment of the present invention stores a computer program not limited to the above-described method operations, but also can perform related operations in a gateway routing automation test method according to any embodiment of the present invention.
In the embodiments of the present invention, it should be understood that the disclosed method, apparatus and storage medium may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the described division of circuitry is merely a logical functional division, and there may be additional divisions when actually implemented, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling shown or discussed as being coupled directly or indirectly to one another through some interface, device or unit, may be in the form of electrical, mechanical, or otherwise.
The foregoing is only a specific embodiment of the invention to enable those skilled in the art to understand or practice the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1.一种网关路由自动化测试方法,其特征在于,包括:1. A gateway routing automation testing method, characterized by comprising: 获取标准格式的整车CAN网段路由关系需求表和整车各网段DBC文件;对比解析整车CAN网段路由关系需求表和各网段DBC文件生成网关路由配置文件,并排查整车CAN网段路由关系需求表和网段DBC文件中存在的问题并解决;应用网关路由测试程序解析所述网关路由配置文件的报文路由信息,根据所述报文路由信息定义仿真报文并针对所选测试用例依次进行测试,其中,所述测试用例涉及到的测试内容包括:标识符ID一致性测试、数据长度一致性测试、信号值一致性测试、正常状态下的网关路由延时时间测试、高优先级负载率状态下的网关路由延时时间测试、低优先级负载率状态下的网关路由延时时间测试、网关诊断网段测试、网关诊断机制路由测试、少量错误帧下的路由行为测试、BusOff故障时的路由行为测试和DLC错误时的路由行为测试;使用总线监控分析工具监测、分析网关所有CAN通道的数据,以获取测试结果。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. 2.根据权利要求1所述网关路由自动化测试方法,其特征在于,对比解析整车CAN网段路由关系需求表和各网段DBC文件生成网关路由配置文件,并排查整车CAN网段路由关系需求表和网段DBC文件中存在的问题并解决的过程包括:S201:将所述整车CAN网段路由关系需求表导入到测试管理系统;2. According to the gateway routing automation test method of claim 1, it is characterized in that 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; S202:测试管理系统根据所述整车CAN网段路由关系需求表的网段名称确定本轮测试的网段数量;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:基于网段数量设置各CAN网段的序号,并导入对应的网段DBC文件;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:测试管理系统解析上传的网段DBC文件,并与所述整车CA N网段路由关系需求表的信息对比;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:判断网段DBC文件中未解析到源网段的报文数量是否为0,如是,则转至S206;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; 否则转至S210;Otherwise, go to S210; S206:判断网段DBC文件中未解析到目标网段的报文数量是否为0,如是,则转至S207;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; 否则转至S210;Otherwise, go to S210; S207:判断未解析到源网段的报文信号起始位的报文数量是否为0,如是,则转至S208;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; 否则转至S210;Otherwise, go to S210; S208:判断未解析到目标网段的报文信号起始位的报文数量是否为0,如是,则转至S209;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; 否则转至S210;Otherwise, go to S210; S209:生成所述网关路由配置文件;S209: Generate the gateway routing configuration file; S210:根据提示定位出问题的报文并对所述整车平台通信数据库进行修改,转至S201。S210: Locate the problematic message according to the prompt and modify the vehicle platform communication database, then go to S201. 3.根据权利要求1所述网关路由自动化测试方法,其特征在于,少量错误帧下的路由行为测试用于测试网关控制器不路由错误帧到其他网段,且路由功能正常,包括:S301:为被测网关控制器供电,等待至总线通信稳定;3. According to the gateway routing automation test method of claim 1, 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:使用总线监控分析工具以设定周期仿真发送错误帧到被测网关控制器的任意一源网段通道;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:利用总线监控分析工具监测其他网段通道,查看是否有错误帧,持续一定时间;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:根据所述网关路由配置文件定义,利用总线监控分析工具仿真任意基于报文路由的报文发送给被测网关控制器源网段通道,检查被测网关控制器是否能够正确仿真报文;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:利用总线监控分析工具监测目标网段,判断是否收到与源网段发送路由报文ID一致的报文,被测网关控制器能够正确转发报文则继续S306;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:重复S302至S305,利用总线监控分析工具分别在其它网段仿真错误帧,查看被测网关控制器的路由功能是否受影响。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.根据权利要求1所述网关路由自动化测试方法,其特征在于,少量错误帧下的路由行为测试包括:S301*:为被测网关控制器供电,等待至总线通信稳定;4. According to the gateway routing automation test method of claim 1, the routing behavior test under a small number of error frames comprises: S301*: supplying power to the gateway controller under test and waiting until the bus communication is stable; S302*:利用总线测试干扰仪干扰被测网关控制器任意一源网段通道发送的网络管理报文的RTR位,制造发送错误帧,每次干扰设定的报文帧,按照设定间隔,干扰设定次数;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*:利用总线监控分析工具监测其他网段通道,查看是否有错误帧,持续设定时间;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*:根据所述网关路由配置文件定义,利用总线监控分析工具仿真任意基于报文路由的报文发送给被测网关控制器源网段通道,检查被测网关控制器是否能够正确仿真报文;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*:利用总线监控分析工具监测目标网段,判断是否收到与源网段发送路由报文ID一致的报文,被测网关控制器能够正确转发报文则继续S306*;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*:重复S302*至S305*,利用总线监控分析工具分别在其它网段仿真错误帧,查看被测网关控制器的路由功能是否受影响。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.根据权利要求1所述网关路由自动化测试方法,其特征在于,BusOff故障时的路由行为测试用于检测当网关控制器的某一通道发生BusOff故障时,网关的路由策略是否满足需求,包括:5. According to the gateway routing automation test method of claim 1, the routing behavior test during BusOff failure is used to detect whether the routing strategy of the gateway meets the requirements when a BusOff failure occurs in a certain channel of the gateway controller, including: S311:为被测网关控制器供电,等待至总线通信稳定;S311: Power the gateway controller under test and wait until the bus communication is stable; S312:利用总线监控分析工具在所有网段模拟发送除网关路由报文外的应用报文;S312: using a bus monitoring and analysis tool to simulate sending application messages other than gateway routing messages in all network segments; S313:保证被测网关控制器可以正确接收应用报文后,利用总线测试干扰仪干扰被测网关控制器任意一源网段通道发送的网络管理报文的RTR位,使该源网段通道始终处于BusOff状态下;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:利用总线监控分析工具监测目标网段,判断被测网关控制器是否按照整车CAN网段路由关系需求表定义,发送相应的路由报文;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:重复步骤S312至S313,利用总线监控分析工具分别判断其它网段间的路由功能是否正常;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:重复步骤S312至S314,分别判断当任意网段处于BusOff状态时,被测控制器的其他网段的路由功能是否正常。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.根据权利要求1所述网关路由自动化测试方法,其特征在于,DLC错误时的路由行为测试用于检测网关在路由过程中DLC错误时是否能够转发报文,包括:6. According to the gateway routing automation test method of claim 1, the routing behavior test when the DLC error occurs is used to detect whether the gateway can forward the message when the DLC error occurs during the routing process, and includes: S321:为被测网关控制器供电,等待至总线通信稳定;S321: Power the gateway controller under test and wait until the bus communication is stable; S322:根据所述网关路由配置文件定义,利用总线监控分析工具仿真任意一报文发送给被测网关控制器对应的源网段通道;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:改变该报文的DLC,使其小于网段DBC文件中定义长度;S323: Change the DLC of the message to be smaller than the length defined in the network segment DBC file; S324:利用总线监控分析工具监测目标网段,观察目标网段是否能够路由源网段发送的报文;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:根据网关路由配置文件定义,利用总线监控分析工具仿真其他报文发送给被测网关控制器对应的源网段通道;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:重复步骤S323至S325,改变该报文的DLC,使其小于网段DBC文件中定义长度;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:改变源网段以遍历所有源网段,重复步骤S322至S326。S327: Change the source network segment to traverse all source network segments, and repeat steps S322 to S326. 7.根据权利要求1所述网关路由自动化测试方法,其特征在于,DLC错误时的路由行为测试用于验证源网段报文DLC大于网段DBC文件中定义时能否正常路由报文,包括:7. According to the gateway routing automation test method of claim 1, it is characterized in that the routing behavior test when the DLC error occurs 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: S331:为被测网关控制器供电,等待至总线通信稳定;S331: Power the gateway controller under test and wait until the bus communication is stable; S332:根据所述网关路由配置文件定义,利用总线监控分析工具仿真任意一DLC小于8的报文发送给被测网关控制器对应的源网段通道;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:改变该报文的DLC为8;S333: Change the DLC of the message to 8; S334:利用总线监控分析工具监测目标网段,观察目标网段是否能够路由源网段发送的报文,DLC是否为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:根据网关路由配置文件定义,利用总线监控分析工具仿真DLC小于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:改变源网段以遍历所有源网段,重复步骤S322至S325。S336: Change the source network segment to traverse all source network segments, and repeat steps S322 to S325. 8.根据权利要求1所述网关路由自动化测试方法,其特征在于,所述测试结果包括测试用例序号、测试时间、测试描述、实际测试结果值、期望结果值、用例测试结果、图片名称和图片描述。8. According to the gateway routing automation testing method of claim 1, 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. 9.一种网关路由自动化测试装置,其特征在于,包括:用于运行测试管理系统和网关路由测试程序的计算机设备、总线监控分析工具、电源和被测网关控制器;总线监控分析工具和被测网关控制器通过多路CAN总线连接通信,从而进行路由关系测试;所述计算机设备包括:至少一处理单元,处理单元经过总线单元与存储单元连接,所述存储单元存储计算机程序,所述处理单元执行所述计算机程序实现权利要求1-8任一所述的所述网关路由自动化测试方法。9. A gateway routing automation test device, characterized in that it 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 described in any one of claims 1-8. 10.一种计算机可读存储介质,所述计算机可读存储介质存储计算机程序,其特征在于,所述计算机程序被处理器执行时,实现如权利要求1-8中任意一项所述的网关路由自动化测试方法。10. A computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the gateway routing automation testing method according to any one of claims 1 to 8 is implemented.
CN202411846621.1A 2024-12-16 2024-12-16 Gateway route automatic test method, device and storage medium Pending CN119835185A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202411846621.1A CN119835185A (en) 2024-12-16 2024-12-16 Gateway route automatic test method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202411846621.1A CN119835185A (en) 2024-12-16 2024-12-16 Gateway route automatic test method, device and storage medium

Publications (1)

Publication Number Publication Date
CN119835185A true CN119835185A (en) 2025-04-15

Family

ID=95293562

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202411846621.1A Pending CN119835185A (en) 2024-12-16 2024-12-16 Gateway route automatic test method, device and storage medium

Country Status (1)

Country Link
CN (1) CN119835185A (en)

Similar Documents

Publication Publication Date Title
CN109039824B (en) Automatic test system and method for wireless remote communication protocol of vehicle-mounted terminal
CN107491061B (en) A network automated test system and method for commercial vehicle OBD diagnostic equipment
CN109388530B (en) Blade server-oriented automatic test platform and test method
WO2017000424A1 (en) Protocol detection method and apparatus
CN109840207A (en) One kind being based on AUTOSAR network management automatization test system and test method
CN106330618A (en) Gateway routing automatic test system and test method based on CAN/LIN/MOST hybrid buses
CN108092854B (en) Test method and device for train-level Ethernet equipment based on IEC61375 protocol
CN107370637B (en) Vehicle-mounted ECU communication function automatic test system and method
CN118972279B (en) A vehicle-mounted TBOX signal test verification method, device and medium
CN110768871A (en) Test method and system for automatically counting data transmission correctness of DCS (distributed control system)
CN118316825A (en) Vehicle Ethernet ring network testing method, device, electronic equipment and storage medium
CN119005081A (en) Chip verification method, verification device, electronic equipment and storage medium
CN111970166B (en) Test method, device, equipment, system and computer readable storage medium
CN120416085A (en) Service supervision and automated testing methods in AFDX network testing
CN114124727B (en) Network management communication pressure testing method and system
CN119835185A (en) Gateway route automatic test method, device and storage medium
CN117891700A (en) 61850 transformer substation spacer layer GOOSE data simulation method
CN116953383A (en) Automatic line protection testing method and system capable of simulating abnormality of optical fiber channel
CN105044552A (en) Fault diagnosis method, system and device for distribution network automation system
CN116866239A (en) Service interface testing method, device and equipment
KR20230099772A (en) Evaluation system and method of vehicle controller function providing device
CN117110733A (en) Automatic diagnosis method and device for battery management system
CN118067418B (en) Automatic test system, method and whole vehicle test system
Pallierer et al. A generic tool for systematic tests in embedded automotive communication systems
CN120342900A (en) Message testing method, device, vehicle and storage medium for vehicle gateway

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination