Knowledge-operation mapping fine-tuning LLM-based power system calibration tuning agent

By constructing the power system calibration and tuning intelligent body based on the large language model based on knowledge-operation mapping fine-tuning, the problem of low efficiency and relying on manual intervention under the complex conditions of traditional methods, and achieve efficient and automated control parameter calibration and optimization. Improve simulation efficiency and results accuracy.

CN119357321APending Publication Date: 2025-01-24TIANJIN UNIV

Patent Information

Application Number
CN202411270278.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-11
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

The traditional power system controller calibration and tuning method relies on a single data mode, which is difficult to cope with complex and changeable working conditions, and is highly dependent on manual intervention, resulting in large investment in time and manpower, and the inability to effectively integrate the knowledge of professional fields and experts. .

Method used

Use knowledge-operation mapping fine-tuning large language model (LLM) to build a power system calibration and tuning smart body, which can process multi-mode information, automatically implement the simulation experimental process, integrate professional knowledge and human-machine interaction optimization strategies, and realize that no one is on duty. The control parameters are automatically calibrated.

Benefits of technology

It significantly improves the efficiency and effect of the controller's tuning, reduces the time and manpower input of manual tuning, improves the efficiency and accuracy of simulation, and improves the explanatoryness and trust of the results by generating interpretation optimization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119357321A_ABST
    Figure CN119357321A_ABST
Patent Text Reader

Abstract

The invention discloses a power system calibration and tuning agent based on knowledge-operation mapping (LLM) fine tuning, and a construction method of the power system calibration and tuning agent comprises the following steps: step 1, collecting corpora; step 2, constructing an RAG framework; 3, selecting a pre-trained large language model, and performing fine tuning on the pre-trained large language model by using data in the structured knowledge base and the unstructured knowledge base; step 4, constructing a function library; 5, designing an automatic execution engine; step 6, mapping between knowledge and actual operation; and step 7, designing a cue word template, determining functions and effects of LLM through the cue word template, and constructing a ReAct reasoning framework. The optimization process of the power system controller is more efficient, more flexible and more operable, the adjustment and optimization requirements of the controller can be met, and human input is greatly reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of power system intelligent control technology, and in particular to a power system calibration and tuning intelligent agent based on knowledge-operation mapping fine-tuning LLM. It can understand multimodal information such as engineer language, data, and charts, and combine with the professional knowledge base in the field of power control to schedule related software and hardware equipment, automatically execute the simulation experiment process, and realize the full process unattended automatic calibration of control parameters. It is suitable for the power system control field using simulation platforms such as Simulink and GT-Power. Background Art

[0002] With the widespread application of power systems in the automotive and industrial fields, the optimization and calibration of their control systems have become increasingly critical. However, traditional controller calibration and tuning methods mainly rely on mathematical models and algorithm derivation. Although they can provide accurate control strategies to a certain extent, they are usually limited to a single data modality and are limited in effectiveness when dealing with complex and changeable actual working conditions. Secondly, these methods are highly dependent on manual intervention, such as the arrangement of manual experimental processes, software and hardware operations, and optimization result judgment, which requires a lot of time and manpower investment. Thirdly, traditional methods cannot effectively integrate knowledge from professional fields and experts, and may lead to suboptimal or undesirable results in parameter calibration due to insufficient experience of engineers.

[0003] In recent years, large language models with emergent capabilities have shown great potential in the field of artificial intelligence, especially in understanding and perceiving the environment (multimodal data), performing task decomposition and planning, seamlessly cooperating with other system modules, adapting to dynamic environmental changes, and interacting with humans through natural language. The cognitive, learning, and reasoning capabilities of large language models lay a solid foundation for building an intelligent agent that can efficiently handle complex problems and automatically optimize controller parameters.

[0004] In view of this, this paper proposes a power system intelligent calibration optimization agent based on a large language model. Through multimodal data processing and analysis, automated experimental procedures, integration of professional knowledge in the field of power systems and human-computer interaction optimization strategies, it aims to address the shortcomings of traditional methods and significantly improve the efficiency and effectiveness of controller tuning. Summary of the invention

[0005] The purpose of the present invention is to address the technical defects stored in the prior art and to provide a power system calibration and tuning intelligent agent based on knowledge-operation mapping fine-tuning LLM, which can realize multimodal data processing in the field of power system control, professional knowledge mastery and practical application, and automatic execution of experimental processes based on simulation platforms such as Simulink and GT-Power, and realize unattended automatic calibration of control system parameters to improve simulation efficiency and result accuracy.

