A CAN bus fault injection device and method

By designing CAN bus fault injection equipment in automobile design, and using real-time processors and CAN boards to inject fault signals, the problem of difficult simulation of communication signals between controllers is solved, and the accuracy of functional safety and fault diagnosis testing is improved.

CN114647232BActive Publication Date: 2024-09-13CHINA FAW CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210416726.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-20
Publication Date
2024-09-13
Estimated Expiration
2042-04-20

AI Technical Summary

Technical Problem

In the automotive design stage, existing technology is difficult to effectively simulate communication signal faults between controllers, resulting in insufficient accuracy in functional safety testing and fault diagnosis testing.

Method used

A CAN bus fault injection device is designed, including a real-time processor, CAN board, main CAN network, auxiliary CAN network and CAN network selector. The real-time processor drives the CAN board to generate and inject fault signals to simulate the controller ECU. communication failures between them to improve test accuracy.

Benefits of technology

It achieves accurate simulation of fault signals between different controller ECUs, improves the accuracy of functional safety testing and fault diagnosis testing, and ensures the reliability and effectiveness of the testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114647232B
    Figure CN114647232B
Patent Text Reader

Abstract

The present invention discloses a CAN bus fault injection device and method. The device comprises: a real-time processor, a CAN board, a main CAN network, an auxiliary CAN network, a CAN network selector and a controller ECU; the real-time processor is connected to the CAN board through a hard line; the CAN board is connected to the main CAN network and the auxiliary CAN network; the selection device is connected to the controller ECU through a hard line; the real-time processor is used to drive the CAN board; the CAN board is used to set or generate a fault signal; the CAN network selector is used to control the controller ECU to access the main CAN network or the auxiliary CAN network. The CAN bus fault injection device composed of the real-time processor, the CAN board, the main CAN network, the auxiliary CAN network, the CAN network selector and the controller ECU realizes the simulation of fault signals between different controller ECUs, and improves the accuracy of the functional safety test and fault diagnosis test of the controller.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of automobile design, and in particular to a CAN bus fault injection device and method. Background Art

[0002] With the rapid development of the times, automobiles have more and more functions, and their electronic and electrical functions are becoming more and more complex. The controllers in the car can share information between multiple controllers through the Controller Area Network (CAN bus). In order to ensure the safe and reliable operation of automobile functions, all electronic and electrical controllers of the car need to be fully tested during the automobile design stage. In addition to functional testing, fault diagnosis testing and functional safety testing are also crucial. Summary of the invention

[0003] The present invention provides a CAN bus fault injection device and method to achieve fault simulation of communication signals between different controllers ECUs and improve the accuracy of functional safety testing and fault diagnosis testing of the controllers.

[0004] According to one aspect of the present invention, a CAN bus fault injection device is provided, the device comprising: a real-time processor, a CAN board, a main CAN network, an auxiliary CAN network, a CAN network selector and a controller ECU; the real-time processor is connected to the CAN board via a hard line; the CAN board is connected to the main CAN network and the auxiliary CAN network; the selection device is connected to the controller ECU via a hard line;

[0005] The real-time processor is used to drive the CAN board;

[0006] The CAN board is used to set or generate a fault signal;

[0007] The CAN network selector is used to control the controller ECU to access the main CAN network or the auxiliary CAN network.

[0008] According to another aspect of the present invention, a CAN bus fault injection method is provided, comprising:

[0009] The real-time processor drives the CAN board to obtain fault signals;

[0010] The CAN board injects the fault signal into the first controller connected to the main CAN network through the main CAN network.

[0011] The technical solution of the embodiment of the present invention realizes the simulation of fault signals between different controller ECUs through a CAN bus fault injection device composed of a real-time processor, a CAN board, a main CAN network, an auxiliary CAN network, a CAN network selector and a controller ECU, thereby improving the accuracy of the functional safety test and fault diagnosis test of the controller.

[0012] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0014] Figure 1 A schematic diagram of the structure of a CAN bus fault injection device provided by an embodiment of the present invention;

