BMS specification book driving full-process automatic test method based on deep learning

CN123011701APending Publication Date: 2026-10-30HEFEI HAIER INTELLIGENT ELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611131839.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-28
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

[0007]本发明为了解决现有BMS 保护板的黑盒测试无法实现以 BMS 规格书为单一驱动源的全流程测试的技术问题,提出了一种用于基于深度学习的BMS规格书驱动全流程自动测试方法,可以解决上述问题

Benefits of technology

[0017]与现有技术相比,本发明的优点和积极效果是:本发明的基于深度学习的BMS规格书驱动全流程自动测试方法,通过训练深度学习模型,配置有双向通信接口,实现规格书解析结果可直接驱动测试软件和硬件设备执行。采用两阶段递进式训练策略,先让模型掌握以规格书为核心的测试内容生成能力,再让模型掌握以规格书为驱动的全流程测试执行控制能力,解决单阶段训练目标混乱、精度不足、规格书驱动性弱的问题。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123011701A_ABST
    Figure CN123011701A_ABST
Patent Text Reader

Abstract

The application provides a BMS specification driven full-process automatic testing method based on deep learning, which comprises a deep learning model training step and a script automatic deployment step; the deep learning model adopts an encoder-decoder architecture with a multi-head attention mechanism and is configured with a bidirectional communication interface; the script automatic deployment step is that the deep learning model generates an automatic testing script according to an input specification, an automatic testing software calling interface, and the automatic testing script is written into BMS black box testing automatic software to automatically complete script loading, running environment configuration, and bidirectional communication interface adaptation; and the BMS specification driven full-process automatic testing method based on deep learning realizes that a specification analysis result can directly drive testing software and hardware devices to execute through training of a deep learning model. A two-stage progressive training strategy is adopted to solve the problems of single-stage training target confusion, insufficient precision, and weak specification driving.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of software testing technology, and in particular relates to a BMS specification-driven fully automated testing method based on deep learning. Background Technology

[0002] As a core safety component of automotive power batteries and energy storage battery systems, the BMS protection board undergoes black-box testing before leaving the factory, which is a crucial step in ensuring product safety and reliability. The BMS product specification sheet is the sole compliance input for the entire testing process. Current technologies only achieve partial automation of the testing execution phase and cannot achieve fully automated testing driven solely by the BMS specification sheet, resulting in the following key technical challenges: (1) Existing technologies cannot achieve a closed-loop process driven by specification sheet input. It requires manual disassembly of specification sheet technical indicators, manual design of test cases, manual writing of automated scripts, manual import of test software, manual debugging of scripts, manual control of equipment testing, and manual generation of test reports. Each link is completely separated, with a very high degree of manual dependence and extremely low efficiency of the entire testing process.

[0003] (2) There is no standardized script no-load safety verification mechanism. Manually written scripts are directly connected to the BMS protection board for actual testing. Due to problems such as misunderstanding of specifications, script logic errors, and improper parameter settings, the BMS protection board and test equipment are easily damaged, resulting in serious safety risks and cost losses.

[0004] (3) The specification input and test software and hardware execution are completely disconnected. There is no standardized two-way communication capability. It is impossible to realize the linkage between specification parsing results and test software script automatic deployment, test status real-time feedback and hardware device automatic control. Manual operation is required to switch between multiple platforms. It is impossible to realize unattended full-process automated testing.

[0005] (4) Script debugging and optimization, and test exception handling rely entirely on manual work. After the script runs into error or an exception occurs during the test, it is necessary to manually check the logs line by line, locate the problem, modify the code, and debug repeatedly. The optimization effect depends entirely on the experience of the personnel. Not only is the debugging cycle long, but it is also easy to miss test items and misjudge the results, which cannot guarantee the consistency between the test results and the requirements of the specification.

[0006] (5) Existing auxiliary tools and general generation models can only improve efficiency in some parts, and cannot drive the entire process of testing with the specification as the core. The generated content cannot be directly adapted to the BMS black box testing software and hardware environment, and cannot guarantee the compliance of the test results with the technical requirements of the specification. Summary of the Invention

[0007] To address the technical problem that existing black-box testing of BMS protection boards cannot achieve full-process testing with the BMS specification as a single driving source, this invention proposes a deep learning-based BMS specification-driven automatic testing method that can solve the aforementioned problem.

[0008] To solve the above-mentioned technical problems, the present invention adopts the following technical solution: A deep learning-based BMS specification-driven fully automated testing method includes: a deep learning model training step and an automated script deployment step. The deep learning model adopts an encoder-decoder architecture with a multi-head attention mechanism and is configured with bidirectional communication interfaces, namely a BMS black-box testing automation software call interface and a BMS black-box testing hardware device control interface. The deep learning model training step includes: The sample dataset is constructed and preprocessed, including specification samples, standardized test case samples, automated test script samples, script idle debugging samples, equipment control samples, and test report samples. The sample dataset is preprocessed by text cleaning and sample dataset partitioning. The specification sample is input into a large language model, which performs semantic understanding on the specification sample to obtain key semantic information on the technical indicators, test requirements and compliance judgment standards of the test, which is the specification text. Each sample data is input into a deep learning model for iterative training. The script automatically deploys the following steps: the deep learning model generates automated test scripts based on the input specifications; the automated test software calls the interface to write the automated test scripts into the BMS black-box test automation software; and automatically completes the script loading, runtime environment configuration, and bidirectional communication interface adaptation.

[0009] In some embodiments, inputting the sample data into the deep learning model for iterative training includes a two-stage progressive training process: The first training phase, specification-driven test content generation capability training, includes: taking the specification text, standardized test case samples, and automated test script samples as input, and test cases and automated test scripts as target outputs; the encoder extracts technical indicators from the specification text and establishes a mapping relationship between technical indicators, test cases, and automated test scripts; the decoder, based on encoding features, first generates test cases that correspond one-to-one with the technical indicators, and then generates automated test scripts that match the control interfaces of BMS black-box test software and hardware devices based on the test cases; the model parameters are trained so that the test cases and automated test scripts are close to the standardized test case samples and automated test script samples, respectively, to obtain the encoder backbone weights and the coefficients of the decoder, attention layer, and bidirectional communication interface adaptation layer; The second training phase is specification-driven training of full-process test control capabilities, including: based on the deep learning model obtained in the first training phase, controlling the entry into idle mode to optimize the script, and obtaining the problem location results, optimized script, device control instructions, and standardized compliance test reports during idle operation. The input consists of script no-load debugging samples, device control samples, and test report samples. The output consists of the corresponding problem location results, optimized scripts, control instructions that match the specifications, and standardized compliance test reports. The encoder backbone weights are frozen, and the coefficients of the decoder, attention layer, and bidirectional communication interface adaptation layer are adjusted. The process is iterated until convergence to obtain the final deep learning model.

