A controller hardware-in-the-loop testing method and device

Through the controller's hardware in-loop testing method, the virtual key status is monitored and corresponding test cases are executed, which solves the problem of low driving mode testing efficiency in the prior art, and realizes unified testing of driving modes of multiple key categories, improving the testing efficiency.

CN114661021BActive Publication Date: 2025-04-11BEIJING ELECTRIC VEHICLE
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202110361109.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-02
Publication Date
2025-04-11
Estimated Expiration
2041-04-02

AI Technical Summary

Technical Problem

In the prior art, the testing efficiency of driving mode-related functions is low, resulting in testers needing to write test cases in multiple modes, increasing the complexity and cumbersomeness of the test.

Method used

A hardware-in-loop testing method of the controller is provided, which monitors the status of the virtual keys, determines the virtual driving mode signal by calling the test case set corresponding to the test instructions, and executes the corresponding test cases to test the vehicle's driving mode related functions.

Benefits of technology

This method does not require writing test cases before each test, and can be used in driving modes of multiple key categories, reducing the time for test engineers to modify and test cases and improving testing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114661021B_ABST
    Figure CN114661021B_ABST
Patent Text Reader

Abstract

The present invention provides a method and device for hardware-in-the-loop testing of a controller, and relates to the field of testing technology. The method comprises: calling a test case set corresponding to a test instruction, and monitoring the virtual button status in the test case set; determining a virtual driving mode signal according to the virtual button status; configuring and executing a test case of a virtual driving mode of a currently configured button category according to the virtual driving mode signal; and testing the driving mode-related functions of the vehicle according to the configured and successfully executed test cases. The technical solution of the present invention solves the problem of low testing efficiency of driving mode testing in the prior art, reduces the time for modifying test cases of driving mode-related functions during the test process, and improves testing efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of testing technology, and in particular to a hardware-in-the-loop testing method and device for a controller. Background Art

[0002] Driving mode is a mode setting that allows drivers to experience driving pleasure. Driving modes include sports mode, comfort mode and economy mode. More and more passenger cars are equipped with driving modes. However, during the development and testing phase, each driving mode of each vehicle model needs to be tested, and each mode test requires the writing of test cases. Testing multiple modes increases the complexity and tediousness of testers, resulting in low test efficiency. Summary of the invention

[0003] The embodiment of the present invention provides a method for solving the problem of low test efficiency of related functional tests of driving modes in the prior art.

[0004] In order to solve the above technical problems, the present invention adopts the following technical solutions:

[0005] An embodiment of the present invention provides a hardware-in-the-loop testing method for a controller, comprising:

[0006] Calling a test case set corresponding to a test instruction, and monitoring the virtual key status in the test case set;

[0007] Determining a virtual driving mode signal according to the virtual button state;

[0008] Execute a test case of the virtual driving mode of the currently configured key category according to the virtual driving mode signal;

[0009] Test the vehicle's driving mode-related functions based on the successfully configured test cases.

[0010] Optionally, monitoring the virtual key status in the test case set includes:

[0011] If the states of all the configuration buttons in the monitoring test case set are not pressed, it is determined that the current driving mode after powering on again is the memory driving mode;

[0012] The memory driving mode is the driving mode used before the vehicle was powered off last time.

[0013] Optionally, the monitoring of the virtual key status in the test case set further includes:

[0014] If the controller detects that a preset action occurs on the virtual key, a first preset instruction is generated according to the preset action of the virtual key;

[0015] According to the first preset instruction, the current driving mode is determined to be the first preset mode.

[0016] Optionally, determining a virtual driving mode signal according to the virtual button state includes:

[0017] When the current driving mode is the first preset mode or the memory driving mode, it is determined that the virtual driving mode signal is a two-button virtual driving mode request.

[0018] Optionally, the configuration and execution of a test case of a virtual driving mode of a currently configured button category includes:

[0019] Under the dual-button virtual driving mode request, obtaining the button category of the current driving mode;

[0020] According to the button category, configure and execute a test case of a virtual driving mode matching the button category, and obtain a bus driving mode corresponding to the virtual driving mode;

[0021] Among them, the button categories of the current driving mode include: a driving mode with a single button configuration, a driving mode with a double button configuration, and a driving mode with a three button configuration.

