A test case generation method, system, device, equipment, and storage medium

By normalizing the battery pack configuration parameters and vehicle electrical parameters and automatically generating test cases using multi-level test process templates, the problem of poor reusability of test case generation in existing technologies is solved, achieving efficient test case generation and adaptability.

CN123114443APending Publication Date: 2026-11-17LIGOO (SHAN DONG) NEW ENERGY TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611569163.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-12
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

Existing technologies are difficult to be compatible with the battery pack configuration parameters and vehicle electrical parameters of different vehicle models and projects, resulting in poor reusability of test case generation, frequent manual modifications, and difficulty in meeting the testing efficiency requirements of rapid iteration.

Method used

By normalizing the battery pack configuration parameters and vehicle electrical parameters, a structured parameter set is generated, and test cases, including test instruction sets and judgment conditions, are automatically generated according to the multi-level test process template and filled into the target test template.

Benefits of technology

It significantly reduces the degree of manual intervention in the test case generation process, improves generation efficiency and reusability, and can adapt to different types of testing needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123114443A_ABST
    Figure CN123114443A_ABST
Patent Text Reader

Abstract

This application discloses a test case generation method, system, device, equipment, and storage medium, belonging to the field of electrical engineering technology. The method includes: normalizing battery pack configuration parameters and vehicle electrical parameters according to parameter mapping information and fault diagnosis configuration information to obtain a structured parameter set; determining the target test template corresponding to the battery pack based on the structured parameter set and multiple levels of test process templates; wherein, different levels of test process templates are matched with different test requirement types; determining the test instruction set corresponding to the battery pack based on the structured parameter set and generating corresponding test judgment conditions; and filling the test judgment conditions, test instruction set, and structured parameter set into the target test template to obtain test cases for the battery pack. This significantly reduces the degree of manual intervention in the test case generation process, improves the generation efficiency and reusability of test cases, and can adapt to different test requirement types.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of electrical engineering technology, and in particular relates to a test case generation method, system, device, equipment and storage medium. Background Technology

[0002] In the field of new energy vehicles, battery management system testing is a crucial step in ensuring vehicle safety and performance. Currently, test case generation typically relies on test engineers manually writing test scripts and configuring execution conditions based on battery pack configuration parameters and vehicle electrical parameters. Due to differences in parameter specifications across different vehicle models and between new and old projects, existing solutions struggle to be compatible with parameters from various sources and adapt to diverse testing needs. When projects change or parameters are adjusted, test scripts require extensive manual modification, resulting in long test preparation cycles, poor reusability, and an inability to meet the testing efficiency demands of rapid vehicle iteration.

[0003] Therefore, how to efficiently generate test cases adapted to battery packs based on differentiated battery pack configuration parameters and vehicle electrical parameters is a technical problem that urgently needs to be solved. Summary of the Invention

[0004] This application provides a test case generation method, system, device, equipment, and storage medium, which significantly reduces the degree of manual intervention in the test case generation process and improves the generation efficiency and reusability of test cases.

[0005] In a first aspect, embodiments of this application provide a test case generation method, including: Based on parameter mapping information and fault diagnosis configuration information, the battery pack configuration parameters and vehicle electrical parameters are normalized to obtain a structured parameter set for the battery pack. The target test template corresponding to the battery pack is determined based on the structured parameter set and the test process templates at multiple levels; wherein, the test process templates at different levels are matched with different test requirement types. Based on the structured parameter set, determine the test instruction set corresponding to the battery pack, and generate the test judgment conditions corresponding to the battery pack; The test judgment conditions, the test instruction set, and the structured parameter set are filled into the target test template to obtain the test cases for the battery pack.

[0006] Secondly, embodiments of this application provide a test case generation system, including: The controller is used to normalize the battery pack configuration parameters and vehicle electrical parameters according to parameter mapping information and fault diagnosis configuration information to obtain a structured parameter set for the battery pack; determine the target test template corresponding to the battery pack based on the structured parameter set and multiple levels of test process templates; wherein, the test process templates at different levels are matched with different test requirement types; determine the test instruction set corresponding to the battery pack based on the structured parameter set, and generate the test judgment conditions corresponding to the battery pack; fill the test judgment conditions, the test instruction set, and the structured parameter set into the target test template to obtain the test cases for the battery pack.

[0007] Thirdly, embodiments of this application provide a battery device, including a battery and a test case generation system as described in the second aspect.

[0008] Fourthly, embodiments of this application provide an electronic device, the device including: a processor and a memory storing computer program instructions; The processor implements the test case generation method as described in the first aspect when executing computer program instructions.

[0009] Fifthly, embodiments of this application provide a computer storage medium on which computer program instructions are stored, and when the computer program instructions are executed by a processor, they implement the test case generation method as described in the first aspect.

[0010] Sixthly, embodiments of this application provide a computer program product in which instructions, when executed by a processor of an electronic device, cause the electronic device to perform the test case generation method as described in the first aspect.

[0011] The technical solutions provided by the embodiments of this application bring at least the following beneficial effects: This application provides a test case generation method, comprising: normalizing battery pack configuration parameters and vehicle electrical parameters according to parameter mapping information and fault diagnosis configuration information to obtain a structured parameter set for the battery pack; determining a target test template corresponding to the battery pack based on the structured parameter set and multiple levels of test process templates; wherein, test process templates at different levels are matched with different test requirement types; determining a test instruction set corresponding to the battery pack based on the structured parameter set, and generating test judgment conditions corresponding to the battery pack; and filling the test judgment conditions, the test instruction set, and the structured parameter set into the target test template to obtain test cases for the battery pack.

[0012] The technical solution provided in this application normalizes battery pack configuration parameters and vehicle electrical parameters, achieving unified management of test input data. Then, it determines a target test template based on a structured parameter set and multiple levels of test process templates, ensuring the test template matches different test requirements. Next, it automatically determines the test instruction set and generates test judgment conditions based on the structured parameter set, eliminating the need for manual configuration of instructions and judgment rules. Finally, it automatically generates complete test cases by filling the target test template with the test judgment conditions, test instruction set, and structured parameter set. This significantly reduces manual intervention in the test case generation process, improves the efficiency and reusability of test case generation, and adapts to different test requirements.

[0013] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description

[0014] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0015] Figure 1 A flowchart illustrating a test case generation method provided in one embodiment of this application; Figure 2 This is a schematic diagram of the overall process of a test case generation method provided in one embodiment of this application; Figure 3 A schematic diagram of the structure of a test case generation system provided in another embodiment of this application; Figure 4 This is a schematic diagram of the structure of an electronic device provided in yet another embodiment of this application. Detailed Implementation

[0016] In the field of new energy vehicles, battery management system testing is a crucial step in ensuring vehicle safety and performance. Currently, test case generation typically relies on test engineers manually writing test scripts and configuring execution conditions based on battery pack configuration parameters and vehicle electrical parameters. Due to differences in parameter specifications across different vehicle platforms and between new and old projects, existing solutions suffer from the following main shortcomings: First, existing test scripts are mostly based on fixed templates with simple parameter filling, making it difficult to flexibly adjust test steps and boundaries according to the specific parameters of the battery pack and the vehicle. Operating conditions, fault injection scenarios, etc., often need to be manually supplemented by test engineers.