[0015] Figure 2 It is a schematic diagram of the internal structure of a CAN network selector provided by an embodiment of the present invention;

[0016] Figure 3 is a schematic diagram of the internal structure of a real-time processor provided by an embodiment of the present invention;

[0017] Figure 4 is a flow chart of a CAN bus fault injection method provided by an embodiment of the present invention;

[0018] Figure 5 It is a schematic diagram of implementing a CAN bus fault injection method provided by an embodiment of the present invention;

[0019] Figure 6 A schematic structural diagram of a CAN bus fault injection device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0020] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0021] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0022] Figure 1 Schematic diagram of the structure of a CAN bus fault injection device provided by an embodiment of the present invention. This embodiment can be applied to the case of simulating one or more communication signal faults between different controller ECUs, such as Figure 1 As shown, the CAN bus fault injection device 10 includes: a real-time processor 101, a CAN board 102, a main CAN network 103, an auxiliary CAN network 104, a CAN network selector 105 and a controller ECU 106; the real-time processor 101 is connected to the CAN board 102 through a hard line; the CAN board 102 is connected to the main CAN network 103 and the auxiliary CAN network 104; the selection device is connected to the controller ECU 106 through a hard line; the real-time processor 101 is used to drive the CAN board 102; the CAN board 102 is used to set or generate a fault signal; the CAN network selector 105 is used to control the controller ECU 106 to access the main CAN network 103 or the auxiliary CAN network 104.

[0023] Among them, the real-time processor 101 is a processor that can process software data in real time and drive the CAN board 102 to send CAN messages. The CAN board 102 is a hardware that generates CAN messages according to the control strategy of the real-time processor 101. Of course, the CAN board 102 can also set or generate fault signals according to the control strategy of the real-time processor 101. One end of the CAN network selector 105 is connected to the controller ECU 106, and the other end is connected to the main CAN network 103 or the auxiliary CAN network 104, which can control the controller ECU 106 to access the main CAN network 103 or the auxiliary CAN network 104. Among them, the fault signal can be any type of fault, for example, it can be a CAN signal fault, a CAN signal loss fault or a bus shutdown fault.

[0024] It should be noted that if the controller ECU connected to the main CAN network is taken as the object to be tested, multiple controller ECU106 can be connected to the main CAN, and the ECU that needs to set the message fault is connected to the auxiliary CAN; if the controller ECU connected to the auxiliary CAN network is taken as the object to be tested, multiple controller ECU106 can be connected to the auxiliary CAN, and the ECU that needs to set the message fault is connected to the main CAN.

[0025] In the embodiment of the present invention, the real-time processor 101 drives the CAN board 102 to modify the CAN signal value or the sending cycle or the check bit value in the process of forwarding the CAN signal in the auxiliary CAN network 104 to the main CAN network 103, simulating CAN signal faults, bus shutdown faults, etc., such as invalid value faults, check bit faults, CAN signal periodic faults, etc.; the real-time processor 101 can also drive the CAN board 102 not to forward the signal on the auxiliary CAN network 104 to the main CAN network 103 to simulate the CAN signal loss fault. Functional safety testing and fault diagnosis testing of the controller ECU 106 connected to the main CAN network 103 can be achieved through fault injection. Alternatively, the real-time processor 101 drives the CAN board 102 to modify the CAN signal value or the sending cycle or the check bit value in the process of forwarding the CAN signal in the main CAN network 103 to the auxiliary CAN network 104, simulating CAN signal faults, bus shutdown faults, etc. The real-time processor 101 can also drive the CAN board 102 not to forward the signal on the main CAN network 103 to the auxiliary CAN network 104, simulating the CAN signal loss fault. Functional safety testing and fault diagnosis testing of the controller ECU 106 connected to the auxiliary CAN network 104 can be achieved through fault injection.

[0026] In the embodiment of the present invention, the controller ECU connected to the main CAN network and the auxiliary CAN network is a real controller, which can ensure that faults are set during the communication process between the real controllers, thereby ensuring the reliability of the simulation environment.