[0022] Optionally, the configuration and execution of a test case of a virtual driving mode of a currently configured button category includes:

[0023] Obtaining the corresponding relationship between the variable of the current key category and the variable mapping from the first preset table;

[0024] According to the correspondence between the variables and the variable mapping, the test case of the virtual driving mode with two buttons is made applicable to the test case of the driving mode with three buttons or the test case of the driving mode with one button;

[0025] The first preset table at least stores variables and variable mappings of a first signal type under multiple physical environments, and variables and variable mappings of a second signal type under multiple virtual environments.

[0026] Optionally, a successfully configured test case includes at least the following test items:

[0027] The first test item: when the vehicle is powered on for the first time, determining that the current driving mode is the second preset mode;

[0028] Second test item: when the vehicle is powered off and then powered on again, determine that the current driving mode is the driving mode used before the vehicle was powered off last time;

[0029] The successfully configured test case stores at least the following test information:

[0030] Test time series, input signal series, and output signal series;

[0031] Among them, the input signal at least includes vehicle power-on information and virtual key status information; the output signal sequence at least includes driving mode information and preparation status information.

[0032] Optionally, the method further includes executing the successfully configured test case, and the step of executing the test case of the virtual driving mode of the currently configured button category includes:

[0033] Reading the test time sequence in the test case and receiving the input signal sequence;

[0034] After reading the test time sequence, determining the output signal sequence according to the time period of the test time sequence and the input signal sequence;

[0035] When a preset end signal appears in the output signal sequence, the output test result is determined.

[0036] The embodiment of the present invention further provides a hardware-in-the-loop test device for a controller, comprising:

[0037] A first processing module, used for calling a test case set corresponding to a test instruction, and monitoring a virtual key state in the test case set;

[0038] A determination module, used to determine a virtual driving mode signal according to the virtual button state;

[0039] A second processing module, configured and executed, according to the virtual driving mode signal, a test case of the virtual driving mode of the currently configured key category;

[0040] The test module is used to test the relevant functions of the vehicle's driving mode based on the configuration and execution of successful test cases.

[0041] An embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps in the hardware-in-the-loop testing method of the controller as described above are implemented.

[0042] The beneficial effects of the present invention are:

[0043] In the above technical solution, the hardware-in-the-loop test method of the controller is applied to the hardware-in-the-loop test environment of the controller, and the method includes: calling the test case set corresponding to the test instruction, and monitoring the virtual button state in the test case set; determining the virtual driving mode signal according to the virtual button state; executing the test case of the virtual driving mode of the currently configured button category according to the virtual driving mode signal; and testing the driving mode-related functions of the vehicle according to the successfully configured test case. The technical solution of the present invention does not require writing test cases before each test, and can configure corresponding test cases according to the driving modes of multiple button categories, which greatly reduces the time for test engineers to modify test cases related to driving mode functions and improves test efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 A schematic diagram showing a flow chart of a hardware-in-the-loop testing method provided by an embodiment of the present invention;

[0045] Figure 2 A schematic diagram showing the structure of the driving mode of the dual button configuration;

[0046] Figure 3 A schematic diagram showing the structure of the driving mode of the three-button configuration;

[0047] Figure 4 A schematic diagram showing a driving mode structure of a single button configuration;

[0048] Figure 5 A schematic diagram showing a module of a hardware-in-the-loop testing device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0049] In order to make the technical problems, technical solutions and advantages to be solved by the present invention clearer, the following will be described in detail in conjunction with the accompanying drawings and specific embodiments. In the following description, specific details such as specific configurations and components are provided only to help fully understand the embodiments of the present invention. Therefore, it should be clear to those skilled in the art that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present invention. In addition, for clarity and brevity, the description of known functions and structures is omitted.

[0050] It should be understood that the references to "one embodiment" or "an embodiment" throughout the specification mean that the specific features, structures, or characteristics associated with the embodiment are included in at least one embodiment of the present invention. Therefore, the references to "in one embodiment" or "in an embodiment" appearing throughout the specification do not necessarily refer to the same embodiment. In addition, these specific features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.

