Power system code intelligent delivery system based on large language model and construction method thereof

Through the intelligent code delivery system of the power system based on large language model, the problems of inefficiency and relying on manual intervention in the traditional code delivery process are solved, efficient and automated code delivery is achieved, and code quality and system maintainability are improved.

CN119513325AActive Publication Date: 2025-02-25TIANJIN UNIV

Patent Information

Application Number
CN202411362954.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-27
Publication Date
2025-02-25
Estimated Expiration
2044-09-27

AI Technical Summary

Technical Problem

The traditional code delivery process is inefficient and relies on manual intervention, making it difficult to fully cover usage scenarios, and it is impossible to effectively integrate the knowledge of professional fields and experts.

Method used

The intelligent code delivery system of the power system based on large language models uses multimodal data processing, automated script generation, and integrates professional knowledge, and provides human-computer interactive interfaces to realize automated code delivery.

Benefits of technology

It significantly improves the efficiency and quality of code delivery, reduces manual intervention, provides more comprehensive technical support, and enhances the maintainability of code and system reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119513325A_ABST
    Figure CN119513325A_ABST
Patent Text Reader

Abstract

The invention discloses a power system code intelligent delivery system based on a large language model and a construction method of the power system code intelligent delivery system, and the power system code intelligent delivery system remarkably improves the code delivery efficiency and quality through the functions of multi-modal data processing, automatic script execution and the like. Compared with a traditional document consulting mode, the power system code intelligent delivery system can integrate wide cross-domain knowledge (such as theoretical knowledge, experience knowledge and historical cases) through an FiD framework, and therefore more comprehensive support is provided in the code delivery process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of packaged code delivery, and in particular to a power system code intelligent delivery system based on a large language model and a construction method thereof. Background Art

[0002] With the widespread application of power systems in the automotive and industrial fields, the development and maintenance of their control systems are facing increasing challenges. The traditional code delivery process mainly relies on detailed documentation and manual guidance. Although these methods can ensure the quality and maintainability of the code to a certain extent, they are powerless when faced with complex and changeable actual application scenarios. On the one hand, these methods are limited to a single data form (such as text documents) and it is difficult to fully cover all possible usage scenarios; on the other hand, they are highly dependent on manual intervention, such as document reading and comprehension, environment configuration, error troubleshooting, etc., which is not only time-consuming and labor-intensive, but also prone to errors due to human negligence. In addition, traditional documentation and support methods cannot effectively integrate knowledge from professional fields and experts, which may make it difficult for users to find satisfactory solutions when they encounter specific problems.

[0003] In recent years, large language models with strong emergence and multimodal processing capabilities have made significant progress in the field of artificial intelligence, especially in understanding and processing diverse information, planning and executing complex tasks, promoting collaboration between systems, and achieving effective communication with humans through natural language. The cognitive, learning, and reasoning capabilities of large language models provide a solid foundation for building an intelligent agent that can efficiently solve complex problems and automatically deliver high-quality code.

[0004] In view of this, the present invention proposes a power system code intelligent delivery system based on a large language model. By integrating multimodal data processing, automatic script generation, integrating professional knowledge in the field of power systems, and providing a convenient human-computer interaction interface, the system aims to overcome the limitations of traditional methods and significantly improve the efficiency and quality of code delivery, thereby better serving the development and maintenance of power system projects. Summary of the invention

[0005] The purpose of the present invention is to address the technical defects in the prior art and to provide a method for constructing a power system code intelligent delivery system based on a large language model, so as to solve the problems of low efficiency, reliance on manual intervention, and difficulty in fully covering usage scenarios in the traditional code delivery process.

[0006] Another object of the present invention is to provide a power system code intelligent delivery system constructed by the above-mentioned construction method.

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

[0008] A method for constructing a power system code intelligent delivery system based on a large language model, comprising the following steps

[0009] Step 1, data collection and preprocessing: collect multimodal data related to the power system packaging code, preprocess the collected multimodal data to obtain a knowledge base;

[0010] Step 2: The knowledge base is divided into structured knowledge and unstructured knowledge, and the knowledge is summarized. The summarized structured knowledge and unstructured knowledge embedding vectors are stored in a unified vectorized database. The FiD framework retrieves the vectors of the knowledge items in the vectorized database as input and passes them to the decoder of the FiD framework. The decoder decodes them into knowledge and scripts. According to the questions or requirements input by the user and the retrieved knowledge and scripts, the prompt word generator generates prompt words, and the large language model generates multiple preliminary solutions according to different scenarios of the prompt words.