[0010] In some embodiments, the method for optimizing the script in the second training phase by controlling the entry into the idle mode includes: configuring the test equipment to run in idle mode; during the idle run, acquiring the hardware test control instructions of the hardware device; acquiring the matching degree between the script execution logic and the test requirements in the specification; and capturing problems in the script execution. Based on the script execution issues captured, corresponding optimization solutions are generated; Modify the script according to the optimization plan; The optimized script is redeployed and re-enters the idle mode until the set goal is achieved.

[0011] In some embodiments, during the first training phase, the loss function Cross-entropy loss Loss of matching with specifications The weighted calculation yields: ; Cross-entropy loss The calculation method is as follows: ; in, The true label of the k-th word at step t is determined by comparing the test case text output by the deep learning model with the standardized test case samples, or by comparing the test script output by the model with the automated test script samples. The label is 1 if correct and 0 otherwise. This represents the predicted probability of the k-th word output by the deep learning model at step t; T represents the total length of the sequence output by the deep learning model, and V represents the total number of words. Specification matching loss The calculation method is as follows: ; This represents the percentage of technical metrics not covered in the specification document, where S is the set of technical metrics extracted from the input specification document text, and S′ is the set of technical metrics output by the deep learning model. Penalty item for communication interface matching: 0 when the generated BMS black-box test hardware device control interface matches the BMS standard interface, and 1 when it does not match; Penalty items are matched to test requirements: 0 if the generated content meets the specification test / compliance requirements, and 1 if it does not; α, β, and γ are weighting coefficients, respectively.

[0012] In some embodiments, during the first training phase, the parameters of the deep learning model are adjusted through repeated iterative training until the technical indicators of the specification are covered by ≥99.5%, the word accuracy of the test script is 100%, the communication interface matching degree is ≥99%, and the matching degree between the test script and the specification requirements is ≥98.5%, thus completing the first phase of training.

[0013] In some embodiments, during the second training phase, the loss function Multi-head attention mechanism - multi-task joint loss Losses related to specification compliance The weighted calculation yields: ; Multi-head attention mechanism - multi-task joint loss The calculation method is as follows: ; in, To optimize the sub-loss of the script, Equipment control sub-loss, To report the loss of generated sub-subs, To test the sub-loss.

[0014] In some embodiments, the sample dataset further includes a negative sample dataset, and the deep learning model training step further includes a contrastive learning optimization step, in which the deep learning model is optimized by inputting the negative sample dataset into the deep learning model and using a contrastive learning algorithm.

[0015] In some embodiments, the BMS black-box test automation software supports Modbus, TCP / IP, CAN industrial communication protocols, and BMS test host computer software.

[0016] In some embodiments, the control interface of the BMS black-box test hardware device supports RS485, CAN, and Ethernet industrial control protocols, and is compatible with the BMS black-box test hardware device.

[0017] Compared with existing technologies, the advantages and positive effects of this invention are as follows: The deep learning-based BMS specification-driven automated testing method of this invention, through training a deep learning model and configuring a bidirectional communication interface, enables the specification parsing results to directly drive the execution of test software and hardware devices. It employs a two-stage progressive training strategy, first enabling the model to master the ability to generate test content centered on the specification, and then enabling the model to master the ability to control the entire test execution process driven by the specification, thus solving the problems of chaotic training objectives, insufficient accuracy, and weak specification-driven performance in single-stage training.

[0018] This invention achieves a fully automated closed loop, with the BMS product specification as the sole input, from indicator analysis, test case generation, script writing, debugging and optimization, test execution to report output, which can greatly improve efficiency.

[0019] Other features and advantages of the present invention will become clearer after reading the detailed description of the embodiments of the present invention in conjunction with the accompanying drawings. Attached Figure Description

[0020] Figure 1 This is an overall architecture diagram of an embodiment of the BMS specification-driven full-process automatic testing method proposed in this invention; Figure 2 This is a training flowchart of an embodiment of the BMS specification-driven full-process automatic testing method proposed in this invention; Figure 3 This is a flowchart illustrating the fully automated testing process of an embodiment of the BMS specification-driven fully automated testing method proposed in this invention. Detailed Implementation

[0021] The specific embodiments of the present invention will be described in further detail below with reference to the accompanying drawings.

[0022] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0023] Example 1: This example proposes a deep learning-based BMS specification-driven fully automated testing method. The core is a self-designed dedicated deep learning model for all scenarios of BMS black-box testing. It employs a fusion algorithm combining a domain-fine-tuned large language model (LLM), a Seq2Seq encoder-decoder architecture with multi-head attention, contrastive learning optimization, and a dual-interface adaptation layer. Using the BMS product specification as the sole input, it achieves full automation from metric analysis to test report output. The generated scripts can seamlessly integrate with existing BMS black-box testing systems. The overall system architecture diagram is shown below. Figure 1 As shown.

[0024] In some embodiments, this deep learning-based BMS specification-driven fully automated testing method includes: a deep learning model training step and an automated script deployment step. The deep learning model adopts an encoder-decoder architecture with a multi-head attention mechanism and is configured with bidirectional communication interfaces, namely, a BMS black-box testing automation software call interface and a BMS black-box testing hardware device control interface. The deep learning model training step includes: The sample dataset is constructed and preprocessed, including specification samples, standardized test case samples, automated test script samples, script idle debugging samples, device control samples, and test report samples. The sample dataset is preprocessed by text cleaning and sample dataset partitioning.

[0025] The specification sample is input into the large language model, which performs semantic understanding on the specification sample to obtain key semantic information such as test technical indicators, test requirements, and compliance judgment standards, thus forming the specification text.

[0026] Each sample data is input into the deep learning model for iterative training.

[0027] The script automatically deploys the following steps: the deep learning model generates automated test scripts based on the input specifications; the automated test software calls the interface to write the automated test scripts into the BMS black-box test automation software; and automatically completes the script loading, runtime environment configuration, and bidirectional communication interface adaptation.

[0028] This embodiment presents a deep learning-based BMS specification-driven automated testing method. By training a deep learning model and configuring a bidirectional communication interface, the specification parsing results can directly drive the execution of test software and hardware devices. A two-stage progressive training strategy is employed: first, the model masters the ability to generate test content centered on the specification; then, the model masters the ability to control the entire test execution process driven by the specification. This addresses the problems of inconsistent training objectives, insufficient accuracy, and weak specification-driven performance in single-stage training.

[0029] This invention achieves a fully automated closed loop, with the BMS product specification as the sole input, from indicator analysis, test case generation, script writing, debugging and optimization, test execution to report output, which can greatly improve efficiency.