[0051] In various embodiments of the present invention, it should be understood that the size of the serial numbers of the following processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0052] It should be noted that the driving mode implementation methods of the vehicle configuration mentioned in the present invention are respectively configured with three buttons, two buttons and a single button, and each configuration implements the driving mode switching method as follows: Figures 2 to 4 As shown, the driving modes include sports mode, comfort mode and economy mode. The default driving mode when the vehicle is first off the line is comfort mode, and the driving mode displayed when it is powered on again is memory driving mode, which is the driving mode before the last power failure.

[0053] like Figure 2 The driving mode of the dual-button configuration shown in the figure, if the current driving mode is the economy mode, press the K- button once to keep the driving mode in the economy mode, press the K+ button and release it, the driving mode changes to the comfort mode, press the K+ button again to change the driving mode to the sport mode, press the K+ button again to keep the driving mode in the sport mode. The dual-button configuration driving mode requires the K- and K+ buttons to control the driving mode to select between the sport mode, comfort mode and economy mode. Figure 3 The three-button driving mode shown in the figure, no matter what the current mode is, press K1 to change the driving mode to sports mode, press K2 to change the driving mode to comfort mode, press K3 to change the driving mode to economy mode. Figure 4 The single-button driving mode shown in the figure, if the current driving mode is the economic mode, press the button K1 button to change to the sports mode, press the K1 button again to the comfort mode, and press the K1 button again to the economic mode. The single-button driving mode uses the K1 single button to realize the cyclic switching of driving modes.

[0054] The test cases related to driving modes in the prior art are all implemented with double buttons. In the process of developing this model, three-button and single-button configurations are added, and the test cases related to driving mode functions need to be rewritten, resulting in a cumbersome test process and low test efficiency. The present invention aims to solve the problem of low test efficiency of driving mode testing in the prior art and provides a hardware-in-the-loop test method and device for a controller.

[0055] like Figure 1 As shown, an optional embodiment of the present invention provides a controller hardware-in-the-loop testing method, which is applied to the controller hardware-in-the-loop environment model, including:

[0056] Step 100, calling a test case set corresponding to a test instruction, and monitoring the virtual key status in the test case set;

[0057] Here, the test case set refers to a test case set for driving mode related functions; the virtual key state includes a pressed state and a not pressed state; the test case set here is also a test case set different from the prior art, and the test case set redefines the virtual key signal type by rewriting, and according to the redefined virtual key signal, the virtual key signal in the current test case set can be determined. Of course, the present invention can also monitor the configuration key state, and the configuration key state also includes a pressed state and a not pressed state.

[0058] Step 200, determining a virtual driving mode signal according to the virtual button state;

[0059] Step 300, configuring and executing a test case of a virtual driving mode of a currently configured key category according to the virtual driving mode signal;

[0060] It should be noted that the present invention can apply the three-button driving mode related function test cases developed for the first time to two-button or single-button models, or apply the single-button driving mode related function test cases developed for the first time to two-button or three-button models.

[0061] Step 400, testing the relevant functions of the vehicle's driving mode according to the successfully configured test case.

[0062] In this embodiment, under the environmental model of the controller hardware in the loop, by calling the improved test case set, the virtual button state is monitored, and the virtual driving mode signal is determined, and according to step 300, it can be applicable to the driving mode of the single-button configuration, the driving mode of the double-button configuration, and the driving mode of the three-button configuration, without writing multiple test cases, thereby achieving the uniformity of the test cases. In order to reduce the time for test engineers to modify the test cases related to the driving mode and improve the test efficiency, the present invention makes improvements on the environmental model of the controller hardware in the loop by comparing the differences between the implementation methods of the double-button, three-button, and single-button driving modes, and finally achieves the way that the test engineer only needs to modify the signal type of the mapping table to realize that the double-button test case is applicable to the three-button and single-button configurations.

[0063] It should be known that all the test cases related to driving modes in the prior art are implemented with double buttons, and the implementation method of the double button test cases is to implement functional testing through the test scenarios edited by EXCEL, and then generate executable cases through tools according to the mapping table (signal input and output categories, signal names, and types in the test cases), and let the executable cases run in the controller hardware-in-the-loop environment through the automatic execution tool. The double button driving mode test cases and driving mode related functional cases of the prior art can be shown in Table 1.

