CN114296432A - Automatic hardware-in-loop testing method, device, medium and equipment - Google Patents

Automatic hardware-in-loop testing method, device, medium and equipment Download PDF

Info

Publication number
CN114296432A
CN114296432A CN202111632428.4A CN202111632428A CN114296432A CN 114296432 A CN114296432 A CN 114296432A CN 202111632428 A CN202111632428 A CN 202111632428A CN 114296432 A CN114296432 A CN 114296432A
Authority
CN
China
Prior art keywords
test
ecu
tested
test case
functional
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.)
Pending
Application number
CN202111632428.4A
Other languages
Chinese (zh)
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.)
Chongqing Jicheng Automotive Electronics Co ltd
Original Assignee
Chongqing Jicheng Automotive Electronics 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 Chongqing Jicheng Automotive Electronics Co ltd filed Critical Chongqing Jicheng Automotive Electronics Co ltd
Priority to CN202111632428.4A priority Critical patent/CN114296432A/en
Publication of CN114296432A publication Critical patent/CN114296432A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Tests Of Electronic Circuits (AREA)

Abstract

The invention discloses an automatic hardware-in-loop testing method, which comprises the following steps: determining an IO port corresponding to the ECU to be tested according to the mapping relation between the type of the ECU to be tested and the IO port; configuring an IO port drive control file for an IO port corresponding to the ECU to be tested, wherein the IO port drive control file is used for driving the IO port; determining functional test points of the ECU to be tested, and selecting test cases corresponding to the functional test points from a pre-constructed test case library; generating an excitation signal according to the test case, and sending the excitation signal to an ECU to be tested; receiving, by the test system, a feedback signal generated by the ECU under test in response to the excitation signal; and generating a test result according to the feedback signal so as to complete the in-loop test of the ECU. The invention has the advantages of low cost, low later maintenance cost, simple and convenient operation, light weight, rich application scenes and customization according to requirements.

Description