[0027] For example, Figure 2It is a schematic diagram of the internal structure of a CAN network selector provided in an embodiment of the present invention. The CAN network selector 105 includes: a first relay 1051, a second relay 1052, a third relay 1053, a fourth relay 1054, a first input / output IO board 1055, a first terminal resistor 1056, and a second terminal resistor 1057; the first input / output IO board 1055 is respectively connected to the control ends of the first relay 1051, the second relay 1052, the third relay 1053 and the fourth relay 1054 through hard wires; the first relay 1051 is connected to the second relay 1052; the second relay 1052 is connected to the main CAN network 103 or the auxiliary CAN network 104; one end of the third relay 1053 is connected to the first terminal resistor 1056, and the other end is connected to the main CAN network 103, for controlling whether the first terminal resistor 1056 is connected to the main CAN network 103; one end of the fourth relay 1054 is connected to the second terminal resistor 1057, and the other end is connected to the auxiliary CAN network 104, for controlling whether the second terminal resistor 1057 is connected to the auxiliary CAN network 104.

[0028] It should be noted that the input / output IO board is used to control the relay, and the input / output IO board is driven by the real-time processor 101. Optionally, the real-time processor 101 includes an IO input / output model, and the IO input / output model is used to drive the first input / output IO board 1055. In this embodiment, the IO input / output model is mapped to the first input / output IO board 1055 through a mapping file, so that the IO input / output model can drive the first input / output IO board 1055.

[0029] Optionally, the first input and output IO board 1055 includes four channels, namely a first IO channel, a second IO channel, a third IO channel and a fourth IO channel; wherein the first IO channel is connected to the first relay 1051, the second IO channel is connected to the second relay 1052, the third IO channel is connected to the third relay 1053, and the fourth IO channel is connected to the fourth relay 1054.

[0030] Among them, the relay is an automatic switching element with an isolation function. The first relay 1051 is used to control whether to access the controller ECU106, the second relay 1052 is used to control the controller ECU106 to access the main CAN network 103 or the auxiliary CAN network 104, the third relay 1053 is used to control whether the first terminal resistor 1056 is connected to the main CAN network 103, and the fourth relay 1054 is used to control whether the second terminal resistor 1057 is connected to the auxiliary CAN network 104.

[0031] It should be noted that if the controllers in the same CAN network already have terminal resistors, there is no need to connect the terminal resistors. If the controllers in the same CAN network do not have terminal resistors, a terminal resistor is connected. For example, two controllers ECU106 are connected to the same CAN network at the same time and in parallel. If one of the controllers ECU106 has a terminal resistor, the other controller ECU106 does not need to add a terminal resistor. In this embodiment, connecting the terminal resistors in the controllers ECU106 can ensure the accuracy and effectiveness of data transmission.

[0032] Specifically, if the first input / output IO board 1055 controls the switch of the first relay 1051 to be closed, the first relay 1051 is connected to the second relay 1052, which is equivalent to the CAN network selector 105 being connected to the real controller ECU 106. If the controller ECU 106 connected to the main CAN network 103 is the object to be tested, the second relay 1052 can be controlled by the first input / output IO board 1055 to be connected to the main CAN network 103, and the controller ECU 106 that does not need to be tested can be controlled by the first input / output IO board 1055 to be connected to the auxiliary CAN network 104. Of course, if the controller ECU 106 connected to the auxiliary CAN network 104 is the object to be tested, the second relay 1052 can be controlled by the first input / output IO board 1055 to be connected to the auxiliary CAN network 104, and the controller ECU 106 that does not need to be tested can be controlled by the first input / output IO board 1055 to be connected to the main CAN network 103. If there is no first terminal resistor 1056 in the controller connected to the main CAN network 103, the first input-output IO board 1055 controls the first terminal resistor 1056 to connect to the main CAN network 103 through the third relay 1053. If there is no second terminal resistor 1057 in the controller connected to the auxiliary CAN network 104, the first input-output IO board 1055 controls the second terminal resistor 1057 to connect to the auxiliary CAN network 104 through the fourth relay 1054.