[0011] Step 3, use the Monte Carlo policy gradient algorithm (REINFORCE) to fine-tune the large language model: In the power system code intelligent delivery system, users provide feedback on the effectiveness of the solution in step 2 and give positive or negative reward signals. The Monte Carlo policy gradient algorithm evaluates the performance of the initially generated solution by accumulating reward signals from multiple scenarios, and updates the weights of the large language model through policy gradients to make the generated future solutions more in line with user needs. The weights of the large language model are continuously adjusted through back propagation, and training is repeated in preset cycles. The large language model gradually learns to generate the final solution to the power system requirements, thereby continuously improving the intelligence level of the power system code intelligent delivery system.

[0012] Step 4: Build an automated script execution module, collect algorithm templates and related parameters commonly used in programming languages ​​in power systems, describe the automated script execution module in a standardized manner, store it in a structured script library template, organize the script library template in a hierarchical manner, and use the large language model to quickly find and call the corresponding script template in the script library through semantic matching based on user input, and convert the call instruction into an instruction executable by the development environment, pass it to the development environment, and the development environment executes the instruction to generate the execution status and operation results;

[0013] Step 5: Build a dynamic learning mechanism, feed back the execution status and operation results generated in step 4 to the dynamic learning mechanism, and feed back the user interaction content to the dynamic learning mechanism. The dynamic learning mechanism processes and analyzes it, deconstructs it into knowledge items and script cases, and passes it to the knowledge base and script library, continuously optimizing the knowledge base and script library to further optimize the large language model.

[0014] In the above technical solution, in step 1, the power system packaging code related data includes multi-field and multi-language power system theoretical knowledge of power system principles and control theories; actual cases of internal combustion power systems and power system intelligent control; and user manuals, API documents and installation guides for power systems written by professional engineers.

[0015] In the above technical solution, in step 2, structured knowledge is used to construct a knowledge graph, and the graph database Neo4j is used to summarize the entities, the relationships between entities and their attributes in the knowledge graph, wherein each entity node represents a concept or object, and the relationships between entities are represented by edges, so that the knowledge graph can not only express the static relationship between entities, but also perform complex multi-hop reasoning through a graph query language, thereby enhancing the understanding ability of the large language model when generating answers.

[0016] In the above technical solution, in step 2, the text of unstructured knowledge is split into blocks and embedded, and information extraction technology is introduced to extract valuable entities and relationships between entities from the text, which are summarized using the HDFS graph database.

[0017] In the above technical solution, in step 3, the scenario is answering questions, code debugging and optimization scenario.

[0018] In the above technical solution, in step 3, the solution is code debugging suggestions, environment configuration guidance and error repair solutions.

[0019] In the above technical solution, in step 4, in the power system, the commonly used algorithm template is proportional integral derivative control (PID), active disturbance rejection control (ADRC) or model predictive control (MPC).

[0020] In the above technical solution, in step 4, the programming language is C, C++ and Python.

[0021] In the above technical solution, in step 4, an automated code optimization function is introduced into the power system code intelligent delivery system, and the system further optimizes the scripts generated by the script library according to the requirements of different development environments or configurations.

[0022] In the above technical solution, in step 4, the execution instruction adapts to the specific format of the development environment and adapts to the operating conditions of the target environment, and the operating conditions are the operating system, dependent libraries and hardware architecture.

[0023] Another aspect of the present invention also includes a power system code intelligent delivery system constructed by the above construction method.

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

[0025] 1. The present invention constructs a power system code intelligent delivery system based on a large language model, which involves knowledge collection in the power system control field, FiD, professional field fine-tuning and automated script execution. The power system code intelligent delivery system of the present invention significantly improves the efficiency and quality of code delivery through functions such as multimodal data processing and automated script execution. Compared with traditional document review methods, the power system code intelligent delivery system can integrate a wide range of cross-domain knowledge (such as theoretical knowledge, experiential knowledge, historical cases) through the FiD framework, thereby providing more comprehensive support in the code delivery process. This enables the power system code intelligent delivery system of the present invention to not only provide theoretical guidance, but also integrate engineers' experience and best practices. The intelligent agent can refer to these experiences when dealing with problems, so as to quickly find efficient solutions and improve the efficiency of power system code delivery.

[0026] 2. The present invention uses multimodal input of text, pictures, and code snippets, so that users can interact with the agent through natural language to obtain the required code support and services, reducing the need for manual document review and the probability of human error. The automated script execution function eliminates the need for users to manually write complex test scripts, reducing the error rate of manual writing. By automatically generating test scripts and other auxiliary codes, the workload of manual code writing can be reduced, and the consistency and maintainability of the code can be improved. The dynamic learning mechanism ensures that when problems arise during code execution, the agent can make timely adjustments and optimizations, further improving the stability of the code.

