CN110377004B - Semi-virtual ECU (electronic control Unit) test system for vehicle and test method thereof - Google Patents

Semi-virtual ECU (electronic control Unit) test system for vehicle and test method thereof Download PDF

Info

Publication number
CN110377004B
CN110377004B CN201910632041.5A CN201910632041A CN110377004B CN 110377004 B CN110377004 B CN 110377004B CN 201910632041 A CN201910632041 A CN 201910632041A CN 110377004 B CN110377004 B CN 110377004B
Authority
CN
China
Prior art keywords
model
unit
real
mcu
test
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910632041.5A
Other languages
Chinese (zh)
Other versions
CN110377004A (en
Inventor
杨博文
金毅
李琪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Xiangyuan Tongda Technology Co ltd
Original Assignee
Beijing Xiangyuan Tongda Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Xiangyuan Tongda Technology Co ltd filed Critical Beijing Xiangyuan Tongda Technology Co ltd
Priority to CN201910632041.5A priority Critical patent/CN110377004B/en
Publication of CN110377004A publication Critical patent/CN110377004A/en
Application granted granted Critical
Publication of CN110377004B publication Critical patent/CN110377004B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B23/00Testing or monitoring of control systems or parts thereof
    • G05B23/02Electric testing or monitoring
    • G05B23/0205Electric testing or monitoring by means of a monitoring system capable of detecting and responding to faults
    • G05B23/0218Electric testing or monitoring by means of a monitoring system capable of detecting and responding to faults characterised by the fault detection method dealing with either existing or incipient faults
    • G05B23/0221Preprocessing measurements, e.g. data collection rate adjustment; Standardization of measurements; Time series or signal analysis, e.g. frequency analysis or wavelets; Trustworthiness of measurements; Indexes therefor; Measurements using easily measured parameters to estimate parameters difficult to measure; Virtual sensor creation; De-noising; Sensor fusion; Unconventional preprocessing inherently present in specific fault detection methods like PCA-based methods
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/20Pc systems
    • G05B2219/24Pc safety
    • G05B2219/24065Real time diagnostics

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Automation & Control Theory (AREA)
  • Debugging And Monitoring (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)

Abstract

A semi-virtual ECU test system for a vehicle and a test method thereof relate to a test system developed by an ECU, and the test system comprises an upper computer PC, a real-time system, a signal simulation unit and a fault injection unit thereof, an MCU simulation communication simulation unit and a fault injection unit thereof, a signal mapping matrix unit and an MCU connecting seat, wherein the upper computer is connected with the real-time system, and the real-time system is respectively connected with the signal simulation unit and the signal mapping matrix unit; the upper computer is internally provided with a hardware model unit, a controlled object model, a test case, a software model and a test management program, and the real-time system is provided with a virtual peripheral unit and a model interaction unit. The test method comprises the following steps: customizing a controlled object model, a test case and a software model, and simulating a controlled object and the test case; connecting the MCU to be tested, writing a software model, and generating an MCU circuit model file and a mathematical model; matching the connection relation between the test resources and the MCU; carrying out the test according to the test case; the ECU development time can be greatly shortened.

Description

Semi-virtual ECU (electronic control Unit) test system for vehicle and test method thereof
Technical Field
The invention relates to a test system developed by an Electric Control Unit (ECU) for a vehicle, in particular to a semi-virtual ECU test system for the vehicle and a test method thereof, which can directly test and verify a microcontroller MCU (micro Control Unit), an MCU bottom layer drive, an application layer Control strategy and a hardware concept scheme before the ECU hardware development is finished, and can greatly shorten the ECU development time.
Background
The development of the ECU for the vehicle has been introduced into a V-Model development process and a Model-Based Design (MBD) method, and a modern V mode depends on computer-aided Design, and a computer support tool is penetrated through the whole process of development and test of an automobile electric control system. The computer can not only assist the design of the automobile electric control system, carry out scheme design and off-line simulation, but also be used for real-time rapid control of prototype, product code generation and hardware-in-loop test, thus forming a set of rigorous and complete system development method. In the process V, after the hardware unit integration test and the software unit integration test are carried out, software and hardware are integrated and a system integration test is carried out, in the stage, the hardware-in-Loop (HIL) test means is required to be utilized to carry out the test and the check of the functions, the safety and the like of the ECU, the process can be carried out only after the ECU hardware entity is obtained, and because the hardware iteration period is longer, the time cost for finding and correcting the problems is high, the development time of the whole controller is long, and the development requirement of the ECU which can not be accelerated daily can not be met.
Disclosure of Invention
The invention aims to solve the defects of the prior art and provides a semi-virtual ECU test system for a vehicle and a test method thereof, which can directly test and verify an MCU, an MCU bottom layer drive, an application layer control strategy and a hardware concept scheme before ECU hardware development is completed and can greatly shorten the ECU development time.
The technical scheme adopted by the invention for solving the defects of the prior art is as follows:
a semi-virtual ECU test system for a vehicle comprises an upper computer PC, a real-time system, a signal simulation unit and a fault injection unit thereof, an MCU simulation communication simulation unit and a fault injection unit thereof, a signal mapping matrix unit and an MCU connecting seat, wherein the upper computer is connected with the real-time system, and the real-time system is respectively connected with the signal simulation unit and the signal mapping matrix unit;
the upper computer is internally provided with a hardware model unit, a controlled object model, a test case, a software model and a test management program, and the real-time system is provided with a virtual peripheral unit and a model interaction unit;
the hardware model unit in the upper computer is used for building a model of a MCU peripheral hardware circuit in the ECU; the controlled object model is used for simulating the function of a real controlled object; the software model is an ECU control strategy realized by using a graphical programming language, can be changed into a target programming language through a code generation tool, can obtain an executable file of the MCU after compiling, and is used for monitoring the building process and the whole test process of the semi-virtual ECU by a test management program;
the virtual peripheral unit in the real-time system is used for reading the information of the hardware model unit in the upper computer, simulating the MCU peripheral hardware circuit in the ECU and forming a peripheral circuit virtual model;
the model interaction system is used for integrating the peripheral circuit virtual model, the controlled object model and the test case;
the signal mapping matrix unit is connected with the MCU connecting seat and is used for connecting the MCU to be tested.
The signal simulation unit comprises a vehicle-mounted communication simulation unit, a digital signal simulation unit, an analog signal simulation unit, an on-board communication simulation unit and a power supply simulation unit.
The signal mapping matrix is formed by connecting each analog unit (and a fault injection unit thereof) in the signal analog units with all pin interfaces of the MCU connecting seat through a switch group arranged in parallel. The signal generated by each analog unit (and the fault injection unit thereof) is accessed to any pin interface of the MCU connecting seat by gating the switches in the switch group arranged in parallel; is suitable for connecting various MCUs.
A semi-virtual ECU testing method for a vehicle is characterized by comprising the following steps:
the first step is as follows: the controlled object model, the test case and the software model are customized, and the real-time system reads the model through the model interaction system to complete the simulation of the controlled object and the test case;
the second step is that: placing the MCU to be tested in an MCU interface to realize the connection with the signal mapping matrix unit, wherein the real-time system controls the MCU simulation communication simulation unit through the real-time communication interface to brush and write the executable file compiled by the software model (through an upper computer) into the real MCU to be tested so as to realize the control strategy function of the MCU;
the third step: the hardware model unit builds a circuit model of a MCU peripheral hardware circuit in the ECU and generates a circuit model file containing connection relation and element attributes;
the fourth step: transmitting the circuit model file to a virtual peripheral unit in a real-time system, wherein the virtual peripheral unit generates a mathematical model of the circuit model according to the circuit model file by using a model of a component;
the fifth step: the real-time system is communicated with the signal mapping matrix unit through a real-time communication interface to match the connection relation between the test resources and the MCU to be tested;
and a sixth step: the real-time system is communicated with the signal simulation unit through a real-time communication interface, and the signal simulation unit is configured;
the seventh step: carrying out a test according to a test case input to a real-time system, wherein the real-time system uses the test case as the input of a virtual model of a peripheral circuit for iteration, the iteration result of the virtual model of the peripheral circuit is the input of a signal simulation unit, and the output of the signal simulation unit is input through a fault injection unit and finally input into an MCU (micro control unit); the test process simulates the process of monitoring and controlling a real controlled object by a real ECU;
the test management program monitors the correctness of logic, functions and time sequence in the construction and whole test process of the semi-virtual ECU, and response signals and data on the pins of the MCU during the test are collected in real time through a real-time system so as to judge whether the functions and strategies of the MCU are complete and reliable.
In the invention, in the test resource allocation stage and the test development process before the seventh test, on one hand, the test management program obtains the internal variables of the virtual peripheral unit and the model interaction system through the real-time system, and the variables represent the working states of the virtual peripheral unit and the model interaction system, the availability of external input information, the correctness of logic interface matching, the memory management and verification conditions, and the real-time performance of test work step operation and iterative computation; and on the other hand, the test management program acquires internal variables of the signal simulation unit, the fault injection unit thereof and the signal mapping matrix unit through a real-time communication interface of the real-time system, and the variables represent information such as working states, communication quality, internal faults, command response correctness and the like of the signal simulation unit, the fault injection unit thereof and the signal mapping matrix unit. After the test management program obtains the information of the two aspects, the building process and the whole test process of the semi-virtual ECU can be monitored through logic and time sequence judgment.
The model interaction system is used for integrating the peripheral circuit virtual model, the controlled object model and the test case, and specifically comprises the following steps: taking the test case as the input of a controlled object model, performing iterative computation on the controlled object model, and taking the output of the controlled object model as the input of a peripheral circuit virtual model for iterative computation; the model interaction system is electrically connected with the signal simulation unit through the real-time communication interface and is used for controlling the signal simulation unit to generate or receive various input or output signals of the MCU to be tested; the iteration result of the virtual model of the peripheral circuit is the input of the signal simulation unit, the signal simulation unit is connected with the signal mapping matrix, and the output of the signal simulation unit is input into the signal mapping matrix unit and finally input into the MCU through respective fault injection units. And the model interaction system inputs an executable file formed by compiling the software model by the upper computer into the MCU through the real-time communication interface, and the MCU writes the executable file of the software model to the MCU in a flashing manner so that the MCU has a control strategy defined by the software model. The MCU simulation communication (such as JTAG, NEXUS and the like) analog unit is connected with the signal mapping matrix through the fault injection unit.
The invention realizes the construction of the semi-virtual ECU by virtue of the virtual peripheral and the real MCU entity, and the functions realized by the semi-virtual ECU are completely consistent with the functions of the entity ECU, so that the tests aiming at the functions, safety, interfaces and the like of the MCU and the software thereof can be independent of the real ECU hardware peripheral. From the V flow angle, the invention can run through the processes of hardware concept development, hardware framework development, hardware unit design, hardware unit simulation test, software unit test, system integration test and the like, widely covers the key development steps of the ECU, and can carry out interaction between software and hardware development at any time, thereby eliminating the problems of mutual restriction and mutual coupling. The MCU, the MCU bottom layer drive, the application layer control strategy and the hardware concept scheme can be directly tested and verified before the ECU hardware development is completed, and the development time of the ECU can be greatly shortened.
Drawings
Fig. 1 is a schematic structural view of a preferred embodiment of the present invention.
Fig. 2 is a schematic diagram of an implementation manner of the MCU virtual peripheral.
Fig. 3 and 4 are schematic diagrams of virtual peripheral function circuits.
Fig. 5 is a schematic diagram of a signal mapping matching matrix.
FIG. 6 is a schematic diagram of an implementation of a model interaction system.
Detailed Description
The semi-virtual ECU testing system for the vehicle shown in fig. 1 comprises an upper computer (PC) 1, a real-time system 7, a signal simulation unit and a fault injection unit thereof, an MCU simulation communication (such as JTAG, NEXUS, etc.) simulation unit 15 and a fault injection unit thereof, a signal mapping matrix unit 17, an MCU connecting seat, wherein the upper computer 1 is connected with the real-time system 7, and the real-time system 7 is respectively connected with the signal simulation unit and the fault injection unit thereof, the signal mapping matrix unit 17, the MCU simulation communication simulation unit 15 and the fault injection unit thereof through a real-time communication interface thereof; as can be seen from fig. 1, the signal simulation unit in the present embodiment includes an on-board communication simulation unit 10, a digital signal simulation unit 11, an analog signal simulation unit 12, an on-board communication (such as SPI bus, IIC bus, memory interface, etc.) simulation unit 14, and a power supply simulation unit 16;
the upper computer 1 is internally provided with a hardware model unit 2 (built by users through different software platforms), a controlled object model 3, a Test case 4, a software model 5 and a Test management program 6, wherein the hardware model unit 2 can be built through software such as Altium Designer to generate a hardware model file with element connection relation and element attributes, the controlled object model 3 and the software model 5 can be built through modeling programming software such as Simulink, the generation of the Test case 4 and the Test management program can be manufactured through Veristand or Simulink Test, and the real-time system 7 is provided with a virtual peripheral unit 8 and a model interaction unit 13;
the hardware model unit 2 in the upper computer 1 is used for building a model of an MCU peripheral hardware circuit in the ECU, realizing the functions of MCU peripheral principle design, obtaining the connection relation and parameter attributes of peripheral circuit elements, building element or chip logic and mathematical models and the like, and realizing virtual hardware peripheral. The general form of the controlled object model 3 is a mathematical model used for simulating the functions and characteristics of a real controlled object, and for the vehicle controller ECU, the controlled object is the vehicle dynamics characteristics; for the battery management system ECU, the controlled object is a power battery; the engine controller ECU controls the engine. The virtual hardware peripheral and the entity MCU are built into a semi-virtual ECU 19, and a controlled object model and the semi-virtual ECU form a control relation. The software model 5 is an ECU control strategy realized by using a graphical programming language, can be changed into a target programming language (such as C language) through a code generation tool, and can obtain an executable file of the MCU after compiling;
the virtual peripheral unit 8 in the real-time system 7 is connected (logically connected) with the hardware model unit 2 and the model interaction system 13, and is used for reading information of the hardware model unit in the upper computer, simulating an MCU peripheral hardware circuit (real-time, high-precision and 100% function reproduction) in the ECU according to output information of the hardware model unit, simulating functions of the MCU peripheral hardware circuit in the actual ECU, and forming a peripheral circuit virtual model;
the model interaction system 13 is connected (logically connected) with the controlled object model 3, the test case 4, the software model 5 and the test management program 6, and is used for integrating the peripheral circuit virtual model with the controlled object model 3 and the test case, performing iterative computation on the controlled object model by using the test case as the input of the controlled object model, and performing iterative computation by using the controlled object model as the input of the peripheral circuit virtual model; the model interactive system 13 is connected (electrically connected) with the signal simulation unit through the real-time communication interface 9, and is used for controlling the signal simulation unit to generate or receive various input or output signals of the MCU to be tested; the iteration result of the virtual model of the peripheral circuit is the input of the signal simulation unit, the signal simulation unit is connected with the signal mapping matrix, and the output of the signal simulation unit is input into the signal mapping matrix unit and finally input into the MCU through respective fault injection units.
The model interactive system 13 inputs an executable file formed by the upper computer compiling software model into the MCU simulation communication simulation unit 15 through the real-time communication interface 9, and the MCU simulation communication simulation unit 15 writes the executable file of the software model to the MCU, so that the MCU has a control strategy defined by the software model. The MCU simulation communication (such as JTAG, NEXUS and the like) analog unit is connected with the signal mapping matrix through the fault injection unit.
And the test management program is used for monitoring the building process and the whole test process of the semi-virtual ECU.
The signal mapping matrix 17 is connected to the MCU connection socket for connecting to the MCU to be tested (real). As shown in fig. 5, the signal mapping matrix 17 described in this embodiment is used to connect each analog unit (and its fault injection unit) in the signal analog unit to all pin interfaces of the MCU socket via the switch sets arranged in parallel. The signal generated by each analog unit (and the fault injection unit thereof) is accessed to any pin interface of the MCU connecting seat by gating the switches in the switch group arranged in parallel, so that the MCU connecting seat is suitable for connecting various MCUs; as shown in the figure, the connection relation between the MCU power supply voltage signal input and the pins of the MCU is schematically shown after the MCU connecting seat is connected with different MCUs.
The testing method for the realized semi-virtual ECU by using the testing system for the semi-virtual ECU for the vehicle is characterized by comprising the following steps:
the first step is as follows: the controlled object model, the test case and the software model are customized (the controlled object model, the test case and the software model are input into the upper computer or built in the upper computer), and the real-time system reads the controlled object model, the test case and the software model through the model interaction system and completes the simulation of the controlled object model and the test case;
the second step is that: placing the MCU to be tested in an MCU interface to realize the connection with the signal mapping matrix unit, and controlling the MCU simulation communication simulation unit by the real-time system through the real-time communication interface to flash the executable file compiled by the software model into the real MCU to be tested so as to realize the control strategy function of the MCU;
the third step: a hardware model unit (according to the designed MCU peripheral hardware circuit of the ECU) builds a circuit model of the MCU peripheral hardware circuit in the ECU and generates a circuit model file containing connection relation and element attributes; the hardware model unit may be implemented in conjunction with circuit design software (e.g., Altium Designer, etc.).
The fourth step: the circuit model file is transmitted to a virtual peripheral unit in a real-time system, the virtual peripheral unit uses a model of components (in which resistors, inductors, capacitors and the like are stored) and generates a mathematical model of the circuit model according to the circuit model file, and the mathematical model simulates the real-time, high-precision and 100% function reproduction of MCU peripheral hardware circuits in the ECU, so that the functions of the MCU peripheral hardware circuits in the actual ECU are simulated, and a peripheral circuit virtual model is formed.
The fifth step: the real-time system is communicated with the signal mapping matrix unit through a real-time communication interface, and the connection relation between the matching test resources and the tested MCU is defined according to the pins of the tested real MCU; and completing the connection between each signal simulation unit and the fault injection unit thereof and the specific pin of the MCU to be tested.
And a sixth step: the real-time system is communicated with the signal simulation unit through a real-time communication interface, and the signal simulation unit is configured (required) according to the test case and the excitation signal required by the test;
the seventh step: carrying out a test according to a test case input to a real-time system, wherein the real-time system uses the test case as the input of a virtual model of a peripheral circuit for iteration, the iteration result of the virtual model of the peripheral circuit is the input of a signal simulation unit, and the output of the signal simulation unit is input through a fault injection unit and finally input into an MCU (micro control unit); and simulating the process of monitoring and controlling the real controlled object by the real ECU.
The test management program monitors the correctness of logic, functions and time sequence in the construction and whole test process of the semi-virtual ECU, and response signals and data on the pins of the MCU during the test are collected in real time through a real-time system so as to judge whether the functions and strategies of the MCU are complete and reliable.
The specific process of the fourth step in the present invention is as shown in fig. 2, and the mathematical model of the virtual peripheral corresponding to the hardware model unit 2 is iteratively calculated by the virtual peripheral unit 8 of the real-time system 7, so as to complete the function and logic substitution of the MCU peripheral circuit, and realize the establishment of the virtual peripheral; the hardware model unit 2 in the upper computer 1 can also supplement the virtual peripheral unit 8 in the real-time system 7 with customized component models and logics, and a user can convert the component models or logics into executable files (such as library files or IP cores) in the real-time system 7 by using multiple programming languages, and the component models are called in future use. The dashed connection between the virtual peripheral unit 8 and the real MCU to be tested in fig. 2 represents the process of the real-time system 7 controlling the signal simulation units 10,11,12,14,15,16 and the fault injection unit and signal mapping matrix unit 17 thereof to input signals to the real MCU through the real-time communication interface 9. The replacement of the MCU peripheral hardware circuit, i.e., the establishment of the semi-virtual ECU 19, is completed so far. The virtual peripheral unit comprises all elements and mathematical models of chips which can be used in actual design, and mainly comprises passive elements such as resistors, capacitors, inductors, triodes, diodes and the like, and active elements such as a non-programmable semiconductor chip, a programmable semiconductor chip and the like. These virtual peripherals exist in the form of models with adjustable precision, parameters and form in real-time systems, and users can also describe and define customized chips or elements by means of specific programming languages (such as hardware languages VHDL and the like, computer languages C, C + + and the like or modeling programming and the like).
In the test resource allocation stage and the test development process before the seventh test, on one hand, the test management program obtains internal variables of the virtual peripheral unit and the model interaction system through the real-time system, and the variables represent the working states of the virtual peripheral unit and the model interaction system, the availability of external input information, the correctness of logic interface matching, memory management and verification conditions, and the instantaneity of test process step operation and iterative computation (for example, whether the connection relation of the input virtual hardware model is correctly realized, whether the data types of the variables of the test case and the corresponding variables of the controlled object model are matched, and the period of the model interaction system for iterative computation of the test case, the controlled object model and the peripheral circuit virtual model). On the other hand, the test management program acquires the internal variables of the signal simulation unit, the fault injection unit thereof and the signal mapping matrix unit through a real-time communication interface of the real-time system, and the variables represent the working states, the communication quality, the internal faults, the command response correctness and other information of the simulation unit, the fault injection unit thereof and the signal mapping matrix unit (such as whether the error of the analog signal output by the analog signal simulation unit exceeds an allowable threshold value, whether the digital signal simulation unit has the internal faults, whether the signal mapping matrix unit accesses the correct signal channel to a specific pin of the MCU). After the test management program obtains the above two information, the building process and the whole test process of the semi-virtual ECU 19 can be monitored through logic and time sequence judgment.
The schematic diagram of the signal mapping matrix 17 is shown in fig. 5, and the purpose of the matrix is to connect the signal paths of the signal simulation units 10-16 to any MCU pin, and each path of signals can be connected to different MCU pins through a switch. The switching signal connection can be realized by a mechanical relay, a semiconductor chip and other switch modes, and an appropriate switch mode is selected according to different signal types. The real-time system controls the on and off of the switch in the signal matching matrix 17 through the real-time communication interface 9, so that the signal of the signal simulation unit is connected to the correct real MCU pin to be tested. The connection with the real MCU to be tested of different types (models and functions) can be adjusted at will through the change-over switch. Taking the power supply of the tested real MCU as an example, as shown in fig. 5, the power voltage signal generated by the power signal simulation board (power signal simulation unit) is connected to the VDD pin of the tested real MCU. The establishment of the semi-virtual ECU 19 is realized by utilizing the virtual peripheral 8, the real-time communication interface 9, the signal simulation and fault injection units 10-16, the signal mapping matrix 17 and the real MCU 18 to be tested.
The test case of a specific ECU, the software model of the ECU and the model of the controlled object established by the user in the upper computer 1 are also configured with a test management program for managing the test in a customized manner, and the information is converted into a file which can be identified and executed by a real-time system before the test and is transmitted to the model interaction system 13 of the real-time system 7.
As shown in fig. 6, the model interaction system 13 is configured to match resources (input end of the virtual peripheral) such as information and interface required by the test, for example, output signals of the test case 4 need to be integrated into corresponding input of the virtual peripheral 8; the output information of the controlled object model 3 needs to be matched with the input of the virtual peripheral 8, and the like. The model interactive system 13 needs to input the relevant information of the test case 4, the controlled object model 3, the virtual peripheral 8 and the software model 5. The real-time system 7 controls the MCU simulation communication simulation unit 15 through a real-time communication interface to write the executable file compiled by the software model 5 into the tested real MCU 18 so as to realize the control strategy function of the MCU; the controlled object model 3 simulates the function of a real controlled object and forms a control relation with the semi-virtual ECU 19; the virtual peripheral generated by the hardware model unit 2 simulates an MCU peripheral hardware circuit; the real MCU containing the control strategy and the virtual peripherals (and associated hardware) form a semi-virtual ECU 19; the test case 4 is also transmitted to the model interaction system after being compiled, and is used as the working condition input of the controlled object model 3 and the semi-virtual ECU 19, and the test case and the semi-virtual ECU output response according to the excitation of the test case and the self function and the operation principle. The real-time system 7 is matched with the model interaction system 13 to complete the construction of a test environment through integration, calling and iteration of the test case 4, the controlled object model 3, the executable file of the virtual peripheral 8 and the mathematical model, and simulate the process of monitoring and controlling the real controlled object by the real ECU. The test management program 6 can monitor the correctness of logic, function and time sequence in the construction and whole test process of the semi-virtual ECU, and collects process signals and data in the test process to judge whether the function and strategy of the MCU are complete and reliable.
The following description will be made by taking two typical circuits of fig. 3 and 4 as examples. The circuit of fig. 3 is generally used for input power supply voltage acquisition of the ECU in order to diagnose the state of the external power supply. Assuming that the test voltage input to the hardware interface of the semi-virtual ECU in the MCU test process isV in The voltage actually input into the MCU after conversion through the virtual peripheral isV out . A user firstly draws a schematic diagram like fig. 3 through circuit design software (such as aluminum Designer, etc.), a hardware model file containing connection relation and element attributes can be generated after drawing, the file is then transmitted to a virtual peripheral unit in a real-time system, models of components such as resistance, inductance and capacitance are already stored in the virtual peripheral unit, the models can be reintegrated into a mathematical model of a complete circuit according to the information of the file, and the building process is as follows:
Figure 667660DEST_PATH_IMAGE001
the following formula (2) is obtained after discretization:
Figure 336539DEST_PATH_IMAGE002
in the formula:
Figure 736427DEST_PATH_IMAGE003
after the virtual peripheral is obtained, the test can be carried out, and the test cases stored in the real-time system can be changed in real timeV in (ii) a In thatV in When the circuit changes, the real-time system simultaneously iterates the discretization mathematical model of the circuit to obtainV out The real-time value is transmitted to the analog signal simulation unit through the real-time communication interface to realize realityV out And (3) generating a voltage signal, and finally inputting the signal to the MCU for sampling so as to finish the functions of filtering, voltage division circuits and the like of the figure 3.
Fig. 4 is another functional circuit, which is used for conditioning a digital signal by the ECU and converting a digital indication signal with a higher external voltage into a digital level signal acceptable by the MCU. Similarly, a user first draws the schematic diagram shown in fig. 4 and obtains information about connection relationships and element attributes, and after obtaining the information, the virtual peripheral unit in the real-time system reproduces the principle and functions by using the internal element model, and obtains an expression of the whole circuit shown in (3). Because the circuit is applied to a digital circuit, the expression (3) uses an ideal simplified model of a rectifier diode, a voltage regulator diode and a comparator, neglects the influence of transient characteristics and nonlinear characteristics, and can be expressed by establishing a mathematical model with higher precision according to an element manual. The modeling modes of the same element are various, and a user can input the self-built element model to the virtual peripheral unit in the real-time system and use the elements to simulate the MCU peripheral according to requirements.
Figure 490757DEST_PATH_IMAGE004
In the formula:
Figure 227769DEST_PATH_IMAGE005
real-time system change according to test caseV in V bat The values of the variables are input, and the expression is obtained by iterative calculationV out The level value (0 or 1), the level information will be transmitted to the digital signal analog unit for simulating the level signal inputted to the MCU pin.
In fig. 2, there are other virtual peripherals, which are abstracted in the present invention as mathematical models and functional logic as above, run in a real-time system, and generate signals interacting with the MCU through various signal simulation units and signal mapping matrices, reproducing the functions of real peripheral hardware circuits. For example, the function, logic and timing of the virtual hardware watchdog chip are consistent with those of the real watchdog chip selected by the user, that is, the MCU is ensured to be always within the normal working boundary by periodically resetting the timer in the watchdog chip, if the operation is overtime, the virtual watchdog chip in the real-time system 7 resets the MCU through the digital signal simulation unit 11 and the signal mapping matrix 17, and the logic and model of the virtual chip can be obtained by user programming.
The general procedure of the test is described in detail below: before the test case is automatically executed, the executable file converted by the software model in the upper computer 1 is flushed to the program space of the MCU 18. This process consists of 3 steps: firstly, the real-time system 7 communicates with a signal mapping matrix unit 17 and an MCU simulation communication simulation unit 15 through a real-time communication interface 9, and configures the connection relation with the MCU simulation interface; the real-time system 7 communicates with the power supply simulation unit 16 through the real-time communication interface 9 to supply power to the MCU; and calling the simulation interface peripheral equipment and the protocol (such as JTAG, NEXUS and the like) in the virtual peripheral equipment 8 by the real-time system 7, and performing program flash on the MCU and verifying after the flash. This process ensures that the test program is in the same version as the test environment and test cases.
After the flash is finished, the real-time system 7 will perform the generation of the test environment. This process consists of 6 steps: firstly, a real-time system 7 communicates with signal simulation units 10,11,12,14,15 and 16 through a real-time communication interface 9, and configures test resources and parameters thereof related to a current MCU to be tested, such as a specific digital input/output channel, a specific analog input/output channel, an onboard SPI, an IIC communication channel, a power signal input/output channel, a vehicle-mounted communication signal, fault injection resources of different channels and the like; the real-time system 7 communicates with the signal mapping matrix unit 17 through the real-time communication interface 9 to match the connection relationship between the testing channel resources and the MCU; the real-time system 7 checks and verifies the configuration work to ensure no error; compiling the built hardware model, reading the compiled hardware model by a real-time system, activating corresponding virtual peripheral equipment to simulate a tested real MCU peripheral circuit, and completing the building of a semi-virtual ECU 19; fifthly, customizing the controlled object model and the test case, reading the model and the test case by a real-time system after compiling, and simulating the controlled object and the test case. And sixthly, inputting the test case to a real-time system, and determining an excitation signal on the controlled object model and the semi-virtual ECU interface. After the customized test environment is built, the user can start the test process.
The real-time system 7 starts to perform automatic testing according to the information in the model interaction system, including the test case 4, the controlled object model 3, the virtual peripheral 8, the test management program 6 and the like, and the logic and function control of the testing process is controlled by the model interaction system. This process is a simulation and reproduction of a real ECU test process. These tests not only contain verification of normal function, but also include robustness testing for fault injection. The real-time system 7 sends information in the testing process to the testing management program 6 of the upper computer 1, and after the testing is finished, the real-time system summarizes and reports the executed testing data.
When testing is carried out on different MCUs of different ECUs, the signals are ensured to be correctly connected through switching of a real-time system control signal mapping matrix, corresponding hardware models, controlled object models 3, software models 5 and test cases 4 are replaced, and corresponding semi-virtual ECUs, controlled objects and test cases are constructed. And simulating the control process of the real ECU according to three steps of MCU program refreshing, test environment building and automatic testing.
The advantages of the invention are as follows:
1. flexibility: any MCU and any ECU based on any MCU can be tested. When testing different MCU and ECU, only different hardware model, controlled object model, test case and software model are needed to control the real-time system to generate virtual peripheral equipment, generate and receive test signal of MCU. The flexible connection of the signals and the MCU is realized through a signal matching matrix, so that the test requirement can be met widely;
2. high efficiency: the software strategy, the MCU bottom layer drive and the MCU can be tested and verified before the ECU hardware entity is developed. The virtual peripheral is used for building a system integration test environment surrounding the MCU, so that the system integration test environment can be parallel to hardware development, and the ECU development period is shortened;
3. and (3) full fault simulation: the general system integration test (HIL) can only perform function test and fault injection on peripheral signals of an ECU entity, and can not simulate the MCU and possible peripheral faults. The invention can simulate any software and hardware faults on the ECU;
4. the cost is low: the resource cost of purchasing a hardware peripheral development board and replacing the hardware peripheral and the time cost of V flow development of the ECU are saved.
On the basis of the integrated HIL test of the vehicle ECU system, hardware circuits except the MCU in an ECU hardware entity are further replaced by virtual peripherals, and a real-time system control signal simulation unit generates and receives signals input and output by the MCU during the test, so that the semi-virtual ECU test system for the vehicle is provided, and the MCU, the MCU bottom layer drive, the application layer control strategy and the hardware concept scheme can be directly tested and verified before the ECU hardware development is completed. The hardware model unit of the upper computer realizes model building of the MCU peripheral hardware circuit in the ECU, the virtual peripheral in the real-time system reads hardware model information in the upper computer, and the simulation of real-time, high-precision and 100% function reproduction of the MCU peripheral hardware circuit in the ECU (simulating the function of the MCU peripheral hardware circuit in the actual ECU) is realized. After the functions of the MCU peripheral circuit in the ECU are called by the virtual peripheral in the real-time system, the model of the MCU peripheral circuit is integrated with a controlled object model and a test case through a model interaction system, the model interaction system establishes communication with a test environment generation unit such as a signal simulation unit and the like through a real-time communication interface, and the signal simulation unit generates or receives analog signals, digital signals, power signals, interface signals and the like input or output by the MCU. These simulated signals will superimpose the required faults through the fault injection unit in order to test the robustness of the MCU and its software to faults. The test signal of the superposition failure may be connected to a specific pin of the MCU through the signal mapping matrix. The signal path enables the MCU and the software thereof to establish an interactive relation with the test case and the controlled object model, and the signals can be monitored by the real-time system and the upper computer PC in real time to judge whether the functions and strategies of the MCU and the software thereof are complete and reliable.
The invention realizes the construction of the semi-virtual ECU by virtue of the virtual peripheral and the real MCU entity, and the functions realized by the semi-virtual ECU are completely consistent with the functions of the entity ECU, so that the tests aiming at the functions, safety, interfaces and the like of the MCU and the software thereof can be independent of the real ECU hardware peripheral. From the V flow angle, the invention can run through the processes of hardware concept development, hardware framework development, hardware unit design, hardware unit simulation test, software unit test, system integration test and the like, widely covers the key development steps of the ECU, and can carry out interaction between software and hardware development at any time, thereby eliminating the problems of mutual restriction and mutual coupling.

Claims (4)

1. A semi-virtual ECU test system for a vehicle is characterized by comprising an upper computer PC, a real-time system, a signal simulation unit and a fault injection unit thereof, an MCU simulation communication simulation unit and a fault injection unit thereof, a signal mapping matrix unit and an MCU connecting seat, wherein the upper computer is connected with the real-time system which is respectively connected with the signal simulation unit and the signal mapping matrix unit;
the upper computer is internally provided with a hardware model unit, a controlled object model, a test case, a software model and a test management program, and the real-time system is provided with a virtual peripheral unit and a model interaction system;
the hardware model unit in the upper computer is used for building a model of a MCU peripheral hardware circuit in the ECU; the controlled object model is used for simulating the function of a real controlled object; the software model is an ECU control strategy realized by using a graphical programming language, can be changed into a target programming language through a code generation tool, can obtain an executable file of the MCU after compiling, and is used for monitoring the building process and the whole test process of the semi-virtual ECU by a test management program;
the virtual peripheral unit in the real-time system is used for reading the information of the hardware model unit in the upper computer, simulating the MCU peripheral hardware circuit in the ECU and forming a peripheral circuit virtual model;
the model interaction system is used for integrating the peripheral circuit virtual model, the controlled object model and the test case;
the signal mapping matrix unit is connected with the MCU connecting seat and is used for connecting the MCU to be tested.
2. The vehicular semi-virtual ECU testing system according to claim 1, characterized in that the signal simulation unit comprises a vehicular communication simulation unit, a digital signal simulation unit, an analog signal simulation unit, an onboard communication simulation unit, and a power supply simulation unit.
3. The semi-virtual ECU test system for the vehicle according to claim 1 or 2, wherein the signal mapping matrix unit connects each analog unit in the signal analog units to all pin interfaces of the MCU connecting socket via a switch set arranged in parallel.
4. A method for testing a semi-virtual ECU for a vehicle using the system for testing a semi-virtual ECU for a vehicle of claim 1, comprising the steps of:
the first step is as follows: the controlled object model, the test case and the software model are customized, and the real-time system reads the model through the model interaction system to complete the simulation of the controlled object and the test case;
the second step is that: placing the MCU to be tested in an MCU interface to realize the connection with the signal mapping matrix unit, and controlling the MCU simulation communication simulation unit by the real-time system through the real-time communication interface to flash the executable file compiled by the software model into the real MCU to be tested so as to realize the control strategy function of the MCU;
the third step: the hardware model unit builds a circuit model of a MCU peripheral hardware circuit in the ECU and generates a circuit model file containing connection relation and element attributes;
the fourth step: transmitting the circuit model file to a virtual peripheral unit in a real-time system, wherein the virtual peripheral unit generates a mathematical model of the circuit model according to the circuit model file by using a model of a component;
the fifth step: the real-time system is communicated with the signal mapping matrix unit through a real-time communication interface to match the connection relation between the test resources and the MCU to be tested;
and a sixth step: the real-time system is communicated with the signal simulation unit through a real-time communication interface, and the signal simulation unit is configured;
the seventh step: carrying out a test according to a test case input to a real-time system, wherein the real-time system uses the test case as the input of a virtual model of a peripheral circuit for iteration, the iteration result of the virtual model of the peripheral circuit is the input of a signal simulation unit, and the output of the signal simulation unit is input through a fault injection unit and finally input into an MCU (micro control unit); the test process simulates the process of monitoring and controlling a real controlled object by a real ECU;
the test management program monitors the correctness of logic, functions and time sequence in the construction and whole test process of the semi-virtual ECU, and response signals and data on the pins of the MCU during the test are collected in real time through a real-time system so as to judge whether the functions and strategies of the MCU are complete and reliable.
CN201910632041.5A 2019-07-12 2019-07-12 Semi-virtual ECU (electronic control Unit) test system for vehicle and test method thereof Active CN110377004B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910632041.5A CN110377004B (en) 2019-07-12 2019-07-12 Semi-virtual ECU (electronic control Unit) test system for vehicle and test method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910632041.5A CN110377004B (en) 2019-07-12 2019-07-12 Semi-virtual ECU (electronic control Unit) test system for vehicle and test method thereof

Publications (2)

Publication Number Publication Date
CN110377004A CN110377004A (en) 2019-10-25
CN110377004B true CN110377004B (en) 2020-08-11

Family

ID=68253009

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910632041.5A Active CN110377004B (en) 2019-07-12 2019-07-12 Semi-virtual ECU (electronic control Unit) test system for vehicle and test method thereof

Country Status (1)

Country Link
CN (1) CN110377004B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP4436223A1 (en) * 2023-03-20 2024-09-25 Xiaomi EV Technology Co., Ltd. Linkage system, method, vehicle, storage medium and chip

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111258294B (en) * 2020-01-07 2021-06-29 北京经纬恒润科技股份有限公司 Fault tolerance time testing system and method
CN111308988A (en) * 2020-03-06 2020-06-19 鹏睿检测技术(上海)有限公司 Automobile electronic control unit test system
CN111708351B (en) * 2020-06-23 2022-05-17 东风汽车股份有限公司 Intelligent detection system and detection method for vehicle body controller
CN111830936A (en) * 2020-07-23 2020-10-27 重庆红江机械有限责任公司 ECU detection calibration system
US11755800B2 (en) * 2020-08-12 2023-09-12 University Of South Carolina Solver creation tool for system simulation
CN112560515B (en) * 2020-12-22 2022-08-16 福建新大陆支付技术有限公司 Method and device for realizing automatic test based on magnetic card simulation and storage medium
CN112636894B (en) * 2020-12-28 2024-05-21 联创汽车电子有限公司 ECU communication module testing method, testing equipment and storage medium based on time parameters
CN113433862B (en) * 2021-06-30 2022-06-10 奇瑞汽车股份有限公司 Simulation method and device of new energy automobile energy management system and storage medium
CN114253158A (en) * 2021-12-23 2022-03-29 江苏辛艾络科技研发有限公司 Semi-physical rapid test system based on virtual resistance
CN114741289B (en) * 2022-03-31 2024-06-04 深蓝汽车科技有限公司 Automatic generation method and system for test cases aiming at controller software storage function
CN115061450A (en) * 2022-05-16 2022-09-16 中汽创智科技有限公司 Flash test method, device and equipment for vehicle-mounted controller and storage medium
CN115576807B (en) * 2022-09-28 2023-09-08 国科础石(重庆)软件有限公司 Virtual ECU implementation method and device, electronic equipment and storage medium
CN115455089B (en) * 2022-11-09 2023-02-28 西安弘捷电子技术有限公司 Performance evaluation method and system of passive component and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101420481B1 (en) * 2011-11-08 2014-07-16 주식회사 만도 In-vehicle debugging system for ecu and method thereof
CN105974909A (en) * 2016-06-28 2016-09-28 河北工业大学 Automatic configuration box for automobile electronic test circuit
CN107479542A (en) * 2017-09-26 2017-12-15 浙江力邦合信智能制动系统股份有限公司 A kind of vehicle ECU test systems
CN108873867A (en) * 2018-07-27 2018-11-23 南京越博动力系统股份有限公司 A kind of automation load and direct fault location test macro and control method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP4436223A1 (en) * 2023-03-20 2024-09-25 Xiaomi EV Technology Co., Ltd. Linkage system, method, vehicle, storage medium and chip

Also Published As

Publication number Publication date
CN110377004A (en) 2019-10-25

Similar Documents

Publication Publication Date Title
CN110377004B (en) Semi-virtual ECU (electronic control Unit) test system for vehicle and test method thereof
CN109324601B (en) Test platform of robot controller or control system based on hardware-in-the-loop
CN107562038B (en) Automatic test system for vehicle-mounted controller
Ramaswamy et al. A case study in hardware-in-the-loop testing: Development of an ECU for a hybrid electric vehicle
JP2014203314A (en) ECU simulation device
JP2008287709A (en) Adaptation element, test system, and operation method of adaptation element and test system
US20170045865A1 (en) Method for connecting an input/output interface of a tester equipped for control unit development
Weissnegger et al. Simulation-based verification of automotive safety-critical systems based on EAST-ADL
CN107943008A (en) Automated diagnostic test method based on VT systems
CN113759879B (en) Vehicle-mounted Ethernet DoIP diagnosis and writing test method and system based on L3 whole vehicle architecture
CN116340150A (en) Reusable register performance interactive verification system based on UVM and application thereof
Mews et al. From AUTOSAR models to co-simulation for MiL-Testing in the automotive domain
Abdo et al. A seamless and end-to-end approach for early and continuous validation of next-generation avionics platforms
WO2004019239A2 (en) Object-oriented design method for the time-effective and cost-effective development of production-grade embedded systems based on a standardized system architecture
KR102401024B1 (en) Railroad simulator for hardware and software intetration
US20040260531A1 (en) Emulation system and method
CN111123084B (en) TCL language-based digital circuit rapid test method
CN114488997A (en) ECU (electronic control Unit) flashing method and device, electronic equipment and storage medium
Xu et al. Design of vehicle gateway automatic test system based on CANoe
Häseker et al. From Behavioural to In-Depth Modelling of a Scalable Spacecraft Power System in SystemC-AMS using Continuous Integration Techniques
Rolfsmeier et al. A new calibration system for ECU development
Nuzzo et al. Platform-based design methodology and modeling for aircraft electric power systems
Hillenbrand et al. Rapid specification of hardware-in-the-loop test systems in the automotive domain based on the electric/electronic architecture description of, vehicles
Yadav et al. Development of Virtual Test Environment for Vehicle Level Simulation
CN110751873B (en) Method for interconnecting whole vehicle electric control practical training platform of new energy automobile and actual vehicle

Legal Events

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