[0033] Optionally, the CAN board 102 includes at least three channels, namely a first board channel, a second board channel and a third board channel; the first board channel is connected to the main CAN network 103, the second board channel is connected to the auxiliary CAN network 104, and the third board channel is connected to the main CAN network 103 through the fifth relay, and the fifth relay is connected to the fifth IO channel of the second input and output IO board.

[0034] In the embodiment of the present invention, the fifth relay can be controlled by the second input / output IO board to connect the virtual controller ECU to the main CAN network 103 according to the test requirements. If the fifth relay is connected to the main CAN network 103, it means that the virtual controller ECU is connected to the main CAN network 103, that is, the real controller ECU is not connected. Specifically, the real-time processor 101 drives the third board channel to simulate the signal of the real controller ECU and sends it to the main CAN network 103, and can control the value of the simulated signal to set the fault. Of course, the real-time processor 101 can drive the first board channel and the second board channel to set or generate a CAN fault signal.

[0035] For example, Figure 3 1 is a schematic diagram of the internal structure of a real-time processor provided by an embodiment of the present invention. The real-time processor 101 includes: a first CAN virtual gateway model 1011, a second CAN virtual gateway model 1012, a third CAN virtual gateway model 1013 and an IO input and output model 1014;

[0036] The first CAN virtual gateway model 1011 is used to drive the first board channel;

[0037] The second CAN virtual gateway model 1012 is used to drive the second board channel;

[0038] The third CAN virtual gateway model 1013 is used to drive the third board channel;

[0039] The IO input-output model 1014 is used to drive the second IO board.

[0040] It can be understood that the first CAN virtual gateway model 1011 can be mapped to the first board channel through a mapping file, so that the first CAN virtual gateway model 1011 can drive the first board channel, the second CAN virtual gateway model 1012 can be mapped to the second board channel through a mapping file, so that the second CAN virtual gateway model 1012 can drive the second board channel, the third CAN virtual gateway model 1013 can be mapped to the third board channel through a mapping file, so that the third CAN virtual gateway model 1013 can drive the third board channel, and the IO input-output model 1014 can be mapped to the second input-output IO board through a mapping file, so that the IO input-output model 1014 can drive the second input-output IO board.

[0041] Specifically, the first CAN virtual gateway model 1011 can drive the first board channel to set or generate a CAN fault signal. The second CAN virtual gateway model 1012 can drive the second board channel to set or generate a CAN fault signal. The third CAN virtual gateway model 1013 drives the third board channel to simulate the signal of the real controller ECU or sets a CAN fault signal to be sent to the main CAN network 103.

[0042] It should be noted that the IO input / output model driving the second IO board and the IO input / output model driving the first IO board 1055 may be the same or different.

[0043] The technical solution of the embodiment of the present invention realizes the simulation of fault signals between different controller ECUs through a CAN bus fault injection device composed of a real-time processor, a CAN board, a main CAN network, an auxiliary CAN network, a CAN network selector and a controller ECU, thereby improving the accuracy of the functional safety test and fault diagnosis test of the controller.

[0044] Figure 4 : is a flow chart of a CAN bus fault injection method provided by an embodiment of the present invention. This embodiment is applicable to the case of simulating communication signal faults between different controller ECUs. The method can be executed by a CAN bus fault injection device. The CAN bus fault injection device can be implemented in the form of hardware and / or software. The CAN bus fault injection device can be configured in a server. Figure 4 As shown, the method includes:

[0045] S210, the real-time processor drives the CAN board to obtain a fault signal.