[0017] Secondly, different vehicle platforms and new / old projects differ in parameter specifications, field definitions, unit systems, and protection logic, making existing test scripts difficult to reuse across projects and requiring manual line-by-line modifications when projects change. Thirdly, existing generated results are mostly adapted to general commercial simulation equipment formats, with insufficient support for the proprietary fields of the self-developed simulation testing system, often requiring secondary adaptation. Fourthly, test pass conditions, expected results, and verification rules typically rely on manual writing and maintenance, requiring recalculation and updates when parameters change, posing a risk of missed or incorrect tests. Fifthly, existing scripts mostly fixate on basic charging / discharging and fault detection scenarios, with limited support for extended testing of SOC (State of Charge), SOH (State of Health), SOP (State of Power), and thermal management strategies.

[0018] Due to differences in parameter specifications across different vehicle models and between new and old projects, existing solutions struggle to be compatible with parameters from various sources and adapt to the testing requirements of different projects. When projects change or parameters are adjusted, test scripts require extensive manual modification, resulting in long test preparation cycles, poor reusability, and an inability to meet the testing efficiency demands of rapid vehicle iteration. Therefore, how to efficiently generate test cases adapted to the battery pack for differentiated battery pack configuration parameters and vehicle electrical parameters is a pressing technical problem that needs to be solved.

[0019] The technical solution provided in this application normalizes battery pack configuration parameters and vehicle electrical parameters, achieving unified management of test input data. Then, it determines a target test template based on a structured parameter set and multiple levels of test process templates, ensuring the test template matches different test requirements. Next, it automatically determines the test instruction set and generates test judgment conditions based on the structured parameter set, eliminating the need for manual configuration of instructions and judgment rules. Finally, it automatically generates complete test cases by filling the target test template with the test judgment conditions, test instruction set, and structured parameter set. This significantly reduces manual intervention in the test case generation process, improves the efficiency and reusability of test case generation, and adapts to different test requirements.

[0020] Regarding the execution entity used in the embodiments of this application, it can specifically be a test case generation system capable of monitoring the terminal voltage and current of a battery, or other electronic devices capable of controlling the test case generation system, such as desktop computers, laptops, etc., or servers, etc. In addition, the execution entity in the embodiments of this application can also be a software entity, such as a client or software program installed in the test case generation system. The specific type of execution entity corresponding to the test case generation method, system, device, equipment, and storage medium provided in the embodiments of this application is not strictly limited here; it can be flexibly selected and set according to the application scenario and actual needs.

[0021] It should be noted that the embodiments provided in this application do not limit the specific application scenarios of the test case generation method, system, device, equipment and storage medium provided above. The technical solutions provided in the embodiments of this application can be flexibly applied to various actual scenarios that require test case generation according to actual needs.

[0022] It should be noted that the application scenarios described in the above embodiments of this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. Those skilled in the art will understand that with the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.

[0023] Figure 1 This is a schematic diagram of a test case generation process provided in one embodiment of this application.

[0024] like Figure 1 As shown, the test case generation method provided in this application includes S101 to S104.

[0025] S101: Based on the parameter mapping information and fault diagnosis configuration information, the battery pack configuration parameters and vehicle electrical parameters are normalized to obtain a structured parameter set for the battery pack.

[0026] S102: Determine the target test template corresponding to the battery pack based on the structured parameter set and the test process templates at multiple levels; wherein, the test process templates at different levels are matched with different test requirement types.

[0027] S103: Based on the structured parameter set, determine the test instruction set corresponding to the battery pack, and generate the test judgment conditions corresponding to the battery pack.

[0028] S104: Fill the target test template with the test judgment conditions, the test instruction set and the structured parameter set to obtain the test cases for the battery pack.

[0029] In the aforementioned test case generation method, this application achieves unified management of test input data by normalizing battery pack configuration parameters and vehicle electrical parameters. Then, it determines the target test template based on a structured parameter set and multiple levels of test process templates, ensuring the test template matches different test requirement types. Next, it automatically determines the test instruction set and generates test judgment conditions based on the structured parameter set, eliminating the need for manual configuration of instructions and judgment rules. Finally, the test judgment conditions, test instruction set, and structured parameter set are filled into the target test template to automatically generate complete test cases. This significantly reduces the degree of manual intervention in the test case generation process, improves the efficiency and reusability of test case generation, and enables adaptation to different test requirement types.

[0030] In S101 above, the parameter mapping information is a set of corresponding association rules pre-established to eliminate the differences in naming and expression of parameters from different vehicle projects and different sources. It is used to convert heterogeneous input parameters into a unified expression form. The specific rules can be configured and updated according to the vehicle platform and battery pack development attribute type.

[0031] The fault diagnosis configuration information is pre-stored configuration data related to battery pack faults, including fault-related result information and fault handling related execution information, which is used to complete normalization processing in conjunction with the original parameters.

[0032] Battery pack configuration parameters are input parameters that characterize the design, calibration, and faults of the battery pack itself. These include hardware and software design parameters of the battery management system for new models, configuration parameters of the historical battery management system for older models, configuration parameters of battery management system units, temperature sensing acquisition parameters, individual cell voltage sampling parameters, battery pack mapping and calibration parameters, various fault threshold parameters of the battery pack, high-voltage interlock implementation scheme parameters, sensor configuration scheme parameters, and battery pack series and parallel topology circuit parameters.

[0033] Vehicle electrical parameters are electrical input parameters from the vehicle side, reflecting electrical-related information about the interaction between the vehicle and the battery pack. Vehicle electrical parameters include, but are not limited to, vehicle high-voltage operating parameters and vehicle lead-acid voltage operating parameters.

[0034] In some embodiments, the battery pack configuration parameters and vehicle electrical parameters are input as a whole. First, the parameter fields in the battery pack configuration parameters and vehicle electrical parameters are uniformly converted according to the parameter mapping information. Then, the fault diagnosis configuration information is retrieved to match the fault association information. The converted parameters and the matched fault-related information are encapsulated to form a structured parameter set. In addition to the above method, other methods can also be used for normalization processing, and this embodiment does not limit this.

[0035] In S102 above, the test process templates at multiple levels are pre-built test process template resource libraries divided into different levels. The different levels of templates are geared towards different business scenarios, and each level of template corresponds to a type of test process logic.

[0036] Test requirement types are categorized into test business types based on vehicle platform, battery pack solution, and product iteration attributes. Different test requirement types correspond to different test focuses. The target test template is a test process template carrier that is matched and adapted to the current battery pack under test from multi-level test process templates.

[0037] In some embodiments, based on the battery pack and vehicle-related information carried by the structured parameter set, matching is performed in multi-level test process templates to determine the target test template adapted to the battery pack. Specifically, key information for template matching can be extracted from the structured parameter set, and this key information is used to traverse multiple levels of test process templates layer by layer to filter out templates adapted to the current battery pack as the target test template; or, a preset starting template is used, and the product iteration attribute information carried by the structured parameter set is used to adapt and adjust the starting template, and then the business logic of higher-level templates is combined to supplement the adaptation, finally obtaining the target test template.

[0038] In S103 above, the test instruction set is a collection of multiple test instructions that can be used to drive test execution. These instructions are used to invoke various test actions. The test judgment condition is a condition used to evaluate whether the test execution result is qualified, and is used to complete result verification during the test process.

[0039] In some embodiments, a structured parameter set is used as input. Various business parameters from the structured parameter set are read, and corresponding instructions are selected from preset instruction resources based on the test business corresponding to the parameters to form a test instruction set. Simultaneously, parameter threshold information from the structured parameter set is read to generate corresponding test judgment conditions. Besides the above method, other methods can also be used to determine the test instruction set and test judgment conditions; this embodiment does not limit this approach.