[0006] The technical solution adopted to achieve the purpose of the present invention is:

[0007] A method for constructing a power system calibration and tuning agent based on knowledge-operation mapping fine-tuning LLM, comprising the following steps:

[0008] Step 1: Collect corpus;

[0009] Step 2, build the RAG framework: remove redundancy, noise and irrelevant content in the corpus, distinguish between structured knowledge and unstructured knowledge, and build a structured knowledge base and an unstructured knowledge base respectively; for structured knowledge, convert it into triples, use the BERT word vector embedding model to process the triples to obtain embedding vectors; for unstructured knowledge, split it into text blocks, use the BERT word vector embedding model to process the text blocks to obtain embedding vectors; store the embedding vectors obtained from structured knowledge and unstructured knowledge into the vectorized knowledge base;

[0010] Step 3: Select a pre-trained large language model and fine-tune it using data from the structured knowledge base and the unstructured knowledge base, so that it can correctly understand and process the professional terms and knowledge in power system control. At runtime, the user's natural language needs are converted into query vectors through the BERT word vector embedding model. The query vector is similar to the knowledge vector in the vectorized knowledge base, and the knowledge vector with the highest similarity is selected. The vector is used to find the corresponding knowledge entry and passed to the large language model.

[0011] Step 4: Build the function library:

[0012] Collect all functions and their related parameters in the simulation platform, divide the simulation task into several subtasks according to the complexity of the task, and integrate and encapsulate the basic functions corresponding to the subtasks to form a custom function. Each function is described in a standardized manner and stored in a structured function library;

[0013] Step 5: Design the automated execution engine and feedback mechanism:

[0014] The automation execution engine communicates seamlessly with the simulation platform through the API interface. When the intelligent agent is running, the large language model calls the corresponding function in the function library according to the user input, and converts the call instruction into a command executable by the simulation platform, and passes it to the simulation platform. The simulation platform executes the instruction, and the execution status or result is fed back to the large language model;

[0015] Step 6: Mapping between knowledge and practical operations:

[0016] Add an Adapter layer to the large language model to collect operation sample data of experts when using the simulation platform, including detailed steps from parameter setting to simulation operation and their decision-making process. Use the mapping relationship between the operation sample data and related knowledge items to train the parameters of the Adapter layer.

[0017] Step 7, design a prompt word template, clarify the function and role of LLM through the prompt word template, build a ReAct reasoning framework, and when the intelligent agent is running, design guiding prompt words for specific tasks to realize the application of the ReAct reasoning framework. The large language model combines the prompt word template, guiding prompt words and user needs to output instructions.

[0018] In the above technical solution, in step 1, the corpus includes basic theoretical knowledge, technical basic knowledge, technical subject knowledge and case knowledge.

[0019] In the above technical solution, in step 1, the basic theoretical knowledge includes advanced mathematics, linear algebra and numerical analysis, the technical basic knowledge includes internal combustion engine principles, thermal engineering principles, control theory, digital signal processing and application, the technical subject knowledge includes internal combustion engine engineer's manual, internal combustion power system modeling, battery system modeling and human-computer interaction theory and application, and the case knowledge includes actual cases of internal combustion power system and fuel cell system intelligent control.

[0020] In the above technical solution, in step 3, the large language surface model is GLM-4.0.

[0021] In the above technical solution, in step 3, during the fine-tuning process, the weights in the large language model are adjusted by optimizing the loss function, the fine-tuned model is evaluated using the validation set, and the process is iterated repeatedly until the large language model passes the test verification of the task test set.

[0022] In the above technical solution, in step 3, the test verification includes verification of prediction accuracy, generation quality, and ability to handle complex tasks.

[0023] In the above technical solution, in step 4, the function and its related parameters include function name, default value, data type and functional description.

[0024] In the above technical solution, in step 4, the function library is organized hierarchically so that the large language model can quickly find and call the most suitable function through semantic matching according to user needs.

[0025] In the above technical solution, the construction step also includes an error feedback mechanism. The simulation platform executes instructions. If no error is reported during the execution process, the simulation result is output to the user. If an error is reported during the execution process, the error information is fed back to the large language model to optimize it.

[0026] Another aspect of the present invention also includes an intelligent agent formed based on the construction method.

[0027] Compared with the prior art, the present invention has the following beneficial effects:

[0028] 1. The present invention constructs an intelligent calibration and optimization agent for power system control based on a large language model, which involves knowledge collection in the field of power system control, RAG, professional field fine-tuning and function calls, etc. The traditional controller parameter calibration method is mainly based on mathematical models and algorithm derivation, relying on a single data modality, while the agent of the present invention can comprehensively process multi-modal information such as engineer language, data, and charts, and can perform controller parameter calibration more intelligently and comprehensively, improving efficiency and optimization effects. Compared with the manual calibration method, the agent can integrate a wide range of cross-domain knowledge (such as theoretical knowledge, empirical knowledge, historical cases, etc.) through the language model, so as to refer to more dimensional information during the optimization process. This makes the optimization process of the present invention include both theory and the experience and best practices of engineers. The agent can refer to these experiences during the optimization process, so as to quickly find an efficient optimization path, automate the experimental process, greatly reduce the time and manpower investment of manual tuning, and improve the efficiency and accuracy of simulation.

[0029] 2. The present invention uses text information to enable the agent to generate explanatory optimization suggestions or decisions. Users can not only obtain the optimization results, but also understand the logic and reasoning process behind them, which improves the interpretability and trustworthiness of the results. In addition, the language model enables the agent to accept and process natural language input, which allows users to participate in the optimization process more intuitively, raise questions or goals, and adjust the optimization strategy in real time based on feedback. This human-computer interaction mode is difficult to achieve in traditional optimization methods.

[0030] In summary, the power system control calibration intelligent agent based on the large language model proposed in the present invention has good comprehensive performance. In addition to the automated experimental process, it can also make the power system controller optimization process more efficient, more flexible and operational, and can meet the controller tuning requirements and significantly reduce manpower investment. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 Shown is a schematic diagram of the structure of the power system calibration and tuning agent. DETAILED DESCRIPTION

[0032] The present invention is further described in detail below in conjunction with specific embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0033] A powertrain calibration and tuning agent based on knowledge-operation mapping fine-tuning LLM is constructed through the following steps:

[0034] Step 1: Collect corpus according to basic theoretical knowledge, technical basic knowledge, technical subject knowledge and case knowledge, covering the knowledge required by human engineers for power system controller parameter calibration:

[0035] Basic theoretical knowledge includes advanced mathematics, linear algebra and numerical analysis, etc. Basic technical knowledge includes internal combustion engine principles, thermal engineering principles, control theory, digital signal processing and application, etc. Technical subject knowledge includes internal combustion engine engineer's handbook, internal combustion power system modeling, battery system modeling and human-computer interaction theory and application, etc. Case knowledge mainly includes actual cases in the fields of internal combustion power system, fuel cell system intelligent control, etc.

[0036] Step 2: Process the structured and unstructured knowledge in the corpus and design a Retrieval Augmented Generation (RAG) framework:

[0037] For the structured knowledge in the corpus, taking the Simulink operation manual as an example, first, remove irrelevant content in the text, such as advertisements, copyright statements, etc., and divide the content by chapters or functional modules to ensure that the content of each part focuses on a specific topic. Secondly, use natural language processing technology to identify key entities in the operation manual, such as function names, parameters, data types, operation steps, etc. For example, identify concepts such as block, parameter, and model in Simulink. Determine the relationship between these entities, such as the relationship between functions and parameters (which parameters are required for function calls) and the relationship between models and components (which components the model contains). Thirdly, build a domain ontology related to Simulink, define the main entity types (such as functions, parameters, models), attributes (such as parameter default values, data types), and relationships between entities (such as call relationships, inclusion relationships). Convert the extracted knowledge into a triple form, that is, the format of (entity-relationship-entity). For example, (Simulink, contains, Block) means that the Simulink model contains a block, and (Block, hasParameter, Gain) means that the block has the parameter Gain. The triple data is stored in a graph database (Neo4j). The triples are processed using the BERT word vector embedding model to obtain embedded vectors, which are then stored in a vectorized knowledge base.

[0038] For unstructured knowledge, taking papers as an example, the present invention splits the collected papers into small blocks (split by subtitles and by a fixed number of words), stores the text blocks in a NoSQL database, and uses the BERT word vector embedding model to process the text blocks, and obtains embedded vectors that are stored in a vectorized knowledge base.

