CN115185726A - Method, device and equipment for generating hardware-in-loop test case and storage medium - Google Patents

Method, device and equipment for generating hardware-in-loop test case and storage medium Download PDF

Info

Publication number
CN115185726A
CN115185726A CN202210808594.3A CN202210808594A CN115185726A CN 115185726 A CN115185726 A CN 115185726A CN 202210808594 A CN202210808594 A CN 202210808594A CN 115185726 A CN115185726 A CN 115185726A
Authority
CN
China
Prior art keywords
statement
hardware
test case
test
preset
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
CN202210808594.3A
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.)
Shanghai Rox Intelligent Technology Co Ltd
Original Assignee
Shanghai Rox Intelligent 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 Shanghai Rox Intelligent Technology Co Ltd filed Critical Shanghai Rox Intelligent Technology Co Ltd
Priority to CN202210808594.3A priority Critical patent/CN115185726A/en
Publication of CN115185726A publication Critical patent/CN115185726A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0706Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment
    • G06F11/0736Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment in functional embedded systems, i.e. in a data processing system designed as a combination of hardware and software dedicated to performing a certain function
    • G06F11/0739Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment in functional embedded systems, i.e. in a data processing system designed as a combination of hardware and software dedicated to performing a certain function in a data processing system embedded in automotive or aircraft systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application discloses a method, a device, equipment and a storage medium for generating a hardware-in-the-loop test case, which are used for acquiring an original test statement, taking a parameter operation statement in the original test statement as a first statement, taking statements except the first statement as second statements, converting the first statement into a third statement which can be run by a hardware-in-the-loop test system, and combining the first statement, the third statement and a preset general operation statement to obtain the test case which can be run by the hardware-in-the-loop test system. According to the embodiment of the application, after the original test statement is obtained, the parameter operation statement in the original test statement can be automatically converted into the statement which can be run by the hardware-in-the-loop test system, an engineer does not need to manually write the statement according to a function, the workload of the engineer is reduced, the generation efficiency of a test case is improved, and the efficiency of hardware-in-the-loop test is further improved.

Description

