Device testing method and device, circuit, medium, and product based on a test circuit
By integrating multiple communication channels and switching circuits in the test circuit and controlling the access target channel using the upper computer signal, the problem of low testing efficiency of internal communication channels in the automobile is solved, and fast switching and stability testing are achieved.
Patent Information
- Application Number
- CN202510629773.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-16
- Publication Date
- 2025-08-05
- Estimated Expiration
- 2045-05-16
AI Technical Summary
In the prior art, the testing efficiency of the internal communication channel of the automobile is low, making it difficult to meet the needs of equipment testing in complex scenarios, and the original data service is affected when switching the communication channel.
By integrating multiple communication channels in the test circuit, each channel has corresponding communication protocols and switching circuits, the target channel is determined by sending signals from the upper computer, and the switching circuit is controlled to connect to the target channel, achieving rapid switching and data forwarding, ensuring the stability of the original data service.
It realizes that the communication channel is quickly switched to test without affecting the original data service, which improves the testing efficiency and ensures the service continuity of the equipment to be tested and the stability of the data service.
Smart Images

Figure CN120151262B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of circuit testing technology, and in particular to a control method, a test circuit, a device, a medium, and a product based on a test circuit. Background Art
[0002] As cars become more and more intelligent, the design of communication channels inside cars is becoming more and more complex.
[0003] Based on varying communication and performance requirements, vehicles utilize communication channels based on various protocols, such as CAN (Controller Area Network), LIN (Local Interconnect Network), FlexRay, and Ethernet. Testing of in-vehicle devices is necessary to verify their safety when failures occur on these different communication channels.
[0004] In the prior art, the fault injection device must be manually connected to different communication channels to test the device under test. When a channel switch is needed, the wiring harness connecting the current channel is disconnected and connected to another channel. However, this approach severely impacts test efficiency and is difficult to meet the needs of complex device testing scenarios. Summary of the Invention
[0005] In view of the above problems, a device testing method and apparatus, circuit, medium, and product based on a test circuit are proposed to overcome or at least partially solve the above problems, including:
[0006] A device testing method based on a test circuit, wherein the test circuit is respectively connected to a host computer, multiple electronic units, and a device to be tested, the test circuit includes multiple communication channels, each communication channel has a corresponding communication protocol, and each communication channel is provided with a switch circuit, the switch circuit is connected to the host computer, and the device to be tested transmits data with the multiple electronic units through the multiple communication channels. The method includes:
[0007] determining a target communication channel from the plurality of communication channels according to the first signal sent by the host computer;
[0008] Controlling a target switch circuit within the target communication channel to connect the host computer to the target communication channel; wherein the host computer is used to forward data transmitted by the target communication channel and / or to test the device to be tested based on a communication protocol corresponding to the target communication channel.
[0009] Optionally, determining a target communication channel from the multiple communication channels according to the first signal sent by the host computer includes:
[0010] determining target attribute information of the first signal;
[0011] According to a preset mapping relationship, a target communication channel corresponding to the target attribute information is determined from the multiple communication channels; wherein the mapping relationship represents a correspondence between the attribute information of the first signal and the multiple communication channels.
[0012] Optionally, each switching circuit is provided with a first switch and a second switch; wherein, the first end of the first switch is connected to the device to be tested, and the second end of the first switch is connected to the electronic unit through the second switch in different states of the first switch, or is connected to the host computer; the first end of the second switch is connected to the electronic unit, and the second end of the second switch is connected to the device to be tested through the first switch in different states of the second switch, or is connected to the host computer.
[0013] Optionally, controlling a target switch circuit in the target communication channel includes:
[0014] A second signal is sent to the target switch circuit to switch the states of the first switch and the second switch in the target switch circuit, so that the second end of the first switch in the target switch circuit is connected to the host computer, and the second end of the second switch in the target switch circuit is connected to the host computer.
[0015] Optionally, the host computer is further configured to generate test data based on data sent by the electronic unit corresponding to the target communication channel, and send the test data to the device to be tested, so as to test the device to be tested based on the communication protocol corresponding to the target communication channel.
[0016] Optionally, the first signal is a pulse width modulation signal, and the target attribute information is a duty cycle of the pulse width modulation signal.
[0017] Optionally, the test circuit further includes a power conversion module, the power conversion module is connected to the power supply of the vehicle, the device to be tested is an on-board device of the vehicle, and the electronic unit is an electronic control unit of the vehicle.
[0018] A test circuit is connected to a host computer, multiple electronic units, and a device to be tested. The test circuit includes a controller and multiple communication channels, each communication channel has a corresponding communication protocol, and each communication channel is provided with a switch circuit, the switch circuit is connected to the controller and the host computer, respectively. The device to be tested transmits data with the multiple electronic units through the multiple communication channels. The controller is used to:
[0019] determining a target communication channel from the plurality of communication channels according to the first signal sent by the host computer;
[0020] Controlling a target switch circuit within the target communication channel to connect the host computer to the target communication channel; wherein the host computer is used to forward data transmitted by the target communication channel and / or to test the device to be tested based on a communication protocol corresponding to the target communication channel.
[0021] Optionally, the test circuit also includes a power conversion module, one end of which is connected to the vehicle's power supply, and the other end is connected to the controller; the device to be tested is an on-board device of the vehicle, and the electronic unit is an electronic control unit of the vehicle.
[0022] A device testing apparatus based on a test circuit, wherein the test circuit is respectively connected to a host computer, multiple electronic units, and a device to be tested, the test circuit includes multiple communication channels, each communication channel has a corresponding communication protocol, and each communication channel is provided with a switching circuit, the switching circuit is connected to the host computer, and the device to be tested transmits data with the multiple electronic units through the multiple communication channels. The apparatus comprises:
[0023] a channel determination module, configured to determine a target communication channel from the plurality of communication channels according to the first signal sent by the host computer;
[0024] A channel processing module is used to control the target switch circuit in the target communication channel to connect the host computer to the target communication channel; wherein the host computer is used to forward data transmitted by the target communication channel and / or test the device to be tested based on the communication protocol corresponding to the target communication channel.
[0025] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the device testing method based on the test circuit is implemented.
[0026] A computer program product includes a computer program, which implements the above device testing method based on a test circuit when executed by a processor.
[0027] The embodiment of the present invention has the following advantages: by integrating multiple communication channels with corresponding communication protocols through the test circuit, data transmission services between the device to be tested and multiple electronic units can be carried out normally through these communication channels, and can also adapt to the test requirements of the device to be tested in different communication environments; by determining a target communication channel from multiple communication channels according to a first signal sent by a host computer, controlling a target switch circuit in the target communication channel, so as to connect the host computer to the target communication channel, and realize rapid switching of the communication channel targeted by the test requirement, without the need for manual access to the host computer, thereby greatly improving the efficiency of testing the device to be tested; moreover, after the host computer is connected to the target communication channel, since the states of the switch circuits corresponding to other communication channels except the target communication channel are unchanged, the original data transmission service logic can be maintained, and the target communication channel connected to the host computer can also forward data normally through the host computer, so that the original data services of the device to be tested and the multiple electronic units and the test on the target communication channel can be carried out in parallel, so that the test is carried out without affecting the original data services, thereby ensuring the service continuity of the device to be tested and the stability of the original data services. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the technical solution of the present invention, the following briefly introduces the drawings required for use in the description of the present invention. 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 paying any creative work.
[0029] Figure 1 This is a flowchart of a device testing method based on a test circuit provided by one embodiment of the present invention;
[0030] Figure 2 This is a connection diagram of a device to be tested and multiple relays provided by one embodiment of the present invention;
[0031] Figure 3 This is a schematic diagram of data forwarding performed by a host computer provided by one embodiment of the present invention;
[0032] Figure 4 This is a connection diagram of a device under test, multiple relays, and an ECU provided by one embodiment of the present invention;
[0033] Figure 5 This is a circuit diagram of a power conversion module provided by an embodiment of the present invention;
[0034] Figure 6 1 is a schematic diagram of the structure of a test circuit provided by an embodiment of the present invention;
[0035] Figure 7This is a structural diagram of a plug connector provided by one embodiment of the present invention;
[0036] Figure 8 This is a schematic diagram of a communication channel switching structure provided by an embodiment of the present invention;
[0037] Figure 9 This is a schematic diagram of an MCU circuit structure provided by an embodiment of the present invention;
[0038] Figure 10 This is a structural block diagram of a device testing apparatus based on a test circuit provided by one embodiment of the present invention. DETAILED DESCRIPTION
[0039] To make the above-mentioned objects, features, and advantages of the present invention more clearly understood, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the embodiments described are only a portion of the embodiments of the present invention, not all of them. All other embodiments derived by persons of ordinary skill in the art based on the embodiments of the present invention without inventive effort are also within the scope of protection of the present invention.
[0040] Reference Figure 1 , shows a flowchart of the steps of a device testing method based on a test circuit provided by an embodiment of the present invention. The test circuit is respectively connected to a host computer, multiple electronic units, and a device to be tested. The test circuit includes multiple communication channels, each communication channel has a corresponding communication protocol, and each communication channel is provided with a switching circuit. The switching circuit is connected to the host computer. The device to be tested transmits data with the multiple electronic units through the multiple communication channels. The device testing method may specifically include the following steps:
[0041] Step 101: determining a target communication channel from the plurality of communication channels according to a first signal sent by the host computer;
[0042] Step 102: Control the target switch circuit in the target communication channel to connect the host computer to the target communication channel; wherein the host computer is used to forward data transmitted by the target communication channel and / or test the device to be tested based on the communication protocol corresponding to the target communication channel.
[0043] Communication channel refers to the transmission channel of communication signals between devices. Each communication channel has a corresponding communication protocol, such as CAN, LIN, FlexRay, Ethernet, etc.
[0044] In actual applications, the interior of a car can be divided into different network segments through communication channels of different communication protocols. Each network segment has its specific function and application scenario, and together they constitute a complex communication network inside the car. For example, the CAN bus can include high-speed CAN and low-speed CAN. The high-speed CAN bus can be used in systems with high real-time requirements, such as engine control, transmission control, and intelligent driving system control. The low-speed CAN bus can be used in body control systems, such as window, door lock, and lighting control. The LIN bus has a single-master-multiple-slave architecture, enabling one master node to control multiple slave nodes. It is suitable for low-speed, low-cost communication and can be used in simple body control systems, such as seat adjustment and wiper control. The FlexRay bus can include high-bandwidth FlexRay and high-real-time FlexRay. The high-bandwidth FlexRay bus is used in systems with high bandwidth requirements, such as chassis control and active suspension systems, supporting large amounts of data transmission. The high-real-time FlexRay bus can be used in systems with high real-time requirements, such as braking systems and steering systems, meeting control systems with strict real-time requirements. Ethernet can be used in systems with high bandwidth requirements, such as Advanced Driver Assistance Systems (ADAS) and In-Vehicle Infotainment Systems (IVI).
[0045] By integrating multiple communication channels with corresponding communication protocols into the test circuit, the communication network environment inside the car can be simulated, making it easy to switch to the required target communication channel to test the device under test.
[0046] The upper computer refers to the equipment responsible for monitoring, managing and controlling the lower computer, such as the test equipment used for simulation testing; the lower computer may include various components or equipment within the test circuit, and may also include other equipment outside the test circuit, such as the device to be tested.
[0047] A switching circuit refers to a circuit that can control the on and off of a circuit, such as a relay circuit.
[0048] The device under test (DUT) is the device that needs to be tested, such as a controller in a vehicle's head unit system. By testing the DUT using the communication protocol corresponding to the target communication channel, the DUT's performance can be verified using that communication protocol.
[0049] The first signal may be any electronic signal, such as a level signal or a pulse signal, and is used to indicate relevant information of the target communication channel;
[0050] The electronic unit may specifically be any electronic unit with data transceiver functions, such as an electronic control unit (ECU), etc., which is used to interact with the device under test through a communication channel.
[0051] In the specific implementation, in the initial state, the device under test transmits data with the electronic unit through multiple communication channels of the test circuit and implements the corresponding data business logic. For example, the device under test sends control instructions to the electronic unit through the communication channel, so that the electronic unit performs the corresponding function; for example, the electronic unit feeds back data to the device under test for further processing by the device under test.
[0052] Furthermore, a first signal sent by the host computer is received, and a target communication channel is determined among multiple communication channels according to the first signal, and then a target switch circuit corresponding to the target communication channel is controlled to connect the host computer to the target communication channel.
[0053] At this time, since the switch circuit states corresponding to other communication channels except the target communication channel have not changed, and the physical circuit structure has not changed, connecting the host computer to the target communication channel does not affect the data transmission business of the device under test in other communication channels and other electronic units, nor does it affect the execution of corresponding functions by the device under test and the electronic units; moreover, the host computer can forward the data transmitted by the target communication channel, and the device under test can also maintain data business with the corresponding electronic unit through the target communication.
[0054] Furthermore, the host computer tests the equipment to be tested through the communication protocol of the target communication channel, so that the test can be carried out without affecting the original data service, so that the original data service and the target communication channel can be carried out in parallel, ensuring the continuity and stability of the data service.
[0055] In this embodiment, the target communication channel that needs to participate in the test of the device to be tested can be determined from multiple communication channels through the information indicated by the first signal, and then the host computer is connected to the target communication channel through the target switch circuit corresponding to the target communication channel, and the device to be tested is tested with a communication protocol based on the target communication channel; moreover, since the states of the switch circuits corresponding to other communication channels except the target communication channel have not changed, the business logic of the original data transmission of these communication channels can be maintained, the target communication channel can also forward data through the host computer, and the original data transmission between the device to be tested and the electronic unit and the test of the target communication channel can be carried out in parallel, so that the test can be carried out without affecting the original data business, thereby ensuring the business continuity of the device to be tested and the stability of the original data business.
[0056] In some examples, a controller (e.g., a microcontroller unit (MCU)) can be provided in the test circuit. The controller is connected to the switches of each communication channel and to a host computer. The controller receives a first signal sent by the host computer and connects the host computer to the target communication channel.
[0057] Specifically, in the initial state, the switch circuit of each communication channel is disconnected from the host computer, and the device under test and multiple electronic units transmit data normally through the communication channel. The controller receives a first signal from the host computer and, based on the information indicated by the first signal, determines a target communication channel from the multiple communication channels and controls the target switch circuit of the target communication channel. By changing the state of the switch circuit, the host computer is connected to the target communication channel, achieving connectivity between the host computer, the electronic unit, and the device under test. Simultaneously, the host computer can forward data within the target communication channel without affecting data transmission between the device under test and the electronic unit via the target communication channel. The switch circuit states corresponding to other communication channels remain unchanged, and the corresponding data transmission services, allowing testing and the original data transmission services to proceed in parallel.
[0058] In some embodiments of the present invention, determining the target communication channel from the multiple communication channels according to the first signal sent by the host computer includes:
[0059] determining target attribute information of the first signal;
[0060] According to a preset mapping relationship, a target communication channel corresponding to the target attribute information is determined from the multiple communication channels; wherein the mapping relationship represents a correspondence between the attribute information of the first signal and the multiple communication channels.
[0061] The target attribute information may be certain attribute information of the first signal to indicate the target communication channel;
[0062] The mapping relationship represents the correspondence between the attribute information of the first signal and the multiple communication channels. Specifically, different values of one attribute information correspond to different communication channels.
[0063] In a specific implementation, the first signal can be generated by a host computer, based on test requirements, by matching the target test channel to target attribute information using a mapping relationship. Furthermore, the test circuit receives the first signal sent by the host computer and determines its target attribute information, matches the target communication channel corresponding to the target attribute information using a mapping relationship, and then switches to the target communication channel.
[0064] In actual applications, the mapping relationship can be written directly in the code or saved through configuration files, databases, etc.
[0065] By determining the target attribute information of the pulse width modulation signal and determining the target communication channel corresponding to the target attribute information according to the mapping relationship, fast matching of the target communication channel can be achieved, thereby improving the overall test efficiency.
[0066] In some embodiments of the present invention, the first signal is a pulse width modulation signal, and the target attribute information is a duty cycle of the pulse width modulation signal.
[0067] A pulse width modulation (PWM) signal is a signal that can express different information by adjusting the width of the pulse signal.
[0068] The duty cycle refers to the ratio of the duration of the high level to the total duration of the pulse cycle within a pulse cycle of the PWM signal.
[0069] In this embodiment, the mapping relationship represents the correspondence between different duty cycles and multiple communication channels. For example, a 10% duty cycle corresponds to communication channel 1, a 20% duty cycle corresponds to communication channel 2, etc. Based on the test circuit receiving different duty cycles, the target communication channel and target switching circuit corresponding to the duty cycle are determined to achieve access to the host computer.
[0070] In actual applications, the upper computer determines the target communication channel that needs to be tested based on the test requirements, and then determines the duty cycle corresponding to the target communication channel through the mapping relationship. The PWM signal is generated based on the duty cycle and sent to the test circuit (lower computer).
[0071] Specifically, the duty cycle of the pulse width modulation signal can be determined by:
[0072] Get the rising edge trigger time, falling edge trigger time and pulse cycle end time of the pulse width modulation signal;
[0073] Determine the high level duration according to the rising edge trigger time and the falling edge trigger time, and determine the pulse cycle duration according to the rising edge trigger time and the pulse cycle end time;
[0074] The duty cycle of the pulse width modulation signal is determined according to the high level duration and the pulse period duration.
[0075] Among them, the rising edge trigger time refers to the time when the event of triggering the PWM signal to switch from a low level to a high level is switched, which can represent the start time of the high-level signal within a pulse cycle; correspondingly, the falling edge trigger time refers to the time when the event of triggering the PWM signal to switch from a high level to a low level is switched, which can represent the end time of the high-level signal within a pulse cycle;
[0076] High level duration refers to the duration of the high level signal within a pulse cycle;
[0077] The pulse cycle end time refers to the end time of a pulse cycle of the PWM signal;
[0078] Pulse cycle duration refers to the total duration of one pulse cycle of the PWM signal;
[0079] The high level duration is obtained by subtracting the rising edge trigger time from the falling edge trigger time; the pulse cycle duration is obtained by subtracting the rising edge trigger time from the pulse cycle end time; and the ratio of the high level duration to the pulse cycle duration is determined to obtain the duty cycle of the pulse width modulation signal sent by the host computer.
[0080] In some examples, a controller (such as a microcontroller) can be set in the test circuit, and a capture circuit can be set inside the controller. The capture circuit is used to capture the PWM signal sent by the host computer, and then the PWM signal is analyzed by the embedded program of the controller to determine its duty cycle.
[0081] Part of the embedded program code can be shown as follows:
[0082] #include"stm32f4xx.h"uint32_tT1=0,T2=0,T3=0;uint32_tT_high=0,T_period=0;floatduty_cycle=0;#Timer 2 interrupt handler voidTIM2_IRQHandler(void)
[0083] {
[0084] # Capture event occurs if(TIM_GetITStatus(TIM2,TIM_IT_CC1)!=RESET)
[0085] {
[0086] # Read the level status of the GPIOA pin if(GPIO_ReadInputDataBit(GPIOA,GPIO_Pin_0))
[0087] {
[0088] #Get the rising edge trigger time T1=TIM_GetCapture1(TIM2);}
[0089] else
[0090] {
[0091] # Get the falling edge trigger time T2=TIM_GetCapture1(TIM2);
[0092] # Calculate the high level duration T_high=T2-T1;}
[0093] # Clear the timer interrupt flag TIM_ClearITPendingBit(TIM2,TIM_IT_CC1);}
[0094] if(TIM_GetITStatus(TIM2,TIM_IT_CC2)!=RESET)
[0095] {
[0096] # Get the pulse cycle end time T3=TIM_GetCapture2(TIM2);
[0097] # Calculate the pulse period duration T_period=T3-T1;
[0098] # Calculate the duty cycle of the PWM signal duty_cycle=((float)T_high / (float)T_period)*100.0f;TIM_ClearITPendingBit(TIM2,TIM_IT_CC2);}
[0099] }
[0100] In some embodiments of the present invention, each switching circuit is provided with a first switch and a second switch; wherein, the first end of the first switch is connected to the device under test, and the second end of the first switch is connected to the host computer in different states of the first switch, or is connected to the electronic unit through the second switch; the first end of the second switch is connected to the electronic unit, and the second end of the second switch is connected to the device under test through the first switch in different states of the second switch, or is connected to the host computer.
[0101] The first switch is used to disconnect the circuit between the device under test and the electronic unit and connect the circuit between the device under test and the host computer, or connect the circuit between the device under test and the electronic unit and disconnect the circuit between the device under test and the host computer, according to its different states (closed or open), so as to realize switching of the circuit connected to the first switch within the switch circuit; in actual application, there can be one or more groups of first switches.
[0102] The second switch is used to disconnect the circuit path between the electronic unit and the device under test and connect the circuit path between the electronic unit and the host computer, or connect the circuit path between the electronic unit and the device under test and disconnect the circuit path between the electronic unit and the host computer, depending on its different states (closed or open), thereby switching the circuit connected to the second switch within the switch circuit. In practical applications, the second switch can be provided in one or more groups.
[0103] In some examples, the switch circuit may specifically be a relay circuit, such as Figure 2 As shown, CON40 is a 40-pin connector. Wires marked with ADC (such as ADC1H, ADC1L, etc.) are connected to corresponding pins of the connector, which are then connected to the device under test through the pins. For example, ADC1H is connected to pin 4, which is then connected to the device under test. Wires marked with GW (such as GW1H, GW1L, etc.) are connected to corresponding pins of the connector, which are then connected to the electronic unit through the pins. For example, GW1H is connected to pin 3, which is then connected to the electronic unit. That is, the device under test is connected to multiple electronic units through 16 different communication channels, and a relay circuit 201 is provided on each communication channel.
[0104] Specifically, each relay circuit 201 is provided with a first switch 202 and a second switch 203. The first end 2021 of the first switch 202 is first connected to the corresponding pin of the connector via a wire with an ADC mark, and then connected to the device under test via the pin, for example, connected to pin 16 via an ADC4H wire, and then connected to the device under test via pin 16; the second end 2022 of the first switch 202 is connected to the second end 2032 of the second switch 203 via a wire 204, and the first end 2031 of the second switch is connected to the corresponding pin of the connector via a wire with a GW mark, and then connected to the electronic unit via the pin, for example, connected to pin 15 via a GW4H wire, and then connected to the electronic unit via pin 15, that is, the device under test and the electronic unit are connected in series;
[0105] When the states of the first switch 202 and the second switch 203 change, the connection point of the second end 2022 of the first switch 202 is switched from the wire 204 to the wire 205, and is connected to the host computer through the wire 205; at the same time, the connection point of the second end 2032 of the second switch 203 is switched from the wire 204 to the wire 206, and is connected to the host computer through the wire 206, thereby connecting the host computer to the corresponding communication channel and connecting the host computer in series between the device to be tested and the electronic unit.
[0106] When the host computer is connected in series between the device to be tested and the electronic unit, Figure 3As shown, it is assumed that the device to be tested is a vehicle-mounted controller and the electronic unit is a gateway. After the host computer is connected, the data sent by the gateway can be forwarded to the controller, and the data sent by the controller can also be forwarded to the gateway. At the same time, the device to be tested can also be tested based on the communication protocol corresponding to the accessed communication channel.
[0107] In yet another example, Figure 4 As shown, the controller under test (UCT) is the device under test. Pins 1-20 are connected to ECU_A-ECU_J via 10 different communication channels. ECU_A-ECU_J are electronic control units (ECUs). Each communication channel has a relay circuit. Within each relay circuit are four sets of switches (two sets of first switches and two sets of second switches). Pins 1-12 are different, and one set of switches switches between two circuit paths (for example, one set of first switches switches between pins 1 and 5, and between pins 1 and 6). Take ECU_J as an example:
[0108] One end of a first switch set is connected to the controller under test via pin 1, and the other end is connected to ECU_J via the line between pins 5 and 9. A second switch set has one end connected to ECU_J via pin 3, and the other end is connected to the controller under test via the line between pins 5 and 9. The other set of first and second switches is similar and will not be described here. At this point, the controller under test and ECU_J are connected in series and are exchanging data normally.
[0109] When the states of the first and second switches change, the connection point at the other end of one set of first switches switches from pin 5 to pin 6, and is connected to port A1 of the test equipment (i.e., the host computer) via pin 6. The connection point at the other end of one set of second switches switches from pin 9 to pin 10, and is connected to port B1 of the test equipment via pin 10. The other set of first and second switches operates similarly and will not be further described here. At this point, the test equipment is connected in series between the controller under test and ECU_J via the relay corresponding to channel 1. The test equipment can then test the controller under test using the corresponding communication protocol.
[0110] In some embodiments of the present invention, the host computer is further used to generate test data based on data sent by the electronic unit corresponding to the target communication channel, and send the test data to the device to be tested to test the device to be tested based on the communication protocol corresponding to the target communication channel.
[0111] In a specific implementation, the test data can be that the host computer modifies the normal data sent by the electronic unit into fault data, simulates the situation where a fault occurs, and performs a fault injection test on the device to be tested, thereby verifying the performance of the device to be tested in the communication protocol (or network segment) corresponding to the target communication channel.
[0112] In some examples, assume that the first switch and the second switch are in one state, the electronic unit is an ECU, the second end of the first switch is connected to the ECU, and the second end of the second switch is connected to the device under test. In this case, the device under test and the ECU are connected, and data exchange between the device under test and the ECU is normal, without affecting the original operating logic of the device under test. For example, if the device under test is a vehicle-mounted controller, the vehicle-mounted controller is connected to the ECU, and the vehicle-mounted controller and the ECU are transmitting and receiving data normally, so that the wiring harness connection state of the vehicle-mounted controller remains consistent with that before it was connected to the test circuit (for example, the connection between the vehicle-mounted controller and the ECU in the vehicle);
[0113] When the first switch and the second switch are in another state, the second end of the first switch is connected to the host computer, and the second end of the second switch is connected to the host computer. At this time, the host computer is connected to the circuit between the device under test and the ECU. The host computer forwards the data transmitted by the device under test and the ECU without affecting the normal communication between the device under test and the electronic unit.
[0114] When the device to be tested needs to be tested based on the communication protocol corresponding to the target communication channel, the host computer can modify the data during data forwarding to simulate the situation when a fault occurs and implement tests such as fault injection.
[0115] In some embodiments of the present invention, controlling a target switch circuit in the target communication channel includes:
[0116] A second signal is sent to the target switch circuit to switch the states of the first switch and the second switch in the target switch circuit, so that the second end of the first switch in the target switch circuit is connected to the host computer, and the second end of the second switch in the target switch circuit is connected to the host computer.
[0117] The second signal is a control signal for the target switch circuit, so as to switch the states of the first switch and the second switch in the target switch circuit.
[0118] In a specific implementation, the switching circuit can be a relay circuit, and the second signal can be a high-level signal. The high-level signal can cause the first switch and the second switch in the relay circuit to jump, so as to change the circuit path of the relay circuit, and thereby connect or disconnect the circuit between the host computer and the communication channel.
[0119] In some examples, assume that the switch states in each relay circuit are as follows: Figure 4 As shown, at this time, the controller under test is connected in series with the electronic control units of ECU_A-ECU_J respectively, and communicates normally through the corresponding communication channels; channel 1-channel 10 connected to each relay is used to receive the second signal.
[0120] When receiving a first signal sent by the host computer, assuming that the first signal is a PWM signal with a duty cycle of 10%, the target communication channel that matches the duty cycle is determined to be the communication channel corresponding to the device under test and ECU_J, and the target switch circuit corresponding to the target communication channel is determined, that is, the relay circuit connected to ECU_J;
[0121] Furthermore, a high-level signal, i.e., the second signal, is sent to the target switch circuit through channel 1, causing the states of the first switch and the second switch in the target relay to change simultaneously: the connection point of the second end of one group of first switches is switched from pin 5 to pin 6, and the connection point of the second end of another group of first switches is switched from pin 7 to pin 8; the connection point of the second end of one group of second switches is switched from pin 9 to pin 10, and the connection point of the second end of another group of second switches is switched from pin 11 to pin 12.
[0122] At this time, the test equipment (host computer) is connected in series between the controller to be tested and ECU_J to connect the test equipment to the target communication channel. The host computer can normally forward the data transmitted by the test equipment and the electronic unit through the target communication channel without affecting the original data business logic. The test equipment can also be tested based on the communication protocol corresponding to the target communication channel. Other ECUs except ECU_J transmit data with the test equipment through independent communication channels, and the states of the first switch and the second switch in the corresponding switching circuit remain unchanged, and the physical structure of the circuit remains unchanged. The original data business is not affected, and the test and the original data business can be carried out in parallel, so that the test can be carried out without affecting the original data business, thereby ensuring the business continuity of the test equipment.
[0123] In actual applications, when it is necessary to switch to another communication channel, a level signal can be sent to the target relay again to reset the states of the first and second switches in the target relay, disconnecting the test equipment from the device under test and the electronic control unit. Then, a new PWM signal is sent by the host computer and switched to another communication channel based on the new PWM signal.
[0124] In this embodiment, different circuit paths can be changed by different states of the first switch and the second switch of the relay, thereby achieving flexible access to the host computer without affecting the original data transmission and reception of the device under test.
[0125] In some embodiments of the present invention, the test circuit further includes a power conversion module, which is connected to the power supply of the vehicle. The device to be tested is an on-board device of the vehicle, and the electronic unit is an electronic control unit of the vehicle.
[0126] The power conversion module is used to convert the input voltage provided by the vehicle's power supply into the voltage required for the operation of each component in the control circuit, providing power for the entire test circuit.
[0127] Vehicle-mounted devices, which may be devices mounted on vehicles, such as the Vehicle Control Unit (VCU);
[0128] An electronic control unit (ECU) can be any type of electronic control unit on a vehicle that is responsible for controlling various functions of the vehicle (such as engine management, transmission control, etc.), and is used to interact with on-board devices; for example, it feeds back data collected by sensors to on-board devices, and executes corresponding functions in response to control instructions from on-board devices.
[0129] In practical applications, the device to be tested can be various types of vehicle-mounted equipment. Through the power conversion module, during the test of the entire vehicle, the vehicle's power supply (such as the vehicle battery, cigarette lighter, etc., which can provide 12V power input) can be directly used to provide power for various components in the test circuit without the need for additional power supply.
[0130] Moreover, the on-board equipment and the electronic control unit communicate normally through the communication channel of the test circuit, which is consistent with the wiring harness status of the device to be tested on the original vehicle and does not interfere with the original business logic of the vehicle system.
[0131] When the host computer is connected to the target communication channel, it can forward the data transmitted by the target communication channel, and can also test the equipment to be tested based on the communication protocol corresponding to the target communication channel, so that the original data services of the on-board equipment and the test of the target communication channel (network segment) can be carried out in parallel. It can also facilitate the synchronization of the test of the equipment to be tested and other development tests of the whole vehicle, effectively improving the overall efficiency of the whole vehicle test.
[0132] In some examples, the device to be tested can be an on-board controller installed in a vehicle, and the electronic unit can be various ECUs installed in the vehicle, namely engine ECU, air conditioning ECU, and air suspension ECU. There are three communication channels in the test circuit, namely CAN bus, LIN bus, and FlexRay bus.
[0133] In the initial state, the on-board controller is connected to the engine ECU via the CAN bus, to the air conditioning ECU via the LIN bus, and to the air suspension ECU via the FlexRay bus. The on-board controller and the above ECUs communicate normally through the corresponding communication channels, and the on-board controller and each ECU operate normally. For example, the engine ECU can respond to the control instructions of the on-board controller via the CAN bus within the test circuit to perform functions such as fuel injection control, turbocharging management, or torque coordination on the engine installed on the vehicle, and can also feedback engine data to the on-board controller via the CAN bus; the air conditioning ECU can respond to the control instructions of the on-board controller via the LIN bus within the test circuit to perform temperature adjustment and air quality optimization functions on the air conditioning equipment installed on the vehicle, and the air conditioning ECU can also normally feedback relevant data of the air conditioning equipment to the on-board controller;
[0134] Further, the host computer responds to the test requirement, determines the LIN bus in the test circuit as the target communication channel, and sends a first signal to the controller of the test circuit;
[0135] The test circuit's controller interprets the first signal and identifies the LIN bus as the target communication channel from among the three communication channels. It then controls the target switch circuit corresponding to the target communication channel, allowing the host computer to access the LIN bus. The host computer then forwards data transmitted via the LIN bus between the vehicle controller and the air conditioning ECU, ensuring that the LIN bus maintains its intended data traffic. The host computer can also test the device under test based on the LIN bus's corresponding communication protocol to verify its performance on the LIN bus.
[0136] On the one hand, after the upper computer is connected to the LIN bus, it can forward data, so that the IN bus maintains its original data business, the original data business of the vehicle controller and the air-conditioning ECU is not affected, and the corresponding functions of the corresponding air-conditioning equipment on the vehicle are also not affected; on the other hand, the engine ECU and air suspension ECU transmit data through independent CAN buses and FlexRay buses respectively, and the switch circuit states corresponding to the CAN bus and FlexRay bus have not changed, and the physical circuit structure has not changed, so the data business corresponding to the engine ECU and air suspension ECU is also not affected, thereby enabling the original data business of the vehicle system and the test of the equipment to be tested on the LIN bus to be carried out in parallel, ensuring the business continuity of the relevant data business of the controller to be tested, and thus ensuring the stability of the entire vehicle system.
[0137] The above description is merely an illustration and is not intended to limit the present invention.
[0138] In some examples, the circuit structure of the power conversion module can be as follows: Figure 5As shown, U2 is the LM2576 wide input voltage chip, which can convert 12V voltage into 5V DC voltage; U5 and U6 are XC6206 conversion chips, which can further convert 5V voltage into 3.3V voltage to power various components in the test circuit (such as MCU, etc.); the capacitors (such as C19, C9, etc.) and inductors (such as L2, etc.) in the circuit can form an LC filter circuit to filter high-frequency noise in the power supply and ensure the stability of the test circuit; each capacitor can be a 0.1uF capacitor to suppress transient interference.
[0139] In some embodiments of the present invention, a test circuit is further provided. The test circuit is respectively connected to a host computer, multiple electronic units, and a device to be tested. The test circuit includes a controller and multiple communication channels. Each communication channel has a corresponding communication protocol, and each communication channel is provided with a switching circuit. The switching circuit is respectively connected to the controller and the host computer. The device to be tested transmits data with the multiple electronic units through the multiple communication channels. The controller is used to:
[0140] determining a target communication channel from the plurality of communication channels according to the first signal sent by the host computer;
[0141] Controlling a target switch circuit within the target communication channel to connect the host computer to the target communication channel; wherein the host computer is used to forward data transmitted by the target communication channel and / or to test the device to be tested based on a communication protocol corresponding to the target communication channel.
[0142] In practical applications, the controller can be a microcontroller (MCU). A microcontroller can perform control functions on a single chip, eliminating the need for additional circuitry. The microcontroller's circuit structure can include a processor minimum circuit and an MCU chip. The processor minimum circuit refers to the basic circuitry that supports the microcontroller's operation, specifically including a power supply, a crystal oscillator circuit, and a reset circuit. The power supply supplies power to the MCU, the crystal oscillator provides a stable clock signal, and the reset circuit restores the MCU to its initial state.
[0143] For example, in Figure 9 In the microcontroller circuit structure shown:
[0144] VCC is the power supply; the crystal oscillator circuit includes crystal oscillator Y1, capacitors C1 and C2, and the reset circuit includes resistor RES1 and reset pin NRST. Crystal oscillator Y1 can be a passive 8MHz crystal oscillator (one that does not require a separate power supply), ensuring both stability and low power consumption.
[0145] U1 is an MCU chip, which is connected to the host computer through the PA0 pin and CANOE_IO line; the PB8 to PB15 pins correspond one-to-one to the OUT1 to OUT8 lines, and the OUT1-OUT8 lines are used to connect the MCU with different relays; U1 is equipped with a capture circuit inside to capture the PWM signal sent by the host computer; U1 can also be written with an embedded program, which may include business logic such as parsing PWM signals and determining the target communication channel.
[0146] J1 is a download circuit used to write embedded programs into the MCU chip U1.
[0147] In some embodiments of the present invention, the test circuit also includes a power conversion module, one end of which is connected to the power supply of the vehicle, and the other end is connected to the controller; the device to be tested is an on-board device of the vehicle, and the electronic unit is an electronic control unit of the vehicle.
[0148] In some examples, such as Figure 6 As shown, the test circuit may include a power conversion module, a microcontroller module, and a relay module; the power conversion module is connected to the vehicle battery through a connector and converts 12V voltage into 5V DC voltage, and 5V voltage into 3.3V voltage to power the microcontroller module; the microcontroller module includes an MCU, which is provided with a stable clock signal by a crystal oscillator circuit and is connected to the host computer through a connector; the relay module includes multiple communication channels and a relay circuit on each communication channel, and is connected to the device under test (device to be tested, i.e., the vehicle-mounted device) through a connector.
[0149] One of the connector structures can be as follows Figure 7 As shown, there can be multiple pins (1-16) connected to multiple signal lines (such as CAN1_L and CAN1_H are a group of high and low level signal lines), which can collect data generated by the host computer and input it into the test circuit.
[0150] In actual applications, the microcontroller module receives the PWM signal generated by the host computer, analyzes the duty cycle of the PWM signal, determines the target communication channel among the multiple communication channels of the relay module, and sends a level signal to the relay circuit in the target communication channel to connect the host computer to the target communication channel and realize the switching of the target communication channel.
[0151] Furthermore, the device under test is tested through the host computer based on the target communication channel.
[0152] Specifically, the target communication channel switching process can be as follows: Figure 8 As shown:
[0153] First, the host computer and test circuit perform self-tests, setting up the vehicle test environment (for example, specifying the test communication channels required for the device under test). If the test circuit detects normal, the process proceeds to the next step. If the test circuit detects abnormalities, the process returns to the self-test process.
[0154] Furthermore, the MCU receives the PWM signal sent by the host computer and analyzes the duty cycle of the PWM signal;
[0155] Furthermore, the MCU determines the target communication channel according to the duty cycle, and controls the target relay (target switching circuit) corresponding to the target communication channel to connect the host computer to the target communication channel.
[0156] The target communication channel is switched and the process ends.
[0157] The embodiment of the present invention has the following advantages: by integrating multiple communication channels with corresponding communication protocols through the test circuit, data transmission services between the device to be tested and multiple electronic units can be carried out normally through these communication channels, and can also adapt to the test requirements of the device to be tested in different communication environments; by determining a target communication channel from multiple communication channels according to a first signal sent by a host computer, controlling a target switch circuit in the target communication channel, so as to connect the host computer to the target communication channel, and realize rapid switching of the communication channel targeted by the test requirement, without the need for manual access to the host computer, thereby greatly improving the efficiency of testing the device to be tested; moreover, after the host computer is connected to the target communication channel, since the states of the switch circuits corresponding to other communication channels except the target communication channel are unchanged, the original data transmission service logic can be maintained, and the target communication channel connected to the host computer can also forward data normally through the host computer, so that the original data services of the device to be tested and the multiple electronic units and the test on the target communication channel can be carried out in parallel, so that the test is carried out without affecting the original data services, thereby ensuring the service continuity of the device to be tested and the stability of the original data services.
[0158] It should be noted that for the sake of simplicity, the method embodiments are described as a series of actions. However, those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, 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 this specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0159] Reference Figure 10, shows a schematic structural diagram of a device testing apparatus based on a test circuit provided by an embodiment of the present invention, wherein the test circuit is respectively connected to a host computer, multiple electronic units, and a device to be tested, the test circuit includes multiple communication channels, each communication channel has a corresponding communication protocol, and each communication channel is provided with a switching circuit, the switching circuit is connected to the host computer, and the device to be tested transmits data with the multiple electronic units through the multiple communication channels. The apparatus includes:
[0160] A channel determination module 1001 is configured to determine a target communication channel from the plurality of communication channels according to a first signal sent by the host computer;
[0161] The channel processing module 1002 is used to control the target switch circuit in the target communication channel to connect the host computer to the target communication channel; wherein the host computer is used to forward the data transmitted by the target communication channel and / or test the device to be tested based on the communication protocol corresponding to the target communication channel.
[0162] In some embodiments of the present invention, the channel determination module 1001 includes:
[0163] an attribute determination submodule, configured to determine target attribute information of the first signal;
[0164] The channel determination submodule is configured to determine the target communication channel corresponding to the target attribute information from the multiple communication channels according to a preset mapping relationship; wherein the mapping relationship represents the correspondence between the attribute information of the first signal and the multiple communication channels.
[0165] In some embodiments of the present invention, each switching circuit is provided with a first switch and a second switch; wherein, the first end of the first switch is connected to the device under test, and the second end of the first switch is connected to the electronic unit or the host computer through the second switch in different states of the first switch; the first end of the second switch is connected to the electronic unit, and the second end of the second switch is connected to the device under test or the host computer through the first switch in different states of the second switch.
[0166] In some embodiments of the present invention, the channel processing module 1002 includes:
[0167] The switch controller submodule is used to send a second signal to the target switch circuit to switch the states of the first switch and the second switch in the target switch circuit, so that the second end of the first switch in the target switch circuit is connected to the host computer, and the second end of the second switch in the target switch circuit is connected to the host computer.
[0168] In some embodiments of the present invention, the host computer is further used to generate test data based on data sent by the electronic unit corresponding to the target communication channel, and send the test data to the device to be tested to test the device to be tested based on the communication protocol corresponding to the target communication channel.
[0169] In some embodiments of the present invention, the first signal is a pulse width modulation signal, and the target attribute information is a duty cycle of the pulse width modulation signal.
[0170] In some embodiments of the present invention, the test circuit further includes a power conversion module, which is connected to the power supply of the vehicle. The device to be tested is an on-board device of the vehicle, and the electronic unit is an electronic control unit of the vehicle.
[0171] Some embodiments of the present invention further provide an electronic device, which may include a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, the device testing method based on the test circuit as described above is implemented.
[0172] Some embodiments of the present invention further provide a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the device testing method based on the test circuit as described above is implemented.
[0173] Some embodiments of the present invention further provide a computer program product, including a computer program, which implements the above device testing method based on the test circuit when executed by a processor.
[0174] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0175] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0176] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0177] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, apparatus, or computer program products. Thus, embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0178] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0179] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0180] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 a process or multiple processes and / or boxes Figure 1 The steps for the function specified in one or more boxes.
[0181] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they become aware of the basic creative concepts. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.
[0182] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "includes," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or terminal device. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of additional identical elements in the process, method, article, or terminal device that includes the above elements.
[0183] The above is a detailed introduction to the device testing method and apparatus, circuit, medium, and product based on the test circuit. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for general technical personnel in this field, according to the ideas of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A device testing method based on a test circuit, characterized in that: The test circuit is respectively connected to a host computer, multiple electronic units and a device to be tested, the test circuit includes multiple communication channels, each communication channel has a corresponding communication protocol, and each communication channel is provided with a switch circuit, the switch circuit is connected to the host computer, the device to be tested transmits data with the multiple electronic units through the multiple communication channels, and each switch circuit is provided with a first switch and a second switch; wherein, the first end of the first switch is connected to the device to be tested, and the second end of the first switch is connected to the electronic unit through the second switch in different states of the first switch, or is connected to the host computer; the first end of the second switch is connected to the electronic unit, and the second end of the second switch is connected to the device to be tested through the first switch in different states of the second switch, or is connected to the host computer; the method includes: determining a target communication channel from the plurality of communication channels according to the first signal sent by the host computer; Controlling a target switch circuit within the target communication channel to connect the host computer to the target communication channel; wherein the host computer is used to forward data transmitted by the target communication channel and / or to test the device to be tested based on a communication protocol corresponding to the target communication channel.
2. The method according to claim 1, characterized in that The determining a target communication channel from the plurality of communication channels according to the first signal sent by the host computer includes: determining target attribute information of the first signal; According to a preset mapping relationship, a target communication channel corresponding to the target attribute information is determined from the multiple communication channels; wherein the mapping relationship represents a correspondence between the attribute information of the first signal and the multiple communication channels.
3. The method according to claim 1, characterized in that The controlling the target switch circuit in the target communication channel includes: A second signal is sent to the target switch circuit to switch the states of the first switch and the second switch in the target switch circuit, so that the second end of the first switch in the target switch circuit is connected to the host computer, and the second end of the second switch in the target switch circuit is connected to the host computer.
4. The method according to claim 1, wherein The host computer is further configured to generate test data based on data sent by the electronic unit corresponding to the target communication channel, and send the test data to the device to be tested, so as to test the device to be tested based on the communication protocol corresponding to the target communication channel.
5. The method according to claim 2, characterized in that The first signal is a pulse width modulation signal, and the target attribute information is a duty cycle of the pulse width modulation signal.
6. The method according to claim 1, characterized in that The test circuit further includes a power conversion module, which is connected to a power source of a vehicle. The device to be tested is an onboard device of the vehicle, and the electronic unit is an electronic control unit of the vehicle.
7. A test circuit, characterized in that: The test circuit is respectively connected to a host computer, multiple electronic units and a device to be tested. The test circuit includes a controller and multiple communication channels, each communication channel has a corresponding communication protocol, and each communication channel is provided with a switching circuit, the switching circuits are respectively connected to the controller and the host computer, the device to be tested transmits data with the multiple electronic units through the multiple communication channels, and each switching circuit is provided with a first switch and a second switch; wherein the first end of the first switch is connected to the device to be tested, and the second end of the first switch is connected to the electronic unit through the second switch in different states of the first switch, or is connected to the host computer; the first end of the second switch is connected to the electronic unit, and the second end of the second switch is connected to the device to be tested through the first switch in different states of the second switch, or is connected to the host computer; the controller is used to: determining a target communication channel from the plurality of communication channels according to the first signal sent by the host computer; Controlling a target switch circuit within the target communication channel to connect the host computer to the target communication channel; wherein the host computer is used to forward data transmitted by the target communication channel and / or to test the device to be tested based on a communication protocol corresponding to the target communication channel.
8. The test circuit according to claim 7, characterized in that: The test circuit also includes a power conversion module, one end of which is connected to the vehicle's power supply, and the other end is connected to the controller; the device to be tested is an on-board device of the vehicle, and the electronic unit is an electronic control unit of the vehicle.
9. A device testing apparatus based on a test circuit, characterized in that: The test circuit is respectively connected to a host computer, a plurality of electronic units and a device to be tested, the test circuit includes a plurality of communication channels, each communication channel has a corresponding communication protocol, and each communication channel is provided with a switch circuit, the switch circuit is connected to the host computer, the device to be tested transmits data with the plurality of electronic units through the plurality of communication channels, and each switch circuit is provided with a first switch and a second switch; wherein, the first end of the first switch is connected to the device to be tested, and the second end of the first switch is connected to the electronic unit through the second switch in different states of the first switch, or is connected to the host computer; the first end of the second switch is connected to the electronic unit, and the second end of the second switch is connected to the device to be tested through the first switch in different states of the second switch, or is connected to the host computer; the device includes: a channel determination module, configured to determine a target communication channel from the plurality of communication channels according to the first signal sent by the host computer; A channel processing module is used to control the target switch circuit in the target communication channel to connect the host computer to the target communication channel; wherein the host computer is used to forward data transmitted by the target communication channel and / or test the device to be tested based on the communication protocol corresponding to the target communication channel.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the device testing method based on the test circuit according to any one of claims 1 to 6 is implemented.
11. A computer program product, characterized in that The invention comprises a computer program, which implements the device testing method based on the test circuit according to any one of claims 1 to 6 when being executed by a processor.
Citation Information
Patent Citations
Intelligent wiring device with reusable channels and integrated with fault injection function
CN108196533A
Vehicle fault diagnosis test method, device, system, equipment and medium
CN115993812A