[0030] In the sample dataset construction and preprocessing steps, a dedicated labeled dataset for the entire scenario of BMS black-box testing is constructed to establish a strong correlation mapping across the entire chain from specification metrics to test cases, automated scripts, debugging and optimization rules, device control instructions, and compliance test reports, providing data support for specification-driven end-to-end testing.

[0031] The sample dataset includes six types of samples that conform to a fixed format specification, constructing a dedicated training dataset for the entire scenario. All samples are anchored to the BMS specification to ensure consistency of data throughout the entire process.

[0032] (1) Sample of BMS protection board product specifications: covering BMS protection boards with different numbers of strings and different power in all scenarios such as vehicle / energy storage. The fixed format includes fixed chapters such as basic product information, electrical performance indicators, protection function requirements, equalization function requirements, communication protocol, fault alarm rules, environmental test requirements, and compliance judgment standards. The technical indicators adopt a standardized description of "indicator name + numerical range + unit + triggering condition + compliance judgment standard" to ensure that the model can accurately extract the core test basis.

[0033] (2) Standardized test case samples corresponding to the specification: The fixed format includes fixed fields such as test case ID, test item, preconditions, test steps, expected results (corresponding one-to-one with the specification indicators), test priority, corresponding specification chapter, and compliance judgment basis, to ensure that each test case can be traced back to the corresponding technical requirements of the specification.

[0034] (3) Sample of executable automated test scripts corresponding to test cases: covering mainstream scripting languages ​​for BMS black-box testing (Python, LabVIEW, Robot Framework), including hardware control functions, communication interaction functions, data acquisition functions, result judgment functions (bound to specification indicators), and exception handling functions, which correspond one-to-one with the test case steps and fully match the interface specifications of BMS black-box test automation software.

[0035] (4) Script no-load debugging sample: includes script running log, error message, problem location result, and optimized script code, covering all types of script problems such as syntax error, interface call error, parameter mismatch with specification indicators, hardware instruction mismatch, and missing logic branch.

[0036] (5) BMS black box test equipment control sample: includes control instruction set, parameter configuration specifications, and status feedback protocol for all types of test hardware such as DC power supply, multi-cell battery simulator, communication board, data acquisition equipment, and temperature chamber. All instructions correspond to the test conditions required in the specification.

[0037] (6) Standardized compliance test report sample: includes fixed chapters such as basic test information, core indicator list of specification, test item details, test results, matching degree judgment with specification requirements, pass / fail conclusion, abnormal data analysis, fault location, test traceability information, etc. All content corresponds one-to-one with the specification and test cases.

[0038] Text cleaning of the sample dataset includes: (1) Text cleaning: Denoising the specification, test cases, debugging logs, and test report samples, removing redundant content, irrelevant format symbols, and non-compliant descriptions, and extracting effective text with the specification as the core; standardizing the syntax of the script samples, unifying the function naming, cleaning up invalid comments, and standardizing the parameter settings that are bound to the specification indicators; (2) Full-link structured annotation: Entity annotation is performed on the core technical indicators of the specification, the test requirements and compliance judgment standards of the indicators are clarified, and a strong correlation mapping relationship of the entire link of "specification indicators → test cases → automated scripts → debugging and optimization rules → equipment control instructions → test report content" is established to ensure that the model training is driven by the specification throughout the entire process; The sample dataset partitioning includes dividing the preprocessed labeled samples into training, validation, and test sets in a 7:2:1 ratio for model training, validation, and performance testing.

[0039] We independently designed a dedicated deep learning model driven by the BMS specification document. The final trained model can achieve end-to-end automated testing by inputting the BMS product specification document, and also has built-in end-to-end test control capabilities. The following are the algorithm selection criteria, core interface design, and detailed model design: (1) Domain Fine-tuning Large Language Model (LLM): It has powerful industrial professional text understanding, code generation, logical reasoning and compliance judgment capabilities. It can accurately analyze the professional technical indicators and compliance judgment standards in the BMS specification and learn the execution rules of the entire BMS testing process. It is the core foundation for realizing specification-driven full-process testing.

[0040] (2) Sequence-to-Sequence (Seq2Seq) encoder-decoder architecture with multi-head attention mechanism: It perfectly adapts to the multi-stage sequence transformation needs of “specification text input → structured test cases → code sequence output → device control instructions → compliance report generation”. The multi-head attention mechanism allows the model to always focus on the core technical indicators and compliance requirements of the specification during the entire process, ensuring that all links in the process are highly matched with the specification requirements, and greatly improving the accuracy and compliance of the output content.

[0041] This architecture (architecture diagram / schematic diagram shown below) is specifically designed to adapt to the multi-stage sequence transformation requirements from natural language text to structured use cases, code, instructions, and reports, while fully supporting a two-stage progressive training strategy.

[0042] Its core logic is as follows: the encoder completes the semantic understanding and feature encoding of the BMS specification, and the decoder generates output sequences such as test cases, test scripts, equipment control instructions, and compliance reports in sequence according to business stages; the multi-head attention mechanism is the core component that runs through the entire encoding and decoding process, ensuring that all generation links in the entire process are always anchored to the core requirements of the specification, and solving the industry pain point of "test content being out of sync with the specification and insufficient compliance throughout the process" from the model structure level.

[0043] The essence of multi-head attention mechanism is to map input features to multiple independent subspaces and compute multiple sets of attention weights in parallel, allowing the model to capture related information from different business dimensions at the same time, rather than single-dimensional feature matching, which perfectly adapts to the multi-dimensional and highly compliant scenario requirements of BMS testing.

[0044] Deep learning models employ a multi-head attention mechanism, and the multi-head attention calculation formula is as follows: Q, K, and V are mapped to h subspaces using h independent projection matrices. The attention results of h groups are calculated in parallel and then concatenated and fused to achieve multi-dimensional parallel attention. .

[0045] .

[0046] : The fusion projection matrix of multi-head attention output (trainable parameter).

[0047] :No. The query, key, and value projection matrix of each attention head (trainable parameters).

[0048] : The number of parallel heads in multi-head attention.

[0049] Business correspondence: different It has the capability to focus on different business dimensions. For example, in an encoder, some headers focus on electrical indicators, some on compliance standards, and some on interface definitions, thus extracting multi-dimensional information from the specification document in parallel.

[0050] In the Seq2Seq architecture of this patent, multi-head attention is divided into three categories, each undertaking different business functions: 1. Encoder side: multi-head self-attention mechanism, function: to perform self-attention calculation on the input BMS specification text, with different attention heads capturing specification information of different dimensions, realizing the transformation from fragmented text to structured features.

[0051] Specific division of labor: (1) Some attention focuses on capturing electrical performance indicators: automatically locate core parameters such as voltage, current, SOC range, charge and discharge threshold, and sampling accuracy, and establish the correlation logic between indicators.