Method, device, equipment and storage medium for generating hardware-in-the-loop test case
Technical Field
The present application relates to a hardware-in-loop test technology, and in particular, to a method, an apparatus, a device, and a storage medium for generating a hardware-in-loop test case.
Background
Hardware in the loop (HIL) testing is a common method for testing controllers in the automotive industry, and is also called semi-physical simulation. Compared with a real bench test, the HIL test is carried out in a laboratory, so that the test of the working condition of the extreme end can be realized, and the HIL test is relatively safer and has lower cost.
The HIL test system generally includes a controller, a real-time computer and an upper computer, where the real-time computer is used to run a simulation model of a virtual controlled object, the controller is used to control the virtual controlled object in the real-time computer when accessing the real-time computer, and the upper computer is used to control the real-time computer and the controller to perform a test according to an input test case and output a test result. Currently, a Speedgoat device is commonly used in real time, and when the Speedgoat device is used for performing HIL (high-level intelligence) testing, an upper computer generally adopts a matlab API (application program interface) mode to automatically control the real time. The test case is written into a matlab operable format by an engineer according to the matlab function, the whole generation process is complex, the learning cost is high, and therefore the generation process of the test case needs to be optimized.
Disclosure of Invention
The embodiment of the application provides a method, a device, equipment and a storage medium for generating a hardware-in-the-loop test case, which can write the test case more conveniently, reduce the workload of engineers and improve the HIL test efficiency.
In a first aspect, an embodiment of the present application provides a method for generating a hardware-in-the-loop test case, including:
acquiring an original test statement;
determining a first statement and a second statement in an original test statement, wherein the first statement is a parameter variable operation statement, and the second statement is other statements except the first statement in the original test statement;
converting the first statement into a third statement which can be operated by a hardware-in-loop test system;
and combining the third statement, the second statement and a preset general operation statement to generate a test case.
As a possible implementation manner, converting the first statement into a third statement that the hardware-in-the-loop test system can run includes:
obtaining statement content corresponding to a first statement from a preset test case management library, wherein the statement content comprises an operation function and a parameter absolute path;
determining parameter values in a first statement;
and combining the statement content and the parameter values according to a preset statement format to obtain a third statement.
As a possible implementation manner, obtaining statement content corresponding to a first statement from a preset test case management library includes:
determining operation information of the first statement, wherein the operation information comprises an operation object, an operation type and a parameter name, the operation object is a real-time or controller, and the operation type is a value or assignment;
and obtaining statement content corresponding to the first statement from a preset test case management library according to the operation information.
As one possible implementation, determining a first statement in the original test statement includes:
aiming at each statement in an original test statement, identifying the statement to determine whether the statement contains an operation object identifier, wherein the operation object identifier is a real-time machine identifier or a controller identifier;
and determining the statement containing the operation object identification as a first statement.
As a possible implementation, determining operation information of the first statement includes:
identifying the first sentence and determining whether the first sentence contains a preset symbol;
if the first statement is identified to contain the preset symbol, determining that the operation type of the first statement is assigned;
and if the first statement is identified not to contain the preset symbol, determining the operation type of the first statement as a value.
As a possible implementation manner, the general operation statement includes a real-time basic operation statement, a basic operation statement of the upper computer software, and a function related to script execution.
In a second aspect, an embodiment of the present application provides an apparatus for generating a hardware-in-the-loop test case, including:
an acquisition unit for acquiring an original test statement;
the statement analysis unit is used for determining a first statement and a second statement in the original test statement, wherein the first statement is a parameter variable operation statement, and the second statement is other statements except the first statement in the original test statement;
the statement reconstruction unit is used for converting the first statement into a third statement which can be run by the hardware-in-the-loop test system;
and the combination unit is used for combining the third statement, the second statement and a preset general operation statement to generate the test case.
In a third aspect, an embodiment of the present application provides a device for generating a hardware-in-loop test case, where the device includes: a processor and a memory storing computer program instructions;
the processor, when executing the computer program instructions, implements the method for generating a hardware-in-the-loop test case according to any one of the first aspects.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, where computer program instructions are stored on the computer-readable storage medium, and when the computer program instructions are executed by a processor, the method for generating a hardware-in-the-loop test case according to any one of the first aspect is implemented.
In a fifth aspect, the present application provides a computer program product, where when executed by a processor of an electronic device, an instruction in the computer program product causes the electronic device to execute the method for generating a hardware-in-loop test case according to any one of the first aspect.
According to the method, the device and the equipment for generating the hardware-in-the-loop test case and the computer storage medium, the original test statement is obtained, the parameter operation statement in the original test statement is used as the first statement, the statements except the first statement are used as the second statement, the first statement is converted into the third statement which can be operated by the hardware-in-the-loop test system, and the first statement, the third statement and the preset general operation statement are combined to obtain the test case which can be operated by the hardware-in-the-loop test system. By the method, after the original test statement is obtained, the parameter operation statement in the original test statement can be automatically converted into the statement which can be run by the hardware-in-loop test system, an engineer does not need to manually write the statement according to a function, the workload of the engineer is reduced, the generation efficiency of the test case is improved, and the efficiency of the hardware-in-loop test is further improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the embodiments of the present application will be briefly described below, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a schematic diagram of an HIL automated testing system according to an embodiment of the present application;
fig. 2 is a schematic flowchart of a method for generating a hardware-in-the-loop test case according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a device for generating a hardware-in-the-loop test case according to another embodiment of the present application;
fig. 4 is a schematic structural diagram of a device for generating a hardware-in-the-loop test case according to still another embodiment of the present application.
Detailed Description
Features and exemplary embodiments of various aspects of the present application will be described in detail below, and in order to make objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are intended to be illustrative only and are not intended to be limiting. It will be apparent to one skilled in the art that the present application may be practiced without some of these specific details. The following description of the embodiments is merely intended to provide a better understanding of the present application by illustrating examples thereof.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising 8230; \8230;" 8230; "does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises the element.
Speedcoat is a HIL solution recommended by the mathworks official, the Real Time is specially designed to be used together with a simulation tool Simulink environment, seamless butt joint with simulation software such as Matlab and Simulink Real-Time can be achieved, and the learning cost is low for engineers who use the Simulink to develop a Control strategy of a Vehicle Controller (VCU). However, in the actual HIL test process using Speedgoat, the following problems also exist: the matlab with the Real-Time machine management interface Simulink Real Time Explorer can only manually change parameters in the Real-Time machine, and cannot meet the requirement of automatic testing.
In order to implement automatic testing, a matlab API is usually used to control a real-time machine using a Test case (i.e., a Test case), so as to implement automatic testing.
Referring to fig. 1, a schematic diagram of an HIL automated testing system based on Speedgoat equipment in the embodiment of the present application is shown, where an upper computer controls an actual time and a controller through matlab software and vehicle calibration software INCA, and an automated testing process corresponding to the testing system mainly includes the following steps:
1. the upper computer inputs a test case in a manual or automatic mode;
2. the upper computer and the real-time machine communicate by using Ethernet;
3. the upper computer and the controller communicate by using an XCP protocol;
4. the upper computer modifies parameters and/or standard quantities in the real-time machine or the controller by using a setparam method according to parameter setting in the test case, reads the observed quantity after the parameters are modified by using the getparam method in real time, judges whether the test result of the controller meets expectation or not, and outputs the test result, wherein the getparam or the setparam is used as a matlab parameter function.
It can be known from the above contents that, when the matlab API is used for automatic testing, in order to ensure that an upper computer can modify real-time or parameter variables (including parameters, standard quantities and the like) of a controller according to a test case, the test case needs to be written in a sentence according to an input format of a getparam or setparam function, and because an absolute path of the parameter variables in a Simulink model (i.e., a simulation model of a virtual object to be tested) needs to be input during the use of the function, the function is relatively long, so that the test case generation process is troublesome, the learning cost is high, and therefore, the test case generation mode needs to be optimized.
In order to solve the prior art problems, embodiments of the present application provide a method, an apparatus, a device, and a computer storage medium for generating a hardware-in-the-loop test case.
The method for generating the hardware-in-loop test case provided by the embodiment of the application can be applied to HIL (hardware in loop) tests of pure electric vehicles, hybrid electric vehicles or traditional fuel vehicles.
Fig. 2 illustrates a flowchart of a method for generating a hardware-in-the-loop test case according to an embodiment of the present application. As shown in fig. 2, the method for generating a hardware-in-the-loop test case according to the embodiment of the present application may include the following steps:
and S21, acquiring an original test statement.
S22, determining a first statement and a second statement in the original test statement, wherein the first statement is a parameter variable operation statement, and the second statement is other statements except the first statement in the original test statement.
And S23, converting the first statement into a third statement which can be run by the hardware-in-the-loop test system.
And S24, combining the third statement, the second statement and a preset general operation statement to generate a test case.
The method for generating the hardware-in-the-loop test case includes the steps of obtaining an original test statement, taking a parameter variable operation statement in the original test statement as a first statement, taking statements except the first statement as a second statement, converting the first statement into a third statement which can be run by a hardware-in-the-loop test system, and combining the first statement, the third statement and a preset general operation statement to obtain the test case which can be run by the hardware-in-the-loop test system. By the method, after the original test statement is obtained, the parameter operation statement in the original test statement can be automatically converted into the statement which can be run by the hardware-in-loop test system, an engineer does not need to manually write the statement according to a function, the workload of the engineer is reduced, the generation efficiency of the test case is improved, and the efficiency of the hardware-in-loop test is further improved.
Specific implementations of the above steps are described below.
In some embodiments, in S21, the script language used by the original test statement may be a script language commonly used by engineers to write scripts, for example, a js language, which is javascript, a lightweight, interpreted, or just-in-time programming language with function priority. For example, as shown in table 1 below, an example of a test case is shown, where the content in the implementation of the test statement is the original test statement:
TABLE 1
Figure BDA0003739425370000071
Figure BDA0003739425370000081
In one example, when the original test statement is obtained in S11, a test statement written and input by a user (for example, an engineer or the like) according to a test requirement may be obtained as the original test statement. By adopting the method, the accuracy of the test statement can be ensured, and the user can write the test statement according to the actual requirement, so that the application range is wider.
In one example, a test case library may also be preset, and a plurality of test statements meeting different test requirements are stored in the library, based on which, in S11, corresponding original test statements may be obtained from the test case library according to the test requirements. By adopting the method, the user does not need to write the sentences, and the workload of the user is further reduced.
Because the script language used by the original test statement does not conform to the language specification of the hardware-in-the-loop test system, the statement related to parameter operation cannot run in the hardware-in-the-loop test system, that is, cannot run through matlab, so that the modification of parameter variables in a real-time machine and/or a controller cannot be realized, and the hardware-in-the-loop test cannot be smoothly carried out. Therefore, in order to ensure that the hardware-in-loop test can be smoothly performed, the parameter operation statements in the original test statements need to be subjected to script language conversion, and converted into the script language which can be run by the hardware-in-loop test system.
For the above reasons, after the original test statement is obtained, the original test statement may be analyzed through S22 to identify the parameter operation statement, that is, the first statement, therein.
In an example, the parameter operation statement is a statement for operating a parameter in a real-time machine and/or a controller, where the operation includes a value taking and an assignment, and thus the parameter operation statement may include a statement for taking a value of the parameter at the real-time, a statement for assigning a value of the parameter at the real-time, a statement for taking a value of the parameter of the controller, and a statement for assigning a value of the parameter of the controller.
In one example, since the argument operation statement is to operate on a specific argument in a real-time machine or a controller, an operation object identifier is usually included therein, and the operation object identifier is also called a real-time machine identifier and a controller identifier. Based on this, in S22, when determining the first statement in the original test statement, it may be separately identified, for each statement, whether the statement includes the operand identifier, and if the operand identifier is included, the statement is determined to be the first statement, otherwise, the statement is determined not to be the first statement, but to be the second statement. In this way, the first statement and the second statement in the original test statement can be quickly identified.
After the first statement is identified, S23 may be used to perform a script language conversion on the first statement, and convert the first statement into a third statement that the hardware can run in the ring test system, that is, a third statement that conforms to the input format of the parameter function.
In one example, a test case management library may be preset, and a plurality of statement contents may be stored in the test case management library, where the statement contents may include an operation function and a parameter absolute path, where the operation function may be a parameter function of matlab, such as a getparam function or a setparam function, and the parameter absolute path is a specific path of a parameter in a real-time or in a controller. Based on the above contents, the statement content can use matlab m language to directly call the statement content in a global variable mode on the parameter of the real time or the controller, and carry out normal value taking and assignment operation. Based on this, in S23, when performing script language conversion on the first statement, the statement content corresponding to the first statement may be acquired from the preset test case management library, the parameter value in the first statement may be determined, and finally, the statement content and the parameter value may be combined according to the preset statement format, so as to obtain the third statement. The statement format is a format of a statement that the hardware-in-the-loop test system can run, and for example, the statement format may be: operation functions (parameter absolute path, parameter values).
Further, because different operation functions correspond to different operation types, for example, a getparam function corresponds to a value operation, a setparam function corresponds to a value operation, and different parameter absolute paths correspond to different operation objects and parameters, when obtaining statement content corresponding to a first statement from a preset test case library, operation information of the first statement may be determined first, where the operation information includes an operation object, an operation type, and a parameter name, where the operation object is an actual time or a controller, the operation type is a value or a value, and then, the statement content corresponding to the first statement is obtained from the test case library based on the operation information.
In an example, an operation object, a parameter name, and a parameter value of a first statement may be directly obtained from the first statement, and when the operation type of the first statement is determined, the first statement may be identified to determine whether a preset symbol is included therein, if the preset symbol is included in the first statement, the operation type of the first statement is determined to be an assignment, and if the preset symbol is not included in the first statement, the operation type of the first statement is determined to be a value. The preset symbol is a symbol that can distinguish between an assignment operation and a value operation, and may be, for example, an equal sign, that is, "=".
An example is as follows: the first statement is ' Param1_ sg = Value 1', the statement is analyzed to determine that the operation object contained therein is sg, the parameter name Param1 and the parameter Value is Value1, the operation object is determined to be a real-time machine according to the operation object identifier, and because "=" is contained therein, the operation type is determined to be an assignment, based on the above contents, the operation function in the corresponding statement content obtained from the test case management library is setparam, and the parameter absolute path is passger Car/VSUM/plantatmodel/Driver/Param 1, so that the third statement obtained by combining the statement content and the parameter Value is ' tg.
In one example, in order to obtain the sentence content corresponding to the first sentence, a data dictionary corresponding to the test case library may be set in advance, and then the corresponding sentence content may be obtained from the test case library based on the data dictionary. The data dictionary can store the mapping relation between the operation information and the sentence content, and based on the mapping relation, after the operation information of the first sentence is determined, the corresponding sentence content can be obtained from the test case library according to the mapping relation in the data dictionary.
After all the first statements complete the script language conversion to obtain corresponding third statements, all the third statements, the second statements, and the preset general operation statements may be combined through S24 to generate a test case.
In one example, the general operation statement may be stored in advance in the designated location, and the preset general operation statement may be directly acquired from the designated location in S24. The general operation statements are statements common to all test cases, and may include basic operation statements of real time, basic operation statements of upper computer software, functions related to script running, and the like.
In one example, a test case template may be preset, and based on this, in S24, the third statement, the second statement and the preset general-purpose operation statement may be combined according to the preset test case template to generate the test case. By the method, the combination of the sentences can be quickly realized, the generation efficiency of the test cases is improved, and the normalization of the generated test cases is ensured.
Based on the method for generating the hardware-in-the-loop test case provided by the embodiment, correspondingly, the application further provides a specific implementation manner of the device for generating the hardware-in-the-loop test case. Please see the examples below.
Referring to fig. 3, a device for generating a hardware-in-the-loop test case according to an embodiment of the present application includes the following units:
an obtaining unit 301, configured to obtain an original test statement.
The statement parsing unit 302 is configured to determine a first statement and a second statement in the original test statement, where the first statement is a parameter operation statement, and the second statement is another statement except the first statement in the original test statement.
And a statement reconstructing unit 303, configured to convert the first statement into a third statement that the hardware-in-the-loop test system can run.
And the combining unit 304 is configured to combine the third statement, the second statement and a preset general operation statement to generate a test case.
The generation device for the hardware-in-the-loop test case, provided by the embodiment of the application, acquires an original test statement, takes a parameter operation statement in the original test statement as a first statement, takes statements except the first statement as second statements, converts the first statement into a third statement that can be run by hardware in a loop test system, and combines the first statement, the third statement and a preset general operation statement to obtain the test case that can be run by the hardware in the loop test system. According to the embodiment of the application, after the original test statement is obtained, the parameter operation statement in the original test statement can be automatically converted into the statement which can be run by the hardware-in-the-loop test system, an engineer does not need to manually write the statement according to a function, the workload of the engineer is reduced, the generation efficiency of a test case is improved, and the efficiency of hardware-in-the-loop test is further improved.
As a possible implementation manner, the statement reconstructing unit 303 is configured to:
obtaining statement content corresponding to a first statement from a preset test case management library, wherein the statement content comprises an operation function and a parameter absolute path;
determining a parameter value in the first statement;
and combining the statement content and the parameter values according to a preset statement format to obtain a third statement.
As a possible implementation manner, the obtaining, by the statement reconstructing unit 303, statement content corresponding to the first statement from a preset test case management library includes:
determining operation information of the first statement, wherein the operation information comprises an operation object, an operation type and a parameter name, the operation object is a real-time or controller, and the operation type is a value or assignment;
and obtaining statement content corresponding to the first statement from a preset test case management library according to the operation information.
As a possible implementation manner, the statement parsing unit 302 is configured to:
aiming at each statement in an original test statement, identifying the statement to determine whether the statement contains an operation object identifier, wherein the operation object identifier is a real-time machine identifier or a controller identifier;
and determining the statement containing the operation object identifier as a first statement.
As a possible implementation manner, the statement reconstructing unit 303 determines operation information of the first statement, including:
identifying the first sentence and determining whether the first sentence contains a preset symbol;
if the first statement is identified to contain the preset symbol, determining the operation type of the first statement as assignment;
and if the first statement is identified not to contain the preset symbol, determining the operation type of the first statement as a value.
As a possible implementation manner, the general operation statement includes a real-time basic operation statement, a basic operation statement of the upper computer software, and a function related to script execution.
Fig. 4 shows a schematic hardware structure diagram of a device for generating a hardware-in-loop test case according to an embodiment of the present application.
The apparatus for generating a hardware-in-the-loop test case may include a processor 401 and a memory 402 storing computer program instructions.
Specifically, the processor 401 may include a Central Processing Unit (CPU), or an Application Specific Integrated Circuit (ASIC), or may be configured to implement one or more Integrated circuits of the embodiments of the present Application.
Memory 402 may include a mass storage for data or instructions. By way of example, and not limitation, memory 402 may include a Hard Disk Drive (HDD), floppy Disk Drive, flash memory, optical Disk, magneto-optical Disk, tape, or Universal Serial Bus (USB) Drive or a combination of two or more of these. Memory 402 may include removable or non-removable (or fixed) media, where appropriate. The memory 402 may be internal or external to the integrated gateway disaster recovery device, where appropriate. In a particular embodiment, the memory 402 is non-volatile solid-state memory.
The memory 402 may include Read Only Memory (ROM), random Access Memory (RAM), magnetic disk storage media devices, optical storage media devices, flash memory devices, electrical, optical, or other physical/tangible memory storage devices. Thus, in general, the memory 402 comprises one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software comprising computer-executable instructions and when the software is executed (e.g., by one or more processors), it is operable to perform operations described with reference to a method according to an aspect of the present disclosure.
The processor 401 reads and executes the computer program instructions stored in the memory 402 to implement the method for generating the hardware-in-the-loop test case in any one of the above embodiments.
In one example, the device for generating the hardware-in-the-loop test case may further include a communication interface 403 and a bus 410. As shown in fig. 4, the processor 401, the memory 402, and the communication interface 403 are connected via a bus 410 to complete communication therebetween.
The communication interface 403 is mainly used for implementing communication between modules, apparatuses, units and/or devices in the embodiments of the present application.
Bus 410 comprises hardware, software, or both that couple the components of the online data traffic billing device to one another. By way of example, and not limitation, a bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hypertransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an infiniband interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a video electronics standards association local (VLB) bus, or other suitable bus or a combination of two or more of these. Bus 410 may include one or more buses, where appropriate. Although specific buses are described and shown in the embodiments of the application, any suitable buses or interconnects are contemplated by the application.
In addition, in combination with the method for generating the hardware-in-the-loop test case in the foregoing embodiment, the embodiment of the present application may provide a computer storage medium to implement. The computer storage medium having computer program instructions stored thereon; the computer program instructions, when executed by a processor, implement the method for generating a hardware-in-the-loop test case in any of the above embodiments.
It is to be understood that the present application is not limited to the particular arrangements and instrumentalities described above and shown in the attached drawings. A detailed description of known methods is omitted herein for the sake of brevity. In the above embodiments, several specific steps are described and shown as examples. However, the method processes of the present application are not limited to the specific steps described and illustrated, and those skilled in the art can make various changes, modifications, and additions or change the order between the steps after comprehending the spirit of the present application.
The functional blocks shown in the above-described structural block diagrams may be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, it may be, for example, an electronic circuit, an Application Specific Integrated Circuit (ASIC), suitable firmware, plug-in, function card, or the like. When implemented in software, the elements of the present application are the programs or code segments used to perform the required tasks. The program or code segments may be stored in a machine-readable medium or transmitted by a data signal carried in a carrier wave over a transmission medium or a communication link. A "machine-readable medium" may include any medium that can store or transfer information. Examples of a machine-readable medium include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio Frequency (RF) links, and so forth. The code segments may be downloaded via computer networks such as the internet, intranet, etc.
It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, the present application is not limited to the order of the above-described steps, that is, the steps may be performed in the order mentioned in the embodiments, may be performed in an order different from the order in the embodiments, or may be performed simultaneously.
Aspects of the present disclosure are described above with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions/acts specified in the flowchart and/or block diagram block or blocks. Such a processor may be, but is not limited to, a general purpose processor, a special purpose processor, an application specific processor, or a field programmable logic circuit. It will also be understood that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based computer instructions which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
As described above, only the specific embodiments of the present application are provided, and it can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the system, the module and the unit described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again. It should be understood that the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive various equivalent modifications or substitutions within the technical scope of the present application, and these modifications or substitutions should be covered within the scope of the present application.