[0064] Table 1: Test cases for dual-button driving mode in existing technologies

[0065]

[0066] Among them, "W10" in Table 1 means that the expected result is achieved within 10s, and the expected result of the test case is output to the next line; "S0.2" means that the current action continues for 0.2s; "sw" means that the current configuration button state signal switch state is "1" and the button state is "0". Use case scenario of the prior art: After the vehicle control unit (VCU) is powered on, the tester does not know what the memory driving mode is, so it is necessary to press the K+ button twice in a row to reset and the K- button once to reset, so that the expected output result of the test case is the comfort mode. Therefore, the expected actual driving mode is not clear when the power is just turned on, which increases the cumbersomeness of the test.

[0067] Optionally, the step 100 includes:

[0068] If the controller detects that a preset action occurs on the virtual key, a first preset instruction is generated according to the preset action of the virtual key;

[0069] According to the first preset instruction, the current driving mode is determined to be the first preset mode.

[0070] After changing the test case mapping table and the controller hardware-in-the-loop environment, the present invention adds preset information of preset virtual buttons in the improved test case mapping table, and adds logic for obtaining the expected virtual driving mode according to the state of the test case virtual buttons in the controller hardware-in-the-loop environment. If it is detected that the virtual button is in action, a first preset instruction is generated, and the configuration button automatically adjusts the bus driving mode to the expected virtual driving mode according to the first preset instruction. The improved mapping table and test environment provide convenience for functional test cases related to driving modes. The driving mode function itself uses the configuration button. There is no virtual button signal in the driving mode test case. The state of the configuration button is set to "sw". When the "sw" instruction appears, the current driving mode is determined to be the first preset mode, and the first preset mode here is the comfort mode. Specifically, the improved driving mode test case shown in Table 2 can be used.

[0071] Table 2: Improved test cases for driving mode-related functions

[0072]

[0073] After the improved test case mapping table and the controller hardware-in-the-loop environmental model of the present invention, it can be directly applicable to vehicle models with three-button or single-button configurations, and the test cases of the present invention can be implemented according to Table 2. Therefore, there is no need for the test engineer to lock the driving mode to the comfort mode according to the situation in Table 1, and adjust the driving mode based on the comfort mode, which simplifies the writing of test cases for functions related to the driving mode. The test cases for functions related to the driving mode are implemented using two buttons, and the improved test case two buttons are virtual buttons in the present invention. The virtual button state "sw" in the improved test cases for functions related to the driving mode is not related to the memory driving function. The memory driving mode function is only for the driving mode function itself. It is particularly noted that the test case for the driving mode itself is to be rewritten according to the actual button configuration because it is necessary to test the actual performance of the driving mode button. The functions related to the driving mode can be implemented by modifying the mapping table.

[0074] Optionally, the step 100 further includes:

[0075] If the states of all the configuration buttons in the monitoring test case set are not pressed, it is determined that the current driving mode after powering on again is the memory driving mode;

[0076] The memory driving mode is the driving mode used before the vehicle was powered off last time. The test case set is a test case set of the driving mode.

[0077] In this embodiment, when the vehicle has a driving mode with a memory driving function, the test for this situation requires that the memory driving mode be used each time the vehicle is powered on, and the memory driving mode is the driving mode used before the vehicle was powered off last time. Based on Table 2, this application uses a driving mode with a three-button configuration to illustrate how to implement the function test of the memory driving mode. The details are shown in Table 3.

[0078] Table 3: Improved three-button driving mode test cases

[0079]

[0080] In Table 3, at "W10" and when the power is on, and the button state is in the "sw" state, it is determined that the vehicle is currently powered on for the first time, and the current mode is determined to be the "comfort mode"; at "W10" and when the power is off, the K1 button state is "not pressed", and it is determined that the current vehicle state has changed from the first power-on state to the first power-off state; again at "W10" and when the power is on, it is determined that the vehicle is powered on again (for the second time), and the driving mode determined at this time is the driving mode before the last (first) power-off.

[0081] In another optional embodiment, determining a virtual driving mode signal according to the virtual button state includes:

[0082] When the current driving mode is the first preset mode or the memory driving mode, the virtual driving mode signal is determined to be a double-button virtual driving mode request. Here, the first preset mode is preferably a comfort mode.