[0052] (2) Focus on capturing compliance judgment dimensions: Focus on fault protection rules, qualification judgment standards, national standard compliance clauses, etc., and sort out the judgment basis of the test.

[0053] (3) Partial attention focuses on capturing the hardware interface dimension: extracting hardware-related information such as communication protocols, I / O interface definitions, and control timing to provide interface basis for subsequent script and instruction generation.

[0054] 2. Decoder side: Mask multi-head self-attention mechanism, function: In the process of generating test cases, script code, control instructions, and report text, it ensures that the currently generated content only depends on the previously generated content (the mask blocks future information), and at the same time, it ensures the logical and syntactic correctness of the output through multi-head division of labor. Specific division of labor: (1) When generating test scripts, some heads focus on code syntax and variable definitions, and some heads focus on the sequence of test steps; (2) When generating control instructions, some heads focus on the process sequence of device operation, and some heads focus on the rationality of parameter values.

[0055] 3. Encoder-decoder cross-head attention mechanism, working logic: Every time the decoder generates an output unit (a test step, a line of script code, a control instruction, or a report conclusion), it will calculate the association weight between the current generation position and all specification features of the encoder through the cross-attention layer, and actively focus on the specification clause most relevant to the current generation content, so as to achieve "one generation step, one specification alignment".

[0056] Overall implementation results: (1) Test case generation stage: Automatically focus on the performance indicators and test conditions corresponding to the specifications, ensuring that each test case corresponds to the clear specifications requirements, directly improving the coverage of test cases to the specifications indicators.

[0057] (2) Test script generation stage: Automatically focus on the interface definition and parameter thresholds in the specification to ensure that the interface adaptation and parameter settings of the script fully meet the requirements of the specification, thereby improving the interface matching degree and the matching degree between the script and the specification.

[0058] (3) Generation of equipment control instructions stage: Automatically focus on the test process and safety thresholds in the specification to ensure that the timing and parameters of the control instructions meet the specification requirements and ensure that the matching degree and accuracy of the equipment control instructions are 100%.

[0059] (4) Generation of compliance report and judgment conclusion stage: Automatically focus on the qualification judgment criteria of the specification to ensure that the test conclusion and report content are fully aligned with the requirements of the specification, and achieve "consistency between test judgment and specification, and 100% coverage of report indicators".

[0060] This embodiment incorporates a standardized bidirectional communication interface into the trained deep learning model, enabling seamless integration between the model and the BMS black-box testing system. This ensures that the specification parsing results can directly drive the execution of testing software and hardware devices. Specifically, it includes two types of core interfaces: (1) BMS black-box testing automation test software call interface.

[0061] It supports mainstream industrial communication protocols such as Modbus, TCP / IP, and CAN, and is compatible with mainstream BMS test host computer software in the industry (LabVIEW, TestStand, customized black-box test platforms, Python test frameworks, Robot Framework, etc.), possessing four core capabilities.

[0062] ① Automatic script writing capability: It can automatically write / import the automated test script code generated by the model and matched with the specifications into the automated test software without manual operation.

[0063] ② Real-time test status capture capability: It can read the test software's running logs, script execution status, error messages, hardware feedback data, and test result data in real time.

[0064] ③ Test process control capability: It can issue commands such as start, pause, and terminate test to the test software to control the entire process of test software operation.

[0065] ④ Compliance verification capability: It can compare test results with specifications in real time to ensure that the test judgment criteria are consistent with the specifications.

[0066] (2) BMS black box test hardware device control interface.

[0067] Supports industrial control protocols such as RS485, CAN, and Ethernet; compatible with all types of BMS black-box testing hardware (DC power supplies, multi-cell battery simulators, serial / CAN communication boards, data acquisition devices, temperature chambers, etc.); possesses three core capabilities: ① Real-time equipment status acquisition capability: It can read the operating parameters, working status, and fault alarm information of each hardware device in real time.

[0068] ② The equipment has automatic control capabilities. It can issue control commands such as parameter configuration, start / stop, and operating condition adjustment to the hardware according to the test conditions required by the specifications, so as to realize fully automatic control of the test hardware.

[0069] ③ Safety protection capabilities: Based on equipment status feedback, it can trigger emergency stop, power failure and other protection commands in real time to avoid safety risks during the testing process.

[0070] This invention inputs sample data into a deep learning model for iterative training, including a two-stage progressive training process. First, the model acquires the ability to generate test content centered on specifications. Then, the model acquires the ability to control the entire test execution process driven by specifications. This solves the problems of inconsistent training objectives, insufficient accuracy, and weak specification-driven performance in single-stage training. The training process is as follows: Figure 2 As shown.

[0071] In some embodiments, the two-stage progressive training is as follows: The first training phase focuses on training the specification-driven test content generation capability, introducing comparative learning for the two core output components: test cases and automated scripts. This phase includes: taking specification text, standardized test case samples, and automated test script samples as input, and test cases and automated test scripts as target outputs. The encoder extracts technical indicators from the specification text, establishing a mapping relationship between technical indicators, test cases, and automated test scripts. Based on the encoded features, the decoder first generates test cases corresponding one-to-one with the technical indicators, and then generates automated test scripts that match the control interfaces of the BMS black-box testing hardware and software devices. The model parameters are trained so that the test cases and automated test scripts closely approximate the standardized test case samples and automated test script samples, respectively. This yields the encoder backbone weights and the coefficients of the decoder, attention layer, and bidirectional communication interface adaptation layer.

[0072] The second training phase involves training the specification-driven end-to-end test control capabilities. This includes: optimizing the scripts based on the automated test scripts output by the deep learning model obtained in the first training phase and the specification encoding features output by the encoder; optimizing the scripts by controlling the system to enter an idle mode; acquiring error logs and hardware interface protocol documents during the idle operation process; freezing the encoder weight parameters and training layer by layer in four sub-phases according to the business execution order of script debugging → script optimization → device control → report generation; correcting the decoder parameters; and obtaining the final deep learning model.

[0073] The input consists of script no-load debugging samples, device control samples, and test report samples. The output consists of the corresponding problem location results, optimized scripts, control instructions that match the specifications, and standardized compliance test reports. The encoder backbone weights are frozen, and the coefficients of the decoder, attention layer, and bidirectional communication interface adaptation layer are adjusted. The process is iterated until convergence to obtain the final deep learning model.

[0074] This stage involves fine-tuning only the decoder, attention layer, and dual-interface adaptation layer, enabling the model to learn four core capabilities: automatic script deployment and idle debugging, script problem analysis and automatic optimization, automatic control of test hardware and software, and automatic generation of test data and compliance reports. The entire process is based on the technical requirements of the specifications as the core judgment criterion.