Claims (10)

1. A method for generating a hardware-in-the-loop test case is characterized by comprising the following steps:
acquiring an original test statement;
determining a first statement and a second statement in the original test statement, wherein the first statement is a parameter variable operation statement, and the second statement is the other statements except the first statement in the original test statement;
converting the first statement into a third statement which can be run by a hardware-in-loop test system;
and combining the third statement, the second statement and a preset general operation statement to generate a test case.
2. The method of claim 1, wherein converting the first statement into a third statement that is executable by a hardware-in-the-loop test system comprises:
obtaining statement content corresponding to the first statement from a preset test case management library, wherein the statement content comprises an operation function and a parameter absolute path;
determining a parameter value in the first statement;
and combining the statement content and the parameter variable value according to a preset statement format to obtain a third statement.
3. The method according to claim 2, wherein the obtaining of the statement content corresponding to the first statement from a preset test case management library includes:
determining operation information of the first statement, wherein the operation information comprises an operation object, an operation type and a parameter name, the operation object is a real-time or a controller, and the operation type is a value or an assignment;
and obtaining statement content corresponding to the first statement from a preset test case management library according to the operation information.
4. The method of claim 1, wherein said determining a first one of said original test statements comprises:
for each statement in the original test statement, identifying the statement to determine whether the statement contains an operation object identifier, wherein the operation object identifier is a real-time machine identifier or a controller identifier;
and determining the statement containing the operation object identifier as a first statement.
5. The method of claim 2, wherein the determining the operation information of the first sentence comprises:
identifying the first sentence and determining whether the first sentence contains a preset symbol;
if the first statement is identified to contain a preset symbol, determining the operation type of the first statement as assignment;
and if the first statement is identified not to contain the preset symbol, determining the operation type of the first statement as a value.
6. The method according to claim 1, wherein the general operation statements comprise real-time basic operation statements, basic operation statements of upper computer software and script running related functions.
7. An apparatus for generating a hardware-in-the-loop test case, comprising:
an acquisition unit, configured to acquire an original test statement;
a statement parsing unit, configured to determine a first statement and a second statement in the original test statement, where the first statement is a parameter operation statement, and the second statement is another statement except the first statement in the original test statement;
the statement reconstruction unit is used for converting the first statement into a third statement which can be run by a hardware-in-the-loop test system;
and the combination unit is used for combining the third statement, the second statement and a preset general operation statement to generate a test case.
8. An apparatus for generating a hardware-in-the-loop test case, the apparatus comprising: a processor and a memory storing computer program instructions;
the processor, when executing the computer program instructions, implements the method for generating a hardware-in-the-loop test case according to any one of claims 1 to 6.
9. A computer-readable storage medium, wherein computer program instructions are stored on the computer-readable storage medium, and when executed by a processor, the computer program instructions implement the method for generating a hardware-in-loop test case according to any one of claims 1 to 6.
10. A computer program product, wherein instructions in the computer program product, when executed by a processor of an electronic device, cause the electronic device to perform the method for generating a hardware-in-loop test case according to any one of claims 1 to 6.
CN202210808594.3A 2022-07-11 2022-07-11 Method, device and equipment for generating hardware-in-loop test case and storage medium Pending CN115185726A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210808594.3A CN115185726A (en) 2022-07-11 2022-07-11 Method, device and equipment for generating hardware-in-loop test case and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210808594.3A CN115185726A (en) 2022-07-11 2022-07-11 Method, device and equipment for generating hardware-in-loop test case and storage medium