[0040] In some embodiments, for the above S104, the test instruction set, test judgment conditions, and structured parameter set are respectively filled into different preset filling areas in the target test template to complete information integration and generate test cases for the battery pack; or, based on the process framework of the target test template, the execution steps corresponding to the test instruction set are embedded in sequence, and then the test judgment conditions are written, while the structured parameter set is attached as the parameter data source of the template to obtain complete test cases for the battery pack.

[0041] In some embodiments, the above-described S101 can be performed in the following manner: Based on the parameter mapping information, fields with different names for the same physical quantity in the battery pack configuration parameters and vehicle electrical parameters are converted into a unified field to obtain multiple target fields and parameter values ​​for each target field; Based on the fault parameters in the battery pack configuration parameters, match the expected fault diagnosis results and execution steps corresponding to the fault parameters from the fault diagnosis configuration information; The target fields, the parameter values ​​of the target fields, the expected results of the fault diagnosis, and the execution steps are encapsulated into a structured parameter set for the battery pack.

[0042] The aforementioned fields with different names for the same physical quantity refer to parameter fields with different names used for the same electrical and physical meaning under different vehicle platforms and application scenarios. For example, the same unit voltage setting command uses different field names on different platforms. The target field is the parameter field with a unified name obtained after name conversion through parameter mapping information.

[0043] Fault parameters are a class of parameters related to fault triggering and recovery, included in the battery pack configuration parameters. These include information such as fault thresholds, fault clearing methods, and fault levels. Expected fault diagnosis results are pre-stored in the fault diagnosis configuration information, corresponding to the output results that should be observed in fault occurrence and recovery scenarios, such as fault trigger thresholds, fault recovery judgment levels, and fault reporting status. Execution steps are the test execution steps corresponding to fault clearing and recovery behaviors, used in fault-related test scenarios.

[0044] In some embodiments, during the field conversion process, parameter mapping information is read, and parameter fields are traversed for battery pack configuration parameters and vehicle electrical parameters. Fields that represent the same physical quantity but have different names are identified, and name normalization is completed to obtain the target field and its corresponding parameter value. When matching fields, precise matching is prioritized. When an operator is attached to a field, the fields are compared in descending order of name length to avoid the problem of short fields being mismatched with long fields. The signal mapping process can support the reading and bit-by-bit backfilling of multiple associated parameter bits.

[0045] During the parameter preprocessing stage, the data types of the read parameters are rectified, and the judgment boundaries for time and power parameters are relaxed to unify the judgment criteria. When there are multiple definitions for the same physical quantity or when the parameter value is empty, a rollback process is performed according to the preset priority to ensure that the output parameters are available.

[0046] Subsequently, the fault parameters carried in the battery pack configuration parameters are read. Using the fault parameters as the retrieval basis, the fault diagnosis configuration information is retrieved to obtain the expected fault diagnosis results and the corresponding execution steps for the fault parameters. For fault parameters with fault levels, the judgment values ​​corresponding to fault degradation and fault recovery are calculated level by level according to the fault threshold relationship. When such judgment values ​​cannot be directly obtained, the preset alternative configuration information in the configuration information is retrieved for fallback compatibility. If some fault-related information cannot be directly read, the alternative configuration information is retrieved for fallback compatibility. For fault clearing actions, if the matched clearing signal has no valid value, the step is automatically replaced with a waiting step to prevent the generation of unexecutable operations; at the same time, the judgment window is converted for time-related parameters. Finally, all target fields, parameter values ​​of target fields, expected fault diagnosis results, and execution steps are integrated and encapsulated to form a structured parameter set.

[0047] This implementation method, through unified conversion of parameter field names and matching and encapsulation of fault information, can convert battery pack configuration parameters and vehicle electrical parameters from different vehicle platforms into a unified format. At the same time, it incorporates the expected results and execution steps corresponding to the fault into a structured parameter set, which is compatible with irregular inputs such as missing parameters and multiple definition conflicts, and provides a complete and comprehensive parameter input foundation for subsequent processes.

[0048] In some embodiments, the parameter mapping information includes signal configuration mapping relationships and command mapping dictionaries. Based on this, the above-mentioned conversion of fields with different names for the same physical quantity in the battery pack configuration parameters and vehicle electrical parameters into unified fields according to the parameter mapping information, to obtain multiple target fields and parameter values ​​for each target field, specifically includes the following steps: In the signal configuration mapping relationship, find the first actual signal name corresponding to the uniform purpose name in the battery pack configuration parameters, and the second actual signal name corresponding to the uniform purpose name in the vehicle electrical parameters; Replace the unified purpose name of the battery pack configuration parameters with the first actual signal name, and fill the parameter value associated with the first actual signal name in the signal configuration mapping relationship back into the parameter position corresponding to the first actual signal name to obtain the first target field and the parameter value of the first target field. Replace the uniform purpose name in the vehicle electrical parameters with the second actual signal name, and fill the parameter value associated with the second actual signal name in the signal configuration mapping relationship back into the parameter position corresponding to the second actual signal name to obtain the second target field and the parameter value of the second target field; Based on the command mapping dictionary, the command names in the battery pack configuration parameters and the command names in the vehicle electrical parameters are replaced with the command names corresponding to the vehicle platform to which the battery pack belongs, to obtain the third target field and the parameter values ​​of the third target field; The first target field, the second target field, and the third target field are used as multiple target fields.

[0049] The above signal configuration mapping relationship is used to process signal class parameter fields and store the correspondence between the unified purpose name and the actual signal name and associated parameter value. For example, the unified purpose name is used as an index to bind the actual bus signal name and corresponding parameter bits of the purpose under the current vehicle platform.

[0050] The command mapping dictionary is used to process command-type parameter fields and store the translation correspondence between command names of different vehicle platforms. Uniform purpose names are standardized names used to characterize the service purpose of signals and are not bound to specific vehicle platforms. Examples include service purpose identifiers such as current sensor, high-voltage interlock normal, high-voltage interlock abnormal, branch current, total voltage signal, insulation resistance signal, and fast charging request current.

[0051] The first actual signal name is the actual signal name corresponding to the unified purpose name on the battery pack configuration parameter side under the current vehicle platform. The second actual signal name is the actual signal name corresponding to the unified purpose name on the vehicle electrical parameter side under the current vehicle platform, such as current sensor, high voltage interlock normal, high voltage interlock abnormal, branch current, total voltage signal, insulation resistance signal, fast charging request current, etc. The first target field is the field and parameter value obtained by replacing the unified purpose name of the battery pack configuration parameter with the first actual signal name and backfilling the parameter value associated with the first actual signal name in the signal configuration mapping relationship to the parameter position corresponding to the first actual signal name. The second target field is the field and parameter value obtained by replacing the unified purpose name in the vehicle electrical parameters with the second actual signal name and backfilling the parameter value associated with the second actual signal name in the signal configuration mapping relationship to the parameter position corresponding to the second actual signal name. The third target field is the standardized command field obtained by replacing the command name in the battery pack configuration parameter and the command name in the vehicle electrical parameter with the command name corresponding to the vehicle platform to which the battery pack belongs, based on the command mapping dictionary.

