Voltage sag state estimation method and system based on complex task decomposition reasoning
By constructing tool tokens and tool function call mechanisms, and combining mind tree strategies and deep graph convolutional neural network models, the problem of insufficient generalization of voltage sag state estimation models is solved, enabling efficient planning and solving of complex problems in power systems, and improving the accuracy and adaptability of voltage sag state estimation.
Patent Information
- Application Number
- CN202511300573.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-12
- Publication Date
- 2025-12-23
AI Technical Summary
Existing voltage sag estimation models lack generalization for problem-solving and cannot effectively handle complex data conditions. Furthermore, traditional LLM models cannot perform planning, decomposition, and reasoning, resulting in high costs for power system dynamic data processing and model training and deployment.
By constructing tool tokens and tool function call mechanisms, combined with the mind tree strategy, and using LLM for complex task decomposition and reasoning, a deep graph convolutional neural network model with power grid topology as physical constraints is constructed. Furthermore, collaborative training and cross-regional knowledge transfer strategies are adopted to improve the generalization and adaptability of the model.
It enables the application of LLM in the planning and solving of complex problems in power systems, improves the accuracy and generalization ability of voltage sag estimation, and reduces the cost of model training and deployment.
Smart Images

Figure CN121189485A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of signal enhancement technology, specifically to a voltage sag state estimation method and system based on complex task decomposition reasoning. Background Technology
[0002] Artificial general intelligence (AGI), as a type of AI possessing intelligence equal to or even surpassing that of humans, can exhibit all the intelligent behaviors of normal humans. The cross-integration of voltage sag analysis and Large Language Models (LLMs) is reshaping scientific research, enabling the automated execution of scientific experiments. Related advances span fields such as mathematics, chemistry, and clinical research, including mathematical algorithm evolution, geometric theorem proving, chemical experiment design and execution, and the development and validation of machine learning methods in clinical research. These recent achievements mark the birth of a new research paradigm, positioning AI with natural language communication capabilities as research assistants for humans, rather than merely as problem solvers for specific issues—that is, possessing "generalization" in problem-solving.
[0003] Compared to traditional methods, the voltage sag state estimation method combined with LLM (Low Voltage Sag Estimation Model) offers significant improvements in data, knowledge, model capabilities, and overall performance. Traditional voltage sag state estimation models focus on a single research object and have limited data and knowledge capacity. In contrast, the large-scale voltage sag state estimation model provides excellent generalization capabilities for multimodal data processing, enabling data analysis even under complex or non-ideal data conditions. Furthermore, traditional voltage sag state estimation models are often small, functionally defined models, while the large-scale model is a product of the fusion of large-scale modeling and voltage sag state estimation techniques; the large model is a generalization and integration of smaller models. In terms of capabilities, the large-scale voltage sag state estimation model enables intelligent, accurate, and generalized solutions for voltage sag state estimation data collection, unstructured data processing, model training, and model deployment, effectively supporting researchers and engineers.
[0004] However, research on human problem-solving suggests that people search within a combinatorial problem space—a tree with partial solutions as nodes and operations that can modify them as branches. The choice of which branch to take depends on heuristics that help navigate the problem space and guide the problem solver to a solution. This perspective highlights two key shortcomings of existing methods using language models to solve general problems: 1) locally, they do not explore different continuations of a thought process—i.e., the branches of the tree; 2) globally, they do not incorporate any type of planning, look-ahead, or backtracking to help evaluate these different options—this heuristically guided search appears to be a characteristic of human problem-solving. Existing LLM models lack this capability. Therefore, this invention aims to develop a research assistant capable of planning, decomposing, and reasoning about complex problems, with professional-grade output capabilities. Summary of the Invention
[0005] This invention provides a voltage sag state estimation method and system based on complex task decomposition reasoning, in order to address the problem that traditional domain models focus more on solving specific problems and lack generalization of problem-solving, including power system dynamic data processing and model training and deployment, which may generate high costs.
[0006] According to a first aspect, one embodiment provides a voltage sag state estimation method based on complex task decomposition reasoning, the method comprising: By constructing tool tokens and establishing a tool function call mechanism, LLM can be made capable of using mathematical tools; Based on the mind tree strategy, the problem of voltage sag estimation is decomposed and reasoned using LLM, which has the ability to use mathematical tools. This enables LLM to generate multiple solutions and evaluate the solutions to obtain the optimal solution.
[0007] Furthermore, constructing the instrumental term Token specifically includes: Given a set of useful tools t ={ t 1, t 2,...}, t i The first one prepared for LLM i A mathematical tool; Each token associated with a tool call is parameterized into a tool token embedding vector, i.e., a tool embedding matrix. Embedding tools into matrices and W v After concatenation, the next token prediction is performed; among them... It is a common word token embedding matrix;v The size of the token vocabulary, i.e., the number of all possible different tokens; d This represents the dimension of the embedding vector corresponding to each word, which is also the length of the output vector.
[0008] Furthermore, a tool function call mechanism is established, specifically including: The user's needs are input as the prompt word, and the system parameters are fixed text specified by the user. When the next token predicted by the LLM is a tool word token, the system immediately enters tool mode. Based on the predicted tool word, the corresponding tool function is called and executed using the function_call function in the LLM. Finally, the specific text form returned by the tool function is combined with the LLM text stream used by the unexecuted tool to form a new text sequence. D .
[0009] Furthermore, based on the mind tree strategy, the voltage sag estimation problem is decomposed and reasoned using LLM, which has the ability to apply mathematical tools. This enables LLM to generate multiple solution approaches and evaluate these approaches to obtain the optimal solution. Specifically, this includes: Mindset decomposition: The solution to the problem is designed into three parts: data collection and preprocessing, model building, and deployment and testing. Based on this, the concept of mind tree is introduced to design branches of the solution for different parts according to the characteristics of the problem. Idea generation: Given the problem corresponding to the current solution x Tree Thinking s =[ x , z 1, ..., z i ],in x The generator will generate suggestions based on the current tree structure. k One possible next step is to consider the following options. z The idea behind the generator's generation is that in the first... i The layer leverages the CoT (Coordination of Thought) framework to generate multiple approaches to address the problem corresponding to the current layer's solution: z (j) ~ LLM p CoT ( z i+1 | s ) = LLM p CoT ( z i+1 | x , z 1···i ) (j =1··· k Each idea is presented in a pre-designed single sentence format to ensure that the LLM implementation tools can be invoked. LLM p Represents the large language model itself; Approach Evaluation: The textgrad mechanism is used to evaluate the branching approach at each level using natural language feedback; based on the textgrad feedback prompts (Pr), the evaluation is conducted. ompt new Compared with the original Pr ompt The data is then concatenated and fed back into the LLM system, where the LLM evaluates the current approach and identifies the optimal approach. s * ~LLM p vote ( s * | S (This is achieved through intentional comparison in the voting prompt) S They were chosen by a vote based on different perspectives. S This represents the set of all idea token sequences under the current layer CoT solution.
[0010] Furthermore, based on the mind tree strategy, the voltage sag estimation problem is decomposed and reasoned using LLM, which has the ability to apply mathematical tools. This enables LLM to generate multiple solution approaches and evaluate these approaches to obtain the optimal solution. Specifically, this includes: A depth-first search algorithm is used to find the best solution path, which first explores the most promising path until the final output is reached, or until the solution evaluator determines that the current solution is the best approach. s When the problem cannot be effectively solved, pruning will be used. s The subtree with the root.
[0011] Furthermore, the method also includes: The mathematical tools are constructed, including building a deep graph convolutional neural network model with power grid topology as the physical constraint, specifically including: Graph construction: G =( V , A ) is a set of vertices V ={ v 1,..., v N The image is from}; in It is an adjacency matrix; n This represents the number of vertices, i.e., the number of network buses; each vertex in the graph v n Depend ond 3D voltage waveform vector Description; the entire voltage waveform matrix Will N The feature vectors are stacked vertically, that is X =[ x 1, x 2,..., x N ] T ; D = diagnosis ( d 1, d 2,..., d N ) is a degree matrix, where d n =Σ j A nj ; The graph convolution operation is defined as:
[0012] in g , i and I These are the filter function, the nonlinear activation function, and the identity matrix, respectively. The implicit features of a vertex are calculated by averaging the features of a given vertex with the features of its neighboring vertices. The model employs residual connection optimization to improve the implicit features of the vertex. l Implicit features of layer +1 H ( l +1) contains the first l Implicit features of layers H (l) and initial implicit features H The information in 1; where physical constraints are introduced by the graph convolutional neural network model in the form of the topological connection relationship of the power grid, and the multi-layer graph convolutional layer structure design allows the current node to capture more feature information of nodes that are farther away from the current span; The voltage waveforms and adjacency matrices recorded by monitoring devices at different busbars are used as inputs to a depth graph convolutional neural network model to achieve voltage sag estimation.
[0013] Furthermore, the method also includes: Based on the constructed deep graph convolutional neural network model with power grid topology as the physical constraint, a collaborative training and cross-regional knowledge transfer strategy is adopted to enhance the generalization of mathematical tools.
[0014] Furthermore, collaborative training strategies include: First, the target domain model sends the relevant global model parameters to each source domain model. i t ; Then, each source domain model i Use its local dataset D i Perform local updates on the model to obtain new local model parameters. i i t+1 ; After multiple rounds of local training, each source domain model uploads its updated parameters to the target domain model; the source domain models i The model parameters are updated by optimizing the following regularization problem:
[0015] in L ( f ( x i ; i ), y i () is a loss function used to measure a given parameter. i Input x i VSSL results on the real label y i The difference between them; introducing parameters µ As a source domain parameter deviation compensation coefficient, it prevents the source domain model from deviating too far from the target domain model, i.e., the domain drift problem. The target domain model receives parameters from the source domain model. i i Then, the corresponding parameters are simply averaged to obtain the new target domain model parameters.
[0016] Furthermore, cross-regional knowledge transfer strategies include: Due to the topological inhomogeneity of the distribution network and the uncertainty of voltage sags, there are significant differences in the feature distribution and label distribution of various sub-regions in the power network. By aligning the feature distribution and label distribution, knowledge obtained from simulation data or real data can be transferred to the power grid area that the user needs to analyze through improved generalization.
[0017] According to a second aspect, one embodiment provides a voltage sag state estimation system based on complex task decomposition reasoning, the system comprising: The tool application implementation module is used to enable LLM to have the ability to use mathematical tools by constructing tool tokens and establishing a tool function call mechanism; The Complex Task Decomposition and Reasoning Module is used to decompose and reason about the voltage sag state estimation problem based on the mind tree strategy and with the help of LLM which has the ability to use mathematical tools. This enables LLM to generate multiple solutions and evaluate the solutions to obtain the optimal solution.
[0018] This invention provides a voltage sag state estimation method and system based on complex task decomposition reasoning, which has the following beneficial effects: 1) This invention designs a tool-like token that differs from conventional tokens and builds a jump architecture based on a function calling mechanism. This architecture enables LLMs to call mathematical tools, giving them the ability to use mathematical tools. Furthermore, it combines the mathematical tool application capabilities of LLMs with a mind tree architecture, allowing LLMs to plan, decompose, and reason about complex problems like humans, assisting engineers and researchers in solving complex problems. Moreover, the use of mind trees can not only assist in voltage sag estimation but can also be extended to assist in solving other problems in power systems.
[0019] 2) Traditional machine learning models are essentially text prediction tools and cannot truly reflect the physical state of the power system. This invention designs a graph convolutional neural network model with multiple graph convolutional layers and a power grid topology as the physical constraint for voltage sag state estimation.
[0020] 3) In order to enable the model to meet the accuracy requirements of users for voltage sag state estimation in different power grids, it is necessary to focus on improving the generalization of the voltage sag state estimation model when applied under different power grid topologies. This invention proposes a generalization-enhanced DGCN model based on collaborative training and cross-regional knowledge transfer. Attached Figure Description
[0021] Figure 1 A flowchart of a voltage sag state estimation method based on complex task decomposition reasoning is provided as an embodiment of the present invention; Figure 2 This is a basic structural diagram of the use of LLM tools and the improvement of mind tree in a voltage sag state estimation method based on complex task decomposition reasoning provided in an embodiment of the present invention; Figure 3 A flowchart of the complex problem planning, task decomposition and high-level reasoning solution in a voltage sag state estimation method based on complex task decomposition and reasoning provided in an embodiment of the present invention; Figure 4 The basic structure diagram of the DGCN model with grid topology as physical constraint in a voltage sag state estimation method based on complex task decomposition reasoning provided in an embodiment of the present invention; Figure 5 An improved DGCN model based on collaborative training and cross-regional knowledge transfer is provided in a voltage sag state estimation method based on complex task decomposition reasoning, as an embodiment of the present invention. Detailed Implementation
[0022] The present invention will now be described in further detail with reference to specific embodiments and accompanying drawings. Similar elements in different embodiments are referred to by associated similar element reference numerals. In the following embodiments, many details are described to facilitate a better understanding of the invention. However, those skilled in the art will readily recognize that some features may be omitted in different situations, or may be replaced by other elements, materials, or methods. In some cases, certain operations related to the present invention are not shown or described in the specification. This is to avoid obscuring the core parts of the invention with excessive description. For those skilled in the art, detailed description of these related operations is not necessary; they can fully understand the related operations based on the description in the specification and general technical knowledge in the art.
[0023] Furthermore, the features, operations, or characteristics described in the specification can be combined in any suitable manner to form various embodiments. At the same time, the steps or actions in the method description can be rearranged or adjusted in a manner obvious to those skilled in the art. Therefore, the various orders in the specification and drawings are only for the clear description of a particular embodiment and do not imply a necessary order, unless otherwise stated that a particular order must be followed.
[0024] Traditional domain models focus more on solving specific problems and lack generalization in problem-solving. This includes dynamic data processing of power systems and model training and deployment, which can generate high costs.
[0025] To this end, this invention utilizes LLM to build an artificial intelligence assistant, introduces the concept of tool tokens, and teaches LLM to use tools in order to achieve efficient integration of domain knowledge and professional-grade output of LLM text.
[0026] Furthermore, by combining the mathematical tools of LLM with an improved LLM architecture based on Tree of Thought (ToT), and by simulating human thinking, the large reasoning model acts as the brain, primarily responsible for problem planning, task decomposition, and high-level reasoning. This architecture models the problem-solving process as a search process on a tree structure composed of "thoughts," enabling the model to perform lookahead, backtrack, and self-evaluation, thus possessing superior reasoning and text output capabilities compared to traditional Chain of Thought (CoT).
[0027] Furthermore, considering that traditional LLM is essentially a prediction of text, it cannot perceive the actual physical state of the power system, let alone achieve text output that conforms to real-world logic. Therefore, this invention constructs a Deep Graph Convolutional Network (DGCN) model with multi-layer graph convolutional layers and power grid topology as physical constraints, using it as the mathematical tool for LLM. Finally, this invention also constructs an improved DGCN model based on collaborative training and cross-power grid region knowledge transfer. By utilizing this mechanism to accumulate and transfer common knowledge (shared knowledge) under different power grid topologies, the generalization and adaptability of the DGCN model when applied to unknown power grid topologies are improved.
[0028] The details are as follows: The first embodiment of this invention provides a voltage sag state estimation method based on complex task decomposition and reasoning. The following is in conjunction with... Figure 1 Please provide a detailed explanation.
[0029] like Figure 1 As shown, in step S100, by constructing a tool word Token and establishing a tool function call mechanism, the LLM is made capable of using mathematical tools.
[0030] Specifically, this embodiment constructs a tool token that differs from conventional word tokens, giving LLM the ability to use multiple different types of mathematical tools simultaneously.
[0031] 1. Basic Principles of LLM This embodiment aims to empower LLMs with a sense of the real physical world by teaching them how to use specific tools. It also ensures that LLMs can use these tools to solve complex voltage sag estimation problems without requiring large-scale model fine-tuning and retraining. It's important to note that in this framework, the tools' role is to return results that help LLMs obtain usable structured data, train and deploy models, and generate final, professional-grade textual results.
[0032] LLM is trained on massive amounts of text data using deep learning techniques. It learns how to predict the next token based on previous tokens (a token is the basic unit of text processing and can be a word, a punctuation mark, a number, or any other character). LLM can be represented as: (1) in, LLM pRepresenting the large language model itself, Prompt refers to the input token. i These are the model parameters. The goal of the model is to minimize the difference between the predicted token and the actual token. This can be achieved by defining an appropriate loss function. L Gradient descent is then applied to update the parameters. i To achieve: (2) in, i new This represents the updated parameters. i old This represents the parameters before the update. or Represents the learning rate. Represents the loss function L For model parameters i The gradient.
[0033] Typically, language models use word token sequences s =( t 1, t 2,..., t n The probability modeling of ) is as follows P ( s )=Σ i n P ( t i | t <i Each word token comes from the vocabulary of the language model, i.e. t <i , t i ∈ n Indicates the first i The preceding token sequence. In practice, users typically set prompts (called Prompts) to guide the language model in generating the required content, such as answering a question.
[0034] To go deeper, the distribution prediction for the next token is as follows: P ( t i | t <i )= softmax ( W v · h i-1 ),in It is the last hidden state in the current context. It is a token embedding matrix (also known as a word embedding matrix), where,v This represents the size of the token vocabulary, that is, the number of all possible different tokens. d This represents the dimension of the embedding vector corresponding to each word, which is the length of the output vector. This parameter is manually specified, and in this embodiment it is set to 1024.
[0035] 2. LLM tool usage Given a set of useful tools t ={ t 1, t 2,...}, t i The first one prepared for LLM i Each tool is a tool. The core idea of the tool invocation mechanism is to explicitly represent the tool as a special type of token. Each token associated with a tool invocation is parameterized as a tool token embedding vector, which can also be represented as a matrix, i.e. This framework allows LLMs to uniformly consider both ordinary word tokens and tokens associated with tool calls.
[0036] Specifically, tool embedding matrix and W v The tokens are then concatenated. Therefore, the probability of predicting the next token is: (3) The next token can be either a regular word token or a tool token. t i ∈ v ∪ t , [;] represents the join operation.
[0037] Therefore, the tool for token embedding can quickly adapt to new tools with only minor fine-tuning training by easily extending the embedding matrix of ordinary word tokens. This is because the framework preserves the original LLM parameters and introduces minimal additional training overhead with tool item (i.e., token embedding relative to tool invocation) embeddings. W τ The embedding matrix contains only the parameters that need to be optimized; it does not need to flow through the gradients of the LLM parameter body, thus making training more stable and efficient.
[0038] Similar to how infants learn new tools through adult demonstrations, this embodiment primarily explores how to teach LLMs to use tools by demonstrating to them how to utilize tool tokens.
[0039] like Figure 2As shown, the user's needs are first input as the prompt word "Prompt," and the system parameters are fixed text specified by the user. When the LLM prediction tool "Token" becomes the next "Token" (e.g., ...), ... Figure 2 (As shown in the "Mode Switching" section), it then enters "Tool Mode," where, based on the predicted tool words, it simultaneously uses the `function_call` function in the LLM to call and execute the corresponding tool function. Finally, it combines the specific text format returned by the tool function with the LLM text stream used by the unexecuted tool to form a new text sequence. D Therefore, the training objective of LLM can be defined as: (4) The LLM was fine-tuned using the methods described above. t' i This is a possible token in the new token sequence after being incorporated into the tool token. This token could be either a common word token or a tool token.
[0040] like Figure 1 As shown, in step S200, based on the mind tree strategy, the LLM with mathematical tool application capabilities is used to perform complex task decomposition and reasoning on the voltage sag state estimation problem, so that the LLM can generate multiple solution ideas and evaluate the ideas to obtain the optimal solution idea.
[0041] Specifically, this embodiment combines tool invocation capabilities with mind trees, enabling LLM to possess complex problem reasoning capabilities similar to human problem planning, decomposition, and optimal path selection, and to solve power system-related problems such as voltage sag estimation.
[0042] This embodiment introduces an improved LLM architecture based on Tree of Thought (ToT). By simulating human thinking, the problem-solving process is modeled as a search process on a tree structure composed of "thoughts", allowing LLM to explore multiple reasoning paths in thought.
[0043] ToT treats any problem as a search of a tree, where each node represents a possible approach. s = [ x , z 1···i ] represents a token sequence representing one approach within a specific partial solution, where, x = ( x (1), ..., x [ n ]),in x [ i ] is a token, in additionS This represents the set of all idea token sequences under the current layer CoT solution.
[0044] The implementation of ToT specifically answers four questions: 1. How to break down the intermediate process into thought steps; 2. How to generate potential ideas from each approach; 3. How to heuristically evaluate approaches; 4. Which search algorithm to use.
[0045] Therefore, ToT is mainly divided into four key components: thought decomposition, thought generator, state evaluator, and search algorithm.
[0046] (1) Thinking decomposition By pre-training a large language model (LLM) on a pre-designed CoT dataset, a fixed process is formed for solving problems in the power system domain.
[0047] like Figure 3 As shown on the left, this embodiment designs the solution to all problems in the power system field into three parts: data collection and preprocessing, model building, and deployment and testing. Based on this, as... Figure 3 As shown on the right, the concept of ToT is introduced to design and decompose the thinking steps of the corresponding parts according to the characteristics of the problem, that is, to design branches of solutions for different parts.
[0048] It is important to note that the ideas of different solution branches should be "small" enough so that the language model can generate promising and diverse samples (e.g., generating an entire book is usually too large to be coherent), but also "large" enough so that the language model can evaluate the prospect of solving the problem (e.g., generating a single word is usually too small to be evaluated).
[0049] (2) Idea generator G ( LLM p , s , k ) Given the problem corresponding to the current solution x Tree Thinking s =[ x , z 1, ..., z i ],in x The generator provides the hints for the current tree approach (i.e., the solution for the current layer's CoT). G It will generate k One possible next step in thinkingz The generator represents the idea that, in the first... i The layer uses the Chain of Thought (CoT) to generate multiple ideas for the problem corresponding to the current layer's solution: z (j) ~ LLM p CoT ( z i+1 | s ) = LLM p CoT ( z i+1 | x , z 1···i ) ( j =1··· k Each idea is presented in a pre-designed single sentence to ensure that the LLM implementation tools can be invoked.
[0050] (3) Idea evaluator V ( LLM p , S ) This embodiment combines the textgrad mechanism with natural language feedback to evaluate the branching logic at each layer, aiming to enhance the success rate and stability of LLM tool calls. The calculation method is as follows: (5) (6) Here, LLM stands for Language Model, and Prompt and are sequences of text containing the user's question. Evaluation_instruction is a set of natural language instructions used to evaluate a given output or solution; that is, it tells LLM how to evaluate the generated text Prediction. This invention outputs the Evaluation result in a "score + reason + suggestion" format, using a manually defined approach. Furthermore, "+" indicates the concatenation of two strings.
[0051] Unlike numerical gradients, which utilize the chain rule in traditional automatic differentiation methods to improve a system's performance relative to an objective function by calculating numerical gradients, textual gradients generate feedback in text form to guide modifications to unstructured variables in the system. Instead of calculating numerical gradients, they provide specific suggestions for improvement to enhance the system's performance relative to the objective function. The backpropagation algorithm for textual gradients can be represented as follows: (7) (8) (9) Function (7) returns an evaluation of the LLM prediction result (used to assess the result), and function (8) returns evaluative feedback on the user's question (used to assess whether the question is conducive to the correct result required by the LLM output), such as "The voltage sag state estimation result can be obtained by calling..."<Voltage sag state estimation> The feedback, expressed as “tool improvement,” explains how to adjust variables to optimize the entire system for the objective function, similar to numerical gradient methods. Further, function (9) returns the user question necessary to ensure stable LLM invocation of mathematical tools. In this context, the modifiable component can be a prompt, a tool, or a future token to be predicted. This evaluation feedback is then used as the basis for prompt optimization in functions (7) and (8). Furthermore, the optimization function employs Textual Gradient Descent (TGD) to update the prompt using the evaluation feedback.
[0052] In summary, based on the textgrad feedback, the prompt words Pr ompt new Compared to the original Pr ompt The data is then pieced together and fed back into the LLM program, where the LLM evaluates the current approach (scoring and voting), with "good" approaches being the most valuable. s * ~ LLM p vote ( s * | S (This is achieved through intentional comparison in the voting prompt) S The different ideas were voted on.
[0053] (4) Search algorithm This embodiment introduces a depth-first search (DFS) algorithm, which first explores the most promising problem-solving path until the final output is reached. t > T ), or when the idea evaluator deems the current idea to be correct. s When the problem cannot be solved effectively ( V ( p θ ,{ s})( s )≤ v th ,in v th (As a threshold), it will prune tos The subtree rooted at [root]. Both of the above cases will backtrack to [root]. s The parent state continues to repeat the finite depth exploration algorithm described above. The pseudocode for this algorithm is shown below:
[0054] like Figure 1 As shown, in step S300, mathematical tools are constructed, including constructing a deep graph convolutional neural network model with the power grid topology as the physical constraint.
[0055] Specifically, this embodiment constructs a deep graph convolutional neural network (DGCN) model with multiple graph convolutional layers, and uses the power grid topology as a physical constraint as the input to the GCN model, thereby improving the accuracy and robustness of the DGCN model.
[0056] Graph construction: G =( V , A ) is a set of vertices V ={ v 1,..., v N The diagram of}, in which It is an adjacency matrix. n This represents the number of vertices (i.e., the number of network buses). Each vertex in the graph... v n Depend on d 3D voltage waveform vector Description. The entire voltage waveform matrix. Will N The feature vectors are stacked vertically, that is X =[ x 1, x 2,..., x N ] T . D = diagnosis ( d 1, d 2,..., d N ) is a degree matrix, where d n =Σ j A nj . y i ∈ Y Indicates the first i A two-dimensional vector consisting of the voltage magnitude and voltage phase angle of each bus.
[0057] Graph convolution can be defined as: (10) in g , i and I It is a filtering function, a nonlinear activation function, and an identity matrix.
[0058] The implicit features of a vertex are calculated by averaging the features of its neighboring vertices. This operation effectively reflects the physical characteristics of electricity propagation in a network; that is, based on the actual physical topology of the power grid, with each round of graph convolution, the relevant bus can obtain feature information from buses farther away, according to the increasing number of convolutional layers. The specific calculation method is as follows: (11) in s (·) represents the sigmoid function. This is the modified degree matrix. W (l) yes l Layer weight matrix, This represents the adjacency matrix with added self-loops. After processing by the normalization layer, we can obtain... H (l) = [ h 1 (l) , h 2 (l) ,..., h n (l) ], as l Layered implicit features, where h n (l) It is a busbar n The implicit features. Then, in the final output. H (L) Further use softmax Activation function to obtain source location H pre = softmax( H (L) ).
[0059] like Figure 2 As shown, the DGCN model employs residual connectivity optimization, aiming to make the first... l Implicit features of layer +1 H ( l +1) contains the first l Implicit features of layers H (l) and initial implicit features HInformation 1. Physical constraints are introduced into the GCN model in the form of the power grid's topological connections. The multi-layered graph convolutional layer structure allows the current node to capture more feature information from nodes further away. The feature propagation process of the DGCN model with residual connections can be represented as: (12) in, For the Sigmoid function; The weighting is a parameter set manually based on the actual situation, and here it is set to 0.5.
[0060] In summary, the voltage waveforms and adjacency matrices recorded by monitoring devices at different busbars are used as inputs to the DGCN model. By constructing a DGCN model with the power grid topology as the physical constraint, voltage sag state estimation is achieved, while simultaneously improving the overall robustness of the state estimation model.
[0061] like Figure 1 As shown, in step S400, based on the constructed deep graph convolutional neural network model with power grid topology as physical constraint, a collaborative training and cross-regional knowledge transfer strategy is adopted to enhance the generalization of mathematical tools.
[0062] Specifically, this embodiment proposes an improved DGCN model based on collaborative training and cross-regional knowledge transfer. This mechanism improves the generalization ability of the DGCN model by accumulating and transferring common knowledge across different power grid topologies.
[0063] This invention proposes a cross-power grid region knowledge transfer framework, the overall architecture of which is as follows: Figure 4 As shown. This method uses DGCN as the basic model, and the model parameters... i and conditional probability P Exchanges are performed between different sub-regions to enable parallel transfer of general knowledge from the source domain (a large amount of simulated power grid topology data and real power grid topology data) to the target domain (the power grid area where the user plans to perform voltage sag state estimation analysis).
[0064] 1. Collaborative training strategy First, the target domain model sends the relevant global model parameters to each source domain model. i t Then, each source domain model i Use its local dataset D i Perform local updates on the model to obtain new local model parameters. i i t+1 After multiple rounds of local training, each source domain model uploads its updated parameters to the target domain model. (Source domain model) iThe model is updated by optimizing the following regularization problem: (13) in L ( f ( x i ; i ), y i () is a loss function used to measure a given parameter. i Input x i VSSL results on the real label y i The difference between them. Unlike traditional federated learning methods, parameters are introduced. µ ∈[0,2] serves as the source domain parameter deviation compensation coefficient to prevent the source domain model from deviating too far from the target domain model, also known as the domain drift problem.
[0065] The target domain model receives source domain parameters. i i Then, these parameters are simply averaged to obtain the new target domain model parameters: (14) 2. Knowledge transfer strategy Traditional federated learning models assume that data from all source domains have similar features and sample spaces. However, due to the topological inhomogeneity of distribution networks and the uncertainty of voltage sags, the feature distributions and label distributions of different sub-regions in the power network differ significantly, a problem known as non-independent identically distributed (non-IID). Therefore, feature and label distributions should be aligned to improve the generalization ability of knowledge acquired from simulation or real data and transfer it to the specific power grid region the user needs to analyze.
[0066] First, feature alignment is required. Considering that bus line numbers differ across power grids, they cannot be used as identical model input variables. Knowledge transfer learning across power grid regions is typically heterogeneous, meaning that different feature spaces have different dimensions. d S ≠ d T A depth map convolutional transformation is proposed. and ,Will x and Projected to d 3D latent feature space.
[0067] (15) G optimal value and Ultimately, this helps in training a good VSSL classifier in the target sub-region; that is, the goal of feature transfer is to ensure that the conditional probabilities are approximately equal. (16) In the formula P (·) represents the probability or probability density of the random variable. Then, the classifier is trained simultaneously using both the source and target feature data. Based on Bayes' rule and probability theory, equation (16) can be rewritten as: (17) (18) (19) By minimizing and The distance between and and The distance between them, i.e. and This problem can be optimized by mining general knowledge to improve generalization. The formula is as follows: (20) in D Let represent the distance between two distributions, where is a hyperparameter used as the weights of the two terms. To prevent overfitting, a penalty term is introduced. l =0.001 and Frobenius norm ||·|| F The maximum mean discrepancy (MMD) is introduced to measure the conditional probability distance in (20). D .
[0068] Based on the above, the total loss function of the DGCN model can be rewritten as: (twenty one) in, L cross The first part is the cross-entropy loss function, and the second part is the loss function for the maximum mean difference of conditional probabilities.
[0069] Next is tag space alignment. Since transmission line numbers differ across different power grid regions, this can lead to variations in tag distribution. Therefore, this invention proposes a tag alignment method. Based on the characteristic that voltage sag propagation attenuates with increasing propagation distance, this characteristic can reflect the relative position of the voltage sag source. That is, the placement of the PQM triggered by a voltage sag can, to some extent, reflect the relative position of the sag source. If the PQM number is used as a reference identifier, voltage sag event tags at other locations in the current region can be replaced with this reference number, and based on this rule, corresponding operations can be performed on other different types of power grid regions. In this way, the reference identifiers between sub-regions can remain consistent, such as... Figure 5 The example in the bottom right corner is shown.
[0070] In summary, after the source domain model completes multiple rounds of training in parallel, its parameters are uploaded to the target domain model. The target domain model also uses the DGCN model as its base classifier model and conducts limited training and testing using the target domain model dataset. This ensures a certain voltage sag state estimation performance under sparse measurement conditions, in different types of distribution networks, and even in zero-shot learning scenarios, thereby enhancing the generalization ability of the mathematical tool.
[0071] Corresponding to the voltage sag state estimation method based on complex task decomposition reasoning disclosed above, this invention also discloses a voltage sag state estimation system based on complex task decomposition reasoning, which specifically includes: The tool application implementation module is used to enable LLM to have the ability to use mathematical tools by constructing tool tokens and establishing a tool function call mechanism; The Complex Task Decomposition and Reasoning Module is used to decompose and reason about the voltage sag state estimation problem based on the mind tree strategy and with the help of LLM which has the ability to use mathematical tools. This enables LLM to generate multiple solutions and evaluate the solutions to obtain the optimal solution.
[0072] It should be noted that for a detailed description of the voltage sag state estimation system based on complex task decomposition reasoning provided in the embodiments of the present invention, please refer to the relevant description of the voltage sag state estimation method based on complex task decomposition reasoning provided in the embodiments of the present invention, which will not be repeated here.
[0073] In addition, embodiments of the present invention also provide an electronic device, the device comprising: a processor and a memory; the memory being used to store one or more program instructions; the processor being used to execute one or more program instructions to perform the steps of a voltage sag state estimation method based on complex task decomposition reasoning as described in any of the preceding embodiments.
[0074] It should be noted that for a detailed description of an electronic device provided in the embodiments of the present invention, please refer to the relevant description of a voltage sag state estimation method based on complex task decomposition reasoning provided in the embodiments of this application, which will not be repeated here.
[0075] In addition, embodiments of the present invention also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of a voltage sag state estimation method based on complex task decomposition reasoning as described in any of the preceding claims.
[0076] It should be noted that for a detailed description of the computer-readable storage medium provided in the embodiments of the present invention, please refer to the relevant description of the voltage sag state estimation method based on complex task decomposition reasoning provided in the embodiments of this application, which will not be repeated here.
[0077] The above examples illustrate the present invention only to aid in understanding it and are not intended to limit the scope of the invention. Those skilled in the art can make various simple deductions, modifications, or substitutions based on the principles of this invention.
Claims
1. A voltage sag state estimation method based on complex task decomposition reasoning, characterized in that, The method includes: By constructing tool tokens and establishing a tool function call mechanism, LLM can be made capable of using mathematical tools; Based on the mind tree strategy, the problem of voltage sag estimation is decomposed and reasoned using LLM, which has the ability to use mathematical tools. This enables LLM to generate multiple solutions and evaluate the solutions to obtain the optimal solution.
2. The voltage sag state estimation method based on complex task decomposition reasoning as described in claim 1, characterized in that, Constructing instrumental tokens, specifically including: Given a set of useful tools τ ={ τ 1, τ 2,...}, τ i The first one prepared for LLM i A mathematical tool; Each token associated with a tool call is parameterized into a tool token embedding vector, i.e., a tool embedding matrix. Embedding tools into matrices and W v After concatenation, the next token prediction is performed; among them... It is a common word token embedding matrix; v The size of the token vocabulary, i.e., the number of all possible different tokens; d This represents the dimension of the embedding vector corresponding to each word, which is also the length of the output vector.
3. The voltage sag state estimation method based on complex task decomposition reasoning as described in claim 2, characterized in that, Establish a utility function call mechanism, specifically including: The user's needs are input as the prompt word, and the system parameters are fixed text specified by the user. When the next token predicted by the LLM is a tool word token, the system immediately enters tool mode. Based on the predicted tool word, the corresponding tool function is called and executed using the function_call function in the LLM. Finally, the specific text form returned by the tool function is combined with the LLM text stream that was not used by the tool to form a new text sequence. D .
4. The voltage sag state estimation method based on complex task decomposition reasoning as described in claim 1, characterized in that, Based on the mind tree strategy, LLM, which possesses mathematical tool capabilities, performs complex task decomposition and reasoning on the voltage sag state estimation problem. This enables LLM to generate multiple solution approaches and evaluate these approaches to obtain the optimal solution. Specifically, this includes: Mindset decomposition: The solution to the problem is designed into three parts: data collection and preprocessing, model building, and deployment and testing. Based on this, the concept of mind tree is introduced to design branches of the solution for different parts according to the characteristics of the problem. Idea generation: Given the problem corresponding to the current solution x Tree Thinking s =[ x , z 1, ..., z i ],in x The generator will generate suggestions based on the current tree structure. k One possible next step is to consider the following options. z The idea behind the generator's generation is that in the first... i The layer leverages the CoT (Coordination of Thought) framework to generate multiple approaches to address the problem corresponding to the current layer's solution: z (j) ~ LLM p CoT ( z i+1 | s ) = LLM p CoT ( z i+1 | x , z 1···i ) ( j =1··· k Each idea is presented in a pre-designed single sentence format to ensure that the LLM implementation tools can be invoked. LLM p Represents the large language model itself; Approach Evaluation: The textgrad mechanism is used to evaluate the branching approach at each level using natural language feedback; based on the textgrad feedback prompts (Pr), the evaluation is conducted. ompt new Compared with the original Pr ompt The data is then concatenated and fed back into the LLM system, where the LLM evaluates the current approach and identifies the optimal approach. s * ~LLM p vote ( s * | S (This is achieved through intentional comparison in the voting prompt) S They were chosen by a vote based on different perspectives. S This represents the set of all idea token sequences under the current layer CoT solution.
5. The voltage sag state estimation method based on complex task decomposition reasoning as described in claim 4, characterized in that, Based on the mind tree strategy, LLM, which possesses mathematical tool capabilities, performs complex task decomposition and reasoning on the voltage sag state estimation problem. This enables LLM to generate multiple solution approaches and evaluate these approaches to obtain the optimal solution. Specifically, this includes: A depth-first search algorithm is used to find the best solution path, which first explores the most promising path until the final output is reached, or until the solution evaluator determines that the current solution is the best approach. s When the problem cannot be effectively solved, pruning will be used. s The subtree with the root.
6. The voltage sag state estimation method based on complex task decomposition reasoning as described in claim 1, characterized in that, The method further includes: The mathematical tools are constructed, including building a deep graph convolutional neural network model with power grid topology as the physical constraint, specifically including: Graph construction: G =( V , A ) is a set of vertices V ={ v 1,..., v N The image is from}; in It is an adjacency matrix; n This represents the number of vertices, i.e., the number of network buses; each vertex in the graph v n Depend on d 3D voltage waveform vector Description; the entire voltage waveform matrix Will N The feature vectors are stacked vertically, that is X =[ x 1, x 2,..., x N ] T ; D = diag ( d 1, d 2,..., d N ) is a degree matrix, where d n =Σ j A nj ; The graph convolution operation is defined as: in g , θ and I These are the filter function, the nonlinear activation function, and the identity matrix, respectively. The implicit features of a vertex are calculated by averaging the features of a given vertex with the features of its neighboring vertices. The model employs residual connection optimization to improve the implicit features of the vertex. l Implicit features of layer +1 H ( l +1) contains the first l Implicit features of layers H (l) and initial implicit features H The information in 1; where physical constraints are introduced by the graph convolutional neural network model in the form of the topological connection relationship of the power grid, and the multi-layer graph convolutional layer structure design allows the current node to capture more feature information of nodes that are farther away from the current span; The voltage waveforms and adjacency matrices recorded by monitoring devices at different busbars are used as inputs to a depth graph convolutional neural network model to achieve voltage sag estimation.
7. The voltage sag state estimation method based on complex task decomposition reasoning as described in claim 1, characterized in that, The method further includes: Based on the constructed deep graph convolutional neural network model with power grid topology as the physical constraint, a collaborative training and cross-regional knowledge transfer strategy is adopted to enhance the generalization of mathematical tools.
8. The voltage sag state estimation method based on complex task decomposition reasoning as described in claim 7, characterized in that, Collaborative training strategies include: First, the target domain model sends the relevant global model parameters to each source domain model. θ t ; Then, each source domain model i Use its local dataset D i Perform local updates on the model to obtain new local model parameters. θ i t+1 ; After multiple rounds of local training, each source domain model uploads its updated parameters to the target domain model; the source domain models i The model parameters are updated by optimizing the following regularization problem: in L ( f ( x i ; θ ), y i () is a loss function used to measure a given parameter. θ Input x i VSSL results on the real label y i The difference between them; introducing parameters µ As a source domain parameter deviation compensation coefficient, it prevents the source domain model from deviating too far from the target domain model, i.e., the domain drift problem. The target domain model receives parameters from the source domain model. θ i Then, the corresponding parameters are simply averaged to obtain the new target domain model parameters.
9. The voltage sag state estimation method based on complex task decomposition reasoning as described in claim 7, characterized in that, Cross-regional knowledge transfer strategies include: Due to the topological inhomogeneity of the distribution network and the uncertainty of voltage sags, there are significant differences in the feature distribution and label distribution of various sub-regions in the power network. By aligning the feature distribution and label distribution, knowledge obtained from simulation data or real data can be transferred to the power grid area that the user needs to analyze through improved generalization.
10. A voltage sag state estimation system based on complex task decomposition reasoning, characterized in that, The system includes: The tool application implementation module is used to enable LLM to have the ability to use mathematical tools by constructing tool tokens and establishing a tool function call mechanism; The Complex Task Decomposition and Reasoning Module is used to decompose and reason about the voltage sag state estimation problem based on the mind tree strategy and with the help of LLM which has the ability to use mathematical tools. This enables LLM to generate multiple solutions and evaluate the solutions to obtain the optimal solution.
Citation Information
Patent Citations
Voltage sag evaluation method based on graph convolutional neural network
CN117592825A
Complex problem reasoning method based on dynamic collaboration of large language model and domain knowledge base
CN118798368A
Method and device for determining large model target space relation based on thinking tree guidance
CN119128222A
Intelligent task planning method based on large model
CN119443695A
Aerospace intelligent manufacturing large model construction method
CN120372834A
Cited By
Damping sealing material state evaluation method and system
CN122073141A