Vehicle communication test method and device, electronic equipment and storage medium
By generating virtual messages and sending them to the controller to be tested through interference channels, and automatically testing their CAN bus off state, the problems of inefficient and insufficient accuracy of manual testing in the prior art are solved, and efficient and reliable fault code recording tests are achieved.
Patent Information
- Application Number
- CN202510209310.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-25
- Publication Date
- 2025-05-09
AI Technical Summary
In the prior art, the test of the ECU in the Busoff state depends on manual operation, which is inefficient and difficult to ensure the consistency and accuracy of the test.
By generating a virtual message and sending it to the controller to be tested through an interference channel, it is determined whether it enters the bus off state and obtains the recorded fault code. If the fault code contains the target fault code, the test is terminated; otherwise, the virtual message is repeatedly sent until the controller to be tested enters the bus off state and reaches the predetermined value.
Automatic testing of the CAN bus shutdown state of the controller to be tested is realized, which improves the testing efficiency, reduces human error, and ensures the reliability and repeatability of the test results.
Smart Images

Figure CN119966870A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of vehicle technology, and in particular to a vehicle communication testing method, device, electronic device and storage medium. Background Art
[0002] As the level of automobile intelligence continues to improve, the communication between various controllers inside the vehicle has become increasingly complex. As one of the main ways of internal communication in the vehicle, the stability of the CAN bus is directly related to the safety and reliability of the vehicle. When a node in the CAN network cannot communicate normally due to a fault, the node will enter the Busoff state. At this time, the ECU needs to be able to correctly identify and record this fault state for subsequent diagnosis and maintenance. However, at present, most of the tests for fault code recording of ECU in the Busoff state rely on manual operations, which is not only inefficient, but also difficult to ensure the consistency and accuracy of the test. Summary of the invention
[0003] The purpose of the embodiments of the present application is to provide a vehicle communication testing method, device, electronic device and storage medium, so as to improve the efficiency of the CAN bus shutdown state test of the controller to be tested.
[0004] In a first aspect, the present invention provides a vehicle communication testing method, the method comprising generating a virtual message and sending it to a controller under test through an interference channel; determining whether the controller under test enters a bus-off state and reaches a first value; if so, obtaining a first fault code recorded by the controller under test; if not, returning to execute the step of generating a virtual message and sending it to the controller under test through an interference channel; if the first fault code includes a target fault code, terminating the test; if the first fault code does not include the target fault code, returning to execute the step of generating a virtual message and sending it to the controller under test through an interference channel, and determining that the controller under test enters a bus-off state and reaches a second value, wherein the second value is greater than the first value.
[0005] In an optional implementation manner, whether the controller to be tested enters the bus-off state is determined by:
[0006] Determine whether an error frame occurs on the bus; if so, determine that the controller under test enters a bus-off state once, and increase the number of times the controller under test enters the bus-off state by 1.
[0007] In an optional implementation, a second fault code recorded in the controller to be tested is obtained, and if the second fault code includes a target fault code, it is determined that the controller to be tested has passed the test.
[0008] In an optional implementation manner, whether the fault code recorded by the controller to be tested includes the target fault code is determined in the following manner:
[0009] Determine a bus-off fault code from all fault codes recorded by the controller to be tested; determine whether the format of the bus-off fault code is correct; if the format is correct, determine whether the fault code includes a target fault code.
[0010] In an optional implementation, the method further includes determining the communication status of the controller to be tested, and generating test abnormality information if the communication status of the controller to be tested is abnormal.
[0011] In an optional implementation, the method further includes responding to a test instruction of the controller under test, generating a power-on instruction for the controller under test and sending the instruction to the power supply module to power on the controller under test.
[0012] In an optional implementation, before the step of generating a virtual message, it also includes generating an initialization instruction and sending it to the controller under test, so that the controller under test clears historical fault codes.
[0013] In a second aspect, the present invention provides a vehicle communication test device, the device comprising:
[0014] A response module, used for generating a virtual message and sending it to the controller under test through an interference channel;
[0015] A first processing module, used for determining whether the controller to be tested enters a bus-off state and reaches a first value;
[0016] A second processing module, used for obtaining a first fault code recorded by the controller to be tested;
[0017] A judgment module, for returning to the step of generating a virtual message and sending it to the controller under test through an interference channel if no;
[0018] A settlement module is used to end the test if the first fault code includes a target fault code, and if the first fault code does not include the target fault code, return to the step of generating a virtual message and sending it to the controller under test through an interference channel, and determine that the controller under test enters a bus-off state and reaches a second value, wherein the second value is greater than the first value.
[0019] In a third aspect, the present invention provides an electronic device comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via the bus, and the processor executes the machine-readable instructions to perform the steps of testing vehicle communications as in any of the aforementioned implementations.
[0020] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the vehicle communication testing method in any of the aforementioned embodiments are executed.
[0021] The present application provides a vehicle communication testing method, device, electronic device and storage medium, the method comprising generating a virtual message and sending it to a controller under test through an interference channel; determining whether the controller under test enters a bus-off state and reaches a first value; if so, obtaining a first fault code recorded by the controller under test; if not, returning to execute the step of generating a virtual message and sending it to the controller under test through an interference channel; if the first fault code includes a target fault code, terminating the test; if the first fault code does not include the target fault code, returning to execute the step of generating a virtual message and sending it to the controller under test through an interference channel, and determining that the controller under test enters a bus-off state and reaches a second value, wherein the second value is greater than the first value, which can realize automated testing of the CAN bus-off state of the controller under test and improve test efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0023] Figure 1 A schematic diagram of the structure of the automated testing system provided in the embodiment of the present application;
[0024] Figure 2 A flow chart of a vehicle communication testing method provided in an embodiment of the present application;
[0025] Figure 3 A flowchart of a Busoff fault code testing method provided in an embodiment of the present application;
[0026] Figure 4 A schematic diagram of the structure of a vehicle communication test device provided in an embodiment of the present application;
[0027] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0028] As the level of automobile intelligence continues to improve, the communication between various controllers inside the vehicle has become increasingly complex. As one of the main ways of internal communication in the vehicle, the stability of the CAN bus is directly related to the safety and reliability of the vehicle. When a node in the CAN network cannot communicate normally due to a fault, the node will enter the Busoff state. At this time, the ECU needs to be able to correctly identify and record this fault state for subsequent diagnosis and maintenance. However, at present, most of the tests for fault code recording of ECU in the Busoff state rely on manual operations, which is not only inefficient, but also difficult to ensure the consistency and accuracy of the test.
[0029] Traditional Busoff fault code testing is usually done manually, and each test requires manual setting of the same interference conditions, which can easily lead to differences due to different operators. At the same time, manual testing is time-consuming, especially when a large number of repetitive tests are required, and the work efficiency is extremely low. In addition, manual operation may result in errors, resulting in inaccurate test results.
[0030] Based on this, the present application provides a vehicle communication testing method, device, electronic device and storage medium to realize automated testing of the CAN bus shutdown state of the controller to be tested.
[0031] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application usually described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, each other embodiment obtained by those skilled in the art without making creative work belongs to the scope of protection of the present application.
[0032] In one embodiment, an automated testing system is provided. Figure 1 As shown, the automated test system includes DUT (Device Under Test), a program-controlled power supply, a jammer (VH6501), a host computer (VN1640) and test electronic devices (a first resistor R1, a second resistor R2 and a CAN line). Among them, the host computer and the controller to be tested are connected in series through the CAN bus, and the output ends of the jammer are respectively connected to the CAN bus. The K30 and K15 pins of the controller to be tested are connected to the program-controlled power supply. The first resistor and the second resistor can be 120Ω. For terminal type DUT, R1 or R2 needs to be selected. For non-terminal type DUT, R1 and R2 need to be configured at the same time.
[0033] The host computer is used to execute the vehicle communication test method provided in this application, enter the Busoff state by simulating specific network interference, and observe whether the DUT can correctly record the corresponding fault code.
[0034] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.
[0035] Figure 2 The following is a flow chart of a vehicle communication testing method provided in an embodiment of the present application. Figure 2 As shown, a vehicle communication test method provided in an embodiment of the present application can be executed by a host computer, specifically including:
[0036] S1. Respond to a test instruction of the controller under test, generate a power-on instruction of the controller under test and send it to a power supply module to power on the controller under test.
[0037] The controller to be tested here can be an on-board controller such as an ECU on a vehicle. The power supply module can be a programmable power supply. The host computer sends a power supply instruction to the programmable power supply through normal communication to provide a standard working voltage such as 24V for the controller to be tested.
[0038] The host computer needs to wait for a while (5S) until the bus communication is stable before executing the next step.
[0039] S2. Generate an initialization instruction and send it to the controller under test, so that the controller under test clears the historical fault codes.
[0040] The host computer sends commands to the DUT via the interference-free CAN bus to clear all historical fault codes previously recorded in the DUT.
[0041] S3. Generate a fault code reading instruction and send it to the controller to be tested to determine whether all historical fault codes have been deleted.
[0042] If yes, execute the next step; if no, return to execute S3.
[0043] If the DUT replies with a correct response message, it can be determined that all historical fault codes are deleted.
[0044] S4. Generate a virtual message and send it to the controller under test through the interference channel.
[0045] The virtual message here is sent through the CAN channel, and the jammer starts to interfere.
[0046] The jammer can interfere with the RTR bit of all messages sent by the DUT, causing the controller under test to enter the Busoff state.
[0047] S5. Determine whether the controller to be tested enters a bus-off state and reaches a first value.
[0048] The host computer can determine whether the controller under test has entered the bus off state in the following ways:
[0049] Determine whether an error frame occurs on the bus. If so, determine that the controller under test enters a bus-off state once, and increase the number of times the controller under test enters the bus-off state by 1.
[0050] The host computer can count the number of times the controller under test enters the bus-off state, determine whether 32 error frames appear on the bus continuously, and if so, determine that the controller under test enters the bus-off state once, and add 1 to the number of times the controller under test enters the bus-off state.
[0051] The first value here may be preset according to test requirements.
[0052] S6: If yes, obtain the first fault code recorded by the controller to be tested.
[0053] S7. Determine whether the first fault code includes a target fault code.
[0054] Determine the bus-off fault code from all fault codes recorded by the controller to be tested; and determine whether the format of the bus-off fault code is correct.
[0055] If the format is correct, determine whether the fault code includes the target fault code; the host computer reads the fault code of the DUT and verifies whether the Busoff fault code is recorded. In addition, the Busoff fault code here should meet the historical fault of the DTC.
[0056] If not, the process returns to step S2 to generate a virtual message and send it to the controller under test through the interference channel.
[0057] S8. If the first fault code includes the target fault code, the test ends.
[0058] If the controller under test has recorded the target fault code, it means that the controller under test has not passed the test and does not meet the usage requirements.
[0059] S9. If the first fault code does not include the target fault code, return to the step of generating a virtual message and sending it to the controller under test through the interference channel, and determine that the controller under test enters the bus-off state and reaches the second value.
[0060] Wherein, the second value is greater than the first value. If the controller to be tested successfully records the Busoff fault code this time and satisfies the preset format, the test is passed.
[0061] The present application provides a vehicle communication testing method, which can realize the automated testing of the CAN bus shutdown state of the controller to be tested, thereby improving the testing efficiency and reducing human errors.
[0062] In one embodiment of the present application, in order to ensure the test quality, a check of the DUT state can be added in the step before or after step S7 to ensure that the DUT remains in the expected working state during the entire test process. The host computer can determine the communication state of the controller to be tested, and if the communication state of the controller to be tested is abnormal, a test abnormality message is generated.
[0063] like Figure 3 As shown, in one embodiment of the present application, a Busoff fault code testing method is also provided, which can be executed by a host computer, specifically including:
[0064] S100, set the DUT power supply voltage to Vnormal and power on, wait for 5 seconds until the bus communication is stable. At this time, the DUT sends application messages normally.
[0065] S101, clear the DTC recorded by the DUT. At this time, the DUT replies with a correct positive response.
[0066] S102, read the DTC recorded by the DUT. At this time, there is no Busoff DTC.
[0067] S103, use a jammer to interfere with the RTR bits of all messages of the DUT, causing it to enter the Busoff state (nBusOffCount-1) times continuously.
[0068] S104, read the DTC recorded by the DUT, and determine whether the DUT records the Busoff DTC. At this time, there is no Busoff DTC.
[0069] Repeat steps S101 and S102.
[0070] S105. Use a jammer to interfere with the RTR bits of all messages of the DUT, causing it to enter the Busoff state nBusOffCount times continuously.
[0071] S106 , reading the DTC recorded by the DUT, and determining whether the DUT records the Busoff DTC.
[0072] A Busoff DTC should be read with bit 3 = 1 and bit 0 = 0 in the DTC status byte.
[0073] The recorded Busoff fault code should be consistent with the requirements. If the DUT enters Busoff for nBusOffCount consecutive times and no message is successfully sent, the Busoff DTC needs to be recorded. The Busoff DTC read can only be a historical fault.
[0074] In one embodiment of the present application, a timeout fault monitoring test method in a Busoff state is also provided, which can be executed by a host computer and specifically includes:
[0075] Set the DUT power supply voltage to Vnormal and power on, use the CANoe simulation partner node to send messages, and wait for 5 seconds until the bus communication is stable. At this time, the DUT sends application messages normally.
[0076] Clear the DTC recorded by the DUT. The DUT should reply with a correct positive response.
[0077] Read the DTC recorded by the DUT. At this time, there is no Busoff DTC and related node timeout DTC.
[0078] Use a jammer to interfere with the RTR bit of all messages sent by the DUT for 1 second, and stop CANoe simulation from sending messages.
[0079] When the jammer ends, the sending of CANoe simulation messages is resumed, and the DUT sends application messages normally.
[0080] Read the DTC recorded by the DUT to determine whether the DUT records the node timeout DTC. The DUT only records the Busoff DTC and does not record any timeout DTC.
[0081] Another timeout fault monitoring test method in Busoff state is also provided, which can be executed by the host computer, including:
[0082] Set the DUT power supply voltage to Vnormal and power on, use the CANoe simulation partner node to send messages, and wait for 5 seconds until the bus communication is stable. The DUT sends application messages normally.
[0083] Clear the DTC recorded by the DUT. The DUT replies with a correct positive response.
[0084] Read the DTC recorded by the DUT. There is no Busoff DTC and related node timeout DTC.
[0085] Use a jammer to interfere with the RTR bits of all messages on the bus for 1 second, and stop CANoe simulation from sending messages.
[0086] After the jammer ends, wait for 5 seconds, read the DTC recorded by the DUT, and determine whether the DUT records the node timeout DTC. The DUT records the Busoff DTC and the related node timeout DTC.
[0087] When the DUT enters Busoff mode, the DUT will only store Busoff fault codes, not node timeout fault codes. When the DUT recovers from Busoff fault, the node timeout monitoring function should be restored immediately.
[0088] In one embodiment of the present application, before step S2, the host computer can determine whether the bus communication is stable by the following steps:
[0089] The host computer detects whether the message sent by the controller to be tested is detected on the CAN bus. If no message is detected, it prompts that the DUT has not sent a message, the implementation example of the present application cannot be performed, and the test ends.
[0090] If a message is detected, the message ID is used as a characteristic value to traverse the network segment database to determine whether the message is a periodic message or a network management message. If not, return to the step of detecting the message.
[0091] If a periodic message or a network management message is detected, wait for a while to ensure that the bus communication enters a stable state.
[0092] In a specific embodiment of the present application, another Busoff fault code testing method is also provided, which can be executed by a host computer, specifically including:
[0093] The host computer reads the node Busoff DTC, performs test initialization, and configures the jammer address.
[0094] The test initialization includes: the host computer loads the network segment database DBC, matches the terminal resistance, enables KL30 / KL15 / GND, and sets the initial voltage to 24V for the controller to be tested.
[0095] The host computer determines whether to pre-define periodic messages or network management messages. If not, the test is determined to be unsuccessful and the reasons for failure, test data, time, etc. are recorded, the test results are uploaded, and a test report is generated.
[0096] The host computer determines whether the DUT sends the message normally. If not, the test fails.
[0097] The host computer clears the DTC recorded by the DUT, and determines and records the response of the DUT.
[0098] The host computer reads the Busoff DTC, determines and records the DTC recorded by the DUT.
[0099] If the DUT logs a DTC, the response is normal.
[0100] The host computer clears the cached interference sequence and configures a new interference sequence.
[0101] The host computer stops CANoe from sending network management messages to the DUT, disturbs the DUT to enter the Busoff state, and judges and records the DUT's communication recovery status and stores the Busoff DTC status after each disturbance.
[0102] The host computer resumes CANoe to send network management messages to the DUT to determine whether the DUT records the Busoff DTC situation. If the DUT does not record it, the host computer stops CANoe from sending network management messages to the DUT, reconfigures the interference mode, and continues to interfere by adding 1 to the number of times the last interference busoff is performed. The host computer determines and records the DUT's communication recovery and storage Busoff DTC situation.
[0103] If the DUT has records, the host computer determines whether the number of interferences is consistent with the number of Busoff DTCs recorded by the DUT.
[0104] The host computer controls the DUT to power off and detects the DUT sleep status. The monitoring time is up to 10 minutes.
[0105] The host computer controls the DUT to power on and determines the sleep status of the DUT when it is powered off. If the DUT is sleeping normally, the DTC recorded by the DUT is read and it is determined whether the DTC bytes meet the test rule requirements.
[0106] The host computer records all test data and evaluation indicators, uploads test results and generates test reports.
[0107] The automated testing method provided in this application can effectively improve the efficiency and accuracy of Busoff fault code testing, reduce the influence of human factors, and ensure that each test can be performed under the same conditions, thereby improving the reliability and repeatability of the test results.
[0108] like Figure 4 As shown, based on the same inventive concept, an embodiment of the present application further provides a vehicle communication test device, the device 40 comprising:
[0109] A response module 401 is used to generate a virtual message and send it to the controller under test through an interference channel;
[0110] A first processing module 402, used to determine whether the controller to be tested enters a bus-off state and reaches a first value;
[0111] The second processing module 403 is used to obtain a first fault code recorded by the controller to be tested;
[0112] The judging module 404 is used for returning to the step of generating a virtual message and sending it to the controller under test through the interference channel if no;
[0113] The settlement module 405 is used to end the test if the first fault code includes the target fault code, and if the first fault code does not include the target fault code, return to the step of generating a virtual message and sending it to the controller under test through an interference channel, and determine that the controller under test enters a bus-off state and reaches a second value, wherein the second value is greater than the first value.
[0114] In a preferred embodiment, the first processing module 403 determines whether the controller to be tested enters the bus-off state by:
[0115] Determine whether an error frame occurs on the bus; if so, determine that the controller under test enters a bus-off state once, and increase the number of times the controller under test enters the bus-off state by 1.
[0116] In a preferred embodiment, the second processing module 403 is further used to obtain a second fault code recorded by the controller to be tested, and if the second fault code includes a target fault code, it is determined that the controller to be tested passes the test.
[0117] In a preferred embodiment, the second processing module 404 determines whether the fault code recorded by the controller to be tested includes the target fault code by:
[0118] Determine a bus-off fault code from all fault codes recorded by the controller to be tested; determine whether the format of the bus-off fault code is correct; if the format is correct, determine whether the fault code includes a target fault code.
[0119] In a preferred embodiment, the method further includes determining the communication status of the controller to be tested, and generating test abnormality information if the communication status of the controller to be tested is abnormal.
[0120] In a preferred embodiment, the response module 401 is further configured to respond to a test instruction of the controller under test, generate a power-on instruction of the controller under test, and send the instruction to the power supply module to power on the controller under test.
[0121] In a preferred embodiment, before the step of generating the virtual message, the response module 401 is further used to generate an initialization instruction and send it to the controller under test, so that the controller under test clears the historical fault code.
[0122] See also Figure 5 , Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 5 As shown in , the electronic device 500 includes a processor 510 , a memory 520 and a bus 530 .
[0123] The memory 520 stores machine-readable instructions executable by the processor 510. When the electronic device 500 is running, the processor 510 communicates with the memory 520 via the bus 530. When the machine-readable instructions are executed by the processor 510, the above-mentioned Figure 1 The steps of a vehicle communication testing method in the method embodiment shown are specifically implemented in accordance with the method embodiment and will not be described in detail here.
[0124] The present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the computer program can execute the above-mentioned Figure 1 The steps of a vehicle communication testing method in the method embodiment shown are specifically implemented in accordance with the method embodiment and will not be described in detail here.
[0125] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0126] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, 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 or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0127] In addition, the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0128] Furthermore, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.
[0129] It should be noted that if the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can essentially be embodied in the form of a software product, or the part that contributes to the prior art or the part of the technical solution. The computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM) random access memory (RAM), disk or optical disk, and other media that can store program codes.
[0130] In this document, relational terms such as first and second, etc. are used merely to distinguish one entity or operation from another entity or operation, but do not necessarily require or imply any such actual relationship or order between these entities or operations.
[0131] The above description is only an embodiment of the present application and is not intended to limit the protection scope of the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A vehicle communication testing method, characterized in that: The method comprises: Generate a virtual message and send it to the controller under test through an interference channel; Determine whether the controller under test enters a bus-off state and reaches a first value; If yes, then obtain the first fault code recorded by the controller to be tested; If not, return to the step of generating a virtual message and sending it to the controller under test through the interference channel; If the first fault code includes the target fault code, the test is terminated. If the first fault code does not include the target fault code, the test returns to the step of generating a virtual message and sending it to the controller under test through the interference channel, and determines that the controller under test enters the bus-off state and reaches a second value, wherein the second value is greater than the first value.
2. The method according to claim 1, characterized in that Determine whether the controller under test enters the bus-off state by: Determine if an error frame occurs on the bus; If so, it is determined that the controller under test enters the bus-off state once, and the number of times the controller under test enters the bus-off state is increased by 1.
3. The method according to claim 1, characterized in that The method also includes obtaining a second fault code recorded in the controller to be tested, and if the second fault code includes a target fault code, it is determined that the controller to be tested has passed the test.
4. The method according to claim 1, characterized in that: Determine whether the fault codes recorded by the controller under test include the target fault code by the following methods: Determine the bus off fault code from all fault codes recorded by the controller to be tested; Determine if the format of the bus off fault code is correct; If the format is correct, determine whether the fault code includes the target fault code.
5. The method according to claim 1, characterized in that The method also includes determining the communication status of the controller to be tested, and generating test abnormality information if the communication status of the controller to be tested is abnormal.
6. The method according to claim 1, characterized in that The method also includes responding to a test instruction of the controller to be tested, generating a power-on instruction of the controller to be tested and sending the instruction to the power supply module to power on the controller to be tested.
7. The method according to claim 1, characterized in that Before the step of generating the virtual message, it also includes generating an initialization instruction and sending it to the controller under test, so that the controller under test clears the historical fault code.
8. A vehicle communication test device, characterized in that: The device comprises: A response module, used for generating a virtual message and sending it to the controller under test through an interference channel; A first processing module, used for determining whether the controller to be tested enters a bus-off state and reaches a first value; A second processing module, used for obtaining a first fault code recorded by the controller to be tested; A judgment module, for returning to the step of generating a virtual message and sending it to the controller under test through an interference channel if no; A settlement module is used to end the test if the first fault code includes a target fault code, and if the first fault code does not include the target fault code, return to the step of generating a virtual message and sending it to the controller under test through an interference channel, and determine that the controller under test enters a bus-off state and reaches a second value, wherein the second value is greater than the first value.
9. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the memory via the bus, and the processor executes the machine-readable instructions to perform the steps of testing vehicle communications as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the vehicle communication testing method according to any one of claims 1 to 7 are executed.
Citation Information
Cited By
DSM fault diagnosis test method, equipment and medium
CN121349051A