[0075] The second training phase includes: In the first sub-stage, the input consists of the automated test script, error log, hardware interface protocol document, and specification encoding features output from the first training stage. The decoder's mask self-attention layer extracts sequence features from the automated test script and error log to locate basic issues such as syntax errors, timing conflicts, and missing variables. The decoder's cross-attention layer compares the hardware interface definitions, communication protocol parameters, and threshold range clauses in the specification text with the corresponding content in the automated test script to locate business-type issues such as interface mismatch, parameter out-of-bounds errors, and test rule non-compliance. It outputs the issue location results, along with the issue type, location, and corresponding violated specification clause number. Based on the issue location results and specification matching degree, it calculates the classification cross-entropy loss for script issue location and uses it as a loss constraint to train and adjust the decoder's top-level self-attention parameters and cross-attention adaptation layer parameters. The second sub-stage takes the following inputs: problem localization results, automated test scripts, specification coding features, and hardware device control interface specifications. It calculates the device control sub-loss and uses it as a loss constraint to train and adjust the attention head parameters and cross-attention adaptation layer parameters related to the decoder and sequence generation. The third sub-stage takes the following inputs: optimized automated test scripts, initial state parameters of test bench hardware, test execution timing and safety rules, specification coding features, calculation of instruction classification loss and sequence loss as loss constraints, training and adjusting the parameters related to decoder and control semantic generation, cross-attention adaptation layer and full parameters of dual interface adaptation layer. In the fourth sub-stage, the inputs are: specification coding features, standardized test report, test execution sequence, and operation log of the no-load operation process. Test data features are obtained, and the error between the test data features and the corresponding feature values ​​in the specification text is used as the loss constraint. The attention head parameters, cross-attention adaptation layer parameters, and data coding adaptation layer parameters related to the decoder and report generation are adjusted.

[0076] In some embodiments, the method for optimizing the script in the second training phase by controlling the entry into the idle mode includes: configuring the test equipment to run in idle mode; during the idle run, acquiring the hardware test control instructions of the hardware device; acquiring the matching degree between the script execution logic and the test requirements in the specification; and capturing problems in the script execution.

[0077] Based on the script execution issues identified, corresponding optimization solutions are generated.

[0078] Modify the script according to the optimization plan.

[0079] The optimized script is redeployed and re-enters the idle mode until the set goal is achieved.

[0080] In some embodiments, during the first training phase, the loss function combines cross-entropy loss with specification matching loss, focusing on the script's syntax correctness, interface matching degree, test case coverage of specification metrics, and the degree of matching between the script and specification requirements as core optimization objectives. Specifically, the loss function... Cross-entropy loss Loss of matching with specifications The weighted calculation yields: ; Minimize during training With the goal of updating model parameters through backpropagation, the ability to generate test content that is grammatically correct and highly consistent with the specifications is ultimately achieved.

[0081] The loss function is a weighted combination of cross-entropy loss and specification matching loss, which constrain the model training from two dimensions: syntactic correctness and business requirement matching. 1. Cross-entropy loss, a common basic loss in text / code generation tasks, is used to supervise the test case text and test script code output by the model and optimize the script syntax accuracy in the objective.

[0082] It penalizes the model for generating scripts / test cases with syntax errors or messy formatting, ensuring the legality of the output in terms of syntax, structure, and code format. This is a fundamental prerequisite for the model to generate executable test content.

[0083] Cross-entropy loss For the token-by-token cross-entropy loss generated from the sequence, take the average of the entire sequence: .

[0084] in, The true label of the k-th word at step t is determined by comparing the test case text output by the deep learning model with the standardized test case samples, or by comparing the test script output by the model with the automated test script samples. The label is 1 if correct and 0 otherwise. V represents the predicted probability of the k-th word output by the deep learning model at step t. T represents the total length of the sequence output by the deep learning model, and V represents the total number of words.

[0085] Specification matching loss is a customized loss item for BMS testing scenarios, corresponding to the interface matching degree, test case coverage of specification metrics, and script matching degree with specification requirements in the optimization objectives. It verifies the generated content from a business perspective: penalizing test cases that omit core specification metrics, script interfaces that do not match BMS hardware interfaces, and test logic that does not comply with specification requirements. This forces the model's generated results to closely align with the input BMS specification, fundamentally solving the problem of generated content being disconnected from specification requirements.

[0086] Specification matching loss It consists of three weighted components: indicator coverage penalty, interface matching penalty, and compliance requirement matching penalty. ; This represents the non-coverage rate of technical indicators in the specification document, where S is the set of technical indicators extracted from the input specification document text, which are the technical indicators to be covered, and S′ is the set of technical indicators output by the deep learning model. The fewer indicators covered by the generated content, the larger this value is and the higher the loss.

[0087] Penalty item for communication interface matching: 0 if the generated BMS black-box test hardware device control interface matches the BMS standard interface, and 1 if it does not match.

[0088] Penalty items are matched to test requirements: 0 if the generated content meets the specification test / compliance requirements, and 1 if it does not.

[0089] α, β, and γ are weighting coefficients, which can be adjusted according to the priority of the test scenario. They are all positive numbers and are used to balance the weight ratio of each loss item.

[0090] In some embodiments, during the first training phase, the parameters of the deep learning model are adjusted through repeated iterative training until the technical indicators of the specification are covered by ≥99.5%, the word accuracy of the test script is 100%, the communication interface matching degree is ≥99%, and the matching degree between the test script and the specification requirements is ≥98.5%, thus completing the first training phase.

[0091] In some embodiments, during the second training phase, a multi-head attention mechanism—a multi-task joint loss function combined with specification compliance loss—is used to optimize script optimization accuracy, device control command matching degree, test report coverage of specification requirements, and test judgment consistency with specifications as core optimization objectives.

[0092] After completing the second training phase, the process also includes initiating end-to-end joint training, inputting initial specification coding features, initial automated test scripts and initial hardware states, using a weighted total loss function as global constraints, and adjusting model parameters. The total loss function includes multi-task joint loss, specification compliance loss and contrastive learning loss.

[0093] In some embodiments, the loss function at this stage Multi-head attention mechanism - multi-task joint loss Losses related to specification compliance The weighted calculation yields: .

[0094] Multi-head attention mechanism - multi-task joint loss The calculation method is as follows: .

[0095] in, To optimize the sub-loss of the script, Equipment control sub-loss, To report the loss of generated sub-subs, To test the sub-loss.

[0096] Loss due to specification compliance The calculation method is as follows: ; : The weight parameters of the four loss terms, the sum of which is 1.

[0097] Semantic feature alignment loss. From the perspective of global high-dimensional features, constraining the semantic consistency between the output content (script / instruction / report) and the specification, and avoiding the overall direction deviating from the specification, is a basic constraint applicable to all output scenarios.