Automatic hardware-in-loop testing method, device, medium and equipment
Technical Field
The invention belongs to the technical field of automotive electronics, and particularly relates to an automatic hardware-in-the-loop testing method, device, medium and equipment.
Background
Under the current automotive electronic technology, automatic testing becomes a necessary condition for developing rapid response of products, and the traditional manual interaction cannot meet the changing user requirements, so that the efficiency is low and the performance cannot be stabilized. Although the existing automatic test based on the HIL platform can meet the specific embedded test in the virtual environment, the existing automatic test based on the HIL platform is limited by the limitations of large size, complex operation, inconvenience for real-vehicle debugging and the like, and is no longer the first choice for the automatic integrated test.
Therefore, there is a need for an automated hardware-in-the-loop test system that is portable and easy to maintain.
Disclosure of Invention
In view of the above-identified shortcomings in the prior art, it is an object of the present invention to provide an automated hardware-in-the-loop testing method, apparatus, medium, and device that address at least one of the deficiencies in the prior art.
To achieve the above and other related objects, the present invention provides an automated hardware-in-the-loop testing method, comprising:
determining an IO port corresponding to the ECU to be tested according to the mapping relation between the type of the ECU to be tested and the IO port;
configuring an IO port drive control file for an IO port corresponding to the ECU to be tested, wherein the IO port drive control file is used for driving the IO port;
determining functional test points of the ECU to be tested, and selecting test cases corresponding to the functional test points from a pre-constructed test case library;
generating an excitation signal according to the test case, and sending the excitation signal to an ECU to be tested;
receiving, by the test system, a feedback signal generated by the ECU under test in response to the excitation signal;
and generating a test result according to the feedback signal so as to complete the in-loop test of the ECU.
Optionally, the generating an excitation signal according to the test case includes:
and calling a target test case from a predefined functional test case library, and generating an excitation signal according to the target test case, wherein the target test case is one of a plurality of test cases of the functional test case library.
Optionally, the step of generating the functional test case includes:
according to the functional specification of the ECU;
determining a function test point corresponding to the function specification;
generating a function test case corresponding to the function test point;
and generating a functional test case library through the functional test cases.
Optionally, the functional test point corresponds to at least one functional test case.
To achieve the above and other related objects, the present invention provides an automatic hardware-in-the-loop testing apparatus, comprising:
the first matching module is used for determining the IO port corresponding to the ECU to be tested according to the mapping relation between the type of the ECU to be tested and the IO port;
the configuration module is used for configuring an IO port drive control file for the IO port corresponding to the ECU to be tested, and the IO port drive control file is used for driving the IO port;
the second matching module is used for determining the functional test points of the ECU to be tested and selecting the test cases corresponding to the functional test points from the pre-constructed test case library;
the excitation signal generating module is used for generating an excitation signal according to the test case and sending the excitation signal to the ECU to be tested;
the feedback signal receiving module is used for receiving a feedback signal generated by the ECU to be tested in response to the excitation signal through the testing system;
and the test result generating module is used for generating a test result according to the feedback signal so as to complete the in-loop test of the ECU.
Optionally, the excitation signal generating module invokes a target test case from a predefined functional test case library, and generates the excitation signal according to the target test case, where the target test case is one of multiple test cases in the functional test case library.
Optionally, the method for generating the functional test case includes:
according to the functional specification of the ECU;
determining a function test point corresponding to the function specification;
generating a function test case corresponding to the function test point;
and generating a functional test case library through the functional test cases.
Optionally, the functional test point corresponds to at least one functional test case.
To achieve the above and other related objects, the present invention provides a computer-readable storage medium having stored thereon a computer program, which, when executed by a processor, performs the steps of the test method.
To achieve the above and other related objects, the present invention provides a computer device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the testing method when executing the computer program.
As described above, the method, the apparatus and the computer-readable storage medium for testing an automatic hardware-in-the-loop according to the present invention have the following advantages:
the invention discloses an automatic hardware-in-loop testing method, which comprises the following steps: determining an IO port corresponding to the ECU to be tested according to the mapping relation between the type of the ECU to be tested and the IO port; configuring an IO port drive control file for an IO port corresponding to the ECU to be tested, wherein the IO port drive control file is used for driving the IO port; determining functional test points of the ECU to be tested, and selecting test cases corresponding to the functional test points from a pre-constructed test case library; generating an excitation signal according to the test case, and sending the excitation signal to an ECU to be tested; receiving, by the test system, a feedback signal generated by the ECU under test in response to the excitation signal; and generating a test result according to the feedback signal so as to complete the in-loop test of the ECU. The invention has the advantages of low cost, low later maintenance cost, simple and convenient operation, light weight, rich application scenes and customization according to requirements.
Drawings
FIG. 1 is a flow chart of an automated hardware-in-the-loop testing method according to an embodiment of the present invention;
FIG. 2 is a schematic block diagram of an automated hardware-in-the-loop test apparatus according to an embodiment of the present invention;
FIG. 3 is a block diagram of an automated hardware-in-the-loop testing apparatus according to an embodiment of the present invention.
Detailed Description
The embodiments of the present invention are described below with reference to specific embodiments, and other advantages and effects of the present invention will be easily understood by those skilled in the art from the disclosure of the present specification. The invention is capable of other and different embodiments and of being practiced or of being carried out in various ways, and its several details are capable of modification in various respects, all without departing from the spirit and scope of the present invention. It is to be noted that the features in the following embodiments and examples may be combined with each other without conflict.
It should be noted that the drawings provided in the following embodiments are only for illustrating the basic idea of the present invention, and the components related to the present invention are only shown in the drawings rather than drawn according to the number, shape and size of the components in actual implementation, and the type, quantity and proportion of the components in actual implementation may be changed freely, and the layout of the components may be more complicated.
As shown in fig. 1, an embodiment of the present application provides an automated hardware-in-the-loop testing method, including the following steps:
s11 determining the IO port corresponding to the ECU to be tested according to the mapping relation between the type of the ECU to be tested and the IO port;
s12 configuring an IO port drive control file for the IO port corresponding to the ECU to be tested, wherein the IO port drive control file is used for driving the IO port;
s13, determining functional test points of the ECU to be tested, and selecting test cases corresponding to the functional test points from a pre-constructed test case library;
s14, generating an excitation signal according to the test case, and sending the excitation signal to an ECU to be tested;
s15 receiving a feedback signal generated by the ECU to be tested in response to the excitation signal through the test system;
and S16, generating a test result according to the feedback signal to complete the in-loop test of the ECU.
The invention has the advantages of low cost, low later maintenance cost, simple and convenient operation, light weight, rich application scenes and customization according to requirements.
In step S11, determining an IO port corresponding to the ECU to be tested according to the mapping relationship between the type of the ECU to be tested and the IO port;
because different ECUs have different input and output terminals, IO ports corresponding to the ECUs need to be matched according to different ECUs, so as to input and output different data through different IO ports.
In step S13, the functional test points of the ECU to be tested are determined, and the test cases corresponding to the functional test points are selected from the pre-constructed test case library.
Each functional test point corresponds to at least one test case. Because a plurality of test cases are stored in the test case library, the test case corresponding to the test case can be selected from the test case library under the condition that the functional test points of the ECU to be tested are clear.
Specifically, the step of generating the functional test case includes:
according to the functional specification of the ECU;
determining a function test point corresponding to the function specification;
generating a function test case corresponding to the function test point; it should be noted that the functional test points correspond to at least one functional test case;
and generating a functional test case library through the functional test cases.
In one embodiment, the generating the excitation signal according to the test case includes:
and calling a target test case from a predefined functional test case library, and generating an excitation signal according to the target test case, wherein the target test case is one of a plurality of test cases of the functional test case library.
In the application, the ECU end wiring harness plug connector is connected to a general aviation plug interface of a test system, so that an excitation signal of the test system is output to the ECU through a conditioning circuit, and meanwhile, an ECU feedback signal is transmitted back to the test system; test results are generated from the feedback signal.
In this embodiment, the most basic execution actions of the ECU can be simulated and operated, and if other execution actions are required, the basic execution actions can be correspondingly combined, so as to implement state switching of the ECU and triggering and closing of functions by corresponding logics, implement forward and reverse test coverage of function points, and record test process data. And automatically recording the test result into the test case library so as to realize the visualization of the test result.
In this embodiment, the data acquisition and data transmission rate is less than 1ms, which facilitates data analysis and database extraction. And meanwhile, a friendly software interaction and automation script interface is provided, so that subsequent product iteration is facilitated.
In a specific embodiment, the function of the steering lamp is simulated and tested, the BSP layer is initialized to configure data to be low-side, the LINK layer is scanned, initialized and configured to be self-adaptive to detect, the APP layer is provided with a SEQ script of the steering lamp, response signals of an ECU terminal are collected, and effective output is judged. The analog level value is changed and a difference analysis is performed for detecting a corresponding change. And judging the flashing times of the steering lamp according to the output response duration time so as to calculate whether the actual output meets the requirement. The BSP layer and the LINK layer are initialized and configured according to the APP layer, curing is conducted, the follow-up iteration test case only needs to change the logic of the APP layer end, the speed is extremely high, and the operation is simple.
The invention provides an automatic hardware-in-the-loop testing device, which comprises:
the first matching module is used for determining the IO port corresponding to the ECU to be tested according to the mapping relation between the type of the ECU to be tested and the IO port;
the configuration module is used for configuring an IO port drive control file for the IO port corresponding to the ECU to be tested, and the IO port drive control file is used for driving the IO port;
the second matching module is used for determining the functional test points of the ECU to be tested and selecting the test cases corresponding to the functional test points from the pre-constructed test case library;
the excitation signal generating module is used for generating an excitation signal according to the test case and sending the excitation signal to the ECU to be tested;
the feedback signal receiving module is used for receiving a feedback signal generated by the ECU to be tested in response to the excitation signal through the testing system;
and the test result generating module is used for generating a test result according to the feedback signal so as to complete the in-loop test of the ECU.
In an embodiment, the excitation signal generating module calls a target test case from a predefined functional test case library, and generates the excitation signal according to the target test case, where the target test case is one of multiple test cases in the functional test case library.
In one embodiment, the method for generating the functional test case includes:
according to the functional specification of the ECU;
determining a function test point corresponding to the function specification;
generating a function test case corresponding to the function test point;
and generating a functional test case library through the functional test cases.
In an embodiment, the functional test point corresponds to at least one functional test case.
The above-mentioned device and the specific implementation of the detection method are substantially the same, and are not described herein again.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
The embodiment of the present application provides a computer device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the detection method when executing the computer program.
The embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, wherein the computer program is implemented to implement the steps of the detection method when being executed by a processor.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus/terminal device and method may be implemented in other ways. For example, the above-described embodiments of the apparatus/terminal device are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated modules/units, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer readable medium may comprise any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a Random Access Memory (RAM), an electrical carrier signal, a telecommunications signal, a software distribution medium, etc.
The foregoing embodiments are merely illustrative of the principles and utilities of the present invention and are not intended to limit the invention. Any person skilled in the art can modify or change the above-mentioned embodiments without departing from the spirit and scope of the present invention. Accordingly, it is intended that all equivalent modifications or changes which can be made by those skilled in the art without departing from the spirit and technical spirit of the present invention be covered by the claims of the present invention.

