Power grid intelligent agent self-adaptive optimization system and method based on large model driving
The large-model-driven adaptive optimization system for power grid intelligent agents solves the problems of insufficient understanding of complex states and multi-source data fusion in power grid operation and maintenance, realizes efficient fault diagnosis and automated decision-making, and improves the intelligence level and reliability of power grid operation and maintenance.
Patent Information
- Application Number
- CN202610787753.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-03
- Publication Date
- 2026-07-03
AI Technical Summary
Existing power grid operation and maintenance technologies lack a deep understanding of complex states, struggle to process unstructured data, lack adaptive learning mechanisms in decision-making systems, have difficulty effectively integrating multi-source heterogeneous data, and employ a single human-computer interaction method, lacking multimodal capabilities.
The power grid intelligent agent adaptive optimization system, driven by a large model, constructs a domain knowledge graph and vector retrieval index, combines a large language model for fault diagnosis and decision optimization, and supports multimodal interaction and human feedback reinforcement learning to achieve self-optimization of the system.
It improved the accuracy of fault diagnosis, increased the efficiency of automated decision-making, lowered the threshold for system use, enhanced the human-machine interaction experience in complex sites, and ensured the reliability and continuous self-improvement capabilities of power grid operation and maintenance.
Smart Images

Figure CN122334622A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent operation and maintenance technology for power systems, and in particular to an adaptive optimization system and method for power grid intelligent agents based on large model-driven architecture. Background Technology
[0002] With the continuous expansion of power system scale and the increasing complexity of network topology, the number of power grid equipment is growing exponentially. The intertwining of massive amounts of real-time operational data with multi-source, heterogeneous equipment ledgers and maintenance logs poses unprecedented challenges to traditional power grid operation and maintenance management models. In the complex power grid operating environment, maintenance personnel need to quickly sift through massive transient alarms to extract invalid information, accurately pinpoint the source of the fault, and formulate safe handling strategies that minimize the scope of power outages. This places extremely high demands on the intelligent data processing capabilities of the operation and maintenance system, the depth of integration of professional knowledge, and the efficiency of auxiliary decision-making in complex scenarios.
[0003] However, existing power grid operation and maintenance technologies have shortcomings: traditional monitoring relies on fixed rules and thresholds, lacking a deep understanding of complex states; existing diagnostic methods are difficult to process unstructured data and knowledge updates are difficult; decision-making systems lack adaptive learning mechanisms; fragmented knowledge base management makes it difficult to effectively integrate multi-source heterogeneous data; and human-computer interaction methods are limited, lacking the multimodal capabilities to meet complex on-site guidance needs. Summary of the Invention
[0004] To overcome the above shortcomings, this invention provides a power grid intelligent agent adaptive optimization system and method based on a large model, aiming to improve the problems of weak cognitive ability and lack of adaptive decision-making in existing systems.
[0005] In a first aspect, the present invention provides the following technical solution: an adaptive optimization method for power grid intelligent agents based on a large model, comprising: S1. Clean and structure the acquired power grid operation data and multi-source text data, construct a domain knowledge graph of related equipment, faults and handling, and vectorize the multi-source text data to construct a vector retrieval index. S2. Use power domain corpus to fine-tune the pre-trained large language model according to domain and instruction, and deploy the fine-tuned large language model to the inference server after quantization and compression. S3. Monitor the power grid operation data stream and generate a status summary. When an abnormal data stream is detected, extract the fault feature vector and retrieve similar historical cases. Call the large language model to infer the cause of the fault and generate a diagnostic report. Evaluate the handling strategy based on the diagnostic report and output the recommended solution. S4. Convert the query request into a query vector, retrieve the relevant multi-source text data based on the vector retrieval index, reorder and filter it as context input to the large language model, and generate a response answer that integrates the retrieval content. S5. Recognize input modalities containing text, images, or speech, perform multimodal fusion, invoke a preset agent to process tasks associated with the input modality, and generate corresponding modal response results; S6. Analyze the decision execution results from interactive feedback and operation logs, update the parameters of the large language model based on the human feedback reinforcement learning mechanism, and extract new knowledge to update the vector retrieval index.
[0006] Preferably, step S1, the step of constructing a domain knowledge graph of associated devices, faults, and handling, includes: Extract structured triples containing equipment entities, fault attributes, and handling procedures from multi-source text data; Semantic associations and topological mappings of structured triples are established based on the power system ontology model and stored in a graph database; Large language models are used to disambiguate and align heterogeneous data entities, and the domain knowledge graph is dynamically updated.
[0007] Preferably, step S2, the step of fine-tuning the pre-trained large language model according to its domain and instructions, includes: Using basic knowledge of power grids and accident reports, unsupervised domain-adaptive training is performed on a pre-trained large language model; By injecting scheduling and operation instruction sets through adapters, the pre-trained large language model is fine-tuned to improve task understanding capabilities. The large language model, after fine-tuning the instructions, is subjected to quantization, pruning, and knowledge distillation, and the output is a large language model deployed to the inference server.
[0008] Preferably, step S3, the step of extracting the fault feature vector, includes: Monitor the power grid operation data stream, which includes alarm and protection signals and waveform recording data, and convert it into a spatiotemporal semantic description; Key fault attributes are extracted using a large language model, and high-dimensional feature vectors are generated by combining power grid topology and equipment parameters. The high-dimensional feature vectors are matched with historical cases, and a large language model is invoked for inference to locate the specific fault location.
[0009] Preferably, step S3, the step of evaluating the treatment strategy, includes: Based on the diagnostic report, an initial set of candidate solutions is generated, which includes load scheduling, isolation, and maintenance recommendations. The initial set of candidate response plans is simulated and rehearsed using a reinforcement learning model to predict the stability and risk level of the power grid. Based on the prediction results, the initial set of candidate treatment plans is sorted, a semantic explanation of the target recommended plan is generated, and the diagnostic confidence score is calculated simultaneously.
[0010] Preferably, step S4, which involves retrieving, reordering, and filtering relevant multi-source text data based on a vector retrieval index, includes: A large language model is used to identify the intent of natural language query requests and convert them into standardized query vectors. Dense vector matching, BM25 sparse search, and graph path search are performed in parallel in the vector database to obtain preliminary search results from multiple paths. Perform a hybrid re-ranking of the preliminary search results from multiple sources, and select the top-ranked document fragments as enhanced context.
[0011] Preferably, step S5, the step of performing multimodal fusion, includes: Visual features are extracted from the input device nameplate or infrared image and converted into visual codes aligned with the text. The voice commands are collected, executed, and converted into text. The text is then fused with visual encoding and text queries across modal tensors to obtain multimodal features. Based on multimodal features, a pre-defined intelligent agent is invoked to process the data and generate modal response results that include analytical charts and voice prompts.
[0012] Preferably, step S6, which involves updating the parameters of the large language model and extracting new knowledge to update the vector retrieval index, includes: Collect user adoption behavior and preference evaluation of the generated scheme to construct a sample set, and use the proximal policy optimization algorithm to update the policy network parameters of the large language model online; Analyze new fault handling records in the operation log, automatically extract new equipment fault association rules, vectorize and encode them, and incrementally write them into the vector retrieval index; A federated learning model is adopted to synchronize updated data of multiple regional power grids under the condition of protecting privacy, and the system accuracy index is monitored to verify the closed-loop optimization performance.
[0013] Secondly, this invention provides the following technical solution: a large-model-driven adaptive optimization system for power grid agents, comprising: The data preprocessing and knowledge construction module is used to clean the acquired runtime data and multi-source text data to construct a domain knowledge graph, and to encode the multi-source text data to construct a vector retrieval index; The large model-driven module is used to obtain a pre-trained large language model that has been fine-tuned with power corpus, and then deploy the large language model after knowledge adaptation and quantization compression. The power grid cognitive intelligent agent module is used to parse operating data and alarms to generate status summaries, extract features to retrieve historical cases to deduce fault causes, and combine reinforcement learning to generate maintenance and scheduling decisions. The retrieval enhancement generation module is used to convert queries into query vectors, perform hybrid retrieval and reordering based on vector retrieval indexes, and filter documents as context input to generate responses from the large language model. The multimodal interaction module is used to integrate text, image, or voice input modalities, call the power grid cognitive agent module to process tasks, and output visualized response results; The adaptive optimization module is used to update the parameters of the large language model through reinforcement learning based on human feedback, based on interaction and execution logs, and to extract new rules to update the vector retrieval index.
[0014] The present invention has the following beneficial effects: 1. In this invention, a large language model and a multi-agent architecture are deeply integrated into power grid operation and maintenance, breaking through the limitations of traditional rule systems. Through the collaborative cooperation of intelligent agents for operation understanding, fault diagnosis and decision optimization, the intelligent cognition of complex power grid states and the efficient decomposition of complex tasks are realized, thereby improving the accuracy of fault diagnosis and the efficiency of automated decision-making.
[0015] 2. In this invention, a retrieval enhancement generation mechanism and a multimodal interaction system are constructed, which organically combine the retrieval of massive power grid professional knowledge with the ability to generate large models to ensure the accuracy of the answers, and support cross-modal fusion processing of text, image and voice information, thereby reducing the threshold for system use and improving the human-computer interaction experience in complex field scenarios.
[0016] 3. In this invention, an adaptive optimization mechanism based on human feedback reinforcement learning is proposed. By collecting system operation logs and human interaction feedback, the model parameters are updated online, and new fault rules are automatically extracted to incrementally update the vector retrieval index. This gives the system the ability to continuously improve itself as operating experience accumulates, effectively ensuring the reliability of long-term power grid operation and maintenance. Attached Figure Description
[0017] Figure 1 This is a flowchart of a large model-driven adaptive optimization method for power grid agents proposed in this invention. Figure 2 This is an architecture diagram of a power grid intelligent agent adaptive optimization system based on a large model driven by the present invention. Detailed Implementation
[0018] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0019] Example 1 In a first embodiment of the present invention, the present invention provides a large model-driven adaptive optimization method for power grid agents, such as... Figure 1 As shown, it includes: S1. Clean and structure the acquired power grid operation data and multi-source text data, construct a domain knowledge graph of related equipment, faults and handling, and vectorize the multi-source text data to construct a vector retrieval index. Furthermore, step S1, the step of constructing a domain knowledge graph of associated devices, faults, and handling, includes: Extract structured triples containing equipment entities, fault attributes, and handling procedures from multi-source text data; Semantic associations and topological mappings of structured triples are established based on the power system ontology model and stored in a graph database; Large language models are used to disambiguate and align heterogeneous data entities, and the domain knowledge graph is dynamically updated.
[0020] Specifically, the process involves acquiring multi-source heterogeneous data, including historical power grid operation data, fault records, equipment archives, and operation and maintenance procedures. The operational data is then cleaned, standardized, and structured, outliers are filtered, and time series alignment is performed. The multi-source text data is segmented, stop words are removed, and the data is standardized to transform it into a structured text sequence that is easy for the algorithm to process.
[0021] Structured triples containing equipment entity fault attributes and handling procedures are extracted from processed multi-source text data. A deep learning information extraction algorithm is used for semantic feature encoding and joint decoding of the text sequence. Specifically, this algorithm employs a bidirectional long short-term memory network combined with a conditional random field architecture, with two hidden layers, each containing 256 hidden units to capture the bidirectional semantic dependencies of the power text. Let the input text sequence be X, the extracted entity set be E, and the relation set be R. The joint extraction process is represented by solving for the entity and relation combination with the highest conditional probability, and its calculation formula is as follows: ; In the formula The input is a natural language sequence containing descriptions of power grid faults. This refers to the extracted set of power equipment and state entities, such as transformers or circuit breakers. For the first A specific extracted entity node, It is a set of relationships between entities. Leading entity With tail entity The actions triggered or the causal relationship between them. In this scheme, the input text sequence The preferred length is 512 characters, and the extracted entity set Size Preferably, there are 5 to 15 relation sets. Size Preferably, there are 3 to 10. This calculation process transforms unstructured text into machine-readable subject-verb-object triplet structured data.
[0022] Based on a pre-defined power system ontology model, the semantic associations and topological mappings of the aforementioned structured triples are established and stored in a graph database. The power system ontology model is a standard data schema for constructing the graph database. It pre-defines the entity categories and corresponding operating status attributes of power equipment such as transformers, circuit breakers, and busbars, and standardizes the topological structure of relationships such as physical connections, control triggers, and logical dependencies between entity categories. The extracted triple data is aligned according to the standard hierarchical architecture defined by the ontology model to form a mesh topology. In the graph database, nodes represent power grid equipment and operating states, and edges represent physical connections or logical evolution paths between nodes, thereby constructing a semantic network for underlying equipment fault handling.
[0023] A pre-trained large language model is used to disambiguate and align heterogeneous data entities in the knowledge graph to dynamically update the domain knowledge graph. The local subgraph structure and text description of the entity to be fused are extracted and input into the large language model to generate high-dimensional feature vectors. The cosine similarity of the feature vectors of the entity to be fused and existing entities in the knowledge graph is calculated to complete entity normalization. The feature similarity calculation formula is as follows: ; In the formula The feature vectors of the power grid equipment entities to be aligned are output by the large language model. These are the feature vectors of standard electric entities that already exist in the graph. This represents the semantic similarity value between the two. In this scheme, the feature vector... and The preferred dimension is 768, with a preset judgment threshold. The preferred value is 0.92. When this similarity value is greater than the preset judgment threshold, the two are identified as synonymous entities and the nodes are merged to eliminate the phenomenon of synonymy with different names and ensure the consistency of the map data.
[0024] The cleaned multi-source text data is vectorized and encoded to construct a vector retrieval index. A text embedding encoder is used to perform deep semantic encoding on text paragraphs of power grid operation and maintenance procedures and historical fault cases. This encoder specifically employs a deep neural network structure with four fully connected hidden layers, each containing 768 neurons, outputting dense vectors of fixed dimensions. The generated dense vectors and their corresponding original text metadata are imported into a vector database to establish a hierarchical navigable small-world graph index, completing the vectorized underlying storage of power grid text knowledge.
[0025] This step enables the structured transformation and high-dimensional feature extraction of multi-source power grid operation and maintenance data, providing a solid data foundation for subsequent accurate causal reasoning and efficient semantic retrieval by intelligent agents.
[0026] S2. Use power domain corpus to fine-tune the pre-trained large language model according to domain and instruction, and deploy the fine-tuned large language model to the inference server after quantization and compression. Furthermore, step S2, which involves fine-tuning the pre-trained large language model according to its domain and instructions, includes: Using basic knowledge of power grids and accident reports, unsupervised domain-adaptive training is performed on a pre-trained large language model; By injecting scheduling and operation instruction sets through adapters, the pre-trained large language model is fine-tuned to improve task understanding capabilities. The large language model, after fine-tuning the instructions, is subjected to quantization, pruning, and knowledge distillation, and the output is a large language model deployed to the inference server.
[0027] Specifically, a pre-trained large language model based on the Transformer architecture was acquired, and basic power grid knowledge texts and historical accident analysis reports were collected to construct a specialized corpus for the power sector. The selected pre-trained large language model had a parameter size of at least 7 bytes. This large language model was configured with 32 Transformer decoder layers, each containing 32 attention heads, and a hidden layer dimension of 4096. An unsupervised, domain-adaptive training was performed on this pre-trained large language model using the objective function of an autoregressive language model. Let the word sequence of the power sector corpus be... The training objective is to minimize the negative log-likelihood loss. The calculation formula is as follows: ; In the formula This indicates the current forecast using technical terms related to the power grid, such as transformer or short circuit. to For historical context word sequence, This represents the original parameters of the large language model. In this scheme, the length of the lexical sequence... The optimal value is 2048, with negative log-likelihood loss. The preferred convergence target value is 1.5.
[0028] The above calculations enable the model to fully learn and fit the implicit statistical distribution characteristics of power system terminology and basic theories.
[0029] We collect power grid dispatching specifications and equipment operation and maintenance procedures to construct a question-and-answer pair format instruction dataset, and inject a low-rank adapter into the self-attention network layer of a large language model to perform instruction fine-tuning. Let the pre-trained weight matrix of a specific attention layer be... The weight update during the fine-tuning process is constrained to be the product of two low-rank matrices A and B. (Special identifier) The mathematical notation for a real matrix is denoted by , indicating that all elements of the matrix are real numbers. For the input power grid dispatch command feature vector x, the formula for calculating the forward propagation output h after injection into the low-rank adapter is as follows: ; In the formula During training, it remains frozen and does not participate in gradient updates. and For a trainable low-rank parameter matrix, much smaller and rank-dimensional scalar, This is the scaling factor. In this scheme, the input dimension... With output dimension The preferred value is 4096, a low-rank dimensional scalar. Preferably 16, scale scaling factor The optimal value is 32. This calculation process, while avoiding catastrophic forgetting, maps and encodes the complex scheduling and maintenance instruction execution logic into a low-rank parameter space, thereby improving the large language model's ability to accurately understand the intent of power grid professional tasks.
[0030] The fine-tuned large language model is set as a knowledge-rich teacher model, and a smaller student model is initialized. This student model adopts a pruned Transformer architecture, specifically containing 6 hidden layers, each configured with 8 attention heads. Knowledge distillation techniques combined with pruning and quantization algorithms are used to significantly compress the model size. During the distillation calculation phase, the student model is forced to simulate the teacher model in processing the same power grid business query. Logical output distribution at time. Knowledge distillation loss function. The calculation formula is as follows: ; In the formula It is the global vocabulary set for a large language model. For teacher models to diagnose specific power grid faults The generated target reference probability distribution The corresponding predicted probability distribution generated for the student model. In this scheme, the global vocabulary set... The preferred size is 65536, for business queries. The maximum sequence length is preferably 1024, and the knowledge distillation loss is... The preferred convergence threshold is 0.05. After completing the distillation training, the absolute values of the connection weights in the student model are calculated and redundant connections below the set threshold are pruned. Furthermore, a quantization algorithm is used to compress the high-precision floating-point parameters into low-bit integer values. Finally, the processed lightweight large language model is deployed to the edge inference server of the power monitoring center.
[0031] This step significantly reduces the system's memory usage and inference response latency while fully preserving the model's electrical expertise and logical reasoning capabilities.
[0032] S3. Monitor the power grid operation data stream and generate a status summary. When an abnormal data stream is detected, extract the fault feature vector and retrieve similar historical cases. Call the large language model to infer the cause of the fault and generate a diagnostic report. Evaluate the handling strategy based on the diagnostic report and output a recommended solution. Further, step S3, the step of extracting the fault feature vector, includes: Monitor the power grid operation data stream, which includes alarm and protection signals and waveform recording data, and convert it into a spatiotemporal semantic description; Key fault attributes are extracted using a large language model, and high-dimensional feature vectors are generated by combining power grid topology and equipment parameters. The high-dimensional feature vectors are matched with historical cases, and a large language model is invoked for inference to locate the specific fault location.
[0033] Furthermore, step S3, the step of evaluating the treatment strategy, includes: Based on the diagnostic report, an initial set of candidate solutions is generated, which includes load scheduling, isolation, and maintenance recommendations. The initial set of candidate response plans is simulated and rehearsed using a reinforcement learning model to predict the stability and risk level of the power grid. Based on the prediction results, the initial set of candidate treatment plans is sorted, a semantic explanation of the target recommended plan is generated, and the diagnostic confidence score is calculated simultaneously.
[0034] Specifically, the system accesses and monitors the power grid operation data stream in real time, which includes telemetry over-limit alarms, relay protection device action signals, and fault recording data. When abnormal changes such as current and voltage over-limits or circuit breaker displacements are detected, the status recording mechanism is triggered to transform the multi-source heterogeneous abnormal data stream into structured spatiotemporal semantic description text according to the time sequence and equipment spatial location.
[0035] The spatiotemporal semantic description text is input into a large language model to extract fault attribute features including fault type, phase, and duration. The extracted fault attribute features are encoded into text vectors and combined with the power grid topology connections and real-time operating parameters of transformers or lines to construct a power grid subgraph model. A graph convolutional neural network (GCNN) is used to aggregate features from the power grid subgraph to generate high-dimensional feature vectors. This GCNN is specifically configured with two graph convolutional hidden layers, each with a width of 128. The node feature update calculation formula is as follows: ; In the formula The adjacency matrix of the physical topology of a power grid including self-connections represents the physical connection relationship between buses and lines. Let be the degree matrix of this adjacency matrix. For the first The hidden state matrix of each power device node in the layered network, and its initial input It includes fault attribute text vectors output by a large language model and real-time telemetry parameters of the equipment. This is the trainable weight matrix for the current layer. It is a non-linear activation function. This is a high-dimensional feature vector output after aggregating the topological and attribute information of neighboring nodes. In this scheme, the hidden state matrix... and The preferred feature dimension is 128, and the weight matrix is... The preferred size Nonlinear activation function The ReLU function is preferred.
[0036] The cosine similarity between the high-dimensional feature vector and the feature vector of historical failure cases is calculated in the vector retrieval index to extract the top-ranked similar historical cases. The current spatiotemporal semantic description of the anomaly and the extracted historical cases are then used as context words to input into the large language model, driving the large language model to perform deep reasoning, gradually investigate the anomaly propagation path, locate the specific faulty device node, and generate a diagnostic report containing fault tracing logic.
[0037] Based on the generated diagnostic report, a decision optimization agent is invoked to generate a candidate set of multiple initial handling schemes, including load transfer path scheduling, physical isolation of fault areas, and equipment maintenance procedure suggestions. Each initial handling scheme is input into a reinforcement learning pre-simulation environment for action sequence simulation. The execution evaluation network employs a deep neural network with three fully connected layers, each containing 128 neurons. In the Markov decision process, the state is defined as the current power flow distribution, and the action is the switching control command from the candidate schemes. The comprehensive impact of each action on power grid stability and risk level is evaluated using a reward function, the formula for which is as follows: ; In the formula This represents the current operating status of the power grid. For the isolation or scheduling actions to be performed, This represents the increase in the voltage margin of all nodes in the network after the action is executed. The system network overhead caused by scheduling. This is the probability assessment value for the risk of equipment overload operation due to operation. , and These are the corresponding weight coefficients. The immediate, quantified reward value obtained by performing this action. In this scheme, the weighting coefficient... The preferred value is 0.5. The preferred value is 0.3. The preferred value is 0.2, which represents the voltage margin increase. The preferred reference baseline is 0.05 pu, which reduces the probability of overload operation. The penalty threshold is preferably 0.15.
[0038] The expected total reward value of each candidate solution's simulated execution is summed, and the initial set of candidate solutions is sorted from highest to lowest score. The solution with the highest total reward is selected as the target recommendation solution, and the mathematical evaluation result corresponding to this solution is translated into a semantic explanation in natural language format using a large language model. Simultaneously, the prediction confidence of the large language model when outputting the diagnostic report is extracted, and combined with the maximum matching score of similar cases, a weighted calculation is performed to generate a diagnostic confidence score, which is then output together.
[0039] This step enables the mapping from massive transient alarm data to precise fault location and automated handling decisions, improving the accuracy of power grid emergency response and operational safety.
[0040] S4. Convert the query request into a query vector, retrieve the relevant multi-source text data based on the vector retrieval index, reorder and filter it as context input to the large language model, and generate a response answer that integrates the retrieval content. Furthermore, step S4, which involves retrieving, reordering, and filtering relevant multi-source text data based on the vector retrieval index, includes: A large language model is used to identify the intent of natural language query requests and convert them into standardized query vectors. Dense vector matching, BM25 sparse search, and graph path search are performed in parallel in the vector database to obtain preliminary search results from multiple paths. Perform a hybrid re-ranking of the preliminary search results from multiple sources, and select the top-ranked document fragments as enhanced context.
[0041] Specifically, the system receives natural language query requests from users, performs intent recognition on the query text using a large language model, extracts intent entities such as power grid equipment names and fault characteristics, and transforms them into standardized retrieval expressions. A text feature embedding model is then used to deeply encode the standardized retrieval expressions. This embedding model employs a 12-layer Transformer encoder structure with residual connections, each layer containing 12 attention heads, and an output dimension of 768, generating a fixed-dimensional high-dimensional standardized query vector.
[0042] Three search engines are launched in parallel in the vector database to perform searches on the standardized query vectors and obtain preliminary search results. In the dense search branch, the cosine similarity algorithm is used to calculate the semantic distance between the standardized query vector and the vectors of power grid equipment manuals and regulations in the database. The calculation formula is as follows: ; In the formula, q is a standardized query vector containing the intent to query power grid faults. For the pre-vectorized storage of the i-th power grid regulation or equipment manual document fragment vector, The dense retrieval score represents the semantic similarity between the two. In this scheme, the standardized query vector q and the document fragment vector... The optimal dimension is 768, resulting in a dense retrieval score. The preferred threshold for matching is 0.80. In the sparse retrieval branch, the keyword matching degree between the query intent and historical fault cases is calculated based on the term frequency inverse document frequency algorithm, and the sparse retrieval score is output. In the graph path retrieval branch, the path distance from the query entity to the associated node of the target treatment plan is calculated based on the graph node connectivity, and the graph path score is output.
[0043] The preliminary search results returned by the three branches above are normalized in terms of score, and a hybrid re-ranking calculation is performed to integrate multi-dimensional search features. The weighted calculation formula is as follows: ; In the formula This is the sparse retrieval score calculated based on keyword matching degree. The graph path score is calculated based on the device entity association relationship. to These are the density / sparseness and graph feature weight values preset according to different power grid retrieval scenarios. This is the overall relevance score of the document after fusing the three features. In this scheme, the weight value of the dense feature is... The preferred value is 0.5, which is the sparse feature weight value. The preferred value is 0.3, which is the weight value of the spectral features. The preferred value is 0.2.
[0044] Based on the comprehensive relevance score of the documents, the document fragments in the initial search results are sorted in descending order, and the top-ranked pre-set number of procedure document fragments and fault cases are selected. The selected multi-source text data fragments are then used as fact-enhanced context input to the large language model, driving the large language model to combine the enhanced context with the original query request to generate a logically rigorous response answer.
[0045] This step achieves deep integration of external power knowledge base with the internal reasoning capabilities of the large language model, significantly reducing the probability of factual errors in the model output and improving the accuracy of the solution.
[0046] S5. Recognize input modalities containing text, images, or speech, perform multimodal fusion, invoke a preset agent to process tasks associated with the input modality, and generate corresponding modal response results; Furthermore, step S5, the step of performing multimodal fusion, includes: Visual features are extracted from the input device nameplate or infrared image and converted into visual codes aligned with the text. The voice commands are collected, executed, and converted into text. The text is then fused with visual encoding and text queries across modal tensors to obtain multimodal features. Based on multimodal features, a pre-defined intelligent agent is invoked to process the data and generate modal response results that include analytical charts and voice prompts.
[0047] Specifically, the system receives multimodal input data uploaded by the maintenance terminal, including an infrared thermal image of the equipment nameplate and voice commands from on-site maintenance personnel. The input equipment nameplate or infrared image is preprocessed to extract the target equipment area, which is then input into a visual feature extraction network. This visual feature extraction network employs a VisionTransformer architecture, containing 12 Transformer layers, with each layer preferably having 12 hidden layers and 12 attention heads. A visual feature encoding architecture is used to slice and depth-map the image, outputting the original visual feature sequence. To achieve semantic alignment between the visual and textual spaces, a pre-trained cross-modal projection matrix is used to perform linear projection mapping on the original visual features. Let the input infrared thermal image be... The original visual feature extraction function is The projection matrix from the visual feature space to the text semantic space is: The bias term is Then the visual encoding aligned with the text. The calculation formula is as follows: ; In the formula Infrared thermal imaging images of transformer bushings or isolating switches collected at the operation and maintenance site. Extract high-dimensional visual features from the image. and This is responsible for mapping the visual features to the semantic dimension of the power grid professional text corpus, so that... It can be directly measured and fused with the embedding vector of text queries. In this scheme, infrared thermal imaging images... The preferred input resolution is The preferred feature dimension for pixels and high-dimensional visual feature sequences is 1024 dimensions, and the projection matrix... The preferred size Bias term Aligned visual encoding The preferred dimensions are all 768.
[0048] An automatic speech recognition engine is used to collect real-time voice commands from maintenance personnel, extracting and decoding acoustic features to achieve speech-to-text processing. The converted text commands and the text query input from the front end are then fed into a text encoder to generate a text embedding vector. A cross-modal attention mechanism is employed to fuse the aforementioned text embedding vector with the visual encoding using cross-modal tensors. The specific architecture of this attention mechanism includes four cross-attention layers, each containing eight parallel attention heads. The cross-modal attention weights are calculated using the text embedding vector as the query condition and the visual encoding as the key and value vectors. Let the text embedding vector be... The query weight matrix is The key weight matrix is The value weight matrix is The scaling factor is Multimodal features after cross-modal tensor fusion The calculation formula is as follows: ; In the formula This is to provide text features for encoding the voice intent of maintenance personnel, such as checking for abnormal overheating of the main transformer bushing. This is a feature matrix characterizing the location attributes of specific heat points in infrared images. In this scheme, the text embedding vector... The optimal dimension is 768, and the query, key, and value weight matrix is... The preferred dimension scaling factor The preferred value is 64, representing the fused multimodal features. The preferred dimension is 768. This calculation process quantifies the spatial semantic correlation between the textual intent and the local heating area in the infrared image, dynamically aggregates key visual features into the textual semantics, and outputs multimodal features that deeply fuse auditory and visual information from the power grid site.
[0049] The acquired multimodal features are input into the state routing module for intent parsing. Based on the business classification labels of the feature vectors, a pre-defined fault diagnosis agent or operational status understanding agent is invoked to perform specific task processing. The agent performs inference based on the multimodal features, generating structured result data containing fault cause analysis and handling operation sequences. A data visualization chart library is used to render the temperature change trend and three-phase current load values in the structured result data into analytical charts such as line charts and bar charts. Simultaneously, a text-to-speech synthesis engine is used to convert the core summary of the diagnostic conclusions into speech audio signals. The rendered analytical charts and voice prompts are encapsulated and distributed to the operation and maintenance terminal for intuitive display and broadcasting, completing the generation of the corresponding modal response results.
[0050] This step breaks the limitations of single text queries, enabling the system to accurately analyze and integrate complex multi-source audio-visual information from the power grid site, and output intuitive and comprehensive analytical and diagnostic feedback.
[0051] S6. Analyze the decision execution results from interactive feedback and operation logs, update the parameters of the large language model based on the human feedback reinforcement learning mechanism, and extract new knowledge to update the vector retrieval index.
[0052] Furthermore, step S6, which involves updating the parameters of the large language model and extracting new knowledge to update the vector retrieval index, includes: Collect user adoption behavior and preference evaluation of the generated scheme to construct a sample set, and use the proximal policy optimization algorithm to update the policy network parameters of the large language model online; Analyze new fault handling records in the operation log, automatically extract new equipment fault association rules, vectorize and encode them, and incrementally write them into the vector retrieval index; A federated learning model is adopted to synchronize updated data of multiple regional power grids under the condition of protecting privacy, and the system accuracy index is monitored to verify the closed-loop optimization performance.
[0053] Specifically, the adoption preferences of power grid dispatchers and maintenance personnel regarding fault handling solutions generated by the large language model, as well as records of manual modifications, are collected. The collected interactive feedback data is then transformed into positive and negative sample pairs required by the reward model to construct a human preference sample set. This reward model employs a deep neural network architecture, configured with four fully connected hidden layers, each containing 256 neurons. A proximal policy optimization algorithm is used to update the policy network parameters of the large language model online. Let the policy ratio of the large language model before and after the parameter update be... The advantage function calculated based on the dispatcher's rating is: The cropping threshold is The objective function for near-end strategy optimization is calculated as follows: ; In the formula The objective function for optimizing the near-end strategy is... For the empirical expectation operator of the sample data, This is a pruning function used to limit the input policy ratio to a specified range; These are the policy network parameters for a large language model. This represents the ratio of the probability that the old and new models will generate the same isolation operation command for a specific power grid fault. The generated fault handling scheme is characterized by its advantage over the baseline scheme in terms of grid stability restoration and minimizing economic losses. This is used to limit the magnitude of policy updates to ensure the stability of the training process. In this scheme, the policy ratio... The allowable fluctuation range is preferably constrained to be between 0.8 and 1.2, and the dominance function... The normalized baseline value is preferably 1.0, and the clipping threshold is... The optimal value is 0.2. By maximizing this objective function, the scheduling strategy output by the model is continuously aligned with the operation and maintenance logic of the power grid experts.
[0054] The system analyzes new fault handling records in its real-time operation logs that are not covered by the existing knowledge base. An adaptive learning engine is used to perform natural language parsing on the scheduling logs and execution work orders, automatically extracting association rules between new transformer defects or line anomalies and their corresponding effective handling steps. A text embedding model is used to feature-encode the newly extracted equipment fault association rules and transform them into high-dimensional dense vectors. The generated high-dimensional dense vectors and their corresponding rule texts are incrementally appended to the vector retrieval index. A knowledge expiration and elimination mechanism is simultaneously established, dynamically updating the underlying database by comparing the timeliness and execution success rate of new and old rules to ensure the accuracy of the retrieved content.
[0055] A federated learning model is employed to achieve knowledge and model synchronization among multiple regional municipal power grids while protecting privacy by not sharing raw power grid operation details. Each regional power grid utilizes local fault logs and feedback samples for local iterative optimization of model parameters. The central server periodically collects model weight updates from each regional node and executes a federated averaging algorithm to aggregate the global model. Assume there are a total of... Several regional power grids participated in federal training. The number of local fault samples in each regional power grid is The total number of fault samples is , No. After round-robin communication, the local model parameters uploaded by each node are: Global model parameters The aggregation calculation formula is as follows: ; In the formula For including the first Local model weights for regional power grids with unique climate or equipment aging characteristics. To integrate the global large language model weights based on the processing experience of the entire network, this scheme preferably uses 5 K as the number of regional power grid nodes participating in federated training, and the minimum number of fault samples per node is determined. The optimal number of parameters is 10,000, and the optimal frequency (t) for global communication aggregation is once every 24 hours. After parameter aggregation and distribution are completed, the system's fault location accuracy and response time in a real-world scheduling scenario are monitored in real time to verify the closed-loop optimization effect.
[0056] This step enables the system performance to continuously and autonomously evolve with the accumulation of power grid operation experience, effectively avoiding knowledge blind spots and decision degradation when the system responds to new types of power faults.
[0057] Example 2 Traditional power grid operation and maintenance technologies have shortcomings: traditional monitoring relies on fixed rules and thresholds, lacking a deep understanding of complex states; existing diagnostic methods struggle to handle unstructured data and face difficulties in knowledge updates; decision-making systems lack adaptive learning mechanisms; fragmented knowledge base management hinders the effective integration of multi-source heterogeneous data; and human-computer interaction methods are limited, lacking multimodal capabilities to meet complex on-site guidance needs. To address these issues, this invention provides a power grid intelligent agent adaptive optimization system based on a large model, the structure of which is as follows: Figure 2 As shown. The specific implementation process of this system is as follows: The data preprocessing and knowledge construction module is used to clean the acquired runtime data and multi-source text data to construct a domain knowledge graph, and to encode the multi-source text data to construct a vector retrieval index; The large model-driven module is used to obtain a pre-trained large language model that has been fine-tuned with power corpus, and then deploy the large language model after knowledge adaptation and quantization compression. The power grid cognitive intelligent agent module is used to parse operating data and alarms to generate status summaries, extract features to retrieve historical cases to deduce fault causes, and combine reinforcement learning to generate maintenance and scheduling decisions. The retrieval enhancement generation module is used to convert queries into query vectors, perform hybrid retrieval and reordering based on vector retrieval indexes, and filter documents as context input to generate responses from the large language model. The multimodal interaction module is used to integrate text, image, or voice input modalities, call the power grid cognitive agent module to process tasks, and output visualized response results; The adaptive optimization module is used to update the parameters of the large language model through reinforcement learning based on human feedback, based on interaction and execution logs, and to extract new rules to update the vector retrieval index.
[0058] Specifically, the system first acquires heterogeneous data from multiple sources, including historical power grid operation data and equipment archives. It then extracts structured triples containing entities, attributes, and handling procedures and maps them to a graph database to construct a foundational domain knowledge graph. Simultaneously, it employs a text embedding encoder to perform deep semantic encoding on operation and maintenance procedures and fault cases to establish a hierarchical, navigable small-world graph-based vector retrieval index. Next, it pre-trains a large language model using a Transformer architecture with at least 7 billion parameters. Unsupervised domain adaptive training is performed using a power-specific corpus, and scheduling and operation and maintenance instructions are fine-tuned by injecting a low-rank adapter. Finally, knowledge distillation and quantization pruning techniques are combined to compress the model size before deployment to the inference server. During online operation, the system monitors real-time operation data streams containing telemetry alarms and protection actions, extracts spatiotemporal semantic features, and generates high-dimensional feature vectors using a graph convolutional neural network. After matching with historically similar cases, it drives the large model to deeply infer fault occurrence nodes. Finally, it calls upon a decision optimization agent in a Markov pre-simulation environment to generate a vector containing the most... The system employs a solution for optimal load scheduling and physical isolation. Upon receiving a user query, it transforms it into a standardized query vector, then initiates dense vector matching, BM25 sparse retrieval, and graph path retrieval in parallel to obtain multiple results and performs hybrid reordering. Relevant documents are selected as contextual aids to the large language model to generate accurate answers. Facing complex operational scenarios, the system utilizes a visual feature extraction network and a cross-modal projection matrix to convert equipment infrared images into text-aligned visual codes. Combined with text commands transcribed from speech recognition, tensor fusion is performed through a cross-modal attention mechanism. After processing by the corresponding intelligent agent, a modal response result containing data visualization charts and voice broadcasts is output. Finally, the system collects dispatchers' scheme adoption behavior and preference evaluations, uses a near-end policy optimization algorithm to update the policy network parameters of the large language model online, automatically extracts new fault association rules incrementally and adds them to the vector retrieval index, and uses a federated learning model to synchronize model weights across multiple power grid regions under privacy protection conditions. This enables continuous closed-loop iteration and autonomous evolution of system performance based on accumulated operational experience.
[0059] The following is a description with reference to specific embodiments: A sudden abnormality occurred during the operation of the No. 2 main transformer of a 220kV substation. The real-time data stream of the power grid real-time monitoring system showed a sudden change. The telemetry and signaling system showed that the heavy gas protection of the No. 2 main transformer was activated, and the three switches on the main transformer tripped.
[0060] The system's operational status understanding agent listens to the aforementioned abnormal monitoring alarm information and protection device action signals in real time. The agent immediately triggers the status recording mechanism, converting the massive amount of transient binary alarm signals into standardized, structured spatiotemporal semantic description text: The No. 2 main transformer suddenly activated with heavy gas, and the circuit breakers on the high, medium, and low voltage sides have all tripped.
[0061] The fault diagnosis agent is activated, extracting key fault attributes from the spatiotemporal semantic description. Combining the physical topology in the power grid graph database, a graph convolutional neural network configured with two layers and a hidden layer width of 128 is used to aggregate features of the No. 2 main transformer and its adjacent bus nodes, generating a high-dimensional fault feature vector. Subsequently, the system calculates the cosine similarity between this feature vector and historical data in a pre-built vector retrieval index, accurately detecting 15 historically highly correlated similar cases with a cosine similarity score greater than 0.80.
[0062] The system combines the current spatiotemporal semantic description with 15 retrieved historical cases as factual augmentation context, inputting them into a large language model with 7 billion parameters, fine-tuned by low-rank adapter power commands, deployed on the inference server. The large language model performs logical evolutionary deduction, initially identifying possible causes of the fault as: internal short circuit, insulation breakdown, or abnormal oil level. Further, the large language model automatically correlates and extracts the transformer's current real-time telemetry sensor data, and through joint inference from multiple source parameters, ultimately diagnosing the root cause as a severe internal fault within the transformer.
[0063] Based on the diagnosis results, the decision-making optimization agent automatically generates multiple candidate solutions. A Markov decision process simulation is performed using a deep neural network with three fully connected layers. The expected total reward is calculated by comprehensively evaluating the voltage margin recovery, network losses, and overload risk. Finally, the target recommended solution with the highest total reward is selected: ① Immediately issue control commands to physically isolate the faulty main transformer No. 2; ② Automatically calculate power flow and start the backup transformer to restore power; ③ Issue a maintenance work order to arrange manual transformer oil chromatography analysis; ④ Retrieve the equipment database to generate a preliminary overhaul / replacement maintenance plan.
[0064] The system translates the analysis logic of the large language model and the mathematical evaluation results of reinforcement learning into natural language, and calls the visualization module to generate a complete structured fault diagnosis report that includes a temperature change line graph, fault cause analysis, optimal handling steps sequence and confidence score, and simultaneously distributes it to the dispatch center's large screen and the on-site operation and maintenance terminal.
[0065] Thanks to the understanding of large language models and the acceleration of end-to-end computing architecture, the entire complex diagnosis and decision-making simulation process took only 45 seconds. The system located the root cause of the fault and provided the optimal load transfer strategy, effectively avoiding bus voltage loss and the expansion of the accident scope, ensuring the stability of the power grid, and directly reducing the economic loss from power outages by approximately 2 million yuan. This verifies the extremely high application value of the system in extreme fault scenarios.
[0066] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A large model driven power grid agent self-adaptive optimization method, characterized in that, include: S1. The acquired power grid operation data and multi-source text data are cleaned and structured to construct a domain knowledge graph of associated equipment, faults and handling, and the multi-source text data is vectorized and encoded to construct a vector retrieval index. S2. Use power domain corpus to fine-tune the pre-trained large language model according to domain and instruction, and deploy the fine-tuned large language model to the inference server after quantization and compression. S3. Monitor the power grid operation data stream and generate a status summary. When an abnormality is detected in the data stream, extract the fault feature vector and retrieve similar historical cases. Call the large language model to infer the cause of the fault and generate a diagnostic report. Evaluate the handling strategy based on the diagnostic report and output a recommended solution. S4. Convert the query request into a query vector, retrieve the relevant multi-source text data based on the vector retrieval index, reorder and filter it as context input to the large language model, and generate a response answer that integrates the retrieval content; S5. Identify input modalities containing text, images, or voice, perform multimodal fusion, invoke a preset intelligent agent to process the task associated with the input modality, and generate corresponding modal response results; S6. Analyze the decision execution results of the interactive feedback and operation log, update the parameters of the large language model based on the human feedback reinforcement learning mechanism, and extract new knowledge to update the vector retrieval index.
2. The power grid agent self-adaptive optimization method based on large model driving according to claim 1, characterized in that, Step S1, the step of constructing a domain knowledge graph of associated devices, faults, and handling, includes: Extract structured triples containing device entities, fault attributes, and handling procedures from the multi-source text data; Based on the power system ontology model, the semantic associations and topological mappings of the structured triples are established and stored in the graph database; The large language model is used to disambiguate and align heterogeneous data entities, and the domain knowledge graph is dynamically updated.
3. The power grid agent self-adaptive optimization method based on large model driving according to claim 1, characterized in that, Step S2, the step of fine-tuning the pre-trained large language model according to its domain and instructions, includes: Using basic knowledge of power grids and accident reports, the pre-trained large language model is subjected to unsupervised domain-adaptive training. By injecting scheduling and maintenance instruction sets through an adapter, the pre-trained large language model is fine-tuned to improve task understanding capabilities. The large language model, after fine-tuning the instructions, is subjected to quantization, pruning, and knowledge distillation, and the output is the large language model deployed to the inference server.
4. The power grid agent self-adaptive optimization method based on large model driving according to claim 1, characterized in that, Step S3, the step of extracting the fault feature vector, includes: Monitor the power grid operation data stream, which includes alarm and protection signals and waveform recording data, and convert it into a spatiotemporal semantic description; The large language model is used to extract key fault attributes, and high-dimensional feature vectors are generated by combining power grid topology and equipment parameters. The high-dimensional feature vector is matched with historical cases, and the large language model is invoked for inference to locate the specific fault location.
5. The power grid agent self-adaptive optimization method based on large model driving according to claim 1, characterized in that, Step S3, the step of evaluating the treatment strategy, includes: Based on the diagnostic report, an initial set of candidate solutions is generated, including load scheduling, isolation, and maintenance recommendations. The initial response plan candidate set is simulated and pre-run using a reinforcement learning model to predict power grid stability and risk level. The initial treatment plan candidate set is sorted according to the prediction results, a semantic explanation of the target recommended plan is generated, and the diagnostic confidence score is calculated simultaneously.
6. The adaptive optimization method for power grid agents based on a large model-driven approach according to claim 1, characterized in that, In step S4, the step of retrieving, reordering, and filtering relevant multi-source text data based on the vector retrieval index includes: The large language model is used to identify the intent of natural language query requests and convert them into standardized query vectors. Dense vector matching, BM25 sparse search, and graph path search are performed in parallel in the vector database to obtain preliminary search results from multiple paths. The preliminary multi-path search results are re-ranked using a hybrid approach, and a predetermined number of document fragments are selected as enhanced context.
7. The adaptive optimization method for power grid agents based on a large model-driven approach according to claim 1, characterized in that, Step S5, the step of performing multimodal fusion, includes: Visual features are extracted from the input device nameplate or infrared image and converted into visual codes aligned with the text. The voice commands are collected, converted to text, and then fused with the visual encoding and text query through cross-modal tensor fusion to obtain multimodal features. Based on the multimodal features, the preset intelligent agent is invoked to process and generate the modal response result, which includes analysis charts and voice prompts.
8. The adaptive optimization method for power grid agents based on a large model-driven approach according to claim 1, characterized in that, Step S6, the step of updating the parameters of the large language model and extracting new knowledge to update the vector retrieval index, includes: A sample set is constructed by collecting user adoption behavior and preference evaluations of the generated schemes, and the policy network parameters of the large language model are updated online using a proximal policy optimization algorithm; Analyze the new fault handling records in the operation log, automatically extract new equipment fault association rules, vectorize and encode them, and incrementally write them into the vector retrieval index; A federated learning model is adopted to synchronize updated data of multiple regional power grids under the condition of protecting privacy, and the system accuracy index is monitored to verify the closed-loop optimization performance.
9. A large-model-driven adaptive optimization system for power grid agents, characterized in that, The system used in the large model-driven adaptive optimization method for power grid agents according to any one of claims 1-8, the system comprising: The data preprocessing and knowledge construction module is used to clean the acquired runtime data and multi-source text data to construct a domain knowledge graph, and to encode the multi-source text data to construct a vector retrieval index; The large model-driven module is used to acquire a pre-trained large language model finely tuned to the power corpus, and deploy the large language model after knowledge adaptation and quantization compression. The power grid cognitive intelligent agent module is used to parse the operating data and alarms to generate status summaries, extract features to retrieve historical cases to deduce the causes of faults, and combine reinforcement learning to generate maintenance and scheduling decisions. The retrieval enhancement generation module is used to convert queries into query vectors, perform hybrid retrieval and reordering based on the vector retrieval index, and filter documents as context input to generate a response from the large language model. A multimodal interaction module is used to integrate text, image, or voice input modalities, call the power grid cognitive agent module to process tasks, and output visualized response results; An adaptive optimization module is used to update the parameters of the large language model based on interaction and execution logs through reinforcement learning with human feedback, and to extract new rules to update the vector retrieval index.