[0039] Step 3, select GLM-4.0 as the base model for fine-tuning. GLM-4.0 is a pre-trained model that has basic language understanding and generation capabilities, but it still needs to be fine-tuned for specific fields. Therefore, the data in the structured and unstructured knowledge bases are input into the large language model for fine-tuning training. During the fine-tuning process, the model weights are adjusted by optimizing the loss function (such as cross entropy loss) to make it better suited to the tasks in the field of power system control. Then, the fine-tuned model is evaluated using the validation set to check the model's understanding and generation capabilities in specific fields. If the model performs poorly on certain tasks, it may be necessary to further adjust the fine-tuning strategy, hyperparameters, or dataset. Finally, use the pre-built task test set to evaluate its application effect in power system control tasks, including prediction accuracy, generation quality, and the ability to handle complex tasks, to ensure that it can correctly understand and handle the professional terms and knowledge in power system control.

[0040] When the intelligent agent is running, the user's natural language needs are converted into query vectors through the BERT word vector embedding model. The similarity between the query vector and the knowledge vectors in the vectorized knowledge base is calculated, and the knowledge vector with the highest similarity is selected. The vector is used to find the corresponding knowledge entry and passed to the large language model.

[0041] Step 4. In order to implement the function call function, it is first necessary to systematically collect all functions and their related parameters in the simulation platform (such as Simulink and GT-Power), including function names, default values, data types, and functional descriptions. Then, according to the complexity of the task, the simulation task is decomposed into several subtasks, and the basic functions corresponding to the subtasks are integrated and encapsulated to form a custom function. Each custom function will be described in a standardized manner, and all its properties will be written into a dictionary, including the name, default value, explanation, and associated functions / methods. All functions and their standardized descriptions are stored in a structured function library. The library is organized hierarchically, allowing the large language model to quickly find and call the most suitable function through semantic matching according to user needs. The function library will be updated regularly to add new functions and optimize existing functions, and will be dynamically adjusted based on user feedback to ensure its effectiveness and flexibility in practical applications.

[0042] Step 5, the design of the automated execution engine and feedback mechanism, first, deeply integrate with the simulation platform (such as Simulink, GT-Power) through an API (such as MATLAB API or Python API). This integration process includes configuring the API interface so that it can communicate seamlessly with the simulation platform and ensure that the instructions generated by the large language model can be correctly transmitted to the target simulation platform. The instructions generated by the large language model are converted into a command format executable by the simulation platform and transmitted through the API interface. In addition, a feedback mechanism needs to be implemented to ensure that the simulation platform can return the execution status or results to the large language model after executing the instructions.

[0043] Step 6: Add an Adapter layer to the large model to collect the operation example data of experts when using simulation platforms such as Simulink and GT-Power, including detailed steps from parameter setting to simulation operation and their decision-making process. The mapping relationship between these operation steps and related knowledge items is used to train the parameters of the Adapter layer, thereby enhancing the ability of the large language model to transform theoretical knowledge into practical operations.

[0044] Step 7: First, design a prompt word template, clarify the functions and roles of LLM, and build the ReAct reasoning framework. Subsequently, for specific tasks, design guiding prompt words throughout the entire execution process of the agent. During the task execution process, the agent will generate a plan based on these prompt words, and through the error feedback mechanism, monitor the system status in real time, and execute the cycle of perception, reasoning, action, and observation. Specifically, when the agent starts to execute the task according to the generated plan, it will monitor the state of the power system in real time, and use the feedback mechanism of ReAct (that is, the cycle of perception-reasoning-action-observation) to detect the execution effect. If it deviates from the goal, the agent will regenerate or adjust the plan. When the goal is achieved, the agent completes the task and generates a result report, and stores the task results and feedback in the knowledge base to provide a reference for future tasks and further optimize the ability to generate and execute plans. If the number of regenerations is greater than the threshold N max , it will be recorded as a failure and a new task will be started.