Claims (10)

1. An automated hardware-in-the-loop test method, comprising:
determining an IO port corresponding to the ECU to be tested according to the mapping relation between the type of the ECU to be tested and the IO port;
configuring an IO port drive control file for an IO port corresponding to the ECU to be tested, wherein the IO port drive control file is used for driving the IO port;
determining functional test points of the ECU to be tested, and selecting test cases corresponding to the functional test points from a pre-constructed test case library;
generating an excitation signal according to the test case, and sending the excitation signal to an ECU to be tested;
receiving, by the test system, a feedback signal generated by the ECU under test in response to the excitation signal;
and generating a test result according to the feedback signal so as to complete the in-loop test of the ECU.
2. The automated hardware-in-the-loop test method of claim 1, wherein the generating an excitation signal from the test case comprises:
and calling a target test case from a predefined functional test case library, and generating an excitation signal according to the target test case, wherein the target test case is one of a plurality of test cases of the functional test case library.
3. The automated hardware-in-the-loop test method of claim 2, wherein the step of generating the functional test cases comprises:
according to the functional specification of the ECU;
determining a function test point corresponding to the function specification;
generating a function test case corresponding to the function test point;
and generating a functional test case library through the functional test cases.
4. The automated hardware-in-the-loop testing method of claim 1, wherein the functional test points correspond to at least one functional test case.
5. An automated hardware-in-the-loop test apparatus, comprising:
the first matching module is used for determining the IO port corresponding to the ECU to be tested according to the mapping relation between the type of the ECU to be tested and the IO port;
the configuration module is used for configuring an IO port drive control file for the IO port corresponding to the ECU to be tested, and the IO port drive control file is used for driving the IO port;
the second matching module is used for determining the functional test points of the ECU to be tested and selecting the test cases corresponding to the functional test points from the pre-constructed test case library;
the excitation signal generating module is used for generating an excitation signal according to the test case and sending the excitation signal to the ECU to be tested;
the feedback signal receiving module is used for receiving a feedback signal generated by the ECU to be tested in response to the excitation signal through the testing system;
and the test result generating module is used for generating a test result according to the feedback signal so as to complete the in-loop test of the ECU.
6. The automated hardware-in-the-loop test apparatus of claim 5, wherein the stimulus signal generation module invokes a target test case from a predefined functional test case library, generates a stimulus signal according to the target test case, and the target test case is one of a plurality of test cases of the functional test case library.
7. The automated hardware-in-the-loop test apparatus of claim 6, wherein the method of generating the functional test cases comprises:
according to the functional specification of the ECU;
determining a function test point corresponding to the function specification;
generating a function test case corresponding to the function test point;
and generating a functional test case library through the functional test cases.
8. The automated hardware-in-the-loop test apparatus of claim 5, wherein the functional test point corresponds to at least one functional test case.
9. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the testing method according to one of claims 1 to 4.
10. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the test method according to any one of claims 1 to 4 are implemented when the computer program is executed by the processor.
CN202111632428.4A 2021-12-28 2021-12-28 Automatic hardware-in-loop testing method, device, medium and equipment Pending CN114296432A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111632428.4A CN114296432A (en) 2021-12-28 2021-12-28 Automatic hardware-in-loop testing method, device, medium and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111632428.4A CN114296432A (en) 2021-12-28 2021-12-28 Automatic hardware-in-loop testing method, device, medium and equipment