[0046] In an embodiment of the present invention, the real-time processor drives the CAN board to modify the CAN signal value or the sending cycle or the check bit value in the process of forwarding the CAN signal in the auxiliary CAN network to the main CAN network, so as to simulate the CAN signal fault, bus shutdown fault, etc. For example, invalid value fault, check bit fault, CAN signal periodic fault, etc.; the real-time processor can also drive the CAN board not to forward the signal on the auxiliary CAN network to the main CAN network to simulate the CAN signal loss fault. Alternatively, the real-time processor drives the CAN board to modify the CAN signal value or the sending cycle or the check bit value in the process of forwarding the CAN signal in the main CAN network to the auxiliary CAN network, so as to simulate the CAN signal fault, bus shutdown fault, etc. The real-time processor can also drive the CAN board not to forward the signal on the main CAN network to the auxiliary CAN network, so as to simulate the CAN signal loss fault. By injecting faults in the forwarding process, the acquisition of fault signals is achieved.

[0047] S220: The CAN board injects the fault signal into the first controller connected to the main CAN network through the main CAN network.

[0048] In the embodiment of the present invention, if the controller ECU connected to the main CAN network is used as the object to be tested, the CAN board injects the fault signal into the first controller connected to the main CAN network through the main CAN network. Functional safety test and fault diagnosis test of the controller ECU connected to the main CAN network can be achieved through fault injection. Of course, if the controller ECU connected to the auxiliary CAN network is used as the object to be tested, the CAN board injects the fault signal into the first controller connected to the auxiliary CAN network through the auxiliary CAN network. Functional safety test and fault diagnosis test of the controller ECU connected to the auxiliary CAN network can be achieved through fault injection.

[0049] The technical solution of the embodiment of the present invention drives the CAN board to obtain a fault signal through a real-time processor, and the CAN board injects the fault signal into the first controller connected to the main CAN network through the main CAN network, thereby realizing the simulation of fault signals between different controller ECUs and improving the accuracy of the functional safety test and fault diagnosis test of the controller.

[0050] Optionally, the real-time processor drives the CAN board to obtain a fault signal by: connecting to a control signal generated by a second controller of the auxiliary CAN network, and transmitting the control signal to the CAN board through the auxiliary CAN network; the real-time processor drives the CAN board to modify the control signal to obtain a fault signal.

[0051] Specifically, the control signal generated by the second controller of the access auxiliary CAN network is transmitted to the second board channel of the CAN board through the auxiliary CAN network. The real-time processor drives the CAN board to forward the control signal in the auxiliary CAN network to the main CAN network. At the second CAN virtual gateway model in the real-time processor, the value of the control signal is modified and forwarded to the first CAN virtual gateway model in the real-time processor, so that the first CAN virtual gateway model drives the first board channel of the CAN board to modify the control signal to obtain a fault signal. Alternatively, the second CAN virtual gateway model may not forward the control signal on the auxiliary CAN network to the first CAN virtual gateway model to simulate the control signal loss fault. Alternatively, the real-time processor drives the CAN board to forward the control signal in the main CAN network to the auxiliary CAN network. At the first CAN virtual gateway model in the real-time processor, the value of the control signal is modified and forwarded to the second CAN virtual gateway model in the real-time processor, so that the second CAN virtual gateway model drives the second board channel of the CAN board to modify the control signal to obtain a fault signal. The first CAN virtual gateway model may also not forward the control signal on the auxiliary CAN network to the second CAN virtual gateway model to simulate the control signal loss fault. By injecting faults during the forwarding process, the fault signal can be obtained.

[0052] Optionally, the real-time processor drives the CAN board to generate an analog control signal, and inputs the analog control signal to a first controller connected to the main CAN network through the main CAN network.

[0053] In the embodiment of the present invention, if there is no real controller ECU, the third CAN virtual gateway model in the real-time processor drives the third card channel of the CAN card to generate an analog control signal, and inputs the analog control signal or the error signal into the first controller connected to the main CAN network through the main CAN network to ensure the normal function test, functional safety test and fault test of the first controller ECU connected to the main CAN network. It should be noted that the analog control signal connected to the main CAN network is not tested, and the other first controller ECUs connected to the main CAN network are tested.