[0083] In this embodiment, when the current driving mode is the first preset mode or the memory driving mode, since the functional test cases related to the preferred dual-button key type driving mode of the prior art already exist, the virtual driving mode signal is first matched as a dual-button virtual driving mode request. If it is found that the key type of the current vehicle is other key types, the current key type is actively modified to adapt to the key type of the vehicle.

[0084] In summary, adding the function of virtual driving mode in the environmental model of the controller hardware in the loop can quickly adjust the driving mode to the comfort mode after the vehicle controller is initialized, without affecting the execution of the normal test case of the test engineer. At the same time, when testing the driving mode memory function, it is only necessary to configure the key switch state not to be cleared, that is, the "not pressed" state, in the test case of testing the driving mode memory mode function, and the test case can realize the driving mode memory function.

[0085] Specifically, the step 300 includes:

[0086] Under the dual-button virtual driving mode request, obtaining the button category of the current driving mode;

[0087] According to the button category, configuring a test case of a virtual driving mode matching the button category;

[0088] Among them, the button categories of the current driving mode include: a driving mode with a single button configuration, a driving mode with a double button configuration, and a driving mode with a three button configuration.

[0089] In this embodiment, the button category of the current driving mode is obtained. This button category is the button category of the driving mode of the actual vehicle. By matching it to a test case that is suitable for the actual button category, there is no need to rewrite new test cases, which improves the automation of test cases and improves testing efficiency.

[0090] Optionally, the test case for configuring the driving mode of the current button category includes:

[0091] Obtaining the corresponding relationship between the variable of the current key category and the variable mapping from the first preset table;

[0092] According to the correspondence between the variables and the variable mapping, the test case of the driving mode with two buttons is made applicable to the test case of the driving mode with three buttons or the test case of the driving mode with one button;

[0093] The first preset table at least stores variables and variable mappings of a first signal type under multiple physical environments, and variables and variable mappings of a second signal type under multiple virtual environments.

[0094] It should be noted that each test case requires a mapping relationship table to be implemented. For example, the dual-button mapping relationship table of the prior art is shown in Table 4.

[0095] Table 4: Dual-button mapping relationship table of prior art

[0096]

[0097] As shown in Table 4, each test case corresponds to a mapping relationship table. Different button configurations require that the corresponding mapping relationship table be modified for each test case, which results in multiple test cases in the prior art being not universal, slowing down the test progress.

[0098] In this embodiment, the present invention designs a mapping table of multiple configuration driving modes, as shown in Table 5.

[0099] Table 5: Mapping table for multi-configuration driving modes

[0100]

[0101] The relationship between the three buttons is as follows: In the dual-configuration driving mode, the signal type is selected as IO, and the K- and K+ buttons are actually Figure 2 To switch modes, in the three-button driving mode, the K1, K2 and K3 buttons are actually used according to the Figure 3 To switch modes, in a single-button configuration, the K1 button is actually used. Figure 4 Switch modes. Dual buttons are configured on the vehicle model for the first time. By improving the test environment and mapping table of the controller hardware in the loop, dual configuration test cases are applicable to three-button and single-button functions related to driving modes, without modifying the test cases. It is only necessary to modify the signal type and variable mapping of the K- and K+ buttons according to Table 5. The signal type is Driver, and the variable mapping is KeyVirtual1 and KeyVirtual2, so as to realize the platformization of test cases for various configuration models.

[0102] According to the improved method of the present invention, the three-button driving mode related function test cases developed for the first time can be applied to two-button or single-button models, or the single-button driving mode related function test cases developed for the first time can be applied to two-button or three-button models.

[0103] Optionally, a successfully configured test case includes at least the following test items:

[0104] The first test item: when the vehicle is powered on for the first time, determining that the current driving mode is the second preset mode;

[0105] The second test item: when the vehicle is powered off and then powered on again, the current driving mode is determined to be the driving mode used before the vehicle was powered off last time. Here, the second preset mode is the comfort mode.

[0106] The successfully configured test case stores at least the following test information:

[0107] Test time series, input signal series, and output signal series;