Publications (1)

Publication Number Publication Date
CN114296432A true CN114296432A (en) 2022-04-08

Family

ID=80972211

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111632428.4A Pending CN114296432A (en) 2021-12-28 2021-12-28 Automatic hardware-in-loop testing method, device, medium and equipment

Country Status (1)

Country Link
CN (1) CN114296432A (en)

Similar Documents

Publication Publication Date Title
US7958488B2 (en) Virtual testing in a development environment
CN105866575B (en) Vehicle-mounted display comprehensive testing device and testing method
CN109740222B (en) Testing device and system for automobile networking scene
CN106776294B (en) Automatic android mobile phone testing method and system
CN104483959A (en) Fault simulation and test system
US20170045865A1 (en) Method for connecting an input/output interface of a tester equipped for control unit development
CN107797004B (en) Digital verification system and method for spacecraft electrical performance test case
CN108829608A (en) A kind of automatization test system and method for the Intelligent vehicle-mounted terminal equipment based on automobile simulator
CN210038539U (en) Hardware-in-loop test system capable of adapting to multiple controllers
CN112996020B (en) Bluetooth-based automatic test method and device and Bluetooth test terminal
CN102707712B (en) Electronic equipment fault diagnosis method and system
CN113110994A (en) Vehicle diagnosis method and device, electronic equipment and storage medium
CN104834591A (en) Method and system for testing AUTOSAR software component
CN111693294A (en) Vehicle detection method and device, terminal equipment and storage medium
CN114328223A (en) Information testing method, device, equipment and storage medium
CN111123728A (en) Unmanned vehicle simulation method, device, equipment and computer readable medium
CN114296432A (en) Automatic hardware-in-loop testing method, device, medium and equipment
CN219266946U (en) Test board card and test system
CN116448158A (en) Method and device for testing combination instrument in vehicle and electronic device
CN115495363A (en) Software testing method, electronic equipment and readable storage medium
CN110362906B (en) Method and system for simulating vehicle-mounted voltage dynamic change environment
CN107748302B (en) Automatic test control method for automatic comprehensive detection equipment for electrical accessories of seat
CN112711245A (en) Calibration method and device for automobile diagnosis equipment and computing equipment
CN110209142B (en) PLC module connection and detection method, device and detection equipment
CN110470927A (en) A kind of key-press test method and button testing device

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