[0052] In some embodiments, when performing signal field processing, a uniform purpose name is retrieved within the signal configuration mapping relationship to obtain the first actual signal name corresponding to the battery pack side and the second actual signal name corresponding to the vehicle side; the original uniform purpose name is replaced with the actual signal name, and the parameter values ​​associated within the signal configuration mapping relationship are backfilled to the corresponding parameter positions to obtain the first target field and the second target field; the matching process adopts a matching strategy of precision priority and long name priority to avoid incorrect replacement of short signal names and complete the backfilling of each parameter position bit by bit.

[0053] When processing command fields, the command mapping dictionary is read, and based on the vehicle platform to which the current battery pack belongs, the original command names in the battery pack configuration parameters and vehicle electrical parameters are translated and replaced with the command names corresponding to that platform, generating the third target field. Finally, the first target field, the second target field, the third target field, and their corresponding parameter values ​​are summarized to obtain multiple target fields and parameter values.

[0054] For example, the search and replacement of all signal configuration mapping relationships and parameter backfilling can be completed first to obtain the first and second target fields. Then, the command mapping dictionary is called to complete the command name conversion to obtain the third target field, and all target fields are obtained by summarizing. Alternatively, the field type of the parameter fields can be distinguished. Signal fields are sent to the signal configuration mapping relationship for processing, and command fields are sent to the command mapping dictionary for processing. The two types of fields are processed in parallel, and after processing, they are merged to obtain multiple target fields.

[0055] This implementation method normalizes and converts signal fields and command fields by distinguishing between signal configuration mapping relationships and command mapping dictionaries. This not only enables the mapping back to actual signals from signal usage names on different platforms, but also enables automatic translation of command names across vehicle platforms, reducing signal matching misjudgment problems. Thus, it achieves complete normalization of the two heterogeneous fields of signals and commands, adapting to the differences in parameter field naming between new and old vehicle platforms.

[0056] In some embodiments, the above-mentioned matching of the expected fault diagnosis result and execution steps corresponding to the fault parameters from the fault diagnosis configuration information based on the fault parameters in the battery pack configuration parameters specifically includes the following steps: Based on the fault parameters in the battery pack configuration parameters, search for the expected fault diagnosis result corresponding to the fault parameters in the fault diagnosis configuration information; Based on the fault clearing method in the fault parameters, find the execution steps corresponding to the fault clearing method in the fault diagnosis configuration information; The fault clearing methods include at least one of the following: diagnostic service clearing, power-off recovery, vehicle controller clearing, and automatic clearing.

[0057] The above-mentioned fault clearing methods describe the methods used to resolve faults, including at least one of diagnostic service clearing, power-down recovery, vehicle controller clearing, and automatic clearing. Diagnostic service clearing is a fault recovery method that clears the fault using diagnostic service commands. Power-down recovery is a fault recovery method that clears the fault by powering down the vehicle. Vehicle controller clearing is a fault recovery method that clears the fault by issuing commands from the vehicle controller. Automatic clearing is a fault recovery method where the fault is automatically resolved once hardware conditions are met.

[0058] In some embodiments, fault parameters within the battery pack configuration parameters are read, and the fault identifier is used as a search keyword to retrieve the corresponding expected fault diagnosis results from the fault diagnosis configuration information. For fault parameters with fault levels, the judgment values ​​corresponding to fault degradation and fault recovery can also be determined based on the size relationship between fault thresholds. If the relevant judgment values ​​cannot be read directly, the preset alternative configuration information in the configuration information is retrieved for rollback compatibility.

[0059] The fault clearing method recorded in the fault parameters is read, and the fault diagnosis configuration information is retrieved according to the fault clearing method to obtain the corresponding execution step. If some signal parameters in the matched execution step are empty or invalid, the execution step is replaced with a waiting step to prevent the generation of an unexecutable step. The time parameters are synchronously converted to a judgment window to finally obtain the usable execution step. The expected fault diagnosis result and the usable execution step after processing are output.

[0060] For example, the expected result of fault diagnosis can be retrieved and determined first, then the fault clearing method can be read, the corresponding execution steps can be matched, and after the rollback correction of the abnormal steps is completed, the expected result of fault diagnosis and the execution steps can be output; or, the fault identifier and fault clearing method in the fault parameters can be read at the same time, the fault diagnosis configuration information can be retrieved in parallel, the expected result of fault diagnosis and the execution steps can be obtained respectively, and then the validity verification and rollback processing can be performed on the execution steps.

[0061] This implementation method can automatically match the expected results of fault diagnosis based on fault parameters and obtain the corresponding test execution steps for different fault clearing methods. It is also compatible with abnormal scenarios such as missing fault configurations and invalid step parameters, and realizes automatic adaptation of the steps corresponding to various fault clearing methods. Testers do not need to manually write fault recovery related execution steps, which improves the automation level of fault-related parameter normalization processing.

[0062] In some embodiments, the above-mentioned multi-level test process template includes a basic test template and a compatibility test template. The basic test template matches a first test requirement type, and the compatibility test template matches a second test requirement type. The first test requirement type is determined based on the vehicle platform type and the battery pack design scheme. The second test type is determined based on the vehicle platform type, the battery pack design scheme, and the historical configuration parameters of the battery pack. Based on this, the above S102 can be performed using the following procedure: Extract the vehicle platform type and design scheme corresponding to the battery pack from the structured parameter set; The vehicle platform type and design scheme are matched with the basic test template; if the match is successful, the basic test template is used as the initial test template. In the event of a matching failure, the basic test template is adjusted according to the vehicle platform type and the design scheme, and the adjusted basic test template is used as the initial test template. If the structured parameter set contains historical configuration parameters of the battery pack, the initial test template is adjusted according to the historical configuration parameters and the compatibility test template to obtain the target test template corresponding to the battery pack.

[0063] The aforementioned basic test template is a pre-built test process template based on the basic general template layer. It is used to solidify the general system-level test process of the battery management system, including common test steps that are independent of specific vehicle models, such as battery management system software function testing, slave board sampling testing, vehicle high and low voltage static testing, conventional charge and discharge logic testing, and basic and configuration fault testing.

[0064] The basic test template can be organized into a CSV (Comma Separated Values) test case template file according to the working mode and functional modules. The template contains the power-on process template and power-off process template shared by each module. The power-on process template is located at the beginning of the test case, and the power-off process template is located at the end of the test case.

[0065] The compatibility test template is a pre-built test process template based on the compatibility template layer of historical development versions. It is used to carry the battery management system board adaptation logic of existing historical development versions, the old version battery management system software control strategy, and the old hardware adaptation logic of self-developed battery management system simulation test. Through mechanisms such as parameter rollback reading, long / short signal compatibility, and bidirectional translation of vehicle commands, it can automatically complete the template adaptation even when the materials of historical development versions are not regular.

[0066] The first type of test requirement is the test business category determined based on the vehicle platform type and battery pack design scheme, such as verification scenarios for new design requirements under the new vehicle platform, including the hardware and software design parameters of the battery management system, sensor configuration scheme, and high-voltage interlock configuration scheme.

[0067] The second type of test requirement is the test business category determined based on the vehicle platform type, battery pack design scheme, and historical configuration parameters of the battery pack. For example, in projects involving older vehicle platforms or historical battery management system versions, there are verification scenarios for the compatibility of the new platform / solution with the existing battery management system's hardware and software, and the old version's control strategies.

[0068] Historical configuration parameters are the configuration parameters used by the battery pack in previous development versions, including configuration parameters of the battery management system in older models, software control strategy parameters of the old version of the battery management system, and old hardware adaptation parameters for simulation testing of the self-developed battery management system.