[0098] : Core metric coverage loss. From a structured business perspective, the constraint output covers the core mandatory test metrics in the specification, which directly corresponds to the business objective of "100% coverage of test report specifications metrics".

[0099] : Parameter compliance loss. For the quantified parameters in the test script and device control commands, verify whether they fall within the threshold range specified in the specification, and penalize the output of parameters that exceed the limit, which directly corresponds to the safety goal of "100% accuracy of device control commands".

[0100] : Determine consistency loss. For the compliance report's conformity determination conclusion, verify whether it is consistent with the determination rules specified in the specification, and penalize incorrect or erroneous judgments, directly corresponding to the goal of "100% consistency between test determination and specification".

[0101] This is a global constraint loss designed for "specification-driven" design and is one of the core designs of this phase. It is not limited to the label fitting of a single task, but verifies the degree of fit between all model outputs (optimization scripts, control instructions, test reports, and judgment conclusions) and the technical indicators and judgment criteria of the input BMS specification from a global perspective. It penalizes outputs that deviate from the specification requirements, ensuring that the entire testing process is always based on the specification and avoids the model merely fitting labeled data and deviating from business needs.

[0102] Constrain the output accuracy of each individual task: Script optimization sub-loss The corresponding script optimization accuracy is improved, the model is supervised to locate the idle debugging problem and the script correction effect is monitored, the deviation between the optimized script and the standard optimized script is penalized, and the model can automatically repair script problems and complete idle debugging.

[0103] Equipment control sub-loss : Matching degree of corresponding device control commands, supervising the consistency between the test hardware control commands output by the model and the standard commands, and ensuring that the commands can accurately drive the BMS test software and hardware to execute the test process.

[0104] Report generated sub-loss The corresponding test report covers the requirements of the specifications, and the supervision of the completeness and format of the compliant test report generated by the model ensures that the report fully covers all test items and results.

[0105] Test decision sub-loss The consistency between the corresponding test results and the specifications is monitored, and the degree of matching between the model's judgment on the pass / fail of the test results and the specifications is ensured, so as to guarantee that the judgment conclusions strictly comply with the compliance requirements of the specifications.

[0106] Loss due to specification compliance This is a global constraint loss designed for "specification-driven" design and is one of the core designs of this phase. It is not limited to the label fitting of a single task, but verifies the degree of fit between all model outputs (optimization scripts, control instructions, test reports, and judgment conclusions) and the technical indicators and judgment criteria of the input BMS specification from a global perspective. It penalizes outputs that deviate from the specification requirements, ensuring that the entire testing process is always based on the specification and avoids the model merely fitting labeled data and deviating from business needs.

[0107] This step involves iterative optimization: repeatedly training on the training set and validating the entire process on the validation set until the model achieves ≥99% accuracy in script optimization, 100% accuracy in device control commands, 100% coverage of test report specifications, and 100% consistency between test judgments and specifications on the test set. This completes the second stage of training and yields the final mature and dedicated deep learning model.

[0108] In some embodiments, the sample dataset also includes a negative sample dataset, and the deep learning model training step also includes a contrastive learning optimization step, in which the deep learning model is optimized by inputting the negative sample dataset into the deep learning model and using a contrastive learning algorithm.

[0109] The trained model can perform unattended inference execution for fully automated testing, using the BMS product specification document as the sole input. The specific process is as follows: Figure 3 As shown, no human intervention is required throughout the entire process, and all steps strictly adhere to the technical requirements of the specifications.

[0110] Automated script deployment is a core innovative module for specification-driven security testing. It works in deep integration with the model's built-in dual interfaces to complete full script verification and optimization without connecting to the BMS protection board, ensuring the scripts fully comply with the specification's testing requirements. (1) Automatic script deployment: After the model generates an automated test script that matches the specification, it automatically calls the interface through the automated test software to write / import the script code into the BMS black box test automation software, automatically completing the script loading, runtime environment configuration, and hardware and software interface adaptation without any manual operation.

[0111] (2) Safety control of no-load test mode: The model automatically configures the test equipment to enter no-load mode through the hardware control interface (disconnects the power supply circuit of the BMS protection board under test, and only retains the communication connection between the test software and the hardware device), completely avoiding the risk of damage to the BMS protection board and hardware device during script debugging.

[0112] (3) Real-time capture of all-dimensional test status: During the script's no-load operation, the model collects three major categories of core data in real time through dual interfaces: the test software's running log, error messages, and script execution progress; the hardware device's status feedback, instruction response, and parameter matching degree; and the matching degree between the script execution logic and the specification test requirements. It captures all kinds of problems in the script's operation, including syntax errors, interface call failures, parameters that do not match the specification indicators, hardware instructions that do not respond, and logic execution that does not match expectations.

[0113] The script's automatic iterative optimization is deeply integrated with the model's inference capabilities, using the technical requirements of the specifications as the sole criterion for judgment, achieving fully automatic problem localization and optimization without manual intervention. (1) Automatic problem location and compliance analysis: Based on the script running problems captured, the model automatically locates the root cause of the problem by combining the debugging and optimization rules learned during training. At the same time, it compares the technical requirements of the specification and analyzes whether the problem causes the test results to be inconsistent with the specification requirements, and generates the corresponding optimization solution.

[0114] (2) Automatic script modification and optimization: The model automatically modifies the script code according to the optimization scheme, and adjusts the function calls, parameter settings, logical branches, communication instructions, etc., to ensure that the optimized script fully meets the test requirements of the specification and the hardware and software interface specifications.

[0115] (3) Iterative verification: The optimized script is automatically redeployed to the test software and run again under no-load conditions. The entire process of "deployment-run-problem capture-optimization" is executed in a loop until the script runs continuously under no-load conditions without any errors, the execution of instructions is completely consistent with the specifications, and the hardware device responds normally. The script is then fully automatically debugged and optimized, and the final version of the compliant executable script is locked.

[0116] The end-to-end test execution and compliance report generation module enables fully automated test execution and compliance report output after script verification, completing the specification-driven end-to-end test closed loop. (1) Automated compliance preparation before testing: After the script verification is passed, the model automatically completes the parameter configuration of the test equipment (such as DC power supply output voltage, single string voltage of multi-string battery simulator, communication baud rate, temperature chamber, etc.) through the hardware control interface and in accordance with the test conditions requirements in the specification. It automatically detects the access status and loop connection status of the BMS protection board under test, and enters the test ready state after confirming that there are no errors.

[0117] (2) Fully automated compliance test execution: The model calls the interface through the automated test software, issues the test start command, drives the test software to run the final version of the compliance script, and controls the test equipment to complete the full-function black box test of the BMS protection board; during the test, test data, feedback signals of the BMS protection board and equipment operating status are collected in real time, and the real-time result is determined by comparing with the compliance judgment standards in the specification; when an abnormality occurs, the safety protection mechanism is automatically executed, the test is paused and the abnormal information is recorded.