[0108] The input signal at least includes vehicle power-on information and virtual button status information; the output signal sequence at least includes driving mode information and preparation status information. The virtual driving mode obtained by the virtual button corresponds to the execution of three buttons and a single button as shown in Table 6. After power-on, the driving mode of each test case related to the driving mode is automatically adjusted to the comfort mode. In the test case, the virtual driving button is adjusted in the comfort mode.

[0109] Table 6: Corresponding three-button and single-button virtual driving mode table

[0110]

[0111] Optionally, the step 400 includes:

[0112] Reading the test time sequence in the test case and receiving the input signal sequence;

[0113] After reading the test time sequence, determining the output signal sequence according to the time period of the test time sequence and the input signal sequence;

[0114] When a preset end signal appears in the output signal sequence, the output test result is determined.

[0115] The specific test process is as follows: the controller hardware in the loop environment model monitors the configuration button status in the automatic execution test case. If it is not pressed before power on, the driving mode on the bus is the memory driving mode; if the actual configuration button status in the monitoring automatic execution test case is "sw", the driving mode on the bus will change to the comfort mode. The bus driving mode obtains the input signal instruction of the virtual driving mode from the virtual double button, and the configuration button is actually executed according to Table 6 to obtain the driving mode.

[0116] According to the K- and K+ signals of the executable test case, the virtual driving mode required by the tester is parsed in the controller hardware-in-the-loop environment model. Figure 2 In order to correctly anticipate the driving mode on the bus, the test engineer designed a test case to press the K+ button twice and then press the K- button once. The bus driving mode is comfort mode, and the other two modes are required, and then the K- button and K+ button can be operated.

[0117] When the driving mode is a three-button configuration, by parsing the virtual driving mode value, the three buttons can be controlled to be pressed accordingly. If the virtual driving mode is sports mode, the K1 button is controlled to output signal 1, and K2 and K3 are 0; if the virtual driving mode is comfort mode, the K2 button is controlled to output signal 1, and K1 and K3 are 0; if the virtual driving mode is economy mode, the K3 button is controlled to output signal 1, and K1 and K2 are 0.

[0118] When the driving mode is a single-button configuration, the K1 button action is controlled according to the actual driving mode of the bus and the comparison of the virtual driving mode values ​​analyzed. The current driving mode is comfort mode, the virtual driving mode is comfort mode, the K1 button does not need to be pressed, the virtual driving mode is economy mode, the K1 button needs to be pressed once, the virtual driving mode is sports mode, the K1 button needs to be pressed twice; the current driving mode is economy mode, the virtual driving mode is comfort mode, the K1 button needs to be pressed twice, the virtual driving mode is economy mode, the K1 button does not need to be pressed, the virtual driving mode is sports mode, the K1 button needs to be pressed once; the current driving mode is sports mode, the virtual driving mode is comfort mode, the K1 button needs to be pressed once, the virtual driving mode is economy mode, the K1 button needs to be pressed twice, the virtual driving mode is sports mode, the K1 button does not need to be pressed.

[0119] It should be noted that in the dual-button execution use case of three-button and single-button configuration models, the dual button is a virtual existence. Pressing it cannot control the actual driving mode of the controller hardware in the loop. Its main function is to obtain a virtual driving mode request based on the dual-button test case, and ultimately control the three-button or single-button controller to obtain the driving mode request of the dual-button test case on the bus based on the virtual driving mode request.

[0120] In summary, the present invention greatly reduces the time for test engineers to modify test cases related to driving modes and improves test efficiency by modifying the environmental model and mapping table of the controller hardware in the loop; the present invention improves the environmental model of the controller hardware in the loop, has no effect on the debugging of test cases configured with different driving modes, and the test cases for driving mode functions require the use of actual configured buttons; the present invention modulates the bus driving mode of the controller to the comfort mode after power-on, which is beneficial for test case developers to write test cases, and test engineers no longer need to adjust the driving mode to the comfort mode through the test case method at the beginning of the test case.

[0121] The driving mode function of the present invention has a power-off storage function. After the next power-on, the driving mode is the last stored mode. When testing the driving mode storage function, it is necessary not to clear the test case input signal of the driving mode configuration button at the end of the test case. The corresponding driving mode configuration button signal before power-off and after power-on again is "not pressed". When power is on again, the driving mode is the memory driving mode.