[0069] In some embodiments, the template directory is located according to the operating mode (e.g., discharging, slow charging, fast charging) and the selected functional module, and the basic test templates in that directory are read; then, the vehicle platform type and design scheme are extracted from the structured parameter set. The vehicle platform type may include information such as the vehicle platform model and high and low voltage architecture types; the design scheme may include the series and parallel topology of the battery pack, sensor configuration scheme, high voltage interlock configuration scheme, battery management system software strategy, etc.

[0070] The extracted vehicle platform type and design scheme are compared with the matching conditions of the basic test template. If the match is successful, it means that the current battery pack can directly use the general test process. In this case, the basic test template is used as the initial test template, and subsequent parameter layering injection is performed.

[0071] If the matching fails, the basic test template is derived and adjusted according to the vehicle platform type and design scheme, using the command translation dictionary and the writing method selected according to the scheme: based on the sensor configuration scheme, high voltage interlock configuration scheme, total voltage / insulation scheme and number of series and parallel branches, the commands, number of parameters, number of branch extension rows and topology distribution logic unique to the current platform are injected into the basic test template to form a vehicle platform variant template, which serves as the initial test template.

[0072] The system then checks if historical configuration parameters exist in the structured parameter set. If they do, it reads the compatibility test template and uses mechanisms such as parameter rollback, long / short signal compatibility, and bidirectional translation of vehicle commands to modify and adapt the initial test template to obtain the target test template. If the initial test template does not exist, it is used directly as the target test template.

[0073] This implementation method uses a hierarchical and progressive matching of basic test templates and compatible test templates. When the basic test template is not applicable, a platform-differentiated template is automatically derived, and historical configuration parameters are used to correct the test template. This ensures test coverage for new vehicle platforms and new design schemes while maintaining compatibility with historical configuration parameters of old projects. It achieves automatic matching of test templates for multiple platforms and multiple battery pack schemes, improving the reusability of test templates and the efficiency of test case generation.

[0074] In some embodiments, the above-described S103 can be performed in the following manner: The parameters in the structured parameter set are classified and decomposed to obtain multiple categories of parameters; wherein, the multiple categories of parameters include battery pack body business parameters, simulated operating condition parameters, and vehicle high voltage topology parameters; Based on the parameters of each category, the test instructions corresponding to each parameter are matched from the preset instruction set to obtain the initial instruction set corresponding to the battery pack; Based on the hardware configuration scheme in the structured parameter set, the initial instruction set is adjusted to obtain the test instruction set corresponding to the battery pack; the hardware configuration scheme includes at least one of the sensor configuration scheme and the high-voltage interlock configuration scheme. Based on the threshold values ​​of each parameter in the structured parameter set, test judgment conditions corresponding to the battery pack are generated; wherein, the test judgment conditions include at least one of electrical signal judgment conditions, parameter threshold judgment conditions, and software strategy judgment conditions.

[0075] The aforementioned battery pack body business parameters characterize the parameters of the battery pack's own design, calibration, and fault strategy, such as the hardware and software design parameters of the new model's battery management system, the configuration parameters of the battery management system unit, the temperature sensing acquisition parameters, the individual cell voltage sampling parameters, the battery pack mapping calibration parameters, the various fault threshold parameters of the battery pack, the battery management system software strategy parameters, and the state of charge strategy calibration parameters that can be compatible with subsequent access.

[0076] Simulated operating condition parameters are used to construct the input parameters for the vehicle's operating conditions, such as high-voltage operating condition parameters and lead-acid voltage operating condition parameters, to simulate the response of the battery management system under real-world high-voltage / low-voltage conditions. Vehicle high-voltage topology parameters characterize the parameters of the vehicle's high-voltage electrical connection topology, sensor scheme, and interlocking scheme, such as high-voltage interlocking implementation scheme parameters, sensor configuration scheme parameters, and battery pack series-parallel topology circuit parameters.

[0077] The preset instruction set is a pre-built instruction resource library corresponding to various test actions, including high and low voltage setting instructions, single cell voltage setting instructions, temperature sensor setting instructions, current sensor setting instructions, high voltage interlock setting instructions, charging communication instructions, battery pack mapping calibration instructions, fault injection instructions, software strategy verification instructions, etc.

[0078] Hardware configuration schemes are optional configuration types that determine the instruction writing or execution method, including at least one of sensor configuration schemes and high-voltage interlock configuration schemes. Sensor configuration schemes include shunt schemes, Hall effect schemes, CAN (Controller Area Network) Hall effect schemes, etc.; high-voltage interlock configuration schemes include PWM (Pulse Width Modulation) type interlock schemes, resistor type interlock schemes, etc.

[0079] The aforementioned electrical signal judgment conditions are for expected results or threshold comparison conditions of electrical signals such as voltage, current, and resistance. Parameter threshold judgment conditions are for comparison conditions of parameter values ​​such as fault thresholds and calibration thresholds. Software strategy judgment conditions are for verifying the results of battery management system software control strategies, such as state-of-charge correction and charge / discharge power calculation.

[0080] In some embodiments, the structured parameter set is classified and decomposed into multiple categories of parameters; according to the business meaning of each category of parameters, corresponding instructions are matched from a preset instruction set; and the matched instruction set is used as the initial instruction set. For example, a single-cell voltage setting instruction is matched based on the single-cell voltage sampling parameters, a temperature sensing setting instruction is matched based on the temperature sensing acquisition parameters, a high-voltage circuit setting instruction is matched based on the vehicle high-voltage operating condition parameters, an interlock setting instruction is matched based on the high-voltage interlock implementation scheme parameters, a current sensor writing instruction is matched based on the sensor configuration scheme parameters, a branch current setting instruction is matched based on the battery pack series-parallel topology circuit parameters; a battery pack mapping calibration instruction is matched based on the battery pack mapping calibration parameters, a fault injection instruction is matched based on various battery pack fault threshold parameters, and a software strategy verification instruction is matched based on the battery management system software strategy parameters.

[0081] The initial instruction set is differentiated and modified according to the hardware configuration scheme in the structured parameter set: if the hardware configuration scheme is a sensor configuration scheme, the write instruction is automatically matched according to the write method corresponding to the current shunt, Hall, and CAN Hall; for multi-branch series-parallel topology, the branch setting steps are automatically expanded. For example, for a three-branch current sensor, the total current is divided by 3 and rounded up to generate the setting steps for each branch. For a two-branch current sensor, the total current is divided by 2 to generate the setting steps for each branch, ensuring that the simulated branch current is consistent with the real series-parallel topology.

[0082] If the hardware configuration scheme is a high-voltage interlock scheme, the corresponding parameter writing method is selected according to whether it is a PWM type interlock or a resistor type interlock. For example, a PWM type interlock is automatically written as two sets of parameters, and a resistor type interlock is automatically written as a single parameter. If a second interlock path exists, a second high-voltage interlock setting step is automatically inserted to ensure complete coverage of the dual-path topology. In addition, the total voltage signal and insulation resistance signal are matched and written according to the configuration. When a certain scheme configuration is empty, the corresponding simulation step is automatically deleted.

[0083] Subsequently, electrical signal judgment conditions are generated based on electrical signal parameters in the structured parameter set, parameter threshold judgment conditions are generated based on parameter threshold information, and software strategy judgment conditions are generated based on battery management system software strategy parameters.