[0118] (3) Automatic generation of standardized compliance test reports: After the test is completed, the model automatically cleans, analyzes and statistically processes all test data. Based on the report specifications learned during training, and in accordance with the technical requirements of the specification, it automatically generates a standardized compliance test report. The report includes core contents such as basic test information, a list of core indicators of the specification, test item details, the degree of matching between the test results and the requirements of the specification, pass / fail judgment, abnormal data and fault analysis, test traceability information, and test conclusions. At the same time, it is associated with the corresponding test cases and automated scripts to ensure that the entire test process is traceable and compliance is verifiable.

[0119] This solution also includes a human-computer interaction and result output module: (1) Visual operation interface: Provides a visual operation interface, which supports users to import BMS product specifications in batches, view the entire process test progress, view the generated test cases / scripts / test reports, manually fine-tune scripts / test parameters, trigger model retraining / fine-tuning, test data traceability query and other operations; (2) Data storage and compliance management: Automatically store input specifications, generated test cases / scripts / test reports, model training parameters, and all data from the testing process to establish a searchable compliance database, meeting the needs of enterprise mass production archiving and industry regulatory traceability, while also supporting subsequent model iteration and optimization; (3) Multi-format compliant export: Supports exporting test cases to Excel and Word formats, exporting automated test scripts to source file formats in the corresponding language, and exporting test reports to PDF and Excel formats to meet the needs of different enterprise scenarios.

[0120] The technical advantages of this deep learning-based BMS specification-driven fully automated testing method include: (1) For the first time, a closed-loop unattended test process driven by specification sheet input was realized, improving efficiency by more than 1,000 times and completely breaking through the production capacity bottleneck.

[0121] Because this invention achieves a fully automated closed loop with the BMS product specification as the sole input, from indicator analysis, test case generation, script writing, debugging and optimization, test execution to report output, the entire process that originally took 5-10 days to complete manually can be completed by the system in just 30 minutes, improving efficiency by over 1000 times. When iterating on a product, only the new specification needs to be entered to complete the entire compliance testing process, without any repetitive manual operations. This completely breaks the capacity constraints of the testing phase on BMS product development and mass production, perfectly matching the market demand for rapid iteration in the new energy industry.

[0122] (2) Innovate the no-load debugging mechanism to completely avoid the risks of actual board debugging, greatly improve test safety and reduce test costs.

[0123] Because this invention innovatively designs a script no-load debugging and automatic optimization mechanism based on the specifications, it completes full script debugging and optimization without connecting to the actual BMS protection board. This completely avoids the risks of BMS protection board burnout and test equipment damage caused by script errors and misunderstandings of specifications, and avoids product and hardware losses caused by actual board debugging, significantly reducing testing costs. At the same time, it eliminates safety accidents such as battery overcharging and short circuits caused by script errors at the source, greatly improving the safety of the testing process.

[0124] (3) Built-in standardized dual interfaces enable seamless linkage between specification parsing and test execution, breaking the long-standing automation gap in the industry.

[0125] Because this invention integrates standardized automated testing software calling interfaces and hardware device control interfaces into the deep learning model, it achieves bidirectional real-time communication between the model and the BMS black-box testing system, completely solving the industry pain point of the complete separation between specification input and test execution in existing technologies. It eliminates the need for manual switching between multiple platforms, enabling full linkage from specification parsing results to automatic script deployment, real-time test status feedback, and automatic device control. This provides core support for specification-driven full-process automated closed loop, achieving truly unattended testing.

[0126] (4) The entire process is driven by the specification sheet to ensure test compliance and avoid mass production risks.

[0127] Because the model training, full-process execution, and result judgment of this invention are all based solely on the BMS specification, the test cases 100% cover the technical indicators in the specification, the script parameters are completely matched with the requirements of the specification, and the judgment of test results strictly follows the compliance standards of the specification, it completely solves the problems of test omissions, inconsistent judgment standards, and insufficient compliance caused by manual operation in the prior art, ensuring the consistency of test results with the requirements of the specification, and fundamentally avoiding the compliance risks of mass-produced products.

[0128] (5) The script is fully automated and iteratively optimized, which greatly improves the reliability of the script and the standardization of the testing process.

[0129] Because the model of this invention is trained on full-scenario samples, it not only masters script writing capabilities but also the ability to debug and optimize scripts according to specifications. It can automatically locate script problems and optimize and iterate until the script fully meets the test requirements. The generated scripts have 100% syntax accuracy, complete interface matching, and high consistency with specifications, eliminating the need for manual debugging. At the same time, the scripts follow unified coding standards and logical architecture, completely solving the pain points of low standardization, poor reliability, and long debugging cycles of manually written scripts, and significantly improving the standardization of the BMS testing process and the reliability of test results.

[0130] (6) Extremely strong generalization ability and compatibility, adapting to the testing needs of BMS in all scenarios.

[0131] Because the model of this invention is trained based on full-scenario BMS test samples, it can be adapted to BMS protection boards with different application scenarios, different number of strings, different power, and different communication protocols, such as vehicle-mounted / energy storage. At the same time, the model's dual-interface adaptation layer supports mainstream test software and hardware devices, and can be directly connected and used without modifying the existing BMS black-box test system. If it is necessary to adapt to new test equipment or protocols, only a small number of samples need to be added to fine-tune the model, which has extremely strong generalization ability and compatibility.

[0132] (7) Completely eliminate reliance on manual labor throughout the entire process, significantly reduce labor costs, and fill the technological gap in the industry.

[0133] Because this invention achieves fully automated, unattended operation throughout the entire process, it eliminates the need for senior testers, professional developers, and test operators. Only a small number of personnel are required to complete the final report review, significantly reducing the manpower required for multiple positions in the testing process and lowering labor costs. At the same time, it is the first to achieve fully automated BMS black-box testing driven solely by specifications, filling a long-standing technological gap in the industry and promoting the upgrading of the new energy BMS testing industry towards intelligence, standardization, and compliance.

[0134] Of course, the above description is not intended to limit the present invention, and the present invention is not limited to the examples given above. Any changes, modifications, additions or substitutions made by those skilled in the art within the scope of the present invention should also fall within the protection scope of the present invention.

Claims

