System and method for hardware-in-loop testing
By introducing switching modules into the hardware to the ring test system and adjusting the real-time working mode, the problem of insufficient resource use is solved, and a more flexible and efficient testing process is achieved, adapting to the testing needs of complex vehicle control systems.
Patent Information
- Application Number
- CN202411482542.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-23
- Publication Date
- 2025-02-18
AI Technical Summary
The hardware in-ring testing system resources are insufficient, and the system resources cannot be fully utilized. The test process is relatively single, and it cannot adapt to the complex testing needs of the vehicle control system.
A hardware-in-loop testing system is designed, including the first host computer, the first real-time, the second real-time, the board box and the program-controlled power supply. By switching modules, the working mode of real-time is adjusted to realize dual real-time or single real-time. The control mode of the machine is switched and the test resources are dynamically allocated.
It realizes the full utilization of the resources of the hardware-in-loop testing system, improves testing flexibility and efficiency, can adapt to test scenarios of different complexities, shortens the test cycle, and improves the reliability and safety of the vehicle control system.
Smart Images

Figure CN119472586A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of automobile technology, specifically to technical fields such as electric vehicle testing technology, and particularly to a system and method for hardware-in-the-loop testing. Background Art
[0002] The Hardware-in-the-Loop (HIL) system plays a key role in the development of new energy vehicles. It can comprehensively test and verify complex vehicle control systems without relying on actual vehicles and environments. This not only greatly shortens the development cycle and reduces testing costs, but also improves the reliability and safety of the vehicle control system in the early design stage.
[0003] At present, most hardware-in-the-loop test systems reserve a large number of signal channels for the controller to be tested, resulting in resource redundancy. However, the hardware-in-the-loop test system can only perform a single test on a single controller, and the test process is relatively simple, which cannot fully utilize the resources of the hardware-in-the-loop test system. Summary of the invention
[0004] The present application provides a system and method for hardware-in-the-loop testing, which can solve the problem of insufficient resource utilization of the hardware-in-the-loop testing system. The technical solution is as follows:
[0005] In a first aspect, a system for hardware-in-the-loop testing is provided, the system comprising: a first host computer, a first real-time machine, a second real-time machine, a board box, and a programmable power supply;
[0006] The first host computer is connected to the first real-time machine and is used to send a real-time machine switching instruction to the first real-time machine;
[0007] The board box includes a first board group, a second board group, a first switching module and a second switching module, wherein the first switching module is arranged between the first board group and the second board group, the second switching module is arranged between the second board group and the backplane of the board box, and the first switching module and the second switching module are used to adjust the working modes of the first real-time machine and the second real-time machine;
[0008] The first real-time machine and the second real-time machine are connected to the board box respectively, wherein the first real-time machine is used to receive the real-time machine switching instruction and control the switch states of the first switching module and the second switching module through the first board group, and the second real-time machine is used to control the second board group;
[0009] The programmable power supply is a dual-channel programmable power supply, which is used to supply power to the controller to be tested.
[0010] In a possible implementation, the first real-time machine is used to determine a first level signal output to the first switching module and a second level signal output to the second switching module based on the received real-time machine switching instruction;
[0011] Based on the first level signal and the second level signal, the switch states of the first switching module and the second switching module are controlled to adjust the working modes of the first real-time machine and the second real-time machine based on the switch states of the first switching module and the second switching module.
[0012] In a possible implementation manner, the first real-time machine is used to:
[0013] In response to the real-time machine switching instruction being to switch to the dual real-time machine control mode, determining that the first level signal output to the first switching module is a low level signal and the second level signal output to the second switching module is a high level signal;
[0014] Based on the low-level signal, the switch state of the first switching module is controlled to be an off state, and based on the high-level signal, the switch state of the second switching module is controlled to be an off state, so as to adjust the working modes of the first real-time machine and the second real-time machine to a dual real-time machine control mode based on the first switching module in the off state and the second switching module in the off state.
[0015] In a possible implementation manner, the first real-time machine is further configured to:
[0016] In response to the real-time machine switching instruction being to switch to a single real-time machine control mode, determining that a first level signal output to the first switching module is a high level signal and a second level signal output to the second switching module is a low level;
[0017] Based on the high-level signal, the switch state of the first switching module is controlled to be a closed state, and based on the low-level signal, the switch state of the second switching module is controlled to be a disconnected state, so as to adjust the working modes of the first real-time machine and the second real-time machine to a single real-time machine control mode based on the first switching module in the closed state and the second switching module in the disconnected state.
[0018] In a possible implementation, the system further includes a second host computer;
[0019] The second host computer is connected to the second real-time machine and is used to send a controller test task to the second real-time machine.
[0020] In a possible implementation, the first board group includes a digital signal board, and the digital signal board is used to output a level signal determined based on the real-time machine switching instruction to the first switching module and the second switching module.
[0021] In a possible implementation, the system further includes a power-on control box, a fault injection module, and a signal box;
[0022] The power-on control box is used to supply power to the first real-time machine, the second real-time machine, the board box, the fault injection module, the signal box and the programmable power supply;
[0023] The fault injection module communicates with the first real-time machine, the second real-time machine, the board box, the signal box, and the controller to be tested respectively, and is used to provide a simulated fault signal for the fault test of the controller to be tested.
[0024] In a possible implementation, the first switching module and the second switching module are both relays.
[0025] In a second aspect, a method for hardware-in-the-loop testing is provided, the method being applied to a system for hardware-in-the-loop testing as described in any one of the above aspects and implementations, the system for hardware-in-the-loop testing comprising a first host computer, a first real-time machine, a second real-time machine, a board box, and a programmable power supply, the method comprising:
[0026] The first host computer sends a real-time machine switching instruction to the first real-time machine;
[0027] The first real-time machine receives the real-time machine switching instruction;
[0028] The first real-time machine controls the switch states of the first switching module and the second switching module in the board box based on the real-time machine switching instruction, so as to adjust the working modes of the first real-time machine and the second real-time machine based on the switch states.
[0029] In a possible implementation manner, before the first host computer sends the real-time machine switching instruction to the first real-time machine, the method further includes:
[0030] In response to the controller to be tested being the first controller, determining that the real-time machine switching instruction is to switch to a single real-time machine control mode; the number of signals corresponding to the first controller is greater than a preset first number threshold;
[0031] In response to the controller to be tested being the second controller, it is determined that the real-time machine switching instruction is to switch to the dual real-time machine control mode, and the number of signals corresponding to the second controller is less than a preset second number threshold.
[0032] The beneficial effects of the technical solution provided by this application include at least:
[0033] It can be seen from the above technical scheme that the system for hardware-in-the-loop testing in the embodiment of the present application includes a first host computer, a first real-time machine, a second real-time machine, a board box, and a programmable power supply. The first host computer is connected to the first real-time machine and is used to send a real-time machine switching instruction to the first real-time machine. The board box includes a first board group, a second board group, a first switching module and a second switching module, wherein the first switching module is arranged between the first board group and the second board group, and the second switching module is arranged between the second board group and the backplane of the board box. The first switching module and the second switching module are used to adjust the working modes of the first real-time machine and the second real-time machine. The first real-time machine and the second real-time machine are respectively connected to the board box, wherein the first real-time machine is used to connect Receive the real-time machine switching instruction, and control the switching states of the first switching module and the second switching module through the first board group, the second real-time machine is used to control the second board group, and the programmable power supply is a dual-channel programmable power supply, which is used to power the controller to be tested. Since the hardware-in-the-loop test system can include the first real-time machine and the second real-time machine, and the working modes of the first real-time machine and the second real-time machine can be adjusted by the first switching module and the second switching module arranged in the board box, the switching of the working modes of the two real-time machines can be realized based on different actual test requirements, and a real-time machine can be dynamically selected to centrally control all test resources, or different test tasks can be assigned to the two real-time machines for processing, which improves the test flexibility of the hardware-in-the-loop test system while making full use of the hardware resources of the system.
[0034] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0036] Figure 1 is a schematic diagram of a system for hardware-in-the-loop testing provided by an embodiment of the present application;
[0037] Figure 2 is a schematic diagram of a system for hardware-in-the-loop testing provided by another embodiment of the present application;
[0038] Figure 3is a schematic diagram of a real-time machine switching principle provided by another embodiment of the present application;
[0039] Figure 4 is a structural schematic diagram of a switching module provided in another embodiment of the present application;
[0040] Figure 5 is a schematic diagram of an application scenario of a hardware-in-the-loop test system provided by another embodiment of the present application;
[0041] Figure 6 is a schematic diagram of another application scenario of a hardware-in-the-loop test system provided by another embodiment of the present application;
[0042] Figure 7 It is a flowchart of a method for hardware-in-the-loop testing provided in yet another embodiment of the present application. DETAILED DESCRIPTION
[0043] The following is a description of exemplary embodiments of the present application in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present application. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0044] Obviously, the described embodiments are only part of the embodiments of the present application, but not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0045] It should be noted that the terminal devices involved in the embodiments of the present application may include but are not limited to mobile phones, personal digital assistants (PDAs), wireless handheld devices, tablet computers and other smart devices; display devices may include but are not limited to personal computers, televisions and other devices with display functions.
[0046] In addition, the term "and / or" in this article is only a description of the association relationship between the associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0047] Please refer to Figure 1, which shows a schematic diagram of a hardware-in-the-loop test system provided by an embodiment of the present application. The hardware-in-the-loop test system 100 may specifically include a first host computer 101, a first real-time machine 102, a second real-time machine 103, a board box 104, and a programmable power supply 105.
[0048] In this implementation, the first host computer 101 can be connected to the first real-time machine 102. The first host computer 101 is used to send a real-time machine switching instruction to the first real-time machine 102.
[0049] The board box 104 may include a first board group, a second board group, a first switching module, and a second switching module. The first switching module is disposed between the first board group and the second board group, and the second switching module is disposed between the second board group and the backplane of the board box 104. The first switching module and the second switching module may be used to adjust the working modes of the first real-time machine 102 and the second real-time machine 103.
[0050] The first real-time machine 102 and the second real-time machine 103 are respectively connected to the board box 104. The first real-time machine 102 is used to receive the real-time machine switching instruction and control the switch states of the first switching module and the second switching module through the first board group, and the second real-time machine 103 is used to control the second board group.
[0051] The program-controlled power supply 105 may be a dual-channel program-controlled power supply for supplying power to the controller to be tested. The program-controlled power supply may also be connected to the first real-time machine 102 and the second real-time machine 103 respectively.
[0052] It should be noted that the controller to be tested may include a first controller and a second controller. The first controller may include a controller with a large signal volume such as a power domain controller. The second controller may include a controller with a small signal volume such as a gateway controller and an automatic transmission controller (Transmission Control Unit, TCU). The first real-time machine may be used to test the first controller. The first real-time machine and the second real-time machine may be used to control two second controllers simultaneously.
[0053] It should be noted that, here, the first real-time machine is connected to the first board group, and the second real-time machine is connected to the second board group. The first real-time machine can be connected to the first board group through a backplane in the board box. The second real-time machine can be connected to the second switching module through another backplane in the board box.
[0054] Optionally, in a possible implementation of the present embodiment, the first real-time machine can be specifically used to determine a first level signal output to the first switching module and a second level signal output to the second switching module based on the received real-time machine switching instruction, and control the switching states of the first switching module and the second switching module based on the first level signal and the second level signal, so as to adjust the working modes of the first real-time machine and the second real-time machine based on the switching states of the first switching module and the second switching module.
[0055] In a specific implementation process of this implementation method, the first real-time machine can also be used to respond to the real-time machine switching instruction to switch to the dual real-time machine control mode, determine that the first level signal output to the first switching module is a low level signal and the second level signal output to the second switching module is a high level signal, and based on the low level signal, control the switch state of the first switching module to be an off state, and based on the high level signal, control the switch state of the second switching module to be an off state, so as to adjust the working modes of the first real-time machine and the second real-time machine to the dual real-time machine control mode based on the first switching module in the off state and the second switching module in the off state.
[0056] Here, the dual real-time machine control mode may be a working mode in which the first real-time machine and the second real-time machine are controlled in parallel.
[0057] It is understandable that the first real-time machine and the second real-time machine can execute the test tasks issued by the host computer in parallel on different controllers to be tested. The first real-time machine and the second real-time machine can execute the test tasks in an existing test manner, which is not specifically limited here.
[0058] In another specific implementation process of this implementation method, the first real-time machine can also be used to respond to the real-time machine switching instruction to switch to the single real-time machine control mode, determine that the first level signal output to the first switching module is a high level signal and the second level signal output to the second switching module is a low level, and based on the high level signal, control the switch state of the first switching module to be a closed state, and based on the low level signal, control the switch state of the second switching module to be a disconnected state, so as to adjust the working modes of the first real-time machine and the second real-time machine to the single real-time machine control mode based on the first switching module in the closed state and the second switching module in the disconnected state.
[0059] Here, the single real-time machine control mode may be a working mode in which the first real-time machine is controlled alone.
[0060] Optionally, in a possible implementation of this embodiment, the hardware-in-the-loop test system may further include a second host computer. The second host computer is connected to the second real-time machine and is used to send the controller test task to the second real-time machine.
[0061] In a specific implementation process of this implementation method, in response to adjusting the working modes of the first real-time machine and the second real-time machine to a dual real-time machine control mode, the first host computer is connected to the first real-time machine and can be used to send a controller test task to the first real-time machine, and the second host computer is connected to the second real-time machine and can be used to send a controller test task to the second real-time machine.
[0062] In this way, one controller to be tested can be tested by the first host computer and the first real-time machine, while another controller to be tested can be tested by the second host computer and the second real-time machine.
[0063] Optionally, in a possible implementation of this embodiment, the first board group includes a digital signal board, and the digital signal board can be used to output a level signal determined based on the real-time machine switching instruction to the first switching module and the second switching module.
[0064] Here, the digital signal board may include a digital signal acquisition board and a digital signal output board.
[0065] Optionally, in a possible implementation of this embodiment, the second board group may also include a digital signal board.
[0066] Optionally, in a possible implementation of this embodiment, the hardware-in-the-loop test system may further include a power-on control box, a fault injection module and a signal box.
[0067] Here, the power-on control box can be used to supply power to the first real-time machine, the second real-time machine, the card box, the fault injection module, the signal box and the programmable power supply. The power-on control box can be connected to a 220 volt power supply.
[0068] The fault injection module can be respectively connected to the first real-time machine, the second real-time machine, the card box, the signal box, and the controller to be tested for communication. The fault injection module is used to provide a simulated fault signal for the fault test of the controller to be tested.
[0069] Optionally, in a possible implementation of this embodiment, the first switching module may be a relay, and the second switching module may also be a relay.
[0070] Figure 2This is a schematic diagram of the structure of a hardware-in-the-loop test system provided by another embodiment of the present application. In order to better understand the system of the embodiment of the present application, the following is a schematic diagram of the structure of a hardware-in-the-loop test system provided by another embodiment of the present application. Figure 2 The system of the embodiment of the present application is described with reference to specific application scenarios.
[0071] like Figure 2 As shown, in an embodiment of the present application, the system 200 for hardware-in-the-loop testing may include a first host computer 201, a second host computer 202, a first real-time machine 203, a second real-time machine 204, a board box 205, a fault injection module 206, a signal box 207, a programmable power supply 208 and a power-on control box 209.
[0072] In this embodiment, if Figure 2 As shown, the first host computer 201 can be connected to the first real-time machine 203. The first host computer 201 is used to send a real-time machine switching instruction to the first real-time machine 203. The second host computer 202 can be connected to the second real-time machine 204. The second host computer 202 can be used to send a test task to the second real-time machine 204.
[0073] The first real-time machine 203 and the second real-time machine 204 are respectively connected to the board box 205. The first real-time machine 203 can be connected to the board box 205 through the first backplane. The second real-time machine 204 can be connected to the board box 205 through the second backplane. The first real-time machine 102 is used to receive the real-time machine switching instruction and control the switch states of the first switching module and the second switching module through the first board group, and the second real-time machine 204 can be used to control the second board group.
[0074] The program-controlled power supply 208 may be a dual-channel program-controlled power supply for supplying power to the controller to be tested. The program-controlled power supply may also be connected to the first real-time machine 203 and the second real-time machine 204, respectively.
[0075] The power-on control box 209 can be used to supply power to the first real-time machine 203, the second real-time machine 204, the card box 205, the fault injection module 206, the signal box 207, and the program-controlled power supply 208. The power-on control box 209 can be connected to a 220 volt power supply.
[0076] In this embodiment, if Figure 2 As shown, the board box 205 may include a first backplane, a second backplane, a first board group, a second board group, a first switching module, and a second switching module.
[0077] In this embodiment, the first board group and the second board group may include the same multiple types of boards.
[0078] Specifically, the first board group may include a bus communication board and an IO board, wherein the bus communication board may include a CAN board and a LIN board; the IO board may include an output board and an acquisition board. The output board may include a resistance analog signal output board, a voltage signal output board, a digital signal output board, and a pulse width modulation (PWM) signal output board. The acquisition board may include a digital signal acquisition board, a voltage signal acquisition board, and a PWM signal acquisition board.
[0079] Here, the second board group may also include a bus communication board and an IO board, wherein the bus communication board may include a CAN board and a LIN board; the IO board may include an output board and an acquisition board. The output board may include a resistance analog signal output board, a voltage signal output board, a digital signal output board, and a PWM signal output board. The acquisition board may include a digital signal acquisition board, a voltage signal acquisition board, and a PWM signal acquisition board.
[0080] In this embodiment, the first switching module and the second switching module arranged inside the board box can constitute a real-time machine switching module, and the real-time machine switching module can be used to implement the switching of the working modes of the first real-time machine and the second real-time machine.
[0081] In this embodiment, Figure 3 is a schematic diagram of a real-time machine switching principle provided by another embodiment of the present application, such as Figure 3 As shown, the real-time machine switching module includes a first switching module and a second switching module. The first host computer can be connected to the first real-time machine through a network cable, and the first real-time machine can be connected to the RJ45 interface of the first backplane of the board box through the network cable, and the first backplane can be connected to the first board group. The second host computer can be connected to the second real-time machine through a network cable, and the second real-time machine can be connected to the RJ45 interface of the second backplane of the board box through the network cable, and the second backplane can be connected to the second board group through the second switching module. The first switching module is arranged between the first board group and the second board group, and the connection interface of the first board group and the second board group can also be an RJ45 interface.
[0082] Here, the first switching module and the second switching module may both be relays.
[0083] Figure 4 is a structural diagram of a switching module provided in another embodiment of the present application, such as Figure 4As shown, the first switching module and the second switching module can both control the switch state through digital signals. The high-level signal of the digital signal can control the coil in the switching module to drive the switch on the input-output line to close; the low-level signal of the digital signal can control the coil in the switching module to drive the switch on the input-output line to open.
[0084] In this embodiment, further, the first real-time machine, the second real-time machine, the board box, the fault injection module, the signal box, the programmable power supply and the power-on control box can be arranged on a hardware-in-the-loop test bench.
[0085] For example, Figure 5 is a schematic diagram of an application scenario of a hardware-in-the-loop test system provided by another embodiment of the present application, such as Figure 5 As shown in the figure, in this application scenario, the hardware-in-the-loop test bench is equipped with real-time machine-A, real-time machine-B, board box, fault injection module, signal box, programmable power supply and power-on control box. The controller-1 under test and the controller-2 under test are connected to the hardware-in-the-loop test bench through wiring harnesses. The host computer-A and the host computer-B are connected to the hardware-in-the-loop test bench through network cables.
[0086] Here, the upper computer-A can send a command to switch to the dual real-time machine control mode to the real-time machine-A, and the real-time machine-A controls the output of a low-level digital signal to drive the first switching module in the card box to disconnect; the real-time machine-A controls the output of a high-level digital signal to drive the second switching module in the card box to close. Based on the first switching module in the disconnected state and the second switching module in the closed state, the working mode of the real-time machine-A and the second real-time machine-B is adjusted to the dual real-time machine control mode.
[0087] It can be understood that the host computer-A can be the first host computer, the real-time machine-A can be the first real-time machine, the host computer-B can be the second host computer, and the real-time machine-B can be the second real-time machine.
[0088] Here, if Figure 2 and Figure 3 As shown, when the first switching module is disconnected and the second switching module is closed, the second real-time machine is connected to the second board group, and the link between the first real-time machine and the first board group and the link between the second real-time machine and the second board group are in parallel. At this time, the working mode of the real-time machine is the working mode of the dual real-time machine control mode, which can be the working mode of the first real-time machine and the second real-time machine in parallel control. Through the first host computer and the first real-time machine, and the second host computer and the second real-time machine, two different controllers to be tested-1 and controllers to be tested-2 can be tested in parallel at the same time.
[0089] Figure 6is a schematic diagram of another application scenario of a hardware-in-the-loop test system provided by another embodiment of the present application, such as Figure 6 As shown in the figure, in this application scenario, the hardware-in-the-loop test bench is equipped with real-time machine-A, real-time machine-B, board box, fault injection module, signal box, programmable power supply and power-on control box. The controller-1 to be tested is connected to the hardware-in-the-loop test bench through a wire harness. The host computer-A and the host computer-B are connected to the hardware-in-the-loop test bench through network cables.
[0090] Here, the host computer-A can send a command to switch to the single real-time machine control mode to the real-time machine-A, and the real-time machine-A controls the output of a high-level digital signal to drive the first switching module in the board box to close; the real-time machine-A controls the output of a low-level digital signal to drive the second switching module in the board box to open. Based on the first switching module in the closed state and the second switching module in the open state, the working mode of the real-time machine-A and the second real-time machine-B is adjusted to the single real-time machine control mode, that is, the real-time machine-A is used to test the controller to be tested.
[0091] It can be understood that the host computer-A can be the first host computer, and the real-time machine-A can be the first real-time machine.
[0092] Here, if Figure 2 and Figure 3 As shown, when the first switching module is closed and the second switching module is disconnected, the first real-time machine is connected to the first board group and the second real-time machine is disconnected from the second board group. At this time, the working mode of the real-time machine is the working mode controlled by the first real-time machine alone. The controller to be tested can be tested by the first host computer and the first real-time machine. The controller to be tested can be a controller with a large amount of processed signals.
[0093] In addition, the first real-time machine can be used to control the first board group and the second board group, and the first real-time machine can be used to control the second board group.
[0094] In this embodiment, the host computer can be used to run the experiment management software and the automated test software. The host computer connected to the first real-time machine can control the switching of the working mode of the real-time machine by running the experiment management software, that is, issue a real-time machine switching instruction.
[0095] In this embodiment, the program-controlled power supply can be a dual-channel controllable power supply. The two channels can be connected to the first real-time machine and the second real-time machine respectively through the serial RS232 interface, so that a single channel can be controlled by a single real-time machine.
[0096] In this embodiment, the power-on control box, i.e., the power distribution unit, can provide a power supply control strategy for the entire hardware-in-the-loop test bench, for example, power supply for the programmable power supply, real-time host, board, etc., and can realize the functions of controlling, distributing, and protecting the AC power supply of the hardware-in-the-loop test system. The power-on control box, i.e., the power distribution unit, controls the power supply of the equipment, and provides necessary voltage protection while supplying power to each test component and the system under test. In order to ensure the personal safety of the test personnel, the switch operation of the cabinet system is realized by using weak current to control strong current. The power distribution unit can include a manual switch (system power supply), an air switch (overload protection), an emergency switch (emergency power off), etc., to realize the control and management of the input AC power.
[0097] In this embodiment, the fault injection module is mainly used for fault diagnosis testing of the controller, providing the hardware-in-the-loop test system with simulated fault signals such as analog quantity, switch quantity, power input, balance, sampling line break fault, insulation detection fault, communication signal, etc. When a fault occurs, the controller can correctly detect it and respond.
[0098] Here, the fault types provided by the fault injection module may include but are not limited to open circuit, short circuit to power supply, short circuit to ground, short circuit between signals, and a combination of the above faults.
[0099] In this embodiment, the signal box, i.e., the wire break test box (BOB), can be mainly responsible for the signal interaction between the controller and the hardware-in-the-loop test bench. The output signal of the controller includes IO hard line (digital quantity, PWM and other signal tests) and communication (CAN, LIN and other signal tests). The input signal of the controller includes IO hard line (digital quantity, PWM and other signal production) and communication (CAN, LIN and other signal production). The signal box can be used as a medium to connect the hardware-in-the-loop test bench with the controller through a wiring harness, that is, the hardware-in-the-loop test bench end connector at one end of the wiring harness and the controller connector at the other end.
[0100] In this way, the system using the hardware-in-the-loop test in this embodiment can dynamically select a real-time machine to centrally control all resources, or assign different test tasks to two real-time machines for parallel processing according to actual test requirements. This flexible resource scheduling method can adapt to test scenarios of different complexities, thereby meeting more test requirements.
[0101] In addition, in the system using the hardware-in-the-loop test in this embodiment, in parallel mode, two real-time machines can run different test tasks at the same time, and perform concurrent tests on multiple controllers or multiple test items, thereby shortening the test cycle and significantly improving the test efficiency. If one real-time machine fails, the other real-time machine can take over all or part of the tasks to ensure that the test process is not interrupted, thereby improving the reliability and fault tolerance of the system.
[0102] In addition, the system using the hardware-in-the-loop test in this embodiment can control all board resources by one real-time machine or by two real-time machines by setting a first board group corresponding to the first real-time machine and a second board group corresponding to the second real-time machine. In this way, by flexibly allocating board resources, idleness or waste of resources can be avoided. When a single test task requires a large number of board resources, the system can concentrate all board resources, and when multiple tasks are performed in parallel, the board resources can be reasonably split to maximize the use of hardware resources.
[0103] Figure 7 FIG. 1 is a flow chart of a method for hardware-in-the-loop testing provided by another embodiment of the present application. Figure 7 In this embodiment, the hardware-in-the-loop test method is applied to the hardware-in-the-loop test system as described in the above embodiment, the hardware-in-the-loop test system, the hardware-in-the-loop test system includes a first host computer, a first real-time machine, a second real-time machine, a board box, and a program-controlled power supply, and the hardware-in-the-loop test method may include:
[0104] Step 701: The first host computer sends a real-time machine switching instruction to the first real-time machine.
[0105] Step 702: The first real-time machine receives the real-time machine switching instruction.
[0106] Step 703: The first real-time machine controls the switch states of the first switching module and the second switching module in the board box based on the real-time machine switching instruction, so as to adjust the working modes of the first real-time machine and the second real-time machine based on the switch states.
[0107] In this way, the working modes of the first real-time machine and the second real-time machine of the hardware-in-the-loop test system can be adjusted through the first real-time machine, the second real-time machine, and the first switching module and the second switching module arranged in the board box. The working modes of the two real-time machines can be switched based on different actual testing requirements. One real-time machine can be dynamically selected to centrally control all test resources, or different test tasks can be assigned to the two real-time machines for processing. This improves the testing flexibility of the hardware-in-the-loop test system while making full use of the hardware resources of the system.
[0108] Optionally, in a possible implementation of the present embodiment, before step 701, further, in response to the controller to be tested being a first controller, the real-time machine switching instruction can be determined to be switching to a single real-time machine control mode; the number of signals corresponding to the first controller is greater than a preset first quantity threshold, or, in response to the controller to be tested being a second controller, the real-time machine switching instruction can be determined to be switching to a dual real-time machine control mode, and the number of signals corresponding to the second controller is less than a preset second quantity threshold.
[0109] Here, the preset first quantity threshold and the preset second quantity threshold may be determined by the test resources of the hardware-in-the-loop test system. The preset first quantity threshold and the preset second quantity threshold may be the same or different. The first controller may be a controller that can process a larger amount of signals, such as a power domain controller. The second controller may be a controller that can process a smaller amount of signals, such as a gateway controller.
[0110] Optionally, in a possible implementation of the present embodiment, in step 703, the first real-time machine may determine a first level signal output to the first switching module and a second level signal output to the second switching module based on the received real-time machine switching instruction, and control the switching states of the first switching module and the second switching module based on the first level signal and the second level signal, so as to adjust the working modes of the first real-time machine and the second real-time machine based on the switching states of the first switching module and the second switching module.
[0111] In a specific implementation process of this implementation method, the first real-time machine can also respond to the real-time machine switching instruction to switch to the dual real-time machine control mode, determine that the first level signal output to the first switching module is a low level signal and the second level signal output to the second switching module is a high level signal, and based on the low level signal, control the switch state of the first switching module to be an off state, and based on the high level signal, control the switch state of the second switching module to be an off state, so as to adjust the working modes of the first real-time machine and the second real-time machine to the dual real-time machine control mode based on the first switching module in the off state and the second switching module in the off state.
[0112] Here, the dual real-time machine control mode may be a working mode in which the first real-time machine and the second real-time machine are controlled in parallel.
[0113] In another specific implementation process of this implementation method, the first real-time machine can also respond to the real-time machine switching instruction to switch to the single real-time machine control mode, determine that the first level signal output to the first switching module is a high level signal and the second level signal output to the second switching module is a low level, and based on the high level signal, control the switch state of the first switching module to be a closed state, and based on the low level signal, control the switch state of the second switching module to be a disconnected state, so as to adjust the working modes of the first real-time machine and the second real-time machine to the single real-time machine control mode based on the first switching module in the closed state and the second switching module in the disconnected state.
[0114] Here, the single real-time machine control mode may be a working mode in which the first real-time machine is controlled alone.
[0115] Optionally, in a possible implementation of this embodiment, the hardware-in-the-loop test system may further include a second host computer. The second host computer is connected to the second real-time machine, and the second host computer may send a controller test task to the second real-time machine.
[0116] In a specific implementation process of this implementation method, in response to adjusting the working modes of the first real-time machine and the second real-time machine to a dual real-time machine control mode, the first host computer is connected to the first real-time machine, and a controller test task can be sent to the first real-time machine, and the second host computer is connected to the second real-time machine, and a controller test task can be sent to the second real-time machine.
[0117] In this way, one controller to be tested can be tested by the first host computer and the first real-time machine, while another controller to be tested can be tested by the second host computer and the second real-time machine.
[0118] Optionally, in a possible implementation of this embodiment, the first board group may include a digital signal board, and the digital signal board outputs a level signal determined based on the real-time machine switching instruction to the first switching module and the second switching module. The second board group may also include a digital signal board.
[0119] Optionally, in a possible implementation of this embodiment, the hardware-in-the-loop test system may further include a power-on control box, a fault injection module and a signal box.
[0120] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0121] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0122] In the technical solution of this application, the user personal information involved, such as the collection, storage, use, processing, transmission, provision and disclosure of user images and attribute data, etc., complies with the provisions of relevant laws and regulations and does not violate public order and good morals.
[0123] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0124] 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 recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution disclosed in this application can be achieved, and this document is not limited here.
[0125] The above specific implementations do not constitute a limitation on the protection scope of this application. 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 modifications, equivalent substitutions and improvements made within the spirit and principles of this application should be included in the protection scope of this application.
Claims
1. A hardware-in-the-loop testing system, characterized in that: The system comprises: a first host computer, a first real-time computer, a second real-time computer, a board box, and a program-controlled power supply; The first host computer is connected to the first real-time machine and is used to send a real-time machine switching instruction to the first real-time machine; The board box includes a first board group, a second board group, a first switching module and a second switching module, wherein the first switching module is arranged between the first board group and the second board group, the second switching module is arranged between the second board group and the backplane of the board box, and the first switching module and the second switching module are used to adjust the working modes of the first real-time machine and the second real-time machine; The first real-time machine and the second real-time machine are connected to the board box respectively, wherein the first real-time machine is used to receive the real-time machine switching instruction and control the switch states of the first switching module and the second switching module through the first board group, and the second real-time machine is used to control the second board group; The programmable power supply is a dual-channel programmable power supply, which is used to supply power to the controller to be tested.
2. The system according to claim 1, characterized in that The first real-time machine is used to determine a first level signal output to the first switching module and a second level signal output to the second switching module based on the received real-time machine switching instruction; Based on the first level signal and the second level signal, the switch states of the first switching module and the second switching module are controlled to adjust the working modes of the first real-time machine and the second real-time machine based on the switch states of the first switching module and the second switching module.
3. The system according to claim 2, characterized in that The first real-time machine is used for: In response to the real-time machine switching instruction being to switch to the dual real-time machine control mode, determining that the first level signal output to the first switching module is a low level signal and the second level signal output to the second switching module is a high level signal; Based on the low-level signal, the switch state of the first switching module is controlled to be an off state, and based on the high-level signal, the switch state of the second switching module is controlled to be an off state, so as to adjust the working modes of the first real-time machine and the second real-time machine to a dual real-time machine control mode based on the first switching module in the off state and the second switching module in the off state.
4. The system according to claim 2, characterized in that The first real-time machine is further used for: In response to the real-time machine switching instruction being to switch to a single real-time machine control mode, determining that a first level signal output to the first switching module is a high level signal and a second level signal output to the second switching module is a low level; Based on the high-level signal, the switch state of the first switching module is controlled to be a closed state, and based on the low-level signal, the switch state of the second switching module is controlled to be a disconnected state, so as to adjust the working modes of the first real-time machine and the second real-time machine to a single real-time machine control mode based on the first switching module in the closed state and the second switching module in the disconnected state.
5. The system according to claim 1, characterized in that The system also includes a second host computer; The second host computer is connected to the second real-time machine and is used to send a controller test task to the second real-time machine.
6. The system according to claim 1, characterized in that The first board group includes a digital signal board, and the digital signal board is used to output a level signal determined based on the real-time machine switching instruction to the first switching module and the second switching module.
7. The system according to claim 1, characterized in that The system also includes a power-on control box, a fault injection module and a signal box; The power-on control box is used to supply power to the first real-time machine, the second real-time machine, the board box, the fault injection module, the signal box and the programmable power supply; The fault injection module communicates with the first real-time machine, the second real-time machine, the board box, the signal box, and the controller to be tested respectively, and is used to provide a simulated fault signal for the fault test of the controller to be tested.
8. The system according to any one of claims 1 to 7, characterized in that: The first switching module and the second switching module are both relays.
9. A method for hardware-in-the-loop testing, characterized in that: The method is applied to a hardware-in-the-loop test system as described in any one of claims 1 to 8, wherein the hardware-in-the-loop test system comprises a first host computer, a first real-time machine, a second real-time machine, a board box, and a programmable power supply, and the method comprises: The first host computer sends a real-time machine switching instruction to the first real-time machine; The first real-time machine receives the real-time machine switching instruction; The first real-time machine controls the switch states of the first switching module and the second switching module in the board box based on the real-time machine switching instruction, so as to adjust the working modes of the first real-time machine and the second real-time machine based on the switch states.
10. The method according to claim 9, characterized in that Before the first host computer sends the real-time machine switching instruction to the first real-time machine, the method further includes: In response to the controller to be tested being the first controller, determining that the real-time machine switching instruction is to switch to a single real-time machine control mode; the number of signals corresponding to the first controller is greater than a preset first number threshold; In response to the controller to be tested being the second controller, it is determined that the real-time machine switching instruction is to switch to the dual real-time machine control mode, and the number of signals corresponding to the second controller is less than a preset second number threshold.
Citation Information
Cited By
Hardware-in-the-loop simulation equipment
CN121277156A