[0122] like Figure 5 As shown, an optional embodiment of the present invention further provides a hardware-in-the-loop test device for a controller, comprising:

[0123] The first processing module 10 is used to call a test case set corresponding to a test instruction and monitor the virtual key state in the test case set;

[0124] A determination module 20, configured to determine a virtual driving mode signal according to the virtual button state;

[0125] A second processing module 30 is used to configure and execute a test case of a virtual driving mode of a currently configured key category according to the virtual driving mode signal;

[0126] The test module 40 is used to test the relevant functions of the vehicle's driving mode according to the configuration and successful execution of the test cases.

[0127] Optionally, the first processing module 10 includes:

[0128] A first determination unit, configured to monitor that all configuration buttons in the test case set are in a non-pressed state, and then determine that the current driving mode after powering on again is a memory driving mode;

[0129] The memory driving mode is the driving mode used before the vehicle was powered off last time.

[0130] Optionally, the first processing module 10 further includes:

[0131] A first generating unit, configured to generate a first preset instruction according to the preset action of the virtual key when the controller detects that the virtual key has a preset action;

[0132] The second determining unit is used to determine that the current driving mode is the first preset mode according to the first preset instruction.

[0133] Optionally, the determining module 20 includes:

[0134] The third determination unit is used to determine that the virtual driving mode signal is a two-button virtual driving mode request when the current driving mode is the first preset mode or the memory driving mode.

[0135] Optionally, the second processing module 30 includes:

[0136] A first acquisition unit, configured to acquire a button category of a current driving mode under the dual-button virtual driving mode request;

[0137] A configuration unit, configured to configure and execute a test case of a virtual driving mode matching the key category, and obtain a bus driving mode corresponding to the virtual driving mode;

[0138] Among them, the button categories of the current driving mode include: a driving mode with a single button configuration, a driving mode with a double button configuration, and a driving mode with a three button configuration.

[0139] Optionally, the second processing module 30 includes:

[0140] A second acquisition unit, used for acquiring the corresponding relationship between the variable of the current key category and the variable mapping from the first preset table;

[0141] a processing unit, configured to make the test case of the virtual driving mode with two buttons configured applicable to the test case of the driving mode with three buttons configured or the test case of the driving mode with one button configured according to the corresponding relationship between the variables and the variable mapping;

[0142] The first preset table at least stores variables and variable mappings of a first signal type under multiple physical environments, and variables and variable mappings of a second signal type under multiple virtual environments.

[0143] It should be noted that a successfully configured test case includes at least the following test items:

[0144] The first test item: when the vehicle is powered on for the first time, determining that the current driving mode is the second preset mode;

[0145] Second test item: when the vehicle is powered off and then powered on again, determine that the current driving mode is the driving mode used before the vehicle was powered off last time;

[0146] The successfully configured test case stores at least the following test information:

[0147] Test time series, input signal series, and output signal series;

[0148] Among them, the input signal at least includes vehicle power-on information and virtual key status information; the output signal sequence at least includes driving mode information and preparation status information.

[0149] Optionally, the testing module 40 includes:

[0150] A receiving unit, used for reading the test time sequence in the test case and receiving the input signal sequence;

[0151] a fourth determining unit, configured to determine the output signal sequence according to a time period of the test time sequence and the input signal sequence after reading the test time sequence;

[0152] The fifth determining unit is used to determine the output test result until a preset end signal appears in the output signal sequence.

[0153] The embodiment of the present invention further provides a readable storage medium, on which a program is stored, and when the program is executed by a processor, each process of the embodiment of the hardware-in-the-loop test method of the controller as described above is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0154] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0155] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary personnel in this technical field, several improvements and modifications can be made without departing from the principles described in the present invention. These improvements and modifications are also within the scope of protection of the present invention.

Claims