1. A deep learning-based BMS specification-driven fully automated testing method, characterized in that, include: The deep learning model training steps and script automated deployment steps are described. The deep learning model adopts an encoder-decoder architecture with a multi-head attention mechanism and is configured with bidirectional communication interfaces, namely an automated testing software call interface and a hardware device control interface. The deep learning model training steps include: The sample dataset is constructed and preprocessed, including specification samples, standardized test case samples, automated test script samples, script idle debugging samples, equipment control samples, and test report samples. The sample dataset is preprocessed by text cleaning and sample dataset partitioning. The specification sample is input into a large language model, which performs semantic understanding on the specification sample to obtain key semantic information on the technical indicators, test requirements and compliance judgment standards of the test, which is the specification text. Each sample data is input into a deep learning model for iterative training. The script automatically deploys the following steps: the deep learning model generates automated test scripts based on the input specifications; the automated test software calls the interface to write the automated test scripts into the BMS black-box test automation software; and automatically completes the script loading, runtime environment configuration, and bidirectional communication interface adaptation.

2. The BMS specification-driven fully automated testing method according to claim 1, characterized in that, The input of each sample data into the deep learning model for iterative training includes two stages of progressive training: The first training phase, the specification-driven test content generation capability training, includes: taking the specification text, standardized test case samples, and automated test script samples as input, and test cases and automated test scripts as target outputs; the encoder extracts technical indicators from the specification text and establishes a mapping relationship between technical indicators, test cases, and automated test scripts; the decoder, based on the encoding features, first generates test cases that correspond one-to-one with the technical indicators, and then generates automated test scripts that match the bidirectional communication interface based on the test cases; the model parameters are used such that the differences between the test cases and automated test scripts and the standardized test case samples and automated test script samples, respectively, are used as loss constraints to obtain encoder weight parameters and decoder parameters; The second training phase involves training the specification-driven end-to-end test control capabilities. This includes: optimizing the scripts based on the automated test scripts output by the deep learning model obtained in the first training phase and the specification encoding features output by the encoder; optimizing the scripts by controlling the system to enter an idle mode; acquiring error logs and hardware interface protocol documents during the idle operation process; freezing the encoder weight parameters and training layer by layer in four sub-phases according to the business execution order of script debugging → script optimization → device control → report generation; correcting the decoder parameters; and obtaining the final deep learning model.

3. The BMS specification-driven fully automated testing method according to claim 2, characterized in that, The second training phase includes: In the first sub-stage, the input consists of the automated test script, error log, hardware interface protocol document, and specification encoding features output from the first training stage. The decoder's mask self-attention layer extracts sequence features from the automated test script and error log to locate basic issues such as syntax errors, timing conflicts, and missing variables. The decoder's cross-attention layer compares the hardware interface definitions, communication protocol parameters, and threshold range clauses in the specification text with the corresponding content in the automated test script to locate business-type issues such as interface mismatch, parameter out-of-bounds errors, and test rule non-compliance. It outputs the issue location results, along with the issue type, location, and corresponding violated specification clause number. Based on the issue location results and specification matching degree, it calculates the classification cross-entropy loss for script issue location and uses it as a loss constraint to train and adjust the decoder's top-level self-attention parameters and cross-attention adaptation layer parameters. The second sub-stage takes the following inputs: problem localization results, automated test scripts, specification coding features, and hardware device control interface specifications. It calculates the device control sub-loss and uses it as a loss constraint to train and adjust the attention head parameters and cross-attention adaptation layer parameters related to the decoder and sequence generation. The third sub-stage takes the following inputs: optimized automated test scripts, initial state parameters of test bench hardware, test execution timing and safety rules, specification coding features, calculation of instruction classification loss and sequence loss as loss constraints, training and adjusting the parameters related to decoder and control semantic generation, cross-attention adaptation layer and full parameters of dual interface adaptation layer. In the fourth sub-stage, the inputs are: specification coding features, standardized test report, test execution sequence, and operation log of the no-load operation process. Test data features are obtained, and the error between the test data features and the corresponding feature values ​​in the specification text is used as the loss constraint. The attention head parameters, cross-attention adaptation layer parameters, and data coding adaptation layer parameters related to the decoder and report generation are adjusted.

4. The BMS specification-driven fully automated testing method according to claim 2, characterized in that, In the first training phase, loss function Cross-entropy loss Loss of matching with specifications The weighted calculation yields: ; Cross-entropy loss The calculation method is as follows: ; in, The true label of the k-th word at step t is determined by comparing the test case text output by the deep learning model with the standardized test case samples, or by comparing the test script output by the model with the automated test script samples. The label is 1 if correct and 0 otherwise. This represents the predicted probability of the k-th word output by the deep learning model at step t; T represents the total length of the sequence output by the deep learning model, and V represents the total number of words. Specification matching loss The calculation method is as follows: ; This represents the percentage of technical metrics not covered in the specification document, where S is the set of technical metrics extracted from the input specification document text, and S′ is the set of technical metrics output by the deep learning model. Penalty item for communication interface matching: 0 when the generated BMS black-box test hardware device control interface matches the BMS standard interface, and 1 when it does not match; Penalty items are matched to test requirements: 0 if the generated content meets the specification test / compliance requirements, and 1 if it does not; α, β, and γ are weighting coefficients, respectively.

5. The BMS specification-driven fully automated testing method according to claim 4, characterized in that, In the first training phase, the parameters of the deep learning model are adjusted through repeated iterative training until the technical indicators of the specification are covered by ≥99.5%, the word accuracy of the test script is 100%, the communication interface matching degree is ≥99%, and the matching degree between the test script and the specification requirements is ≥98.5%, thus completing the first training phase.

6. The BMS specification-driven fully automated testing method according to claim 3, characterized in that, In the second training phase, the loss function Multi-head attention mechanism - multi-task joint loss Losses related to specification compliance The weighted calculation yields: ; Multi-head attention mechanism - multi-task joint loss The calculation method is as follows: ; in, To optimize the sub-loss of the script, Equipment control sub-loss, To report the loss of generated sub-subs, To test the sub-loss.

7. The BMS specification-driven fully automated testing method according to any one of claims 1-5, characterized in that, The sample dataset also includes a negative sample dataset, and the deep learning model training step also includes a contrastive learning optimization step, in which the deep learning model is optimized by inputting the negative sample dataset into the deep learning model and using a contrastive learning algorithm.

8. The BMS specification-driven fully automated testing method according to any one of claims 1-5, characterized in that, The BMS black-box testing automation software supports Modbus, TCP / IP, CAN industrial communication protocols, and BMS testing host computer software.

9. The BMS specification-driven fully automated testing method according to any one of claims 1-5, characterized in that, The control interface of the BMS black-box test hardware device supports RS485, CAN, and Ethernet industrial control protocols and is compatible with BMS black-box test hardware devices.

10. The fully automated testing method driven by the BMS specification as described in claim 2, characterized in that, After completing the second training phase, the process also includes initiating end-to-end joint training, inputting initial specification coding features, initial automated test scripts and initial hardware states, using a weighted total loss function as global constraints, and adjusting model parameters. The total loss function includes multi-task joint loss, specification compliance loss and contrastive learning loss.