[0045] The above is only a preferred embodiment of the present invention. It should be pointed out that, for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A method for constructing a power system calibration and tuning agent based on knowledge-operation mapping fine-tuning LLM, characterized in that: The following steps are involved: Step 1: Collect corpus; Step 2: Build the RAG framework: remove redundancy, noise, and irrelevant content from the corpus, distinguish between structured knowledge and unstructured knowledge, and build a structured knowledge base and an unstructured knowledge base respectively; For structured knowledge, convert it into triples, and use the BERT word vector embedding model to process the triples to obtain embedded vectors; For unstructured knowledge, split it into text blocks, use the BERT word vector embedding model to process the text blocks and obtain embedding vectors; store the structured knowledge and unstructured embedding vectors into the vectorized knowledge base; Step 3: Select a pre-trained large language model and fine-tune it using data from the structured knowledge base and the unstructured knowledge base, so that it can correctly understand and process the professional terms and knowledge in power system control. At runtime, the user's natural language needs are converted into query vectors through the BERT word vector embedding model. The query vector is similar to the knowledge vector in the vectorized knowledge base, and the knowledge vector with the highest similarity is selected. The vector is used to find the corresponding knowledge entry and passed to the large language model. Step 4: Build the function library: Collect all functions and their related parameters in the simulation platform, divide the simulation task into several subtasks according to the complexity of the task, and integrate and encapsulate the basic functions corresponding to the subtasks to form a custom function. Each function is described in a standardized manner and stored in a structured function library; Step 5: Design the automated execution engine and feedback mechanism: The automated execution engine communicates seamlessly with the simulation platform through an API interface. The large language model calls the corresponding function in the function library according to the user input, and converts the calling instruction into a command executable by the simulation platform, and transmits it to the simulation platform. The simulation platform executes the instruction, and the execution status or result is fed back to the large language model. Step 6: Mapping between knowledge and practical operations: Add an Adapter layer to the large language model to collect operation sample data of experts when using the simulation platform, including detailed steps from parameter setting to simulation operation and their decision-making process. Use the mapping relationship between the operation sample data and related knowledge items to train the parameters of the Adapter layer. Step 7, design a prompt word template, clarify the function and role of LLM through the prompt word template, build a ReAct reasoning framework, and when the intelligent agent is running, design guiding prompt words for specific tasks to realize the application of the ReAct reasoning framework. The large language model combines the prompt word template, guiding prompt words and user needs to output instructions.

2. The construction method according to claim 1, characterized in that: In the step 1, the corpus includes basic theoretical knowledge, technical basic knowledge, technical subject knowledge and case knowledge.

3. The construction method according to claim 2, characterized in that: In step 1, the basic theoretical knowledge includes advanced mathematics, linear algebra and numerical analysis, the technical basic knowledge includes internal combustion engine principles, thermal engineering principles, control theory, digital signal processing and application, the technical subject knowledge includes internal combustion engine engineer's manual, internal combustion power system modeling, battery system modeling and human-computer interaction theory and application, and the case knowledge includes actual cases of internal combustion power system and fuel cell system intelligent control.

4. The construction method according to claim 1, characterized in that: In step 3, the large language surface model is GLM-4.

0.

5. The construction method according to claim 1, characterized in that: In step 3, during the fine-tuning process, the weights in the large language model are adjusted by optimizing the loss function, the fine-tuned model is evaluated using the validation set, and the process is repeated until the large language model passes the test verification of the task test set.

6. The construction method according to claim 5, characterized in that: The test verification includes verification of prediction accuracy, generation quality, and ability to handle complex tasks.

7. The construction method according to claim 1, characterized in that: In step 4, the function and its related parameters include function name, default value, data type and functional description.

8. The construction method according to claim 1, characterized in that: In step 4, the function library is organized hierarchically so that the large language model can quickly find and call the most suitable function through semantic matching according to user needs.

9. The construction method according to claim 1, characterized in that: The construction step also includes an error feedback mechanism. The simulation platform executes instructions. If no error is reported during the execution process, the simulation result is output to the user. If an error is reported during the execution process, the error information is fed back to the large language model to optimize it.

10. An intelligent entity formed based on the construction method as described in any one of claims 1-9.

Citation Information

Patent Citations

  • Method for calling data system interface through natural language

    CN117290429A

  • Construction method of mold professional question-answering system based on LLM model

    CN117909458A

  • Task processing method, commodity classification method and commodity classification method for e-commerce live broadcast

    CN118097490A

  • Equipment operation and maintenance text data analysis processing method based on large model

    CN118246541A

  • Intelligent automobile virtual simulation test method based on large language model

    CN118586281A

Cited By

  • Self-adaptive software stack optimization method and system based on GPU (Graphics Processing Unit) server configuration

    CN120803541A

  • Adaptive software stack optimization method and system based on GPU server configuration

    CN120803541B

  • Wind power operation and maintenance knowledge management method, device, equipment and medium

    CN121144534A

  • Wind power operation and maintenance knowledge management method, device, equipment and medium

    CN121144534B