[0084] In this implementation, by classifying the structured parameter set into business categories, matching test instructions in layers, and adapting the instructions to the hardware configuration scheme, multi-dimensional test judgment conditions are generated. This can adapt to the differentiated requirements of instructions under different hardware topology schemes, eliminating the need for manual modification of test instructions and verification conditions for different hardware schemes, and improving the automation level of instruction set and judgment condition generation.

[0085] In some embodiments, after S104 above, the test case generation method further includes the following process: Based on the high-voltage architecture parameters in the structured parameter set, the power-on and power-off processes corresponding to the battery pack are matched from the preset power-on and power-off process templates. The operation flow is determined based on the execution steps in the test cases; the operation flow includes the template logic flow and the verification logic flow in the test cases. The power-on process, the operation process, and the power-off process are combined sequentially to obtain the target test process; The target test process is converted according to a preset encoding format to generate the test script file corresponding to the battery pack.

[0086] The aforementioned high-voltage architecture parameters are parameters that characterize the high-voltage electrical architecture features of the battery pack and the entire vehicle in a structured parameter set. These parameters include information such as high-voltage architecture type, high-voltage interlock implementation scheme, series and parallel topology circuits, and high and low voltage power-on and power-off control methods.

[0087] The preset power-on and power-off process templates are pre-built sets of power-on and power-off process templates corresponding to different high-voltage architecture platforms. The power-on process template is used to establish the high-voltage power-on working condition and is located at the beginning of the use case; the power-off process template is used for safe power-off after testing and is located at the end of the use case.

[0088] The power-on procedure is a high-voltage power-on operation sequence matched from a preset power-on / off procedure template, used to establish the high-voltage operating conditions of the battery pack before test execution. The power-off procedure is a power-off operation sequence matched from a preset power-on / off procedure template, used to safely disconnect the high voltage after test execution, completing the test.

[0089] The operation flow is the core operational step determined according to the execution steps in the test case. It includes the template logic flow and the verification logic flow, and belongs to the main operation part of the test case. The template logic flow is the part of the operation flow formed based on the template logic within the template library of the target test template itself, and is used to carry out the operation sequence specified by the test template. The verification logic flow is the part of the operation flow formed based on the verification logic of all parameters within the test case, and is used to verify various parameters and decision conditions during the testing process.

[0090] In some embodiments, high-voltage architecture parameters are read from a structured parameter set, and the power-on and power-off processes corresponding to the current battery pack are matched in a preset power-on / off process template. Template logic processes and verification logic processes are extracted from test cases and combined to form an operation process. The power-on process, operation process, and power-off process are spliced ​​together in a preset order to obtain the target test process.

[0091] Finally, based on the character set supported by the host computer or test system to which the test script file is to be imported, an appropriate encoding is selected from the preset encoding formats to encode the target test process. Using the writer function of the Python CSV module, the processed target test process is exported as a whole, resulting in the test script file. The preset encoding formats include at least one of GBK encoding and UTF-8 encoding, used to match the character set requirements of different operating environments.

[0092] This implementation method automatically matches the power-on and power-off processes by matching high-voltage architecture parameters. After combining the template logic process and the verification logic process into an operation process, they are concatenated in sequence to finally output a standardized coded test script file. This method can automatically generate system-level test scripts for the battery management system that can be executed directly without secondary modification, ensuring the compatibility and correctness of power-on and power-off processes under different high-voltage architecture platforms. At the same time, it reduces the workload of manually writing scripts and improves the efficiency and versatility of test script generation.

[0093] In one feasible implementation, the filling process of S104 specifically includes: extracting parameters from the structured parameter set, decomposing them according to preset categories to obtain signal parameters, fault threshold parameters, and calibration strategy parameters; mapping the signal parameters to a unified signal name in the target test template and backfilling them into the corresponding parameter positions; locating the corresponding fault template area in the target test template according to the fault name and filling the fault threshold parameters into that area; looking up the calibration strategy parameters according to preset coordinates and filling the calibration values ​​obtained from the lookup table into the calibration template area of ​​the target test template; simultaneously, filling the test instruction set into the instruction area of ​​the target test template and filling the test judgment conditions into the judgment area of ​​the target test template, thereby completing the information integration of the structured parameter set, test instruction set, and test judgment conditions in the target test template and generating test cases for the battery pack.

[0094] The test cases generated through the above-described filling method include battery pack parameter calibration test cases, battery pack fault parameter injection test cases, and BMS (Battery Management System) software strategy verification test cases. Specifically, battery pack parameter calibration test cases are generated based on calibration strategy parameters, using a two-dimensional charge / discharge mapping table to generate calibration cases for multiple temperatures and multiple states of charge / voltage points. For fast / slow charging modes, the sign and tolerance direction of the charging request current are handled separately, and target values ​​are generated through interpolation fitting when the mapping table is missing. Battery pack fault parameter injection test cases are generated based on fault threshold parameters, locating matching fault templates according to fault names, and injecting fault threshold parameters, recovery judgment logic, and signal type configurations into the corresponding fault templates. BMS software strategy verification test cases are generated based on signal parameters and test judgment conditions, using a strategy table to generate temperature-state-of-charge / voltage correction and boundary verification test cases. Each type of test case embeds corresponding test instruction sets and test judgment conditions to drive test execution and verify test results.

[0095] In some embodiments, for ease of understanding, the following are used: Figure 2The overall process of the test case generation method is described, specifically including the following steps: S21, normalize the battery pack configuration parameters and vehicle electrical parameters according to parameter mapping information and fault diagnosis configuration information to obtain a structured parameter set for the battery pack; S22, determine the target test template corresponding to the battery pack based on the structured parameter set and multiple levels of test process templates; S23, determine the test instruction set corresponding to the battery pack based on the structured parameter set, and generate the test judgment conditions corresponding to the battery pack; S24, fill the test judgment conditions, the test instruction set, and the structured parameter set into the target test template to obtain test cases for the battery pack; S25, match the power-on process and power-off process corresponding to the battery pack from the preset power-on and power-off process templates based on the high-voltage architecture parameters in the structured parameter set; S26, determine the operation process based on the execution steps in the test cases; the operation process includes the template logic process and verification logic process in the test cases; S27, combine the power-on process, the operation process, and the power-off process sequentially to obtain the target test process; S28. Convert the target test process according to a preset encoding format to generate a test script file corresponding to the battery pack.

[0096] Based on the same inventive concept as the test case generation method described above, this application also provides a test case generation system, which can be found in detail below. Figure 3 As shown.

[0097] Figure 3 This is a schematic diagram of the structure of a test case generation system provided in another embodiment of this application.

[0098] like Figure 3 As shown in the illustration, this application also provides a test case generation system 300, comprising: The controller 301 is used to normalize the battery pack configuration parameters and vehicle electrical parameters according to parameter mapping information and fault diagnosis configuration information to obtain a structured parameter set for the battery pack; determine the target test template corresponding to the battery pack based on the structured parameter set and multiple levels of test process templates; wherein, the test process templates at different levels are matched with different test requirement types; determine the test instruction set corresponding to the battery pack based on the structured parameter set, and generate the test judgment conditions corresponding to the battery pack; fill the test judgment conditions, the test instruction set, and the structured parameter set into the target test template to obtain test cases for the battery pack.

[0099] In some embodiments, the controller 301 may include a parameter processing module, a template processing module, a condition generation module, and a test case generation module.

