Disclosure of Invention
The invention aims to provide a method for establishing a hardware-in-loop test case library of a new energy BMS (Battery management System) (BATTERY MANAGEMENT SYSTEM). the method is characterized in that test software, test hardware, a model and test cases are respectively defined, so that any one of the test software, the test hardware, the model and the test cases is prevented from being in a problem, the whole test is influenced, and error correction is facilitated.
In order to achieve the purpose, the new energy BMS hardware-in-loop test case library establishing method is characterized by comprising the following steps of:
step 1: establishing a hardware-in-loop test item in hardware-in-loop simulation test software, and adding the following five items in the hardware-in-loop test item:
item A, a model for simulating the running state of the whole vehicle; the hardware board card required by the in-loop test of the item B, BMS hardware; item C, an incidence relation file of a model for simulating the running state of the whole vehicle and the input/output relation of BMS hardware; the view window of the project D, BMS hardware for any variable during the loop test; the project E, BMS hardware is in the incidence relation file between any variable observation window and the corresponding variable in the ring test process;
step 2: for items A, B, C, D and E, different storage spaces are respectively adopted for block management to prevent data from overlapping;
and step 3: the method comprises the following steps of establishing a BMS hardware-in-loop test case management file by adopting test case execution software, wherein the BMS hardware contains four contents in the loop test case management file:
1. adding the items A, B, C, D and E into a BMS hardware-in-loop test case management file as an environment file for BMS hardware-in-loop test;
2. the method comprises the following steps of establishing a test case library by using test case execution software, wherein each test case library is a test case for testing one type of functions, each test case library consists of a plurality of test cases, each test case is a test case with one type of function, and the establishment of each test case is operated by using an INTES self-contained function;
3. setting an output mode of a BMS hardware in-loop test report;
4. defining a required BMS hardware-in-loop test tool, and setting an ID address of an INCA tool for testing at a corresponding position of test case execution software;
and 4, step 4: and (3) according to the BMS hardware in-loop test requirement, forming a BMS hardware in-loop test sequence by each test case of the BMS hardware in-loop test case management file in the step (3), and defining the test sequence and the cycle number of each test case.
The invention has the following beneficial effects:
1. the method completes the establishment of the new energy BMS hardware in the loop test case library by using project management and test management respectively. And management software designed by test work is simplified. The test environment, the test case and the test tool are managed by one piece of software, and different working spaces are adopted for storage allocation of different resources. Not only eliminates the direct mutual influence of different resources, but also manages all the resources used for testing by the same software, thereby reducing the difficulty of testing work.
2. In the project management and test management of the invention, different work spaces are adopted to complete the management of different projects, and the cross influence of data is prevented (when the data is stored in a cross way instead of in blocks, an access data error may occur in the execution, namely, a certain data in a data block 2 is used as the data in a data block 1, even if no error occurs, the data of which address is required to be continuously calculated in the test, the calculation time is increased, and the test efficiency is reduced).
3. In the test case management file, the test cases used in the test are put into the test case management file instead of using macro definition EXCELE or other software (interpretation: the dedicated application of the test case management file is not EXCEL, and the last patent is) to finish the definition of the test cases, so that the definition language of the test sequence is unified, and the test work is simplified.
4. In the test management of the invention, each test case in the test case library is positioned into a sub-sequence which cannot be subdivided, and the test case can test the function of the whole vehicle. The definition method meets the data segmentation requirements of data of the bottom layer data of the database on a three-normal form, reduces the correlation among test cases to the maximum extent, and reduces the influence degree among the test cases (for example, when the test case 1 can be tested, when the vehicle speed is 15KM/H, and the gear is shifted from 2 gear to 3 gear, the test case is a single function of the test, if the test case 2 can be tested, when the vehicle speed is 15KM/H, and the gear is shifted from 2 gear to 3 gear, the functions of low SOC and power reduction of the motor can be tested, so that the test cases 1 and 2 have the overlapping of the test functions.
Detailed Description
The invention is described in further detail below with reference to the following figures and specific examples:
the new energy BMS hardware-in-loop test case library establishment method shown in FIG. 1 comprises the following steps:
step 1: establishing a hardware-in-loop test item in hardware-in-loop simulation test software, and adding the following five items in the hardware-in-loop test item:
item A, a model for simulating the running state of the whole vehicle; the hardware board card required by the in-loop test of the item B, BMS hardware; item C, an incidence relation file of a model for simulating the running state of the whole vehicle and the input/output relation of BMS hardware; the view window of the project D, BMS hardware for any variable during the loop test; the project E, BMS hardware is in the incidence relation file between any variable observation window and the corresponding variable in the ring test process;
step 2: for items A, B, C, D and E, different storage spaces are respectively adopted for block management to prevent data from overlapping;
and step 3: the method comprises the following steps of establishing a BMS hardware-in-loop test case management file by adopting test case execution software, wherein the BMS hardware contains four contents in the loop test case management file:
1. adding the items A, B, C, D and E into a BMS hardware-in-loop test case management file as an environment file for BMS hardware-in-loop test;
2. the method comprises the following steps of establishing a test case library by using test case execution software, wherein each test case library is a test case for testing one type of functions, each test case library consists of a plurality of test cases, each test case is a test case with one type of functions, and the establishment of each test case is operated by using an INTES self-contained function, for example: wait (a) function, which can wait a seconds during the test;
3. setting the output mode of the BMS hardware in the ring test report (in the test management, a check mode is needed to define what test data needs to be output in the test report, and the display mode of the test data output is single data or a chart, and the detail degree of the display, such as the display of the last result of one test data or the display of the data change every second);
4. defining a required BMS hardware-in-loop test tool, and setting an ID address of an INCA tool for testing at a corresponding position of test case execution software, namely enabling the test case execution software to finish data acquisition and calibration work in the test;
and 4, step 4: and (3) according to the BMS hardware in-loop test requirement, forming a BMS hardware in-loop test sequence by each test case of the BMS hardware in-loop test case management file in the step (3), and defining the test sequence (in the test management, the execution sequence of the test cases is realized in a dragging mode, queuing is carried out, the execution cycle number of each test case needs to be set in the test so as to achieve the purpose of multiple execution), and the cycle number of each test case, namely realizing the establishment of the BMS hardware in the loop test case library.
In step 2 of the above technical solution, when allocating storage spaces to the items A, B, C, D and E, the items A, B, C, D and E are to be placed in different storage spaces, and the storage spaces do not intersect with each other, and when performing block management, the first addresses of the items A, B, C, D and E are recorded (the first address of storage is a key for data storage, and the first address is found, so that it is known where the data is, the length of the data is determined by the size of the offset), and the storage spaces of the items A, B, C, D and E are collectively called a working space.
In the technical scheme, the hardware board cards required by the BMS hardware in-loop test comprise a single battery simulation unit board card, a single battery injection fault board card, an electrical fault injection board card, a single battery injection fault board card and an electrical fault injection board card.
In the above technical solution, when the storage space is allocated to the items A, B, C, D and E, the storage space is reserved according to the size of the existing data volume in the items and the possibility of later expansion.
In the technical scheme, the hardware-in-loop simulation test software is Veristand software.
In the above technical solution, the test case execution software is an inces software.
In the above technical solution, in step 3, the output mode of the BMS hardware in the ring test report includes display of the test result of the BMS hardware in the ring test, a sequence of the display of the result, a detailed degree of the display of the result, a storage address of the test report, and a storage format.
The example of step 4 of the above technical solution is as follows: according to the BMS hardware in-loop test requirement, an A1 test case can be selected from a test case library A; selecting a B2 test case from the test case library B; from the test case library C, C3 test cases are selected. According to the test requirement, the test is carried out in the sequence of C3-B2-A1, A1 is carried out 1 time, B2 is carried out 3 times, C3 is carried out 2 times, namely, the test is finally set to C3(2) -B2 (3) -A1 (1), and the C3(2) -B2 (3) -A1 (1) test sequence can be subjected to automatic test in the test environment of INTES by pressing an execution key.
The test software, the test hardware, the model and the test case are respectively defined, different test spaces are used for storage, data cross storage is prevented, any problem is prevented, the whole test is influenced, the test software, the test hardware, the model and the test case are managed by adopting the same software, error correction is facilitated, the use process of a user is considered, an observation window of any variable of the BMS hardware in the whole process of the ring test can be defined, test data can be observed in the test process, a test data display mode in a test report can be defined, all data required by the test can be conveniently managed, and unified platform management is performed.
Details not described in this specification are within the skill of the art that are well known to those skilled in the art.