[0027] 3. The proposed power system code intelligent delivery system based on a large language model has significant advantages. While improving development efficiency, it also enhances code quality and system maintainability. By comprehensively processing multimodal information, the intelligent agent can provide comprehensive technical support, reduce the need for manual intervention, and ensure that the code delivery process is more efficient and accurate. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1 It is a structural schematic diagram of the power system code intelligent delivery system 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 code intelligent delivery system based on a large language model, comprising the following steps

[0031] Step 1, data collection and preprocessing: Collect multimodal data related to the power system packaging code, preprocess the collected multimodal data to obtain a knowledge base; the power system packaging code related data includes multi-field and multi-language power system theoretical knowledge such as power system principles and control theories; actual cases of internal combustion power systems and power system intelligent control; and user manuals, API documents, and installation guides for power systems written by professional engineers.

[0032] Step 2: Divide the knowledge base into structured knowledge including database records, API parameters and table data, and unstructured knowledge including long documents, technical descriptions and debug logs. Use structured knowledge to build a knowledge graph, and use the graph database Neo4j to summarize the entities, relationships between entities and their attributes in the knowledge graph. For unstructured knowledge, split its text into blocks and embed them. Introduce information extraction technology to extract valuable entities and relationships between entities from the text, and use the HDFS graph database to summarize. The summarized structured knowledge and unstructured knowledge embedding vectors are stored in a unified vectorized database. The FiD framework retrieves the vector of the knowledge item in the vectorized database as input and passes it to the decoder of the FiD framework. The decoder decodes it into knowledge and scripts. According to the questions or needs entered by the user and the retrieved knowledge and scripts, the prompt word generator generates prompt words, and the large language model generates multiple preliminary solutions according to different scenarios of the prompt words, among which knowledge: explanations, application cases, etc., scripts: code to implement specific functions, and the solution includes direct answers based on documents and merging multiple information blocks into logical and coherent answers.

[0033] Step 3, Monte Carlo policy gradient algorithm (REINFORCE) fine-tunes the large language model: In the power system code intelligent delivery system, users provide feedback on the effectiveness of the solution in step 2 and give positive or negative reward signals. The Monte Carlo policy gradient algorithm evaluates the performance of the initially generated solution by accumulating reward signals from multiple scenarios (answering user questions, code debugging and optimization, etc.), and updates the weights of the large language model through policy gradients to make the generated future solutions more in line with user needs. The weights of the large language model are continuously adjusted through back propagation, and training is repeated in preset cycles. The large language model gradually learns to generate the final solution to the power system requirements, thereby continuously improving the intelligence level of the power system code intelligent delivery system.

[0034] Step 4, build an automated script execution module, collect algorithm templates and related parameters commonly used in programming languages ​​(C, C++ and Python) in power systems, standardize the description of the automated script execution module, store it in a structured script library template, organize the script library template in a hierarchical manner, and use the large language model to quickly find and call the corresponding script template in the script library through semantic matching based on user input, and convert the call instructions into executable instructions for the development environment, and pass them to the development environment. The development environment adapts to the specific format of the development environment, and at the same time adapts to the execution instructions of the operating conditions of the target environment (operating system, dependent library and hardware architecture), and generates execution status and operating results. In order to ensure the efficiency and operability of script generation, an automated code optimization function is introduced in the power system code intelligent delivery system. The system further optimizes the generated scripts according to the requirements of different development environments or configurations.

[0035] Step 5: Build a dynamic learning mechanism and feed back the execution status or results generated in step 4 to the dynamic learning mechanism. Specifically, when the user uses the system to obtain technical support, the system will record each user interaction and collect each generated execution status or result, including but not limited to generated code snippets, test scripts, environment configuration information, etc. The dynamic learning mechanism will process and analyze these feedback data. At the same time, the dynamic learning mechanism processes the content of user interactions, deconstructs them into knowledge items and script cases, and passes them to the knowledge base and script library, continuously optimizing the content of the knowledge base and script library in order to further optimize the large language model. This process ensures that the system can continuously improve the generation capability and response accuracy of the large language model according to the actual needs and usage of users, thereby improving the overall reliability and user experience.

[0036] Example 2

[0037] This embodiment provides a power system code intelligent delivery system constructed by the construction method described in Embodiment 1.