Publications (1)

Publication Number Publication Date
CN115185726A true CN115185726A (en) 2022-10-14

Family

ID=83517377

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210808594.3A Pending CN115185726A (en) 2022-07-11 2022-07-11 Method, device and equipment for generating hardware-in-loop test case and storage medium

Country Status (1)

Country Link
CN (1) CN115185726A (en)

Similar Documents

Publication Publication Date Title
CN109740222B (en) Testing device and system for automobile networking scene
US11954015B2 (en) Software environment for control engine debug, test, calibration and tuning
CN110632499B (en) Test vector generation method based on test object and storage medium
US11989535B2 (en) Simulation method and recording medium
CN111983429A (en) Chip verification system, chip verification method, terminal and storage medium
US9117018B2 (en) Method of debugging software and corresponding computer program product
CN114840191A (en) Software code automatic generation method, device, equipment and readable storage medium
CN112433940A (en) Software development kit SDK testing method and related equipment
CN111176995B (en) Test method and test system based on big data test case
CN115185726A (en) Method, device and equipment for generating hardware-in-loop test case and storage medium
CN115952044A (en) Automatic testing method and device
CN116090376A (en) Chip integrated verification component development method and device and computer equipment
US20160224456A1 (en) Method for verifying generated software, and verifying device for carrying out such a method
CN113220345B (en) Method, device, equipment and storage medium for processing instruction block
CN114116497A (en) Test method and device and server
CN114579093A (en) Software integration method, device and equipment for Simulink model generation codes and storage medium
CN112269740A (en) Automatic testing method and device for automatic driving software
Kaprocki et al. Multiunit automotive perception framework: Synergy between AI and deterministic processing
Naithani et al. Development of an Automobile Hardware-inthe-Loop Test System with CAN Communication
CN117170350B (en) Service testing method and device, electronic equipment and storage medium
US20240037012A1 (en) Computer-implemented method for verifying a software component of an automated driving function
CN114676670A (en) File conversion method and device and electronic equipment
US20040220765A1 (en) Method for communication with a test system for integrated circuits
CN117806281A (en) Diagnostic data verification method, device, system, equipment and storage medium
CN118642966A (en) Smoking case generating method and 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