[0054] Optionally, the fault signal is any one of the following types: CAN signal value error fault, CAN signal loss fault, CAN signal sending cycle error fault, CAN signal data length error fault and bus shutdown fault.

[0055] Among them, the CAN signal error fault is a signal value error fault, such as an invalid value fault, a check bit fault, a CAN signal periodicity fault, etc. The CAN signal loss fault is a fault in which the signal required for transmission is lost. The CAN cycle error fault is a fault in which the transmission cycle is incorrect. The CAN signal data length error is a fault in which the length of the signal sent only to the first controller is incorrect. The bus off fault is a fault caused by a short circuit in the twisted pair.

[0056] For example, Figure 5 It is a schematic diagram of the implementation of a CAN bus fault injection method provided by an embodiment of the present invention. Take the power system network in the vehicle and the controller connected to the main CAN network as the test object. If there are three controllers on the power system network, they are the controller EMS, the controller VCU, and the controller TCU, to test the functional safety and fault diagnosis correctness of the controller EMS. First, the controller TCU is connected to the auxiliary CAN network through the CAN network selection device connected to the controller TCU, and the controller EMS is connected to the main CAN network through the CAN network selector connected thereto. If the controller VCU does not have a real controller, the second input and output IO board control controls the fifth relay to be connected to the main CAN network through the fifth IO channel, then the third board channel simulation controller VCU signal of the CAN board can be controlled by the third CAN virtual gateway model to send to the main CAN network. During the test, if the controller EMS needs to receive the gear signal sent by the controller TCU, the gear signal can be not forwarded to the first CAN virtual gateway model at the second CAN virtual gateway model, thereby realizing the design of the gear signal report loss fault and achieving the purpose of the controller EMS strategy test. Alternatively, during the operation of the test controller EMS, if the gear position signal value received from the controller TCU is wrong, the gear position signal is modified at the second CAN virtual gateway model and then forwarded to the first CAN virtual gateway model. Of course, the same operation is performed for other signal faults or other types of faults.

[0057] Figure 6 A schematic diagram of the structure of a CAN bus fault injection device provided by an embodiment of the present invention. Figure 6 As shown, the device comprises:

[0058] An acquisition module 301 is used for a real-time processor to drive a CAN board to acquire a fault signal;

[0059] The injection module 302 is used for the CAN board to inject the fault signal into the first controller connected to the main CAN network through the main CAN network.

[0060] Optionally, the acquisition module 301 includes:

[0061] A control signal generated by a second controller connected to the auxiliary CAN network is transmitted to the CAN board through the auxiliary CAN network; a real-time processor drives the CAN board to modify the control signal to obtain a fault signal.

[0062] Optionally, the device further comprises:

[0063] The generating module is used for a real-time processor to drive the CAN board to generate an analog control signal, and input the analog control signal to the first controller of the main CAN network through the main CAN network.

[0064] Optionally, the fault signal is any one of the following types: a CAN signal value error fault, a CAN signal loss fault, a bus shutdown fault, a CAN signal sending cycle error fault, and a CAN signal data length error fault.

[0065] A CAN bus fault injection device provided by an embodiment of the present invention can execute a CAN bus fault injection method provided by any embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution method.

[0066] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0067] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A CAN bus fault injection device, characterized in that: The device comprises: a real-time processor, a CAN board, a main CAN network, an auxiliary CAN network, a CAN network selector and a controller ECU; the real-time processor is connected to the CAN board via a hard line; the CAN board is connected to the main CAN network and the auxiliary CAN network; the selection device is connected to the controller ECU via a hard line; The real-time processor is used to drive the CAN board; The CAN board is used to set or generate a fault signal; The CAN network selector is used to control the controller ECU to access the main CAN network or the auxiliary CAN network; The real-time processor drives the CAN board to simulate CAN signal failure and bus shutdown failure by modifying the CAN signal value or the sending cycle or the check bit value in the process of forwarding the CAN signal in the auxiliary CAN network to the main CAN network; or The real-time processor drives the CAN board to not forward the signal on the auxiliary CAN network to the main CAN network to simulate the CAN signal loss fault; or, The real-time processor drives the CAN board to simulate CAN signal failure and bus shutdown failure by modifying the CAN signal value or the sending cycle or the check bit value when forwarding the CAN signal in the main CAN network to the auxiliary CAN network; or The real-time processor drives the CAN board to not forward the signal on the main CAN network to the auxiliary CAN network to simulate the CAN signal loss fault.

