CN-121996235-A - Traction converter control software design method integrating large language model
Abstract
The invention provides a traction converter control software design method integrating a large language model, which comprises the steps of analyzing a historical document by adopting the large language model subjected to data fine adjustment in the traction converter field to generate a structural requirement and establishing MATLAB requirement tracing, constructing an initial model in a Simulink according to the requirement, completing multi-objective iterative optimization by model recommendation parameters, generating normal, extreme and fault working condition scenes by the large language model to drive MATLAB batch simulation, giving a semantic analysis result, automatically generating codes by Embedded Coder, implementing readability and real-time optimization by the large language model, outputting a final code after PIL verification, downloading the codes to a real control board card, combining a virtual traction system constructed by a semi-physical simulation platform to form a closed loop, automatically generating test cases by the large language model, analyzing software and hardware cooperative data, and iterating until the performance reaches the standard. The invention realizes the full-flow AI driving including demand, modeling, simulation, code and test, obviously shortens the development period and improves the software reliability.
Inventors
- YU XIAOMAN
- REN BAOZHU
- GUO YANG
- MA ZHIJUN
- JIANG SONGYANG
- WANG PANPAN
Assignees
- 中车大连电力牵引研发中心有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20251230
Claims (9)
- 1. A traction converter control software design method integrating a large language model is characterized by comprising the following steps: S1, carrying out semantic analysis and knowledge extraction on a historical demand document, an industry standard and a fault case by using a large language model for completing parameter fine adjustment based on traction converter field data to generate a structured demand list, and carrying out demand association and tracing by combining a demand management tool Requirements Toolbox of MATLAB to output a model design specification scheme conforming to the industry specification; S2, constructing an initial simulation model of traction converter control software in an MATLAB/Simulink environment according to the model design specification scheme, calling a parameter recommended value output by the large language model based on a vector knowledge base and an algorithm selection proposal to finish parameter initial value setting, and then utilizing a model verification tool of MATLAB to realize automatic correction of model compliance, and simultaneously comprehensively considering control precision, response speed and stability multi-objective parameters of the traction converter to carry out parameter iteration verification to obtain a verified optimized simulation model; S3, generating a normal, extreme and fault condition simulation scene list by the large language model according to causal reasoning of the operation characteristics of the traction converter, driving MATLAB to perform simulation in batches, transmitting simulation results back to the large language model for semantic analysis, and outputting fault risk points and performance optimization directions; S4, converting the verified optimized simulation model into an initial embedded code through a Embedded Coder module of MATLAB, performing readability optimization and real-time optimization on the initial code through the large language model, generating a hardware compatible optimized code aiming at a target processor architecture, verifying the execution efficiency through PIL test, and outputting a final code; S5, the final codes are downloaded to a real control board, a virtual traction system built by combining a semi-physical simulation platform forms a closed loop, unit test, fault test and deviation adaptation test cases are automatically generated by the large language model according to platform characteristics and code functions, hardware-software cooperative data are automatically executed and acquired through an automatic Desk, and the large language model is used for analyzing and outputting optimization suggestions again, and iterating is performed until the software-hardware cooperative performance reaches the standard, so that the whole flow of controlling software design of the traction converter is completed.
- 2. The method for designing the traction converter control software integrated with the large language model according to claim 1, wherein the step S1 comprises: S11, carrying out standardization processing on massive unstructured text resources in the traction converter field, extracting LLM field knowledge, including document blocking, vectorizing and establishing a vector database, and generating a structured demand list; s12, importing the structural demand list generated by LLM into a demand management tool Requirements Toolbox of MATLAB, and establishing a traceability relation between the demand and an initial simulation model of traction converter control software; S13, outputting a model design specification scheme which accords with the industry specification by the LLM according to the demand characteristics and the historical modeling data, wherein the model design specification scheme comprises a model hierarchy structure construction scheme and a module division scheme.
- 3. The method for designing the traction converter control software integrated with the large language model according to claim 2, wherein in step S11, the document blocking process is a semantic level splitting based on the technical logic of the traction converter, and the method comprises the following steps: The document is divided into a plurality of independent and complete text blocks by taking a functional module or a technical topic as a unit, so that each text block is ensured to focus on a single technical scene, and cross-topic information interference is avoided.
- 4. The traction converter control software design method with fusion of large language model according to claim 2, wherein in step S11, the vectorization is text encoding of large language model, comprising: converting each text block into a token sequence conforming to the input format of the model through a Tokenizer tool of the model, namely mapping natural language vocabulary into a digital code recognizable by the model; A transducer encoder of a large language model is utilized to carry out deep semantic analysis on a token sequence based on a self-attention mechanism, grammar association and domain term association inside a text block are captured, and finally vector representation with context semantic features is generated.
- 5. The method for designing a traction converter control software integrated with a large language model according to claim 2, wherein in step S11, the creating a vector database includes: and establishing a high-performance vector database based on the vectors, and constructing a knowledge base special for the traction converter field.
- 6. The method for designing the traction converter control software integrated with the large language model according to claim 1, wherein the step S2 comprises: S21, constructing an initial simulation model, namely constructing a logic control model, an algorithm model and a hardware driving model based on a model design specification scheme of LLM output and combining actual design requirements, wherein: the logic control model comprises an initialization model, a pre-charge model, a self-building model, an operation state model, a fault protection model, a jump bow model and a shutdown state model; the algorithm model comprises a main control algorithm, a fault diagnosis and fault tolerance algorithm, a fault protection algorithm, a state estimation algorithm and an auxiliary control algorithm; The hardware driving model comprises GPIO, ADC, ePWM, eCAP, SCI, SPI, CAN, EMI which is an interaction channel and an interaction mode of software and hardware; S22, intelligent LLM parameter recommendation, namely converting the current design requirement into a structured query vector which comprises key parameters of power level, motor type, motor parameters, rotating speed range, current range, voltage range and response index, searching through a vector library, matching a plurality of historical cases in industry, wherein each case comprises a complete parameter set and corresponding performance data, inputting the cases as few-shot examples into a large language model, and generating an initial parameter scheme by combining pre-trained control theory knowledge and field rules by the large language model; S23, performing parameter iteration verification of MATLAB, namely importing LLM recommended parameters into a large language model, simulating under typical working conditions, setting an optimization target, automatically executing parameter iteration, generating an optimized parameter scheme, synchronously updating to a vector database and associating new demand labels, and forming iterative accumulation of parameter knowledge.
- 7. The method for designing the traction converter control software integrated with the large language model according to claim 1, wherein the step S3 comprises: s31, LLM generates a plurality of simulation scenes including normal working conditions, extreme working conditions and fault working conditions through causal reasoning according to the operation characteristics of the traction converter, wherein each simulation scene comprises test parameters and evaluation indexes; s32, importing simulation scene parameters generated by LLM into MATLAB Simulink, executing simulation in batches, and automatically recording simulation data, wherein the simulation data comprise motor rotation speed, direct current bus voltage, motor three-phase current and fault protection action time; s33, inputting simulation data into the LLM, automatically identifying performance bottlenecks by comparing design requirements, outputting optimization suggestions, and automatically updating and re-simulating a large language model after the optimization suggestions are imported into the MATLAB.
- 8. The method for designing the traction converter control software integrated with the large language model according to claim 1, wherein the step S4 comprises: s41, selecting a traction converter target processor in a Embedded Coder module of MATLAB, and converting a large predictive model which passes verification into an initial code, wherein the initial code comprises a main function, a module function and an interface function; S42, performing readability optimization and real-time optimization on the initial code by LLM, wherein the readability optimization is to add standardized comments and simplify nesting logic, and the real-time optimization is to automatically execute loop expansion and memory allocation adjustment according to the real-time control requirement of the traction converter; S43, LLM generates a code compliance report, verifies whether the code meets the ISO 26262 functional safety standard, and performs static analysis through MATLAB Polyspace Code Prover to confirm that no runtime error exists.
- 9. The method for designing the traction converter control software integrated with the large language model according to claim 1, wherein step S5 comprises: S51, building a semi-physical simulation environment based on a dSPACE platform, comprising the following steps: constructing a virtual simulation layer, namely constructing a power electronic simulation model of the traction converter to realize millisecond-level real-time train dynamic working condition simulation; Setting up a real hardware layer, namely accessing core hardware such as a traction converter communication board card, a signal board card, a control board card and the like into a semi-physical simulation platform, and transmitting the hardware and the virtual simulation layer to real control software through an I/O module by real-time signal interaction; a software running layer is built, namely traction converter control software to be tested is downloaded to a target hardware CPU, and closed-loop control is formed by the traction converter control software, the real hardware and a virtual simulation model; S52, LLM generates test cases according to the dSPACE semi-physical platform characteristics, wherein the test cases comprise instruction response tests, deviation adaptation tests and fault tests, automatic execution is realized through an Automation Desk, and real-time simulation effects are comprehensively verified; S53, acquiring software instructions, hardware responses and virtual working condition data in real time by the dSPACE platform, carrying out deep analysis on the acquired data by the large language model, outputting optimization suggestions, and after software modification, re-verifying by the dSPACE platform until the cooperative performance of the software and the hardware reaches the standard, generating a dSPACE semi-physical simulation test report, and determining the function passing rate, real-time index, hardware adaptation problem and optimization scheme of the software under the real hardware characteristics, thereby providing a direct basis for the real vehicle loading test.
Description
Traction converter control software design method integrating large language model Technical Field The invention relates to the technical field of traction converter control, in particular to a traction converter control software design method integrating a large language model. Background The traction converter control software is used as a core control component of a traction system of the rail transit vehicle, and the design quality of the traction converter control software directly determines the reliability and safety of the vehicle operation. The software needs to realize the core functions of traction motor torque control, network side converter control, fault protection and the like, and the control algorithm of the software relates to complex mathematical operations such as coordinate transformation, PI regulation, space vector modulation and the like. With the development of the alternating current transmission technology to the directions of high power density and wide speed regulation range, traction control software needs to process more control tasks with high real-time requirements and strong coupling, and the requirements on a software development method are higher. At present, the traction converter control software development mainly adopts two technical routes, namely a traditional manual coding method and a model-based design method. The manual coding method is completely dependent on engineers to manually write the embedded C codes, and has the inherent defects of low development efficiency, easiness in introducing human errors, difficulty in later maintenance and the like. The design method based on the model improves development efficiency and reliability to a certain extent through graphical modeling and automatic code generation technology, but still has the technical bottlenecks that firstly, a large number of industry standard documents and historical requirements are required to be manually extracted and arranged in a requirement analysis stage, the efficiency is low, key information is easy to miss, secondly, the model parameter optimization process depends on experience of engineers, an optimal parameter combination is difficult to quickly find according to complex multi-working condition operation characteristics of a traction system, and again, the simulation test scene design is difficult to comprehensively cover extreme working conditions, so that the fault exposure rate in a later system test stage is high, and finally, the automatically generated codes are difficult to consider engineering actual requirements in terms of instantaneity and readability. These technical bottlenecks severely restrict development efficiency and quality improvement of traction converter control software. Disclosure of Invention According to the technical problems, the design method of the traction converter control software integrated with the large language model is provided. The invention is based on the forward development flow of the software based on the model, and deeply fuses a large language model to construct an AI-driven traction control software whole-flow development system. The method realizes the automatic extraction of domain knowledge, intelligent parameter recommendation, simulation scene generation and test case design by means of a large language model, completes intelligent model construction, LLM generation type simulation verification simulation, AI auxiliary automatic code generation and optimization and intelligent online test verification by combining MATLAB, promotes the design to be changed from 'experience driving' to 'data and knowledge double driving', finally achieves the aims of improving the design quality, shortening the development period, reducing the development cost and reducing the maintenance difficulty, and meets the requirements of rail transit on high reliability and high safety of the converter. The invention adopts the following technical means: a traction converter control software design method integrating a large language model comprises the following steps: S1, carrying out semantic analysis and knowledge extraction on a historical demand document, an industry standard and a fault case by using a large language model for completing parameter fine adjustment based on traction converter field data to generate a structured demand list, and carrying out demand association and tracing by combining a demand management tool Requirements Toolbox of MATLAB to output a model design specification scheme conforming to the industry specification; S2, constructing an initial simulation model of traction converter control software in an MATLAB/Simulink environment according to the model design specification scheme, calling a parameter recommended value output by the large language model based on a vector knowledge base and an algorithm selection proposal to finish parameter initial value setting, and then utilizing a model verification tool of MATLAB to realiz