[0100] The aforementioned parameter processing module is used to normalize the battery pack configuration parameters and vehicle electrical parameters according to the parameter mapping information and fault diagnosis configuration information, so as to obtain a structured parameter set of the battery pack. The template processing module described above is used to determine the target test template corresponding to the battery pack based on the structured parameter set and multiple levels of test process templates; wherein, test process templates at different levels are matched with different test requirement types; The aforementioned condition generation module is used to determine the test instruction set corresponding to the battery pack based on the structured parameter set, and to generate the test judgment conditions corresponding to the battery pack. The aforementioned test case generation module is used to fill the test judgment conditions, the test instruction set, and the structured parameter set into the target test template to obtain test cases for the battery pack.

[0101] In some embodiments, the controller 301 described above is specifically used for: Based on the parameter mapping information, fields with different names for the same physical quantity in the battery pack configuration parameters and vehicle electrical parameters are converted into a unified field to obtain multiple target fields and parameter values ​​for each target field; Based on the fault parameters in the battery pack configuration parameters, match the expected fault diagnosis results and execution steps corresponding to the fault parameters from the fault diagnosis configuration information; The target fields, the parameter values ​​of the target fields, the expected results of the fault diagnosis, and the execution steps are encapsulated into a structured parameter set for the battery pack.

[0102] In some embodiments, the controller 301 described above is specifically used for: In the signal configuration mapping relationship, find the first actual signal name corresponding to the uniform purpose name in the battery pack configuration parameters, and the second actual signal name corresponding to the uniform purpose name in the vehicle electrical parameters; Replace the unified purpose name of the battery pack configuration parameters with the first actual signal name, and fill the parameter value associated with the first actual signal name in the signal configuration mapping relationship back into the parameter position corresponding to the first actual signal name to obtain the first target field and the parameter value of the first target field. Replace the uniform purpose name in the vehicle electrical parameters with the second actual signal name, and fill the parameter value associated with the second actual signal name in the signal configuration mapping relationship back into the parameter position corresponding to the second actual signal name to obtain the second target field and the parameter value of the second target field; Based on the command mapping dictionary, the command names in the battery pack configuration parameters and the command names in the vehicle electrical parameters are replaced with the command names corresponding to the vehicle platform to which the battery pack belongs, to obtain the third target field and the parameter values ​​of the third target field; The first target field, the second target field, and the third target field are used as multiple target fields.

[0103] In some embodiments, the controller 301 described above is specifically used for: Based on the fault parameters in the battery pack configuration parameters, search for the expected fault diagnosis result corresponding to the fault parameters in the fault diagnosis configuration information; Based on the fault clearing method in the fault parameters, find the execution steps corresponding to the fault clearing method in the fault diagnosis configuration information; The fault clearing methods include at least one of the following: diagnostic service clearing, power-off recovery, vehicle controller clearing, and automatic clearing.

[0104] In some embodiments, the controller 301 described above is specifically used for: Extract the vehicle platform type and design scheme corresponding to the battery pack from the structured parameter set; The vehicle platform type and design scheme are matched with the basic test template; if the match is successful, the basic test template is used as the initial test template. In the event of a matching failure, the basic test template is adjusted according to the vehicle platform type and the design scheme, and the adjusted basic test template is used as the initial test template. If the structured parameter set contains historical configuration parameters of the battery pack, the initial test template is adjusted according to the historical configuration parameters and the compatibility test template to obtain the target test template corresponding to the battery pack.

[0105] In some embodiments, the controller 301 described above is specifically used for: The parameters in the structured parameter set are classified and decomposed to obtain multiple categories of parameters; wherein, the multiple categories of parameters include battery pack body business parameters, simulated operating condition parameters, and vehicle high voltage topology parameters; Based on the parameters of each category, the test instructions corresponding to each parameter are matched from the preset instruction set to obtain the initial instruction set corresponding to the battery pack; Based on the hardware configuration scheme in the structured parameter set, the initial instruction set is adjusted to obtain the test instruction set corresponding to the battery pack; the hardware configuration scheme includes at least one of the sensor configuration scheme and the high-voltage interlock configuration scheme. Based on the threshold values ​​of each parameter in the structured parameter set, test judgment conditions corresponding to the battery pack are generated; wherein, the test judgment conditions include at least one of electrical signal judgment conditions, parameter threshold judgment conditions, and software strategy judgment conditions.

[0106] In some embodiments, the controller 301 is further configured to: match the power-on and power-off processes corresponding to the battery pack from a preset power-on / off process template based on the high-voltage architecture parameters in the structured parameter set; The operation flow is determined based on the execution steps in the test cases; the operation flow includes the template logic flow and the verification logic flow in the test cases. The power-on process, the operation process, and the power-off process are combined sequentially to obtain the target test process; The target test process is converted according to a preset encoding format to generate the test script file corresponding to the battery pack.

[0107] The test case generation system in this application is used to implement at least one of the following functions for battery cells: state monitoring, state analysis, charge / discharge control, safety protection, thermal management, high-voltage power distribution, and information management. In addition, the test case generation system in this application can also implement the functions of a controller in an electrical device, such as a vehicle control unit (VCU) or a motor control unit (MCU), etc., and this application does not impose any limitations on this.

[0108] It should be noted that the test case generation system in this application can be integrated as a controller into the battery device, such as into the battery pack or energy storage box. The test case generation system in this application can also be integrated as a controller into electrical devices, such as vehicles or vehicle chassis. The test case generation system in this application can also be integrated into the charging device as a controller, such as into the charging device or the battery swapping device. The test case generation system in this application can also be deployed as control software on a server. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms, such as vehicle networking cloud, APP backend, etc.

[0109] Based on the same inventive concept, embodiments of this application also provide a battery device, including a battery and a test case generation system as described in the above embodiments.

[0110] Figure 4 This is a schematic diagram of the structure of an electronic device provided in yet another embodiment of this application.

[0111] The electronic device may include a processor 401 and a memory 402 storing computer program instructions.

[0112] Specifically, the processor 401 may include a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.

[0113] Memory 402 may include mass storage for data or instructions. For example, and not limitingly, memory 402 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 402 may include removable or non-removable (or fixed) media. Where appropriate, memory 402 may be internal or external to the integrated gateway disaster recovery device. In a particular embodiment, memory 402 is non-volatile solid-state memory.

[0114] In a particular embodiment, memory 402 may include read-only memory (ROM), random access memory (RAM), disk storage media device, optical storage media device, flash memory device, electrical, optical, or other physical / tangible memory storage device. Thus, typically, memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to any of the test case generation methods disclosed in this application.

[0115] The processor 401 reads and executes computer program instructions stored in the memory 402 to implement any of the test case generation methods in the above embodiments.

[0116] In one example, the electronic device may also include a communication interface 403 and a bus 410. For example, Figure 4 As shown, the processor 401, memory 402, and communication interface 403 are connected through bus 410 and complete communication with each other.

[0117] The communication interface 403 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.

[0118] Bus 410 includes hardware, software, or both, that couples components of an online data traffic metering device together. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel 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 buses, or combinations of two or more of these. Where appropriate, bus 410 may include one or more buses. Although specific buses are described and illustrated in embodiments of this application, any suitable bus or interconnect is contemplated herein.

[0119] Furthermore, in conjunction with the test case generation methods in the above embodiments, this application embodiment can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when these computer program instructions are executed by a processor, they implement any of the test case generation methods in the above embodiments.

[0120] This application also provides a computer program product, including a computer program that, when executed by a processor, implements any of the test case generation methods described in the above embodiments.

[0121] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.