2. The device according to claim 1, characterized in that The CAN network selector includes: a first relay, a second relay, a third relay, a fourth relay, a first input / output IO board, a first terminal resistor, and a second terminal resistor; the first input / output IO board is respectively connected to the control ends of the first relay, the second relay, the third relay and the fourth relay through hard wires; the first relay is connected to the second relay; the second relay is connected to the main CAN network or the auxiliary CAN network; one end of the third relay is connected to the first terminal resistor, and the other end is connected to the main CAN network, for controlling whether the first terminal resistor is connected to the main CAN network; one end of the fourth relay is connected to the second terminal resistor, and the other end is connected to the auxiliary CAN network, for controlling whether the second terminal resistor is connected to the auxiliary CAN network.

3. The device according to claim 2, characterized in that The first input / output IO board includes four channels, namely a first IO channel, a second IO channel, a third IO channel and a fourth IO channel; wherein the first IO channel is connected to the first relay, the second IO channel is connected to the second relay, the third IO channel is connected to the third relay, and the fourth IO channel is connected to the fourth relay.

4. The device according to claim 2, characterized in that The real-time processor includes an IO input-output model; the IO input-output model is used to drive the first IO board.

5. The device according to claim 1, characterized in that The CAN board includes at least three channels, namely a first board channel, a second board channel and a third board channel; the first board channel is connected to the main CAN network, the second board channel is connected to the auxiliary CAN network, and the third board channel is connected to the main CAN network through a fifth relay, and the fifth relay is connected to the fifth IO channel of the second input and output IO board.

6. The device according to claim 5, characterized in that The real-time processor also includes: a first CAN virtual gateway model, a second CAN virtual gateway model, a third CAN virtual gateway model and an IO input and output model; The first CAN virtual gateway model is used to drive the first board channel; The second CAN virtual gateway model is used to drive the second board channel; The third CAN virtual gateway model is used to drive the third board channel; The IO input-output model is used to drive the second IO board.

7. A CAN bus fault injection method, characterized in that: include: The real-time processor drives the CAN board to obtain fault signals; The CAN board injects the fault signal into a first controller connected to the main CAN network through the main CAN network; The real-time processor drives the CAN board to simulate CAN signal failure and bus shutdown failure by modifying the CAN signal value or the sending cycle or the check bit value in the process of forwarding the CAN signal in the auxiliary CAN network to the main CAN network; or The real-time processor drives the CAN board to not forward the signal on the auxiliary CAN network to the main CAN network to simulate the CAN signal loss fault; or, The real-time processor drives the CAN board to simulate CAN signal failure and bus shutdown failure by modifying the CAN signal value or the sending cycle or the check bit value when forwarding the CAN signal in the main CAN network to the auxiliary CAN network; or The real-time processor drives the CAN board to not forward the signal on the main CAN network to the auxiliary CAN network to simulate the CAN signal loss fault.

8. The method according to claim 7, characterized in that The real-time processor drives the CAN board to obtain fault signals, including: A control signal generated by a second controller connected to the auxiliary CAN network is transmitted to the CAN board through the auxiliary CAN network; a real-time processor drives the CAN board to modify the control signal to obtain a fault signal.

9. The method according to claim 8, characterized in that Also includes: The real-time processor drives the CAN board to generate an analog control signal, and inputs the analog control signal into the first controller of the main CAN network through the main CAN network.

10. The method according to claim 7, characterized in that The fault signal is any one of the following types: a CAN signal value error fault, a CAN signal loss fault, a bus shutdown fault, a CAN signal sending cycle error fault, and a CAN signal data length error fault.