Power system control algorithm agent based on large language model and construction method thereof
Through the power system control algorithm agent based on the large language model, combined with data preprocessing, iterative optimization and user preference modeling, the shortcomings of traditional power system control methods under complex working conditions are solved, and precise control and optimization of the power system are achieved. , improving system performance and user experience.
Patent Information
- Application Number
- CN202411270269.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-11
- Publication Date
- 2025-01-24
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional power system control methods are difficult to deal with complex and variable working conditions, and are difficult to combine theoretical knowledge and engineering practice, resulting in insufficient information utilization and limited control accuracy.
Using a dynamic system control algorithm agent based on a large language model, through data collection and preprocessing, iterative optimization of the large language model, definition of multi-functional functions, user preference modeling and reinforcement learning methods, a control that conforms to user preferences and meets functional requirements is generated algorithm.
It achieves precise control and optimization of the power system under complex working conditions, improves system performance, fuel efficiency, reduces emissions, and enhances system adaptability and stability.
Smart Images

Figure CN119357320A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent control and optimization technology, and in particular to a power system control algorithm intelligent agent based on a large language model and a construction method thereof. Background Art
[0002] With the widespread application of power systems in automobiles, ships, aviation and other industrial fields, how to improve their performance and efficiency has become a key research direction in the field of engineering technology. However, traditional power system control methods usually rely on single modal data, such as physical models and empirical formulas. When dealing with complex and changeable working conditions, it is difficult to cope with the challenges of multi-modal data, resulting in insufficient information utilization. In addition, these traditional methods show limitations in precise control and optimization, especially in complex working conditions. It is difficult to provide flexible and personalized control solutions based on user preferences and actual control needs. At the same time, since power systems involve theoretical knowledge in multiple fields, including thermodynamics, dynamics, fluid mechanics and control theory, traditional algorithms are difficult to fully integrate these theoretical knowledge with engineering practice experience, further limiting the improvement of system performance.
[0003] In recent years, the rapid development of large language models (LLMs) has provided new ideas for the design and optimization of intelligent control algorithms. Through training on massive text data, large language models have extensive knowledge acquisition and reasoning capabilities, and can perform knowledge transfer and problem solving in a variety of scenarios. Applying large language models to the algorithm construction of power systems can not only combine theoretical knowledge with engineering practice, but also generate more flexible and accurate control strategies and solutions based on user preferences and control requirements. Through personalized control strategies, the power system can not only optimize its performance and efficiency, but also improve user experience under complex working conditions and meet diverse control needs. Summary of the invention
[0004] The purpose of the present invention is to provide a method for constructing a power system control algorithm intelligent agent based on a large language model in order to address the technical defects in the prior art.
[0005] Another object of the present invention is to provide an intelligent agent constructed by the above construction method.
[0006] The technical solution adopted to achieve the purpose of the present invention is:
[0007] A method for constructing a power system control algorithm agent based on a large language model comprises the following steps:
[0008] Step 1, data collection and preprocessing: collect relevant data through power system theoretical knowledge and engineering practice experience, and preprocess the collected data to obtain the QA pair training set;
[0009] Step 2, selecting a control algorithm task related to the power system, iteratively optimizing the large language model using the QA training set, and fine-tuning the large language model;
[0010] Step 3: Based on the working principle of the power system, control strategy and engineering practice experience, multiple functional functions are defined. The multifunctional functions are used to implement the call and environment configuration of the compilation and interpreter of multiple languages. The large language model parses the user instructions and requirements according to the user's question input, intelligently matches and calls the corresponding functions, adopts the automatic execution engine, and integrates the API interface to realize the automatic operation of the corresponding functions to obtain the execution result of the control algorithm. If the execution result fails, it is fed back to the large language model. The large language model is iterated repeatedly until multiple executable control algorithms that meet user needs are generated;
[0011] Step 4, the multiple control algorithms generated in step 3 are simultaneously presented to the user, and the user ranks the multiple control algorithms according to his or her own preferences. The control algorithms and their user rankings are recorded and collected to construct a user preference training set. When the amount of data in the training set meets the training requirements of the Scaling law, the training set is used to optimize the training value model based on the neural network. The optimized value model is used to extract the user's preference features and give a high score to the control algorithm that meets the user's preferences.
[0012] In step 5, based on the reinforcement learning method of proximal policy optimization (PPO), the control algorithm output by the large language model is input into the value model trained in step 4 for evaluation and scoring. Weights are assigned to multiple control algorithms according to the evaluation scores, and the weighted results are back-propagated to fine-tune the parameters of the large language model according to user preferences to generate a control algorithm that meets user preferences and functional requirements.
[0013] In the above technical solution, in step 1, the theoretical knowledge of dynamic systems is basic knowledge in related fields such as engine principles, thermodynamics, combustion and control theory, and the theoretical knowledge is knowledge data in multiple languages.
[0014] In the above technical solution, in step 1, the preprocessing is to clean, label, classify and format the collected data.
[0015] In the above technical solution, in step 2, the low-rank adaptation (LoRA) fine-tuning technology is adopted to decompose the weight matrices of the two parts of the self-attention layer and the feedforward neural network layer in the large language model into two low-rank matrices, and fine-tune them into two low-rank matrices to achieve fine-tuning of the large language model.
[0016] In the above technical solution, in step 3, the multiple languages are Python, C++ and Java, and there are three executable control algorithms, each of which is written in a different way and has a different structure.
[0017] In the above technical solution, the control algorithm writing method includes algorithm logic, code structure and performance optimization.
[0018] In the above technical solution, in step 4, the multifunctional function is a fuel injection control, ignition advance angle calculation and fault diagnosis function.
[0019] In the above technical solution, in step 5, the response time, accuracy and stability of the control algorithm agent are regularly evaluated.
[0020] In the above technical solution, the large language model is GLM-4.0 model, Baichuan Intelligence, Tongyi Qianwen, MiniMax, Moonshot or Kimi (8K) 8K.
[0021] Another aspect of the present invention also includes an intelligent agent constructed by the above construction method.
[0022] Compared with the prior art, the present invention has the following beneficial effects:
[0023] 1. The present invention effectively solves the problem of dependence on single modal data in traditional power system control methods by introducing a large language model. The powerful data processing and analysis capabilities of the large language model enable it to integrate multimodal data, including theoretical knowledge, scientific research results, expert experience and actual operation data, so as to achieve precise control and optimization in complex engineering practices. This fusion of multimodal data makes the optimized control algorithm not only conform to theoretical logic, but also closely fits engineering practice, significantly improving the overall performance of the power system, such as improving fuel efficiency, reducing emissions, and enhancing the adaptability and stability of the system under various working conditions.
[0024] 2. The present invention emphasizes the continuous integration of theoretical knowledge and engineering practice experience, and realizes an efficient algorithm development and iteration mechanism. Through the close collaboration between the control algorithm agent and the large language model, the development and optimization of the algorithm no longer rely on a single dimension of knowledge, but can absorb and integrate the latest information from multiple fields and multiple levels in real time. This dynamic knowledge fusion capability ensures that the algorithm can quickly adapt to market changes and technological progress, continuously optimize and innovate itself, and completely breaks the bottleneck of the difficulty in integrating engineering experience and theoretical knowledge in traditional control methods, and plays an important role in promoting the continuous development of power technology.
[0025] 3. The present invention effectively solves the problem that traditional power system control methods are difficult to meet the personalized needs of users by introducing user preference modeling and intelligent generation mechanism of control algorithms. The large language model can score, sort and optimize different control algorithms based on the personalized preferences and control requirements of users, thereby generating a control strategy that meets user preferences. This optimization mechanism based on user feedback not only improves the flexibility of the control algorithm, but also ensures that it is more in line with the specific requirements of users while meeting functional requirements. Through continuous iterative optimization, the power system can show higher adaptability and accuracy in different scenarios of personalized needs, further improving the user experience and the overall operating efficiency of the system.
[0026] 4. The present invention decomposes the weight matrix of the large language model into two low-rank matrices and only updates the parameters of the two low-rank matrices, thereby achieving efficient fine-tuning of the large language model while significantly reducing computing resources and storage overhead. In this way, the large language model gradually adapts to the understanding and processing of power system data, ensuring that it can achieve optimal performance in tasks such as fuel injection control, ignition advance angle calculation, and fault diagnosis.
[0027] 5. The power system algorithm agent based on the large language model proposed in the present invention has good comprehensive performance, realizes the intelligent upgrade and performance optimization of the power system control algorithm, builds an efficient algorithm development and iteration mechanism, and significantly improves the overall performance and reliability of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 It is a schematic diagram of the process of the present invention. DETAILED DESCRIPTION
[0029] 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.
[0030] A method for constructing a power system control algorithm agent based on a large language model comprises the following steps:
[0031] Step 1, data collection and preprocessing: Collect theoretical knowledge on power systems in multiple fields and languages, such as power system principles, thermodynamics, fluid mechanics, and control theory, from authoritative channels such as academic journals, conference papers, and technical reports. Cooperate with automobile manufacturers and related R&D institutions to obtain power system design data of multiple models, real-time test data, fault records, and other engineering practice experience to collect relevant data. Preprocess the collected data (cleaning, labeling, classification, and formatting, etc.) to obtain the QA training set.
[0032] Step 2, using low-rank adaptation (LoRA) fine-tuning technology, the weight matrices of the self-attention layer and the feedforward neural network layer in the large language model are decomposed into two low-rank matrices, and only the parameters of these two matrices are updated to achieve fine-tuning of the large language model; through the LoRA technology, the computational overhead in the fine-tuning process is reduced, while ensuring that the model maintains efficient and stable performance when performing power system-related control tasks, ensuring that the large language model achieves optimal performance when processing fuel injection control, ignition advance angle calculation and fault diagnosis tasks.
[0033] Step 3. According to the working principle, control strategy and engineering experience of the power system, multiple core functional functions are defined to support the compilation, interpreter call and environment configuration of multiple languages (such as Python, C++, Java, etc.). The large language model parses the requirements according to the user input, intelligently matches the corresponding functional functions, and integrates the API interface through the automatic execution engine to realize the automatic operation of the control algorithm. During the execution of the algorithm, if the operation result is normal, the final result is output; if an error occurs, the system will feedback to the large language model, and the large language model will be iterated repeatedly until an executable control algorithm that meets user needs is generated. Specifically, three control algorithms with different structures and writing methods are generated for users to choose and sort according to their preferences to meet personalized needs.
[0034] Step 4: Display the three control algorithms (different in function, structure, and performance) generated in step 3 to the user, allowing the user to evaluate based on multiple dimensions, including code readability, code operation efficiency, code modular design and maintainability, and code fault tolerance. The user gives scores based on the above dimensions and sorts the three control algorithms based on the scores. The system provides an intuitive interface to support users to view the different characteristics of each control algorithm in detail and give text feedback. The user's score and sorting results are recorded together with specific feedback information to form a user preference data set; as the user evaluation data accumulates, the system establishes a user preference training set. When the amount of data in the training set meets the training requirements of the Scaling law, the training set is used to optimize the value model based on the neural network. The optimized value model is used to automatically learn the user's preference characteristics and score the control algorithms generated subsequently, thereby improving the personalized adaptability of the subsequent control algorithms.
[0035] Step 5, using the proximal policy optimization (PPO) algorithm, the generated control algorithm of the large language model is reinforced learning adjusted; first, the three generated control algorithms are input into the neural network-based value model, the value model scores the control algorithms, and weights are assigned to the three control algorithms according to the scoring results, and the higher the score, the greater the weight of the control algorithm; the weight-adjusted scoring results are transmitted back to the large language model through the back propagation algorithm to update its parameters; through this iterative process, the large language model can gradually learn and adjust the generated control algorithm, and the fine-tuned large language model will tend to generate a single control algorithm code that meets user preferences and functional requirements. After multiple rounds of reinforcement learning, the system finally outputs the optimal control algorithm that meets the user's personalized needs.
[0036] 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 control algorithm agent based on a large language model, characterized in that: The following steps are involved: Step 1, data collection and preprocessing: collect relevant data through power system theoretical knowledge and engineering practice experience, and preprocess the collected data to obtain the QA pair training set; Step 2, selecting a control algorithm task related to the power system, iteratively optimizing the large language model using the QA training set, and fine-tuning the large language model; Step 3: Based on the working principle of the power system, control strategy and engineering practice experience, multiple functional functions are defined. The multifunctional functions are used to implement the call and environment configuration of the compilation and interpreter of multiple languages. The large language model parses the user instructions and requirements according to the user's question input, intelligently matches and calls the corresponding functions, adopts the automatic execution engine, and integrates the API interface to realize the automatic operation of the corresponding functions to obtain the execution result of the control algorithm. If the execution result fails, it is fed back to the large language model. The large language model is iterated repeatedly until multiple executable control algorithms that meet user needs are generated; Step 4: Present multiple control algorithms generated in step 3 to the user at the same time. The user ranks the multiple control algorithms according to his / her own preferences. The control algorithms and their user rankings are recorded and collected to construct a user preference training set. When the amount of data in the training set meets the training requirements of the Scaling law, the training set is used to optimize the value model based on the neural network. The optimized value model is used to extract the user's preference features and give high scores to the control algorithms that meet the user's preferences. In step 5, based on the reinforcement learning method of proximal policy optimization (PPO), the control algorithm output by the large language model is input into the value model trained in step 4 for evaluation and scoring. Weights are assigned to multiple control algorithms according to the evaluation scores, and the weighted results are back-propagated to fine-tune the parameters of the large language model according to user preferences to generate a control algorithm that meets user preferences and functional requirements.
2. The construction method according to claim 1, characterized in that: In step 1, the theoretical knowledge of dynamic systems is basic knowledge in related fields such as engine principles, thermodynamics, combustion and control theory, and the theoretical knowledge is knowledge data in multiple languages.
3. The construction method according to claim 1, characterized in that: In step 1, the preprocessing is to clean, label, classify and format the collected data.
4. The construction method according to claim 1, characterized in that: In the step 2, the low-rank adaptation (LoRA) fine-tuning technology is used to decompose the weight matrices of the two parts of the self-attention layer and the feedforward neural network layer in the large language model into two low-rank matrices, and fine-tune them into two low-rank matrices to achieve fine-tuning of the large language model.
5. The construction method according to claim 1, characterized in that: In step 3, the multiple languages are Python, C++ and Java, and there are three executable control algorithms, each of which has a different writing method and structure.
6. The construction method according to claim 1, characterized in that: The control algorithm writing method includes algorithm logic, code structure and performance optimization.
7. The construction method according to claim 1, characterized in that: In step 4, the multifunctional functions are fuel injection control, ignition advance angle calculation and fault diagnosis.
8. The construction method according to claim 1, characterized in that: In step 5, the response time, accuracy and stability of the control algorithm agent are regularly evaluated.
9. The construction method according to claim 1, characterized in that: The large language model is GLM-4.0 model, Baichuan Intelligence, Tongyi Qianwen, MiniMax, Moonshot or Kimi (8K) 8K.
10. An intelligent agent constructed by the construction method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Deep learning-based flight path data quality control algorithm
CN116737700A
Question answering system based on large language model and knowledge graph, construction method of question answering system and intelligent data governance platform
CN117609470A
Unmanned cluster formation control algorithm intelligent generation method based on large model
CN117647934A
Multi-Agent cooperative control algorithm and system for large language model in security and futures industry
CN117788164A
Efficient recommendation algorithm and system for large model
CN117909589A
Cited By
Comprehensive energy system flexible optimization scheduling method based on large language model
CN120611899A
Method and device for intelligent computing cloud platform to realize agent self-evolution through computing power
CN121614114A