1. A controller hardware-in-the-loop testing method, characterized in that: include: Calling a test case set corresponding to the test instruction, and monitoring the state of the virtual buttons in the test case set, including: if all the configured button states in the test case set are monitored to be in the unpressed state, determining that the current driving mode after powering on again is the memory driving mode; wherein the memory driving mode is the driving mode used before the vehicle was powered off last time; if the controller detects that a preset action occurs on the virtual button, generating a first preset instruction according to the preset action of the virtual button; according to the first preset instruction, determining that the current driving mode is the first preset mode; the first preset mode is the comfort mode; Determining a virtual driving mode signal according to the virtual button state includes: determining that the virtual driving mode signal is a dual-button virtual driving mode request when the current driving mode is the first preset mode or the memory driving mode; According to the virtual driving mode signal, configuring and executing a test case of a virtual driving mode of a currently configured button category, including: obtaining a button category of a current driving mode under the double-button virtual driving mode request; configuring and executing a test case of a virtual driving mode matching the button category according to the button category, and obtaining a bus driving mode corresponding to the virtual driving mode; wherein the button category of the current driving mode includes: a driving mode of a single-button configuration, a driving mode of a double-button configuration, and a driving mode of a three-button configuration; Test the vehicle's driving mode related functions based on the configured and executed test cases.

2. The hardware-in-the-loop test method of the controller according to claim 1, characterized in that: The configuration and execution of the test case of the virtual driving mode of the currently configured button category include: Obtaining the corresponding relationship between the variable of the current key category and the variable mapping from the first preset table; According to the correspondence between the variables and the variable mapping, the test case of the virtual driving mode with two buttons is made applicable to the test case of the driving mode with three buttons or the test case of the driving mode with one button; The first preset table at least stores variables and variable mappings of a first signal type under multiple physical environments, and variables and variable mappings of a second signal type under multiple virtual environments.

3. The hardware-in-the-loop test method of the controller according to claim 1, characterized in that: A successfully configured test case includes at least the following test items: The first test item: when the vehicle is powered on for the first time, determining that the current driving mode is the second preset mode; Second test item: when the vehicle is powered off and then powered on again, determine that the current driving mode is the driving mode used before the vehicle was powered off last time; The successfully configured test case stores at least the following test information: Test time series, input signal series, and output signal series; Among them, the input signal at least includes vehicle power-on information and virtual key status information; the output signal sequence at least includes driving mode information and preparation status information.

4. The hardware-in-the-loop test method of the controller according to claim 3, characterized in that: The steps for executing the test case of the virtual driving mode of the currently configured button category include: Reading the test time sequence in the test case and receiving the input signal sequence; After reading the test time sequence, determining the output signal sequence according to the time period of the test time sequence and the input signal sequence; When a preset end signal appears in the output signal sequence, the output test result is determined.

5. A hardware-in-the-loop test device for a controller, characterized in that: include: A first processing module, used for calling a test case set corresponding to a test instruction, and monitoring a virtual key state in the test case set; A determination module, used to determine a virtual driving mode signal according to the virtual button state; A second processing module, configured and executed, according to the virtual driving mode signal, a test case of the virtual driving mode of the currently configured key category; A test module for testing the vehicle's driving mode-related functions based on configured and successfully executed test cases; The first processing module includes: a first determining unit, which is used to monitor that all the configuration buttons in the test case set are in a non-pressed state, and then determine that the current driving mode after powering on again is a memory driving mode; wherein the memory driving mode is the driving mode used before the vehicle was powered off last time; The first processing module further includes: a first generating unit, configured to generate a first preset instruction according to the preset action of the virtual key when the controller detects that the virtual key has a preset action; a second determining unit, configured to determine that the current driving mode is the first preset mode according to the first preset instruction; and the first preset mode is the comfort mode; The determination module includes: a third determination unit, configured to determine that the virtual driving mode signal is a double-button virtual driving mode request when the current driving mode is the first preset mode or the memory driving mode; Among them, the second processing module includes: a first acquisition unit, used to obtain the button category of the current driving mode under the dual-button virtual driving mode request; a configuration unit, used to configure and execute test cases of the virtual driving mode matching the button category, and obtain the bus driving mode corresponding to the virtual driving mode; wherein the button categories of the current driving mode include: a driving mode with a single-button configuration, a driving mode with a dual-button configuration, and a driving mode with a three-button configuration.

6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the hardware-in-the-loop testing method for a controller according to any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • Hardware-in-loop simulation testing system and testing method for automobile

    CN104062969A

  • Multimode drive control method for pure electric vehicle

    CN104648184A

  • Driver reaction behavior test system and test method after steering function failure of automatic driving system

    CN112487549A