[0038] 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 code intelligent delivery system based on a large language model, characterized in that: The following steps are included Step 1, data collection and preprocessing: collect multimodal data related to the power system packaging code, preprocess the collected multimodal data to obtain a knowledge base; Step 2: divide the knowledge base into structured knowledge and unstructured knowledge, summarize them, and store the summarized structured knowledge and unstructured knowledge embedding vectors in a unified vectorized database; The FiD framework retrieves the vector of the knowledge item from the vectorized database as input and passes it to the decoder of the FiD framework, which decodes it into knowledge and scripts. The prompt word generator generates prompt words based on the questions or requirements input by the user and the retrieved knowledge and scripts, and the large language model generates multiple preliminary solutions based on different scenarios of the prompt words. Step 3: Monte Carlo policy gradient algorithm (REINFORCE) fine-tunes the large language model: In the power system code intelligent delivery system, users provide feedback on the effectiveness of the solution in step 2 and give positive or negative reward signals. The Monte Carlo policy gradient algorithm evaluates the performance of the initially generated solution by accumulating reward signals from multiple scenarios, and updates the weights of the large language model through policy gradients to make the generated future solutions more in line with user needs. The weights of the large language model are continuously adjusted through back propagation, and training is repeated in preset cycles. The large language model gradually learns to generate the final solution for the power system requirements, so that the intelligence level of the power system code intelligent delivery system is continuously improved. Step 4: Build an automated script execution module, collect algorithm templates and related parameters commonly used in programming languages ​​in power systems, describe the automated script execution module in a standardized manner, store it in a structured script library template, organize the script library template in a hierarchical manner, and use the large language model to quickly find and call the corresponding script template in the script library through semantic matching based on user input, and convert the call instruction into an instruction executable by the development environment, pass it to the development environment, and the development environment executes the instruction to generate the execution status and operation results; Step 5: Build a dynamic learning mechanism, feed back the execution status and operation results generated in step 4 to the dynamic learning mechanism, and feed back the user interaction content to the dynamic learning mechanism. The dynamic learning mechanism processes and analyzes it, deconstructs it into knowledge items and script cases, and passes it to the knowledge base and script library, continuously optimizing the knowledge base and script library to further optimize the large language model.

2. The construction method according to claim 1, characterized in that: In step 1, the power system packaging code related data includes power system theoretical knowledge in multiple fields and languages, including power system principles and control theories; actual cases of internal combustion power systems and power system intelligent control; and user manuals, API documents and installation guides for power systems written by professional engineers.

3. The construction method according to claim 1, characterized in that: In step 2, structured knowledge is used to construct a knowledge graph, and the graph database Neo4j is used to summarize the entities, the relationships between entities, and their attributes in the knowledge graph, wherein each entity node represents a concept or object, and the relationships between entities are represented by edges, so that the knowledge graph can not only express the static relationships between entities, but also perform complex multi-hop reasoning through a graph query language, thereby enhancing the understanding ability of the large language model when generating answers.

4. The construction method according to claim 1, characterized in that: In step 2, the text of unstructured knowledge is split into blocks and embedded, and information extraction technology is introduced to extract valuable entities and relationships between entities from the text, which are summarized using the HDFS graph database.

5. The construction method according to claim 1, characterized in that: In step 3, the scenarios are answering questions, code debugging and optimization scenarios; the solutions are code debugging suggestions, environment configuration guidance and error repair solutions.

6. The construction method according to claim 1, characterized in that: In the step 4, in the power system, the commonly used algorithm template is proportional integral derivative control (PID), active disturbance rejection control (ADRC) or model predictive control (MPC).

7. The construction method according to claim 1, characterized in that: In step 4, the programming languages ​​are C, C++ and Python.

8. The construction method according to claim 1, characterized in that: In step 4, an automated code optimization function is introduced into the power system code intelligent delivery system, and the system further optimizes the scripts generated by the script library according to the requirements of different development environments or configurations.

9. The construction method according to claim 1, characterized in that: In step 4, the execution instruction adapts to the specific format of the development environment and the operating conditions of the target environment, wherein the operating conditions are the operating system, dependent libraries and hardware architecture.

10. A power system code intelligent delivery system constructed by the construction method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Project optimization problem rapid modeling method and system based on large language model

    CN118151910A

  • Rich text code review method and system based on large language model and medium

    CN118152287A

  • Code generation model fine tuning method and device based on clustering and natural language strategy optimization algorithm

    CN118468982A

  • Machine Learning-Assisted Code Generation in Directed Acyclic Graph-Driven Notebook Environment

    US20240256228A1

  • Method, System, and Computer Program Product for Code Generation Using LLMs

    US20240281600A1

Cited By

  • Three-dimensional industrial model construction method and system based on large language model

    CN120541898A