[0122] The functional blocks shown in the above block diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media 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, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.

[0123] It should also be noted that the exemplary embodiments mentioned in this application describe methods or systems based on a series of steps or apparatus. However, this application is not limited to the order of the above steps; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.

[0124] The aspects of this disclosure have been described above with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It should be understood that each block in 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 can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by special-purpose hardware performing the specified functions or actions, or can be implemented by a combination of special-purpose hardware and computer instructions.

[0125] The above are merely specific embodiments of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the protection scope of this application.

Claims

1. A test case generation method, characterized in that, The method includes: Based on parameter mapping information and fault diagnosis configuration information, the battery pack configuration parameters and vehicle electrical parameters are normalized to obtain a structured parameter set for the battery pack. The target test template corresponding to the battery pack is determined based on the structured parameter set and the test process templates at multiple levels; wherein, the test process templates at different levels are matched with different test requirement types. Based on the structured parameter set, determine the test instruction set corresponding to the battery pack, and generate the test judgment conditions corresponding to the battery pack; The test judgment conditions, the test instruction set, and the structured parameter set are filled into the target test template to obtain the test cases for the battery pack.

2. The method according to claim 1, characterized in that, The battery pack configuration parameters and vehicle electrical parameters are normalized according to parameter mapping information and fault diagnosis configuration information to obtain a structured parameter set for the battery pack, including: Based on the parameter mapping information, fields with different names for the same physical quantity in the battery pack configuration parameters and vehicle electrical parameters are converted into a unified field to obtain multiple target fields and parameter values ​​for each target field; Based on the fault parameters in the battery pack configuration parameters, match the expected fault diagnosis results and execution steps corresponding to the fault parameters from the fault diagnosis configuration information; The target fields, the parameter values ​​of the target fields, the expected results of the fault diagnosis, and the execution steps are encapsulated into a structured parameter set for the battery pack.

3. The method according to claim 2, characterized in that, The parameter mapping information includes signal configuration mapping relationships and command mapping dictionaries; The step of converting fields with different names for the same physical quantity in the battery pack configuration parameters and vehicle electrical parameters into a unified field based on parameter mapping information, thereby obtaining multiple target fields and parameter values ​​for each target field, includes: In the signal configuration mapping relationship, find the first actual signal name corresponding to the uniform purpose name in the battery pack configuration parameters, and the second actual signal name corresponding to the uniform purpose name in the vehicle electrical parameters; Replace the unified purpose name of the battery pack configuration parameters with the first actual signal name, and fill the parameter value associated with the first actual signal name in the signal configuration mapping relationship back into the parameter position corresponding to the first actual signal name to obtain the first target field and the parameter value of the first target field. Replace the uniform purpose name in the vehicle electrical parameters with the second actual signal name, and fill the parameter value associated with the second actual signal name in the signal configuration mapping relationship back into the parameter position corresponding to the second actual signal name to obtain the second target field and the parameter value of the second target field; Based on the command mapping dictionary, the command names in the battery pack configuration parameters and the command names in the vehicle electrical parameters are replaced with the command names corresponding to the vehicle platform to which the battery pack belongs, to obtain the third target field and the parameter values ​​of the third target field; The first target field, the second target field, and the third target field are used as multiple target fields.

4. The method according to claim 2, characterized in that, The step of matching the expected fault diagnosis result and execution steps corresponding to the fault parameters from the fault diagnosis configuration information based on the fault parameters in the battery pack configuration parameters includes: Based on the fault parameters in the battery pack configuration parameters, search for the expected fault diagnosis result corresponding to the fault parameters in the fault diagnosis configuration information; Based on the fault clearing method in the fault parameters, find the execution steps corresponding to the fault clearing method in the fault diagnosis configuration information; The fault clearing methods include at least one of the following: diagnostic service clearing, power-off recovery, vehicle controller clearing, and automatic clearing.

5. The method according to claim 1, characterized in that, The multi-level test process templates include a basic test template and a compatibility test template. The basic test template matches the first test requirement type, and the compatibility test template matches the second test requirement type. The first test requirement type is determined based on the vehicle platform type and the battery pack design scheme. The second test type is determined based on the vehicle platform type, the battery pack design scheme, and the historical configuration parameters of the battery pack. The step of determining the target test template corresponding to the battery pack based on the structured parameter set and multiple levels of test process templates includes: Extract the vehicle platform type and design scheme corresponding to the battery pack from the structured parameter set; The vehicle platform type and design scheme are matched with the basic test template; if the match is successful, the basic test template is used as the initial test template. In the event of a matching failure, the basic test template is adjusted according to the vehicle platform type and the design scheme, and the adjusted basic test template is used as the initial test template. If the structured parameter set contains historical configuration parameters of the battery pack, the initial test template is adjusted according to the historical configuration parameters and the compatibility test template to obtain the target test template corresponding to the battery pack.

6. The method according to claim 1, characterized in that, The step of determining the test instruction set corresponding to the battery pack based on the structured parameter set and generating the test judgment conditions corresponding to the battery pack includes: The parameters in the structured parameter set are classified and decomposed to obtain multiple categories of parameters; wherein, the multiple categories of parameters include battery pack body business parameters, simulated operating condition parameters, and vehicle high voltage topology parameters; Based on the parameters of each category, the test instructions corresponding to each parameter are matched from the preset instruction set to obtain the initial instruction set corresponding to the battery pack; Based on the hardware configuration scheme in the structured parameter set, the initial instruction set is adjusted to obtain the test instruction set corresponding to the battery pack; the hardware configuration scheme includes at least one of the sensor configuration scheme and the high-voltage interlock configuration scheme. Based on the threshold values ​​of each parameter in the structured parameter set, test judgment conditions corresponding to the battery pack are generated; wherein, the test judgment conditions include at least one of electrical signal judgment conditions, parameter threshold judgment conditions, and software strategy judgment conditions.

7. The method according to any one of claims 1 to 6, characterized in that, After filling the test judgment conditions, the test instruction set, and the structured parameter set into the target test template to obtain the test cases for the battery pack, the method further includes: Based on the high-voltage architecture parameters in the structured parameter set, the power-on and power-off processes corresponding to the battery pack are matched from the preset power-on and power-off process templates. The operation flow is determined based on the execution steps in the test cases; the operation flow includes the template logic flow and the verification logic flow in the test cases. The power-on process, the operation process, and the power-off process are combined sequentially to obtain the target test process; The target test process is converted according to a preset encoding format to generate the test script file corresponding to the battery pack.

8. A test case generation system, characterized in that, The system includes: The controller is used to normalize the battery pack configuration parameters and vehicle electrical parameters according to parameter mapping information and fault diagnosis configuration information to obtain a structured parameter set for the battery pack; determine the target test template corresponding to the battery pack based on the structured parameter set and multiple levels of test process templates; wherein, the test process templates at different levels are matched with different test requirement types; determine the test instruction set corresponding to the battery pack based on the structured parameter set, and generate the test judgment conditions corresponding to the battery pack; fill the test judgment conditions, the test instruction set, and the structured parameter set into the target test template to obtain the test cases for the battery pack.

9. A battery device, characterized in that, The device includes a battery and a test case generation system as described in claim 8.

10. An electronic device, characterized in that, The electronic device includes: a processor and a memory storing computer program instructions; The processor reads and executes the computer program instructions to implement the test case generation method as described in any one of claims 1-7.

11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer program instructions, which, when executed by a processor, implement the test case generation method as described in any one of claims 1-7.